
function CalendarControl() 
{
  function getProperty(p_property)
	{
    var p_elm = calendarId;
    var elm = null;

    if(typeof(p_elm) == "object")
		{
     	 elm = p_elm;
    	} else 
		{
      	elm = document.getElementById(p_elm);
    	}
    
	if (elm != null)
		{
      	if(elm.style)
			{
        	elm = elm.style;
        	if(elm[p_property])
				{
          		return elm[p_property];
        		}
				else 
				{
          		return null;
       			}
      		} 
			else 
			{
        	return null;
      		}
    	}
  }
 function PropertySetting(propertyid, noofval) 
 {
    ElementSetting(noofval, propertyid,  calendarId);
 }
  function ElementSetting( noofval, propertyid, Idofelement)
		{
    	var v_element = Idofelement;
    	var v_element = null;

    	if(typeof(Idofelement) == "object")
			{
      		v_element = Idofelement;
    		} 
			else 
			{
      		    v_element = document.getElementById(Idofelement);
    		}
    	
		if((v_element != null) && (v_element.style != null))
			{
      		v_element = v_element.style;
      		v_element[ propertyid ] = noofval;
    		}
 		 }
}

function FlightSearchCalToolTip(tdID, detailFortooltip)  
      {
      
       
        //In Array 0-BaseFareForAdult, 1-TaxForAdult, 2-TotalFareperAdult
        //3- Basefareforchild, 4- taxforchild,5-totalamountperchild
        //6-basefareforinfant, 7-taxforinfant, 8-totalamountperinfant
        // 9 airlinename
        
        arfaredetail = detailFortooltip.split(",");
        var basefareforadult = arfaredetail[0];
        var taxforadult = arfaredetail[1];
        var totalfareperadult =arfaredetail[2];
        
        
        var basefareforchild = arfaredetail[3];
        var taxforchild = arfaredetail[4];
        var totalfareperchild =arfaredetail[5];
        
        var basefareforinfant = arfaredetail[6];
        var taxforinfant = arfaredetail[7];
        var totalfareperinfant =arfaredetail[8];
        var airlinename = arfaredetail[9];
        //alert(airlinename);
       var strCreatetbl= "<table width='232px' border='0' cellspacing='0' cellpadding='0'>"
      //  strCreatetbl=strCreatetbl+"<tr> <td align="left" valign="top">"
  strCreatetbl=strCreatetbl+"<tr><td align='left' valign='top'><img src='http://www.carltonleisure.com/pictures/uparrow.png' alt='up' class='uparrow' /></td></tr>"
  strCreatetbl=strCreatetbl+"<tr><td align='left' valign='top' ><table width='100%'class='conttool'  border='0' cellspacing='0' cellpadding='0'>"
        
        strCreatetbl=strCreatetbl+" <tr><td height='5' align='left' valign='top'></td></tr>"
        strCreatetbl=strCreatetbl+"<tr><td align='left' valign='top'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr>"
        strCreatetbl=strCreatetbl+"<td width='5' align='left' valign='top'>&nbsp;</td>"
        strCreatetbl=strCreatetbl+"<td align='left' valign='top'><table width='100%' border='0' cellspacing='0' cellpadding='0'>"
        strCreatetbl=strCreatetbl+"<tr>"
        strCreatetbl=strCreatetbl+"<td height='38' align='left' valign='top' class='bordbottool'><table width='100%' border='0' cellspacing='0' cellpadding='0'>"
        strCreatetbl=strCreatetbl+"<tr>"
        strCreatetbl=strCreatetbl+"<td align='left' valign='bottom' class='prbr'>Price Breakdown</td>"
        strCreatetbl=strCreatetbl+"<td width='87' align='left' valign='top'><img src='http://www.carltonleisure.com/AirlineLogo/" + airlinename + ".gif' alt='km' width='85' height='30' class='pick'/></td>"
        strCreatetbl=strCreatetbl+"</tr>"
         strCreatetbl=strCreatetbl+"</table></td>"
         strCreatetbl=strCreatetbl+"</tr>"
         strCreatetbl=strCreatetbl+"<tr>"
         strCreatetbl=strCreatetbl+"<td height='5' align='left' valign='top'></td>"
         strCreatetbl=strCreatetbl+"</tr>"
         strCreatetbl=strCreatetbl+"<tr>"
                      strCreatetbl=strCreatetbl+"<td align='left' valign='top' class='prbrlist'><span>&pound;"+ totalfareperadult+"</span> price per adult incl taxes"
                       var bfarechild = parseInt(basefareforchild);
        //alert(bfarechild);
           if(bfarechild > parseInt('0'))
            {
               strCreatetbl=strCreatetbl+"<br /><span>&pound;" + totalfareperchild + "</span> price per child incl taxes"
            }
           var bfareinfant = parseInt(basefareforinfant); 
           if(bfareinfant > parseInt('0'))
           {
             strCreatetbl=strCreatetbl+"<br /><span>&pound;"+ totalfareperinfant+"</span> price per infant incl taxes</td>"
            }
           strCreatetbl=strCreatetbl+"</tr>"
           strCreatetbl=strCreatetbl+"</table></td>"
           strCreatetbl=strCreatetbl+"<td width='5' align='left' valign='top'>&nbsp;</td>"
           strCreatetbl=strCreatetbl+"</tr>"
           strCreatetbl=strCreatetbl+"</table></td>"
           strCreatetbl=strCreatetbl+"</tr>"
           strCreatetbl=strCreatetbl+"<tr>"
           strCreatetbl=strCreatetbl+"<td height='5' align='left' valign='top'></td>"
           strCreatetbl=strCreatetbl+"</tr>"
           strCreatetbl=strCreatetbl+"</table>"
            strCreatetbl=strCreatetbl+"</td></tr></table></td></tr>"
            strCreatetbl=strCreatetbl + "</table>"
         document.getElementById("PriceDetailPopUp").innerHTML="";
        document.getElementById("PriceDetailPopUp").innerHTML=strCreatetbl
        var fieldPos = new positionInfo(tdID);
        var xpos;
        var ypos = fieldPos.getElementBottom()-30;
        xpos = fieldPos.getElementLeft()+10;
        PropertySetting('left', xpos + "px");
        PropertySetting('top', ypos + "px");
        document.getElementById("PriceDetailPopUp").style.visibility = "visible";
 }


function hideAgeCond()
{
   document.getElementById("PriceDetailPopUp").style.visibility = "hidden";

}


function AgeCondDetail(helpid)  
      {
        var strCreatetbl= "<table width='440'  border='0' cellspacing='0' cellpadding='2' bgcolor='#ffffff'>"
        strCreatetbl=strCreatetbl + "<tr ><td colspan='4' height='23px' style='font-family: Arial;color: #ffffff; font-weight:bold; font-size:13px;background:#436aa2; padding-left:7px;'align='left'>Age of Travellers: </td></tr>"
        strCreatetbl=strCreatetbl + "</tr>"
       
      
        strCreatetbl=strCreatetbl + " <tr>"
        strCreatetbl=strCreatetbl + " <td style='font-family: Arial;color: #000000;  width:99%;font-weight:normal; font-size:11px;padding-left:7px;border-left:1px solid #1070be;border-right:1px solid #1070be;border-bottom:1px solid #1070be;'><strong>All ages are at date of return to the UK.</strong> <br/><strong>Adults:</strong> An adult is someone aged 12 years and over. <br/><br/><strong>Children:</strong> A child is someone aged between 2 and 11 years (inclusive). <br/><br/> <strong>Infants: </strong>An Infant is someone aged less than 2 years on the date of his or her return to the UK. This means that if your infant will turn 2 during your holiday, you will need to book them as a child. <br/><br/><strong>Note:</strong> Infants travel for a fee (varies by supplier and destination), on an adult's lap. If you want your infant to have their own seat, he or she must be booked as a child. </td>"
        strCreatetbl=strCreatetbl + "</tr>"
       
       
        strCreatetbl=strCreatetbl + "</table>"
      
      
        document.getElementById("PriceDetailPopUp").innerHTML="";
        document.getElementById("PriceDetailPopUp").innerHTML=strCreatetbl
        var fieldPos = new positionInfo(helpid);
        var xpos;
        var ypos = fieldPos.getElementBottom();
        xpos = fieldPos.getElementLeft();
        PropertySetting('left', xpos + "px");
        PropertySetting('top', ypos + "px");
        document.getElementById("PriceDetailPopUp").style.visibility = "visible";
 }



