<!--
function open_dest(dest,div_id,st_date,end_date,chk,loc)
		{
		if (st_date&&end_date)
			var url = "scripts/location.php?tara="+dest+"&st_date="+st_date+"&end_date="+end_date;
		else
		if (st_date)
			var url = "scripts/location.php?tara="+dest+"&st_date="+st_date;
		else
		if (end_date)
			var url = "scripts/location.php?tara="+dest+"&end_date="+end_date;
		else
			var url = "scripts/location.php?tara="+dest;
			
	if (chk != '0,0,0'){
	    url +='&chk='+chk;
						}
	if (loc&&loc!=''){
	    url +='&loc='+loc;
		}
		
		
	pr_start = document.getElementById('pret_start').value;
	pr_end   = document.getElementById('pret_end').value;
	if (pr_start){url +='&pr_start='+pr_start;}
    if (pr_end){url +='&pr_end='+pr_end;}
		ajaxGET(url,div_id);
		}
		
		
function oferte(tara){
		var url = "scripts/oferte.php?tara="+tara;
		ajaxGET(url,'dest_detail');
		}		
		
function load_menu(div_id)
		{
		var url = "scripts/get_menu_items.php";
		ajaxGET(url,div_id);
		}
		
function get_hotels(dest)
		{
		var url = "scripts/get_all_hotels.php?tara="+dest;
		ajaxGET(url,'dest_detail');
		}
		
function descriere_tara(dest)
		{
		var url = "scripts/descriere_tara.php?tara="+dest;
		ajaxGET(url,'dest_detail');
		}
		
function load_location(dest,div_id)
		{
		var url = "scripts/get_location.php?id_dest="+dest;
		ajaxGET(url,div_id);
		}
		
function setSession(name,value){
	
		var url = "scripts/setsession.php?name="+name+"&value="+value;
		ajaxGET(url,'response');
		}
function setSessionSubdir(name,value){
	
		var url = "scripts/setsession.php?name="+name+"&value="+value;
		ajaxGET(url,'response');
		}




function load_general(divID,hotel){
		var url = "../hotels/pages/general.php?hotel="+hotel;
		ajaxGET(url,divID);
		}
function load_details(divID,hotel){
		var url = "../hotels/pages/details.php?hotel="+hotel;
		ajaxGET(url,divID);
		}
function load_services(divID,hotel){
		var url = "../hotels/pages/services.php?hotel="+hotel;
		ajaxGET(url,divID);
		}
function load_children(divID,hotel){
		var url = "../hotels/pages/children.php?hotel="+hotel;
		ajaxGET(url,divID);
		}
function load_beach(divID,hotel){
		var url = "../hotels/pages/beach.php?hotel="+hotel;
		ajaxGET(url,divID);
		}
function load_oferte(divID,hotel){
		var url = "../hotels/pages/oferte.php?hotel="+hotel;
		ajaxGET(url,divID);
		}
function load_all(hotel)
		{
		load_general('fragment-16',hotel);
		load_details('fragment-17',hotel);
		load_services('fragment-18',hotel);
		load_children('fragment-19',hotel);
		load_beach('fragment-20',hotel);
		load_oferte('fragment-21',hotel);
		}

function get_descr(hotel){
		var url = "../hotels/scripts/get_descr.php?hotel="+hotel;
		ajaxGET(url,'descr');
		}
		
function get_reg(tara){
		var url = "hotels/filter/get_reg.php?tara="+tara;
		ajaxGET(url,'res');
		}


function menu_over(div_id){
    document.getElementById(div_id).style.background = 'url(img/menu_over.png)'; 
    document.getElementById(div_id).style.backgroundRepeat = 'repeat-x';
    document.getElementById(div_id).style.cursor = 'hand';
	}
function menu_out(div_id){
    document.getElementById(div_id).style.background = '';
	document.getElementById(div_id).style.cursor = 'pointer';
	}

function menu_loc_over(div_id){
    document.getElementById(div_id).style.background = 'url(img/menu_left_over.png)'; 
    document.getElementById(div_id).style.backgroundRepeat = 'repeat-x';
	document.getElementById(div_id).style.cursor = 'pointer';

	}
function menu_loc_out(div_id){
    document.getElementById(div_id).style.background = '';
	document.getElementById(div_id).style.cursor = 'pointer';
	}
	

function menu_loc_over_sub(div_id){
    document.getElementById(div_id).style.background = 'url(../img/menu_left_over.png)'; 
    document.getElementById(div_id).style.backgroundRepeat = 'repeat-x';
	document.getElementById(div_id).style.cursor = 'pointer';
	}
function menu_loc_out_sub(div_id){
    document.getElementById(div_id).style.background = '';
	document.getElementById(div_id).style.cursor = 'pointer';
	}
	
	
function menu_loc_over_sup(div_id){
    document.getElementById(div_id).style.background = 'url(main/img/menu_left_over.png)'; 
    document.getElementById(div_id).style.backgroundRepeat = 'repeat-x';
	document.getElementById(div_id).style.cursor = 'pointer';
	}
function menu_loc_out_sup(div_id){
    document.getElementById(div_id).style.background = '';
	document.getElementById(div_id).style.cursor = 'pointer';
	}

		
function menu_loc_over_tip(div_id){
    document.getElementById(div_id).style.background = 'url(../main/img/menu_left_over.png)'; 
    document.getElementById(div_id).style.backgroundRepeat = 'repeat-x';
	document.getElementById(div_id).style.cursor = 'pointer';
	}

	
	
function page_preloader() {
 var elem = new Array ();
    // elem[0] = document.getElementById("overlay");
     elem[1] = document.getElementById("bodydiv");
	  
    // elem[0].style.visibility="hidden";
     elem[1].style.visibility="visible"; 
 }
 
 function check(chk){
	 
	 if (chk == 'checkbox11'||chk == 'ch9')
	 	if (document.getElementById(chk).checked)
		    document.getElementById(chk+'1').style.background = 'url(img/icons/categ/3starSmallUnactive.png) no-repeat'; 
		else
		    document.getElementById(chk+'1').style.background = 'url(img/icons/categ/3starSmall.png) no-repeat';
			
	 if (chk == 'checkbox12'||chk == 'ch10') 
	 	if (document.getElementById(chk).checked)
		    document.getElementById(chk+'1').style.background = 'url(img/icons/categ/4starSmallUnactive.png) no-repeat'; 
		else
		    document.getElementById(chk+'1').style.background = 'url(img/icons/categ/4starSmall.png) no-repeat';
	 
	 if (chk == 'checkbox13'||chk == 'ch11')
	 	if (document.getElementById(chk).checked)
		    document.getElementById(chk+'1').style.background = 'url(img/icons/categ/5starSmallUnactive.png) no-repeat'; 
		else
		    document.getElementById(chk+'1').style.background = 'url(img/icons/categ/5starSmall.png) no-repeat';
	 		
	if (document.getElementById(chk).checked)
		document.getElementById(chk).checked = false;
	else
		document.getElementById(chk).checked = true;
			}

function chkFilter(){
				var chk = '';
				if (document.getElementById('checkbox11').checked){chk+='3,';} else {chk+='0,';}
				if (document.getElementById('checkbox12').checked){chk+='4,';} else {chk+='0,';}
				if (document.getElementById('checkbox13').checked){chk+='5';} else {chk+='0';}
				return(chk);
				}
				
function checkData(id_tara,chk,loc){
		if(document.getElementById('start_date').value){
							   var st_date  = document.getElementById('start_date').value;
							   var st_samg = explode('.',st_date);
							   var st_samg_conv = st_samg[2]+st_samg[1]+st_samg[0];
								}
						   if(document.getElementById('end_date').value){
							   var end_date = document.getElementById('end_date').value;
							   var end_samg = explode('.',end_date);
							   var end_samg_conv = end_samg[2]+end_samg[1]+end_samg[0];
                          		}
							if(st_samg_conv&&end_samg_conv)
								open_dest(id_tara,'dest_detail',st_samg_conv,end_samg_conv,chk,loc);
								else
								if(st_samg_conv){
								open_dest(id_tara,'dest_detail',st_samg_conv,'99999999',chk,loc);
								}
									else
									if(end_samg_conv)
									open_dest(id_tara,'dest_detail','0',end_samg_conv,chk,loc);
										else
										open_dest(id_tara,'dest_detail','0','99999999',chk,loc);
						  }
		


function chkFilter_adv(tara){
    var reg = document.getElementById('regiune').value;
	var ch1 = document.getElementById('ch1');
	var ch2 = document.getElementById('ch2');
    var ch3 = document.getElementById('ch3');
	var ch4 = document.getElementById('ch4');
	var ch6 = document.getElementById('ch6');
	var ch8 = document.getElementById('ch8');
	var ch9 = document.getElementById('ch9');
	var ch10= document.getElementById('ch10');
	var ch11= document.getElementById('ch11');
	var result = '';
	
	if(tara&&tara!=0) result+=tara+'|-|'; else result+='undef|-|';
	if(reg&&reg!=0) result+=reg+'|-|'; else result+='undef|-|';
	if(ch1.checked) result+='1|-|'; else result+='undef|-|';
	if(ch2.checked) result+='1|-|'; else result+='undef|-|';
	if(ch3.checked) result+='1|-|'; else result+='undef|-|';
	if(ch4.checked) result+='1|-|'; else result+='undef|-|';
	if(ch6.checked) result+='1|-|'; else result+='undef|-|';
	if(ch8.checked) result+='1|-|'; else result+='undef|-|';
	if(ch9.checked) result+='1|-|'; else result+='undef|-|';
	if(ch10.checked) result+='1|-|'; else result+='undef|-|';
	if(ch11.checked) result+='1'; else result+='undef|-|';
var url = "hotels/filter/get_hotels.php?query="+result;
	ajaxGET(url,'dest_detail');
		
	}


function ajaxGET(url,GETdiv_id){
var mygetrequest=new ajaxRequest();
mygetrequest.onreadystatechange=function(){

if (mygetrequest.readyState==3){
document.getElementById(GETdiv_id).innerHTML='<img src="img/loading.gif">';
    setTimeout('getHeightDiv()', 500);
}

 if (mygetrequest.readyState==4){
  if (mygetrequest.status==200 || window.location.href.indexOf("http")==-1){
   document.getElementById(GETdiv_id).innerHTML=parseScript(mygetrequest.responseText);
     setTimeout('getHeightDiv()', 500);
//   document.getElementById("result").innerHTML=mygetrequest.responseText
  }
 }
}

//values::::
//var namevalue=encodeURIComponent(document.getElementById("name").value);
//var agevalue=encodeURIComponent(document.getElementById("age").value);


mygetrequest.open("GET", url, true);
mygetrequest.send(null);

}







function ajaxRequest(){
 var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"]; //activeX versions to check for in IE
 if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
  for (var i=0; i<activexmodes.length; i++){
   try{
    return new ActiveXObject(activexmodes[i]);
   }
   catch(e){
    //suppress error
   }
  }
 }
 else if (window.XMLHttpRequest) // if Mozilla, Safari etc
  return new XMLHttpRequest();
 else
  return false;
}

/* Updated 11.04.2010*/
function showHide(divName, flagSH){
	var objDivName = document.getElementById(divName);
	var countSH;
	
	if(countSH)
		{
			objDivName.style.display = 'none';
			objDivName.style.visibility = 'hidden';
			flagSH = 'false';		
		}
    else 
		{
			objDivName.style.display = 'block';
			objDivName.style.visibility = 'visible';
		}
	}	
/**/







	function parseScript(_source) {
		var source = _source;
		var scripts = new Array();
		
		// Strip out tags
		while(source.indexOf("<script") > -1 || source.indexOf("</script") > -1) {
			var s = source.indexOf("<script");
			var s_e = source.indexOf(">", s);
			var e = source.indexOf("</script", s);
			var e_e = source.indexOf(">", e);
			// Add to scripts array
			scripts.push(source.substring(s_e+1, e));
			// Strip from source
			source = source.substring(0, s) + source.substring(e_e+1);
		}
		
		// Loop through every script collected and eval it
		for(var i=0; i<scripts.length; i++) {
			try {
				eval(scripts[i]);
			}
			catch(ex) {
				// script fail
				
				}}
		// Return the cleaned source
		return source;}
		
		


function explode( delimiter, string ) { // Split a string by string
    var emptyArray = { 0: '' };
    if ( arguments.length != 2 || typeof arguments[0] == 'undefined' || typeof arguments[1] == 'undefined' )
    {  return null; }
     if ( delimiter === '' || delimiter === false || delimiter === null )
    { return false; }
     if ( typeof delimiter == 'function' || typeof delimiter == 'object' || typeof string == 'function' || typeof string == 'object' )
    { return emptyArray; }
    if ( delimiter === true ) { delimiter = '1'; }
    return string.toString().split ( delimiter.toString() );
}


function getHeightDiv()
{

if (document.getElementById('idDivLeft')||document.getElementById('idDivRight'))
{
    var wh = getDivHeight();
    var dLeft = document.getElementById('idDivLeft');
    var dRight = document.getElementById('idDivRight');	
    var dhLeft = dLeft.offsetHeight;
    var dhRight = dRight.offsetHeight;
    dLeft.style.height  = wh  + 'px'; 
    dRight.style.height = wh  + 'px';
}	
	}
	
function getDivHeight() {
  	var divHeight = 0;
	var objDivHeight = document.getElementById('page');
  	if (typeof(objDivHeight.innerHeight) == 'number')
		divHeight = objDivHeight.innerHeight;
	 
  	else {
 
    if (document.documentElement && document.documentElement.clientHeight)
      divHeight = objDivHeight.clientHeight;
 
    else {
      if (document.body && objDivHeight.clientHeight)
        divHeight = objDivHeight.clientHeight; }; };
  
  return divHeight;
}	


function meteo(tara){
		var url = "http://vacanta.md/main/scripts/meteo.php?tara="+tara;
		ajaxGET(url,'meteo');
		}

function offers(aux){
                        oferte(aux);
                        getHeightDiv();
						}
function hot(aux){
        chkFilter_adv(aux);
        getHeightDiv();
}
function desc(aux){
        descriere_tara(aux);
        getHeightDiv();
}

		-->
