ddaccordion.init({
	headerclass: "submenuheader", //Shared CSS class name of headers group
	contentclass: "submenu", //Shared CSS class name of contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover
	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
	defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc] [] denotes no content
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: true, //Should contents open by default be animated into view?
	persiststate: false, //persist state of opened contents within browser session?
	toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["suffix", "<img src='"+pathdateimg+"/images/plus.gif' class='statusicon' />", "<img src='"+pathdateimg+"/images/minus.gif' class='statusicon' />"], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
   });

$("document").ready(function(){

			urlStr=location.href.split("#");
			
			$pos = location.href.indexOf("#");
			
			if($pos>0 && urlStr[1]!=''){
				
				
				
				displayMyBox(urlStr[1], $("#"+urlStr[1]));
				$("a[href*='#"+urlStr[1]+"']").addClass('arrow');
			}else {
				
				displayMyBox('details', $("#details"));
				$("a[href*='#details']").addClass('arrow');
			}
			
			
           	
           	//getCountryDropDown(countryName);
			//getCityDropDown(countryName, cityName);
			
			 $("li.imgList").css("cursor", "pointer").bind("click", function(){
                	$("div.header-main-pic").find("img").attr("src", $(this).find("img").attr("src"));
					$("div.header-main-pic").find("img").attr("alt", $(this).find("img").attr("alt"));
					$("#currentphoto").html($(this).find("img").attr("title"));
                });
			 
			$(".photoback").click(function(){
                	
					var currentphoto = $("#currentphoto").html();
					
					currentphoto = parseInt(currentphoto)-1;
					
					if(currentphoto>0){
					 $("#currentphoto").html(currentphoto);
					  $("li.imgList img[title="+currentphoto+"]").parent().trigger('click');
					//$("div.header-main-pic").find("img").attr("src",$("div.thumb-pic img[title="+currentphoto+"]").attr('src'));
					//$("div.thumb-pic").find("img [title="+currentphoto+"]").trigger('click');
					}
                });
				
				$(".photonext").click(function(){
                	
					var currentphoto = $("#currentphoto").html();
					//alert(currentphoto);
					currentphoto = parseInt(currentphoto)+1;
					
					//find("img [title="+currentphoto+"]").trigger('click')
					//alert($("div.thumb-pic img[title="+currentphoto+"]").attr('src'));
					 //$("#currentphoto").html(currentphoto);
					 $("li.imgList img[title="+currentphoto+"]").parent().trigger('click');
					//$("div.header-main-pic").find("img").attr("src",$("div.thumb-pic img[title="+currentphoto+"]").attr('src'));
                });
				
              /*  $('#container-10').tabs();
                $('<p><a href="#">Disable third tab<\/a><\/p>').prependTo('#fragment-28').find('a').click(function() {
                    $(this).parents('div').eq(1).disableTab(3);
                    return false;
                });
                $('<p><a href="#">Activate third tab<\/a><\/p>').prependTo('#fragment-28').find('a').click(function() {
                    $(this).parents('div').eq(1).triggerTab(3);
                    return false;
                });
                $('<p><a href="#">Enable third tab<\/a><\/p>').prependTo('#fragment-28').find('a').click(function() {
                    $(this).parents('div').eq(1).enableTab(3);
                    return false;
                });*/
                
                
                
                
                 $(".sendquery" ).click(function(){
					//id = $(this).attr('id');
					//pieces = id.split("-");
					pkgName= '';//$("form[name='form-"+pieces[1]+"'] input[name='package_name_title'][type='hidden']").val();
					pkgid= '';//$("form[name='form-"+pieces[1]+"'] input[name='package_id'][type='hidden']").val();
					$.ajax({
						 type:"POST",
						 url:HOSTURL+"hotels/cityhotels/index.php",
						 /*url:HOSTURL+"hotels/30percentcashbackhotels/sendmailform",*/
						 data:"package_name_title="+escape(pkgName)+"&country="+countryName+"&city="+cityName+"&pkgid="+pkgid+"&action=sendQuery",
						 success:function(results){
										  //alert(results);
										  jQuery.facebox( results );
										  $("img#emailformbtnfield").css("cursor", "pointer").bind("click",function(e){
												$.ajax({
														type:"POST",
														url:HOSTURL+"hotels/cityhotels/index.php",
														/*url:HOSTURL+"hotels/30percentcashbackhotels/validatemailform",*/
														data:"action=sendQueryVal&sendqueryname="+$("input[type='text'][name='sendqueryname']").val()+"&sendqueryemail="+$("input[type='text'][name='sendqueryemail']").val()+"&sendquerytel="+$("input[type='text'][name='sendquerytel']").val()+"&sendquerymob="+$("input[type='text'][name='sendquerymob']").val()+"&sendqueryremarks="+$("textarea[name='sendqueryremarks']").val()+"&packagename="+$("input[type='hidden'][name='query_pckname']").val(),
														success:function(msg){
															$("div.msg").html("*"+msg);
														}
			
												});
												return false;
										  });
										  
						 },
						 error:function ( XMLHttpRequest, textStatus, errorThrown) {
							 alert("An error occured.Detail can not obtained");
							 return null;
						 }
					});
							return false;
			
				});

				/*$("a.left_links").bind("click", function(){
					$("a.left_links").each().css("font-weight","normal");
					$(this).css("font-weight","bold");
				});*/

				$("#faq" ).click(function(){
    	
    			NewWindow("http://www.ezeego1.co.in/hotels/html/hotels_faqs.html","FAQs",'yes', '615', '400');     
				return false;
				});
				/*scroller("div#modal");
				scroller("div#loader");*/
				
				$(".overlay_it").click(function(){
					showOverlay();
					
				});	

               var thisdate = new Date();
				var day = thisdate.getDate();
				var month = thisdate.getMonth();
				month=month+1;
				var year = thisdate.getFullYear().toString(); 
				var year = year.substring(2); 				       
				var currdate=day+'/'+month+'/'+year;
			               $('#check_in_date').datepicker({showOn: 'both', buttonImage: ''+STATICURL+'/images/hotels/themehotels/cal.gif', buttonImageOnly: true, buttonText: 'Choose date', minDate: currdate, maxDate: false, changeMonth: false, changeYear: false, numberOfMonths: 1, dateFormat: 'dd/mm/y', firstDay: 1, closeText: '', clearText: '', currentText:'', prevImage: ''+STATICURL+'/images/hotels/themehotels/double_prev.gif', nextImage: ''+STATICURL+'/images/hotels/themehotels/double_next.gif'});
			    
			    //var check_in_date = $("select#check_in_date").val();
			    
			    $('#check_out_date').datepicker({showOn: 'both', buttonImage: ''+STATICURL+'/images/hotels/cal.gif', buttonImageOnly: true, buttonText: 'Choose date', maxDate: false, changeMonth: false, changeYear: false, numberOfMonths: 1, dateFormat: 'dd/mm/y', beforeShow: getmindate, firstDay: 1, closeText: '', clearText: '', currentText:'', prevImage: ''+STATICURL+'/images/hotels/themehotels/double_prev.gif', nextImage: ''+STATICURL+'/images/hotels/themehotels/double_next.gif'});

			$("#rooms").trigger("change");	
			
			if(hotelNames.length>0)
			{
				getImages(countryName, cityName, hotelNames);
			}	
				
            });
            
function getmindate()
{
	var dateArray=new Array();
	var depdate=document.getElementById('check_in_date').value;
	/*if(depdate == '' )
    	{
    		alert("please select a check in date first.");
    		return false;
    	}  */	
	if(depdate!="dd/mm/yy"){
	       dateArray=depdate.split('/');
	       
	       var day1=dateArray[0];
	       var month1=dateArray[1];
	       var mymonth=trimNumber(month1);
	       var year1=dateArray[2]; 
	       
	       var minidate=new Date( '20'+year1 , mymonth - 1 , day1 );     
	       return {minDate:minidate};
	}else{
	       return {minDate:0}
	}
}
function trimNumber(s) {
	while (s.substr(0,1) == '0' && s.length>1) { s = s.substr(1,9999); }
	return s;
}


getNumberOfNights = function()
    {
        x = $("#check_in_date").datepicker("getDate");
		y = $("#check_out_date").datepicker("getDate");
        var dt1 = new Date();
        dt1.setFullYear(x.getFullYear(), x.getMonth(), x.getDate());
        var dt2 = new Date();
        dt2.setFullYear(y.getFullYear(), y.getMonth(), y.getDate());
		return (dt2.valueOf() - dt1.valueOf()) / (60 * 60 * 24 * 1000);

    }

            
            function displayMyBox(myId, obj)
            {
				$("div.hotel_desc").each(function(){
            		$(this).hide();            		            		
            	});
            	$("#"+myId).show();
            	$(".left_links").removeClass("arrow");
            	$(obj).addClass("arrow");
            	//return false;
            }
			
            
        function showHideRooms(obj)
        {
        	var numRooms	= $(obj).val();
        	$("div#room_2").html("");
        	$("div#room_3").html("");
            for(var num=2;num<=numRooms;num++)
            {
            	var roomHTML	= '';
			roomHTML	+= '<br clear="all"><br>';
			roomHTML	+= '<div  class="frm-left-text2" id="label_room'+num+'">Room'+num+'</div>';
			roomHTML	+= '<div class="frm-left-input" id="select_room_'+num+'">';
			roomHTML	+= '	<select class="listmenu8" id="roomtype'+num+'" name="roomtype'+num+'" onchange="showHidePersons(this);">  ';
			roomHTML	+= '	    <option value="SGL_1">Single (1 Guest)</option>';
			roomHTML	+= '	    <option value="DBL_1">Double for sole use (1 guest)</option>';
			roomHTML	+= '	    <option value="DBL_2" selected="selected">Double (2 Guests)</option>';
			roomHTML	+= '	    <option value="TWN_1">Twin for sole use (1 guest)</option>';
			roomHTML	+= '	    <option value="TWN_2">Twin (2 Guests)</option>';
			roomHTML	+= '	    <option value="TRP_3">Triple (3 Guests)</option>';
			roomHTML	+= '	    <option value="QUD_4">Quad (4 Guests)</option>';
			roomHTML	+= '	    <option value="DBL_1C">Double with 1 child (2 Guests + 1 Child)</option>';
			roomHTML	+= '	    <option value="DBL_2C">Double with 2 children (2 Guests + 2 Child)</option>';
			roomHTML	+= '	    <option value="TRP_1C">Triple with 1 child (3 Guests + 1 Child)</option>';                                    
			roomHTML	+= '	</select>';
			roomHTML	+= '</div>';
			roomHTML	+= '<div class="frm-left-sub" style="margin-bottom:5px;">';
			/*roomHTML	+= '	<div class="frm-left-sub-text" style="float:left;">Adult</div>';
			roomHTML	+= '	<div class="frm-left-sub-text" style="float:left;margin-left:5px;">child</div>';*/
			roomHTML	+= '	<div class=" frm-left-select1" id="adults_room'+num+'">Adult<br>';
			roomHTML	+= '		<select class="listmenu9" id="adult'+num+'"  name="adult'+num+'">';
			roomHTML	+= '				<option value="1">1</option>';
			roomHTML	+= '				<option value="2" selected="selected">2</option>';
			roomHTML	+= '				<option value="3">3</option>';
			roomHTML	+= '				<option value="4">4</option>';
			roomHTML	+= '</select>';
			roomHTML	+= '	</div>';
		/*	roomHTML	+= '	<div class=" frm-left-select1" style="margin-left:5px;" id="childs_room'+num+'">Child<br>';
			roomHTML	+= '		<select class="listmenu9"  name="">';
			roomHTML	+= '				<option>0</option>';
			roomHTML	+= '				<option>1</option>';
			roomHTML	+= '				<option>2</option>  ';					
			roomHTML	+= '		</select>';
			roomHTML	+= '	</div>';*/
			roomHTML	+= '</div>';
			/*roomHTML	+= '<div  class="frm-left-text2" id="label_childage'+num+'" style="clear:both;float:left; ">child age</div>';
			roomHTML	+= '<div class="frm-left-sub">';
			roomHTML	+= '	<div class=" frm-left-select1" id="age1_room'+num+'">';
			roomHTML	+= '		<select class="listmenu9"  name="">';
			roomHTML	+= '				<option>1</option>';
			roomHTML	+= '				<option>2</option>';
			roomHTML	+= '				<option>3</option>';
			roomHTML	+= '				<option>4</option>';
			roomHTML	+= '		</select>';
			roomHTML	+= '	</div>';
			roomHTML	+= '	<div class=" frm-left-select1" id="age2_room'+num+'">';
			roomHTML	+= '		<select class="listmenu9" style="margin-left:5px;" name="">';
			roomHTML	+= '				<option>0</option>';
			roomHTML	+= '				<option>1</option>';
			roomHTML	+= '				<option>2</option>';					
			roomHTML	+= '		</select>';
			roomHTML	+= '	</div>';
			roomHTML	+= '</div>';*/
			 $("div#room_"+num).html(roomHTML);
            }
            
           

	}
	
	function showHidePersons(obj)
	{
		var options = '';
		var roomtype = $(obj).val();
		var id = $(obj).parent().parent().attr("id");
		var pieces = id.split("_");
		id = pieces[1];
			$("#bed"+id).remove();
			$("#childs_room"+id).remove();
			$("#label_childage"+id).remove();
			$("#container_childage"+id).remove();
		
		if(roomtype == 'SGL_1' || roomtype == 'DBL_1' || roomtype == 'TWN_1')
		{
			
			options = getOptions(1, 4, 1);
			$("#adults_room"+id).find("select").html(options);
		}
		if(roomtype == 'DBL_2' || roomtype == 'TWN_2')
		{
			
			options = getOptions(1, 4, 2);
			$("#adults_room"+id).find("select").html(options);
		}
		
		if(roomtype == 'TRP_3')
		{
			
			options = getOptions(1, 4, 3);
			$("#adults_room"+id).find("select").html(options);
		}
		if(roomtype == 'QUD_4')
		{
			
			options = getOptions(1, 4, 4);
			$("#adults_room"+id).find("select").html(options);
			
		}
		if(roomtype == 'DBL_1C')
		{
			
			options = getOptions(1, 4, 2);
			$("#adults_room"+id).find("select").html(options);
			addChild(id, 1);
			addChildAge(id, 1);
		}
		if(roomtype == 'DBL_2C')
		{
			
			options = getOptions(1, 4, 2);
			$("#adults_room"+id).find("select").html(options);
			addChild(id, 2);
			addChildAge(id, 2);
		}
		if(roomtype == 'TRP_1C')
		{
			
			options = getOptions(1, 4, 3);
			$("#adults_room"+id).find("select").html(options);
			addChild(id,1);
			addChildAge(id, 1);
		}
	}
	
	function getOptions(start, end, selectnum)
	{
		var str = '';
		for(var i=start;i<=end;i++)
		{
			if(i==selectnum)
			{
				str += '<option value="'+i+'" selected="selected">'+i+'</option>';
			}
			else
			{
				str += '<option value="'+i+'">'+i+'</option>';
			}
			
		}//alert(str)
		return str;
	}
	
	function addChild(id, num)
	{
		var options = getOptions(0, 2, num);
		var str = '<div class="frm-left-select1" id="childs_room'+id+'" style="margin-left:5px;">Child<br>'+
				'	<select class="listmenu9" id="child'+id+'" name="child'+id+'">'+options+  							
				'	</select>'+				
				' </div>'+
				'<div class="frm-left-select1" id="bed'+id+'">&nbsp;Extra Bed<br>&nbsp;&nbsp;<input type="checkbox" name="extraBed'+id+'" checked="checked" value="Y" /></div>';
		$("#bed"+id).remove();
		$("#childs_room"+id).remove();
		$("#adults_room"+id).parent().append(str);
	}
	
	function addChildAge(id, num)
	{
		var select = '';
		var options = getOptions(0, 11, 0);
		for(var i=1; i<=num; i++)
		{
			select += '<div class="frm-left-select1" id="age'+i+'_room'+id+'">'+
							'<select class="listmenu9" id="childAge'+id+i+'" name="childAge'+id+i+'">'+options+
			  				
							'</select>'+
						'</div>';
		}
						
		var str = '<div  class="frm-left-text2" id="label_childage'+id+'" style="clear:both; float:left;">child age</div>'+
					'<div class="frm-left-sub" id="container_childage'+id+'">'+select+	
					'</div>';
		$("#label_childage"+id).remove();
		$("#container_childage"+id).remove();
		$("#room_"+id).append(str);
	}
        
	
	
function submitval(thisObj)
{
	//alert(document.getElementById('more').value);
	var StrError="";
	var mycnt=0;
	error=true;
	
	if(document.getElementById('country').value=="")
	{
		StrError = StrError +"* Please fill in suitable country in 'country' field<br />";
		error=false;
	}
	/*if(document.getElementById('more').value==""  && document.getElementById('less').value=="" )
	{
		//alert("i m in in city");
		StrError = StrError +"Please fill in suitable city in 'city' field\n";
		error=false;
	}*/
	
	if(document.getElementById('check_in_date').value=="" || document.getElementById('check_in_date').value=="dd/mm/yy"
		|| document.getElementById('check_in_date').value=="-" || document.getElementById('check_in_date').value=="NaN/NaN/NaN")
	{
		StrError = StrError +"* Please fill in suitable date in 'check in date' field<br />";
		error=false;
	}
	
	if(document.getElementById('check_out_date').value=="" || document.getElementById('check_out_date').value=="dd/mm/yy"
		|| document.getElementById('check_out_date').value=="-" || document.getElementById('check_out_date').value=="NaN/NaN/NaN")
	{
		StrError = StrError +"* Please fill in suitable date in 'check out date' field<br />";
		error=false;
	}
	
	/*if(document.getElementById('night_id').value==0)
	{
		StrError = StrError +"No of Nights cannot be empty\n";
		error=false;
	}*/
	/*if(document.getElementById('rooms').value==0)
	{
		StrError = StrError +"No of Rooms cannot be zero\n";
		error=false;
	}*/

	if(error)
	{
		$("input#noofnights").val(getNumberOfNights());
		var noofpax=0; // no of passengers les  than 10
		var noRooms=parseInt(document.getElementById('rooms').value)
		for(var i=1;i<=noRooms;i++)
		{
			//alert('rooms--'+document.getElementById('roomtype'+i).value+document.getElementById('child'+i).value)
			if(document.getElementById('roomtype'+i).value=='SGL_1')
			{
				document.getElementById('sglQty').value=parseInt(document.getElementById('sglQty').value)+1;
				if(parseInt(document.getElementById('adult'+i).value) > 1 )
				{
					error=false;
					StrError = StrError +"* Select Proper Adult Passengers For Room # "+i+"<br />";
				}
			}
			if(document.getElementById('roomtype'+i).value=='DBL_1')
			{
				document.getElementById('dblQty').value=parseInt(document.getElementById('dblQty').value)+1;
				if(parseInt(document.getElementById('adult'+i).value) > 1 )
				{
					error=false;
					StrError = StrError +"* Select Proper Adult Passengers For Room # "+i+"<br />";
				}
			}
			
			
			if(document.getElementById('roomtype'+i).value=='DBL_2')
			{
				document.getElementById('dblQty').value=parseInt(document.getElementById('dblQty').value)+1;
				if(parseInt(document.getElementById('adult'+i).value) != 2 )
				{
					error=false;
					StrError = StrError +"* Select Proper Adult Passengers For Room # "+i+"<br />";
				}
			}
			if(document.getElementById('roomtype'+i).value=='TWN_1')
			{
				document.getElementById('twnQty').value=parseInt(document.getElementById('twnQty').value)+1;
				if(parseInt(document.getElementById('adult'+i).value) > 1 )
				{
					error=false;
					StrError = StrError +"* Select Proper Adult Passengers For Room # "+i+"<br />";
				}
			}
			if(document.getElementById('roomtype'+i).value=='TWN_2')
			{
				document.getElementById('twnQty').value=parseInt(document.getElementById('twnQty').value)+1;
				if(parseInt(document.getElementById('adult'+i).value) != 2 )
				{
					error=false;
					StrError = StrError +"* Select Proper Adult Passengers For Room # "+i+"<br />";
				}
			}
			if(document.getElementById('roomtype'+i).value=='TRP_3')
			{
				document.getElementById('tplQty').value=parseInt(document.getElementById('tplQty').value)+1;
				if(parseInt(document.getElementById('adult'+i).value) != 3 )
				{
					error=false;
					StrError = StrError +"* Select Proper Adult Passengers For Room # "+i+"<br />";
				}
			}
			if(document.getElementById('roomtype'+i).value=='QUD_4')
			{
				document.getElementById('quadQty').value=parseInt(document.getElementById('quadQty').value)+1;
				if(parseInt(document.getElementById('adult'+i).value) != 4 )
				{
					error=false;
					StrError = StrError +"* Select Proper Adult Passengers For Room # "+i+"<br />";
				}
			}
			if(document.getElementById('roomtype'+i).value=='DBL_1C')
			{
				document.getElementById('dblQty').value=parseInt(document.getElementById('dblQty').value)+1;
				if(parseInt(document.getElementById('adult'+i).value) != 2 || parseInt(document.getElementById('child'+i).value) != 1)
				{
					error=false;
					StrError = StrError +"* Select Proper Adult/Child Passengers For Room # "+i+"<br />";
				}
				
				  // alert("i : DBL_1C  "+i);
			
				if(i== 1 && document.getElementById('childAge11').value==0)
	               {
		             StrError = StrError +"* Select proper age of child to proceed <br />";
		             error=false;
	                }
	                else
	                if(i==2 && document.getElementById('childAge21').value==0)
	               {
		             StrError = StrError +"* Select proper age of child to proceed <br />";
		             error=false;
	                }
	                  else
	                if(i==3 && document.getElementById('childAge31').value==0)
	               {
		             StrError = StrError +"* Select proper age of child to proceed <br />";
		             error=false;
	                }

			}
			if(document.getElementById('roomtype'+i).value=='DBL_2C')
			{
			
			     //alert("mycnt : DBL_2C "+mycnt);
				document.getElementById('dblQty').value=parseInt(document.getElementById('dblQty').value)+1;
				if(parseInt(document.getElementById('adult'+i).value) != 2 || (parseInt(document.getElementById('child'+i).value) != 2))
				{
					error=false;
					StrError = StrError +"* Select Proper Adult/Child Passengers For Room # "+i+"<br />";
				}
				
				if(i== 1 && (document.getElementById('childAge11').value==0 || document.getElementById('childAge12').value==0 ))
	               {
		             StrError = StrError +"* Select proper age of child to proceed <br />";
		             error=false;
	                }
	                else
	              if(i==2 && (document.getElementById('childAge21').value==0 || document.getElementById('childAge22').value==0 ))
	             {
		             StrError = StrError +"* Select proper age of child to proceed <br />";
		             error=false;
	                }
	                  else
	              if(i==3 && (document.getElementById('childAge31').value==0 || document.getElementById('childAge32').value==0 ))
	             {
		             StrError = StrError +"* Select proper age of child to proceed <br />";
		             error=false;
	                }
	                
						}
			if(document.getElementById('roomtype'+i).value=='TRP_1C')
			{
			
			    document.getElementById('tplQty').value=parseInt(document.getElementById('tplQty').value)+1;
				if(parseInt(document.getElementById('adult'+i).value) != 3 || parseInt(document.getElementById('child'+i).value) != 1)
				{
					error=false;
					StrError = StrError +"* Select Proper Adult/Child Passengers For Room # "+i+"<br />";
				}
				
				
				if(i==1 && document.getElementById('childAge11').value==0)
	               {
		             StrError = StrError +"* Select proper age of child to proceed <br />";
		             error=false;
	                }
	                else
	                if(i==2 && document.getElementById('childAge21').value==0)
	               {
		             StrError = StrError +"* Select proper age of child to proceed <br />";
		             error=false;
	                }
	                  else
	                if(i==3 && document.getElementById('childAge31').value==0)
	               {
		             StrError = StrError +"* Select proper age of child to proceed <br />";
		             error=false;
	                }
				
			}
			if(document.getElementById('roomtype'+i).value=='QUD_1C')
			{
				document.getElementById('quadQty').value=parseInt(document.getElementById('quadQty').value)+1;
				if(parseInt(document.getElementById('adult'+i).value) != 4 || parseInt(document.getElementById('child'+i).value) != 1 )
				{
					error=false;
					StrError = StrError +"* Select Proper Adult/Child Passengers For Room # "+i+"<br />";
				}
			}
				// for no of passengers to be less than 10
			if(document.getElementById('child'+i))
			{
				noofpax += (parseInt(document.getElementById('adult'+i).value) + parseInt(document.getElementById('child'+i).value));
			}
			else
			{
				noofpax += parseInt(document.getElementById('adult'+i).value);
			}
		}
	}
	if(noofpax >=10)
	{
		error=false;
		StrError = StrError +"* The maximum number of passengers allowed is 9" + "<br />";  
	}
	if(error==false)
	{
		//alert("Following fields requires correction:\n"+StrError);
		/*document.getElementById("errMsg").innerHTML = StrError;
		document.getElementById("errTr").style.visibility = "visible";
		document.getElementById("errTr").style.display = "";
		window.scrollBy(0,110);*///alert(StrError);
		
		$("#checkavaerror").css("display","none");
		$("#checkavaerror").html(StrError);
		$("#checkavaerror").fadeIn().css("display","block");;
	}
	else
	{
	
	//alert("ok");
	//thisObj.style.visibility='hidden';
	//thisObj.style.display = 'none';
	//document.getElementById('progressRowhot').style.visibility='visible';
	//document.getElementById('progressRowhot').style.display = '';
	//document.getElementById('documentBody').style.visibility='hidden';
	//document.getElementById('documentBody').style.display = 'none';
	
	//document.hotelsearch.action="offlinebookinghotelsearchresult.do?productType=HOT";
	//document.hotelsearch.BIZ_ACTION_MODE.value="HOTEL_SEARCH_LIST";
	jQuery("#hotelsearch").append(jQuery("#productForm").html());

	document.hotelsearch.submit();
	
	}
}


function ChatPopUp(email)
{
 window.open("http://203.76.139.6/Chat/Non_Air.asp?Email="+email,"","scrollbars=yes,width=480,height=400,resizable=no");
 //return false;
}

function NewWindow(mypage,myname,scroll,w,h){    
    var width = w ? w : '725';
    var height = h ? h : '600';
  	window.open(mypage,myname,'scrollbars=yes,width='+width+',height='+height);
}

function showOverlay()
{
	$("select").css("background-color", "#ebebe4");
	$("div#modal").css("width",screen.width+"px").css("height", screen.height+"px");
	$("div#modal").bgiframe();
	$("div#modal").show();
	$('div#loader').show();
	//$('div#loader').html("Loading...<br><img src='webroot/images/loader.gif' />");
}



function ajaxController(query, methodName )
{	 
	$.ajax({
             type:"POST",
             url:"ajaxController.php",
             data: query,
             success:function(results){  
             		if(methodName) 	
                    	eval (methodName+"(results)");
             },
             error:function ( XMLHttpRequest, textStatus, errorThrown) {
                // alert("An error occured.Detail can not obtained");
                 return null;
             }
       	});     
}

	
function getCityDropDown(countryName, cityName)
{
	$("span#city_loader_img").show();
	var queryStr ='f=getCities&country='+countryName+'&city='+cityName;
	ajaxController(queryStr,'displayCityContent');
}

function getCountryDropDown(countryName)
{
	$("span#country_loader_img").show();
	var queryStr ='f=getCountries&country='+countryName;
	ajaxController(queryStr,'displayCountrtyContent');
}

function displayCityContent(data)
{
	$("select#city_drop").replaceWith(data);
	$("span#city_loader_img").hide();
}

function displayCountrtyContent(data)
{
	$("select#country_drop").replaceWith(data);
	$("span#country_loader_img").hide();
}

function getHotels()
{
	showOverlay();
	var curLocation	= location.href;
	var lastChar 	= curLocation.substring(curLocation.length-1);	
	var prefix		= '../../../';
	if(lastChar != '/')
	{
		prefix = '../../';
	}			
	location.href = prefix+$("#country_drop").val().toLowerCase()+"/"+$("#city_drop").val().toLowerCase()+"/page/1";
	
}

function showCountryCitySelect()
{
	//$("div#hotel_menu").css("height", "380px!important;");
	$(".hide_it").show();
	
}
function img_popup(obj, cityName, countryName, hotelName){        	 	
	jQuery.facebox('<div style="width:770px;"><div class="floatright" style="margin:5px 5px 0 0;"><a href="javascript:;" class="colorgrey bold text11" style="text-decoration:none" onClick="$(document).trigger(\'close.facebox\');">Close</a>&nbsp;<img src="'+pathdateimg+'/images/close.gif" alt="Close" width="16" height="16" align="absmiddle" onClick="$(document).trigger(\'close.facebox\');" style="cursor:pointer;"></div><div class="clear" align="center"><img src="'+pathdateimg+'/images/loading.gif" align="middle" /><br />Loading...<br /></div><div class="clear" style="line-height:10px;">&nbsp;</div></div>');

	 $("#facebox div.content").load(HOSTURL+'hotels/cityhotels/ajaxController.php', {f: 'getImages', city: cityName, country: countryName, hotelName: hotelName}, function(){ 				//alert( $("#facebox div.content").html());
		  $('#facebox a.img').click(function() { 
		  	$("#facebox img.image_show_big").attr("src", $(this).find("img").attr("src")); 
		  	return false;
		  });				
    }); 
	
    return false;
  }

   function landmark_popup(obj, cityName, countryName, hotelName){        	 	
	jQuery.facebox('<div style="width:770px;"><div class="floatright" style="margin:5px 5px 0 0;"><a href="javascript:;" class="colorgrey bold text11" style="text-decoration:none" onClick="$(document).trigger(\'close.facebox\');">Close</a>&nbsp;<img src="'+pathdateimg+'/images/close.gif" alt="Close" width="16" height="16" align="absmiddle" onClick="$(document).trigger(\'close.facebox\');" style="cursor:pointer;"></div><div class="clear" align="center"><img src="'+pathdateimg+'/images/loading.gif" align="middle" /><br />Loading...<br /></div><div class="clear" style="line-height:10px;">&nbsp;</div></div>');

	 $("#facebox div.content").load(HOSTURL+'hotels/cityhotels/ajaxController.php', {f: 'getLandmark', city: cityName, country: countryName, hotelName: hotelName}, function(){ 				//alert( $("#facebox div.content").html());			
    }); 
	
    return false;
  }
  
  
function map_popup(obj, cityName, countryName, hotelName){        	 	
	jQuery.facebox('<div style="width:770px;"><div class="floatright" style="margin:5px 5px 0 0;"><a href="javascript:;" class="colorgrey bold text11" style="text-decoration:none" onClick="$(document).trigger(\'close.facebox\');">Close</a>&nbsp;<img src="'+pathdateimg+'/images/close.gif" alt="Close" width="16" height="16" align="absmiddle" onClick="$(document).trigger(\'close.facebox\');" style="cursor:pointer;"></div><div class="clear" align="center"><img src="'+pathdateimg+'/images/loading.gif" align="middle" /><br />Loading...<br /></div><div class="clear" style="line-height:10px;">&nbsp;</div></div>');

	 $("#facebox div.content").load(HOSTURL+'hotels/cityhotels/ajaxController.php', {f: 'getMap', city: cityName, country: countryName, hotelName: hotelName}, function(){ 	   
		
    }); 
	
    return false;
  } 
  
  function video_popup(obj, cityName, countryName, hotelName){        	 	
	jQuery.facebox('<div style="width:770px;"><div class="floatright" style="margin:5px 5px 0 0;"><a href="javascript:;" class="colorgrey bold text11" style="text-decoration:none" onClick="$(document).trigger(\'close.facebox\');">Close</a>&nbsp;<img src="'+pathdateimg+'/images/close.gif" alt="Close" width="16" height="16" align="absmiddle" onClick="$(document).trigger(\'close.facebox\');" style="cursor:pointer;"></div><div class="clear" align="center"><img src="'+pathdateimg+'/images/loading.gif" align="middle" /><br />Loading...<br /></div><div class="clear" style="line-height:10px;">&nbsp;</div></div>');
		
	 $("#facebox div.content").load(HOSTURL+'hotels/cityhotels/ajaxController.php', {f: 'getVideo', city: cityName, country: countryName, hotelName: hotelName}, function(){ 	   
	
	if($("#player").attr('class')=='found'){
		
		flowplayer("player", HOSTURL+"static/flash/flowplayer-3.1.5.swf");
	}

	 /*alert(videopath);		
	 $f("player", HOSTURL+"static/flash/flowplayer-3.1.5.swf", {
		clip: {
			baseUrl: ''+videopath,
			autoPlay: true,
			autoBuffering: true
		} 
	});*/		
    }); 
	
    return false;
  }
function getImages(countryName, cityName, hotelNames)	
{
	for (k in hotelNames)
	{
		$("div#pic-left-pack-"+k).load(HOSTURL+'hotels/cityhotels/ajaxController.php', {f: 'getFrontImage', city: cityName, country: countryName, hotelName: hotelNames[k]});
	}
}
