 function ProcessHotelRates()
 {
        var myajax=ajaxpack.ajaxobj
        var myfiletype=ajaxpack.filetype
        if (myajax.readyState == 4)
        {
            if (myajax.status==200 || window.location.href.indexOf("http")==-1) 
            {
                if (myfiletype=="txt")
                {                
                  
                  if ( myajax.responseText.length != 0)
                  {                  
                      document.getElementById("ratessonuc").innerHTML = myajax.responseText;
                      document.getElementById("arama").style.display = "none";
                      WPosition();
                      
                  }
                  else
                  {
                       document.getElementById("ratessonuc").innerHTML =                   
                       'There are no available rooms for the period you asking about, from '+
                       document.getElementById("checkindate").value  +
                       ' to '+ document.getElementById("checkoutdate").value +
                       '. <br>Please choose another option or try searching again.'; 
                       document.getElementById("arama").style.display = "block";                       
                  }            
                }                            
            }
        }
    }
 function GetHotelRates()
    {            
     var hid = oxi.HotelReelCode;
     var hcd = oxi.HotelCode;
     var cou = oxi.Country;
     var des = oxi.Destination;
     var zone = oxi.Zone;
     
        var cid = document.getElementById("checkindate").value;
        var cod = document.getElementById("checkoutdate").value; 
var Today = new Date; 
var SelectedDate = new Date(cid);
var SelectedDate2 = new Date(cod);
var OK = (SelectedDate > Today);   
var OK2 = (SelectedDate2 > SelectedDate);  
if (!OK){ alert('Please select a date from tomorrow');return false;}
if (!OK2){ alert('Please select a departure date incorred ');return false;}
               
      var cur = "EUR";              
        var r1_a   =  (document.getElementById("adult_1") != null) ? document.getElementById("adult_1").value :"0";
        var r2_a   =  (document.getElementById("adult_2") != null) ? document.getElementById("adult_2").value :"0";
        var r3_a   =  (document.getElementById("adult_3") != null) ? document.getElementById("adult_3").value :"0";
        var r4_a   =  (document.getElementById("adult_4") != null) ? document.getElementById("adult_4").value :"0";    
        var r1_c   =  (document.getElementById("child_1") != null) ? document.getElementById("child_1").value :"0";
        var r2_c   =  (document.getElementById("child_2") != null) ? document.getElementById("child_2").value :"0";
        var r3_c   =  (document.getElementById("child_3") != null) ? document.getElementById("child_3").value :"0";
        var r4_c   =  (document.getElementById("child_4") != null) ? document.getElementById("child_4").value :"0";    
        var r1_c1a =  (document.getElementById("age_1_1") != null) ? document.getElementById("age_1_1").value :"0";
        var r1_c2a =  (document.getElementById("age_1_2") != null) ? document.getElementById("age_1_2").value :"0"; 
        var r2_c1a =  (document.getElementById("age_2_1") != null) ? document.getElementById("age_2_1").value :"0";
        var r2_c2a =  (document.getElementById("age_2_2") != null) ? document.getElementById("age_2_2").value :"0";    
        var r3_c1a =  (document.getElementById("age_3_1") != null) ? document.getElementById("age_3_1").value :"0";
        var r3_c2a =  (document.getElementById("age_3_2") != null) ? document.getElementById("age_3_2").value :"0"; 
        var r4_c1a =  (document.getElementById("age_4_1") != null) ? document.getElementById("age_4_1").value :"0";
        var r4_c2a =  (document.getElementById("age_4_2") != null) ? document.getElementById("age_4_2").value :"0";
        var r1 = r1_a + "-" + r1_c + "-" + r1_c1a + "-" + r1_c2a ;
        var r2 = r2_a + "-" + r2_c + "-" + r2_c1a + "-" + r2_c2a ;
        var r3 = r3_a + "-" + r3_c + "-" + r3_c1a + "-" + r3_c2a ;
        var r4 = r4_a + "-" + r4_c + "-" + r4_c1a + "-" + r4_c2a ;                 
				var st ="";
    
            var poststr = "des=" + des+    
                      "&zone=" + encodeURI(zone)+  
                      "&hcd=" + encodeURI(hcd)+      
                      "&cou=" + encodeURI(cou)+ 
                      "&cid=" + encodeURI(cid)+
                      "&cod=" + encodeURI(cod)+   
                      "&cur=" + encodeURI(cur)+   
                      "&r1=" + encodeURI(r1)+
                      "&r2=" + encodeURI(r2)+
                      "&r3=" + encodeURI(r3)+
                      "&r4=" + encodeURI(r4)+
                      "&st=" + encodeURI(st);
  
      
      location.href = "http://www.oxihotels.com/HotelList.aspx?"+poststr; 
    }


 function ProcessRates()
 {
        var myajax=ajaxpack.ajaxobj
        var myfiletype=ajaxpack.filetype
        if (myajax.readyState == 4)
        {
            if (myajax.status==200 || window.location.href.indexOf("http")==-1) 
            {
                if (myfiletype=="txt")
                {     
                  if ( myajax.responseText.length != 0)
                  {                  
                      document.getElementById("ratessonuc").innerHTML = myajax.responseText;
                      document.getElementById("arama").style.display = "none";
                  }
                  else
                  {
                       document.getElementById("ratessonuc").innerHTML ='<br><div style="border: 3px solid #800000"> '+                  
                       '<p>There are no available rooms for the period you asking about, from '+
                       document.getElementById("checkindate").value  +
                       ' to '+ document.getElementById("checkoutdate").value +
                       '. <br>Please choose another option or try searching again.</p></div>'; 
                       document.getElementById("arama").style.display = "block";
                       
                  }
            
                }             
               
            }
        }
    }

    function GetRates()
    {
        var arrTemp=self.location.href.split("?");

        if (arrTemp.length ==2)
        {
          //var arrItem = arrTemp[1].split("=");
          
          var index = arrTemp[1].indexOf('=');
          
          var deger = arrTemp[1].substring(index+1 , arrTemp[1].length);
            //if (arrItem[0] == "id")                        
            //{
                // var poststr = "id=" +arrItem[1];
                var poststr = "id=" +deger;
               //alert(poststr);
                  ajaxpack.getAjaxRequest('../../../HotelRates2.aspx', poststr, ProcessRates, 'txt');
                 document.getElementById("ratessonuc").style.display="block";
                 document.getElementById("ratessonuc").innerHTML ="<img src='../../../image/loading.gif' />";    
                
           // }  
        }
    }
    
    function ProcessSendFriend()
    {
        var myajax=ajaxpack.ajaxobj
        var myfiletype=ajaxpack.filetype
        if (myajax.readyState == 4)  
        {
            if (myajax.status==200 || window.location.href.indexOf("http")==-1) 
            {
                if (myfiletype=="txt")
                {              

		if ( myajax.responseText.length != 0)
                  {                  
                    document.getElementById("sendfriendsonuc").innerHTML = myajax.responseText;
                  }
                  else
                  {
                  
                  document.getElementById("sendfriendsonuc").innerHTML = myajax.responseText;
                  }		
                  
                }             
                
            }
        }
    }

   function SendFriend()
   {           
     var sf_name =   document.getElementById("sf_name");
     var sf_email =   document.getElementById("sf_email");
     var sf_fname =   document.getElementById("sf_fname");
     var sf_femail =   document.getElementById("sf_femail");
     var sf_comment =   document.getElementById("sf_comment");
     var shotelname = oxi.HotelName;
     var shid=   oxi.HotelReelCode;
     var scou =  oxi.Country;
     var sdes =  oxi.Destination ;
     var shimg = oxi.HotelPicSrc;
     var siteurl =oxi.Url;

if (!ForceEntry(sf_name, 'Your Name')){return false;} 	
if (!ForceEntry(sf_fname, 'Your Friend Name')){return false;}
if (!ForceEntry(sf_email, 'E-mail Address')){return false;}
if (!ForceEntry(sf_femail, 'E-mail Address')){return false;}
if (!IsValidEmail(sf_email.value)){alert("Please check the E-mail address you entered");sf_email.focus();return false;}
if (!IsValidEmail(sf_femail.value)){alert("Please check the E-mail address you entered");sf_femail.focus();return false;}

     ajaxcachebust=new Date().getTime();
     var poststr2 = "sf_name="  + encodeURI(sf_name.value) +
                      "&sf_email=" + encodeURI(sf_email.value)+
                      "&sf_fname=" + encodeURI(sf_fname.value)+
                      "&sf_femail=" + encodeURI(sf_femail.value)+ 
                      "&sf_comment=" + encodeURI(sf_comment.value)+
                      "&shid=" + encodeURI(shid)+ 
                      "&shotelname=" + encodeURI(shotelname)+
                      "&scou=" + encodeURI(scou)+
                      "&sdes=" + encodeURI(sdes)+  
                      "&shimg=" + encodeURI(shimg)+
		      "&siteurl=" + encodeURI(siteurl)+
		      "&ajaxcachebust="+encodeURI(ajaxcachebust);

        ajaxpack.postAjaxRequest('../../../sendfriend.aspx', poststr2, ProcessSendFriend, 'txt','sendfriendsonuc');
        document.getElementById("sendfriendsonuc").innerHTML ="<img src='../../../image/loading.gif' />"; 
   }
   
            
	var laPosse=0;
	function resimal(imgNum){
						
		        	var	imgSrc = document.getElementById('htlImg' + imgNum).getAttribute('longdesc');
					    kaynak=document.getElementById('source');
					    kaynak.innerHTML = '<br/><img id="srcdimg" src="http://www.oxihotels.com/inc/wait.gif" onLoad="showImg()" onError="noShowImg()"/>';
					    analyr=document.getElementById('analayer');
					    anatit=document.getElementById('anatitle');
					    laphoto=document.getElementById('srcdimg');
					    laphoto.src=imgSrc;
					}			
	function showImg(){
					
					   analyr.style.display='block';
					   analyr.style.height=laphoto.offsetHeight+20+'px';
					   anatit.style.width=analyr.offsetWidth-8+'px';
						 if(laPosse==0){
							analyr.style.left=(document.body.offsetWidth/2)-(analyr.offsetWidth/2) + 'px';
							analyr.style.top=210+'px';
							analyr.style.left=300+'px';
							laPosse++;
							}
						}
function noShowImg()
					 {
						analyr=document.getElementById('analayer');		
						analyr.style.display='none';	
				
						}
						
function mapal(el,adres){
							var e = document.getElementById(el);
					    kaynak=document.getElementById('source');
					    kaynak.innerHTML = '<iframe name="googlemap" id="googlemap" src="../../../inc/wait.gif" scrolling="no" width="540" height="360"/>';
					    analyr=document.getElementById('analayer');
					    anatit=document.getElementById('anatitle');
					    laphoto=document.getElementById('googlemap');
					    if (laphoto.src != adres) laphoto.src=adres;
					    var box = getDimensions(e);	
						  showImg();
					}
function loadPanoramio() {

   if(document.getElementById("panoramio_thumbnails")) {
      if(!document.getElementById("panoramio_thumbnails").hasChildNodes()) {
         document.getElementById("panoramio_copywrite").innerHTML = '<img src="../../../inc/indicator.gif" alt="Area photos loading..." style="padding:30px;" />'; 
       var A = document.createElement("script"); 
        A.src = "http://www.panoramio.com/map/get_panoramas.php?order=popularity&set=public&from=0&to=20&minx=" + (oxi.PositionLan - 0.04) + "&miny=" + (oxi.PositionLat - 0.04) + "&maxx=" + (oxi.PositionLan + 0.04) + "&maxy=" + (oxi.PositionLat + 0.04) + "&size=square&callback=photoresults"}
         // A.src = "http://www.panoramio.com/map/get_panoramas.php?order=popularity&set=public&from=0&to=20&minx=28.880131&miny=40.008532&maxx=28.980131&maxy=41.008532&size=square&callback=result"}
            A.type = "text/javascript"; 
         document.getElementsByTagName("head")[0].appendChild(A);}

}

function photoresults(A) {
   photoslist = A.photos; 
   document.getElementById("panoramio_copywrite").innerHTML = ""; 
   copyinfo(photoslist); 
   panoramiogallery(photoslist)}
function enlarge(B) {
   var A = B.src.replace(/square/g,"small");
   var C = document.getElementById("groot"); 
   C.src = A;}
function panoMeta(D) {
   for(var C = 0; C < photoslist.length; C++) {
      var A = photoslist[C]; 
      var B = A.photo_id; 
      panImage = document.getElementById(B); 
      panImage.style.display = "none"}
   selImage = document.getElementById(D); 
   selImage.style.display = "block"; 
   document.getElementById("groot").style.visibility = "visible"
   
   }
   
function copyinfo(H) {
   for(var G = 0; G < H.length; G++) {
      var B = H[G]; 
      var F = B.photo_id; 
      var A = B.photo_file_url; 
      var D = B.owner_url; 
      var E = B.owner_name; 
      var C = '<p style="display:none;font-size: 0.88em;color: #666;" id="' + F + '">Image by <a rel="nofollow" target="_blank" style="color: #666" href="' + D + '">' + E + '</a><br />Photos provided by <a href="http://www.panoramio.com" style="color: #666" rel="nofollow" target="_blank">Panoramio</a> are under the copyright of their owners.</p>'; 
      if(document.getElementById("panoramio_copywrite")) {
         document.getElementById("panoramio_copywrite").innerHTML = document.getElementById("panoramio_copywrite").innerHTML + C;}
      }
   }
function panoramiogallery(H)
 {
   for(var G = 0; G < H.length; G++) 
   {
      var D = ""; 
      var C = H[G]; 
      var F = C.photo_id; 
      var B = C.photo_file_url; 
      var E = C.photo_title; 
 
     var D = '<img class="hotel" style="cursor:pointer;padding:.1em;"  alt="Photos Around the Hotel" onclick="enlarge(this);panoMeta(\'' + F + "');\" src=" + B + " /> ";
      if(document.getElementById("panoramio_thumbnails")) 
      {
         document.getElementById("panoramio_thumbnails").innerHTML = document.getElementById("panoramio_thumbnails").innerHTML + D
      }
    }
 }
function WPosition(){
	
	var sagob=document.getElementById("sagcenah");
  var solob=document.getElementById("solcenah");
  var detailob=document.getElementById("detail_ic");
  
 var sag = sagob.offsetHeight;
 var sol =solob.offsetHeight;

   if(sag>sol){
   	
   	   solob.style.height=sag+165+'px';
   	   detailob.style.height=sag+165+'px';
   	}
   	
   	else{
   		sagob.style.height=sol+'px';
   		detailob.style.height=sol+165+'px';
   		}
   
	}

