var slidecc = 0;var counter1 = 0;var counter2 = 0;var hotel2map = new Array();var avalcheklr = new Array();var avalchekhd = new Array();var moreThan4 = new Array();var arrayCC = new Array();var onloadStart = new Array();var httpReq = new Array();var httpReqFolow = 0;var httpReqFolow2 = 0;var httpReqFolow3 = 0;var radurlala = '';var opacityLevel = 0;var maxOpacityLevel = 8;var opacityRise = true;var filler = '';function upresizeBopx(){	if( ++slidecc <= 10 )	{		setTimeout("upresizeBopx()",5);		//do something		arrayCC[slidecc] = new Array;		resizeBox( ( 31*slidecc ), (15*slidecc), 'show' );		arrayCC[slidecc]['width']= 31*slidecc;		arrayCC[slidecc]['height']= 15*slidecc;	}}function resizeBox( width, height, show_hide ){	document.getElementById( 'chconvph' ).style.width = width+'px';	document.getElementById( 'chconvph' ).style.height = height+'px';	var pos = findPos( document.getElementById( "cconvlb" ) );	if( slidecc == 1 )	{		if( show_hide == 'show' )		{			document.getElementById( 'chconvph' ).style.display = 'block';			document.getElementById( 'chconvph' ).style.position = 'absolute';			document.getElementById( 'chconvph' ).style.visibility = 'visible';			document.getElementById( 'chconvph' ).style.top=( pos[1]-403 ) + "px";			document.getElementById( 'chconvph' ).style.left="6px";		}		else if( show_hide == 'hide' )		{			document.getElementById( 'chconvph' ).style.display = 'none';			slidecc = 0;		}	}}function unresizeBopx(){	if( --slidecc >= 0 )	{		setTimeout("unresizeBopx()",5);		resizeBox( arrayCC[slidecc]['width'], arrayCC[slidecc]['height'], 'hide' );	}	else		slidecc = 0;}function callOncel_upresizeBopx(){	 if( slidecc < 1 ){return upresizeBopx();}}//end slide currency converterfunction startOnloadEvents( events ){	if( !onloadStart[0] )	{		return false;	}	else	{		eval( onloadStart[0][0]+'( onloadStart[0][1], onloadStart[0][2], onloadStart[0][3], onloadStart[0][4] );' );	}}function findPos( obj ){	var offwidth = offheight = curleft = curtop = 0;	if (obj.offsetParent)	{		curleft = obj.offsetLeft;		curtop = obj.offsetTop;		offwidth = obj.offsetWidth;		offheight = obj.offsetHeight;		while (obj = obj.offsetParent)		{			curleft += obj.offsetLeft;			curtop += obj.offsetTop;		}	}	return [curleft,curtop,offwidth,offheight];}//curency converterurl = document.location.href;xend = url.indexOf("/") + 1;var base_url = url.substring(0, xend);function ajax_do (url){        // Does URL begin with http?        if (url.substring(0, 4) != 'http')		{                url = base_url + url;        }        // Create new JS element        var jsel = document.createElement('SCRIPT');        jsel.type = 'text/javascript';        jsel.src = url;        // Append JS element (therefore executing the 'AJAX' call)        document.body.appendChild (jsel);}function curConvert( obj, from, to, value, savein, alertstr ){	if( ( document.getElementById( from ).value == 0 ) || ( document.getElementById( to ).value == 0 ) || ( document.getElementById( value ).value == 0 ) )	{		alert( alertstr );	}	else	{		document.getElementById( savein ).value = '';		document.getElementById( savein ).style.backgroundImage = 'url(/imgs/load1.gif)';		var url = 'cc.php?from='+document.getElementById( from ).value+'&to='+document.getElementById( to ).value+'&value='+document.getElementById( value ).value+'&tag='+savein;		ajax_do (url);	}	return false;}function doSAt(){	var onext = '/'+document.getElementsByName('lang')[0].value+'/';	var nto = document.getElementsByName('date[d]')[0].value+'-'+document.getElementsByName('date[m]')[0].value+'-'+document.getElementsByName('date[y]')[0].value+'_'+document.getElementsByName('rooms')[0].value+'-'+document.getElementsByName('guests')[0].value+'-'+document.getElementsByName('nights')[0].value+'/'+document.getElementsByName('thid')[0].value+'.html';	window.location.href = ( onext+nto );}function my_init_map( obj, lat, lon, h_id ){	var map_id = 'map_canvas';	var map_close_id = 'map_close';	var w = 500;	var h = 300;	var hc = 15;	if( ( document.getElementById( map_id ).style.width != '0px' ) && ( document.getElementById( map_id ).style.width != '' ) )	{		document.getElementById( map_id ).style.width = '0px';		document.getElementById( map_close_id ).style.width = '0px';		document.getElementById( map_id ).style.height = '0px';		document.getElementById( map_close_id ).style.height = '0px';		document.getElementById( map_id ).border = 'none';		document.getElementById( map_close_id ).border = 'none';		document.getElementById( map_id ).innerHTML = '';		document.getElementById( map_close_id ).innerHTML = '';		GUnload();	}	else	{		var pos_map = findPos( obj );		document.getElementById( map_id ).style.width = w+'px';		document.getElementById( map_close_id ).style.width = w+'px';		document.getElementById( map_id ).style.height = h+'px';		document.getElementById( map_close_id ).style.height = hc+'px';		initialize( lat, lon, h_id );		document.getElementById( map_id ).style.left = ( pos_map[0]-655 )+'px';		document.getElementById( map_close_id ).style.left = ( pos_map[0]-655 )+'px';		document.getElementById( map_id ).style.top = ( pos_map[1]-220 )+'px';		document.getElementById( map_close_id ).style.top = ( (pos_map[1]-220-hc) )+'px';		document.getElementById( map_close_id ).innerHTML = '<img src="/imgs/x.gif" alt="" align="right" onclick="my_init_map( \''+obj+'\', '+lat+', '+lon+', '+h_id+' );" title=""/>';		document.getElementById( map_id ).style.position = 'absolute';		document.getElementById( map_id ).style.border = '10px solid white';		document.getElementById( map_id ).style.borderTopWidth = '0px';		document.getElementById( map_close_id ).style.borderLeft = '20px solid white';		document.getElementById( map_id ).style.overflow = 'hidden';	}}function my_init_map_details( div2pos, lat, lon, h_id ){	var w = 318;	var h = 333;	var map_id = 'map_canvas';	if( ( document.getElementById( map_id ) != null ) &&  ( document.getElementById( map_id ).style.width != '0px' ) && ( document.getElementById( map_id ).style.width != '' ) )	{		document.getElementById( map_id ).style.width = '0px';		document.getElementById( map_id ).style.height = '0px';		document.getElementById( map_id ).border = 'none';		document.getElementById( map_id ).innerHTML = '';		GUnload();	}	else	{		var pos_map = findPos( document.getElementById( div2pos ) );		document.getElementById( map_id ).style.width = w+'px';		document.getElementById( map_id ).style.height = h+'px';		initialize( lat, lon, h_id );		document.getElementById( map_id ).style.overflow = 'hidden';		document.getElementById( map_id ).style.left = '287px';		document.getElementById( map_id ).style.top = ( pos_map[1]+2 )+'px';		document.getElementById( map_id ).style.position = 'absolute';		document.getElementById( map_id ).style.borderTopWidth = '0px';	}}function showThisImg( targetUrl ){	document.getElementById( 'target_img' ).src = targetUrl;}function doSearchAval(){	var onext = '/'+document.getElementsByName('lang')[0].value+'/'+document.getElementsByName('ccode')[0].value+'/'+document.getElementsByName('city')[0].value+'-'+document.getElementsByName('rating')[0].value+'/';	var nto = document.getElementsByName('date[d]')[0].value+'-'+document.getElementsByName('date[m]')[0].value+'-'+document.getElementsByName('date[y]')[0].value+'_'+document.getElementsByName('rooms')[0].value+'-'+document.getElementsByName('guests')[0].value+'-'+document.getElementsByName('nights')[0].value+'.1.html';	window.location.href = ( onext+nto );}function chekRooms( rooms ){	if( rooms.value > document.getElementById( 'guests' ).value )	{		rooms.value = document.getElementById( 'guests' ).value;	}	if( ( document.getElementById( 'guests' ).value > 4 ) && ( rooms.value == 1 ) )	{		rooms.value = 2;	}	if( ( document.getElementById( 'guests' ).value > 8 ) && ( rooms.value <= 2 ) )	{		rooms.value = 3;	}}function chekPersons( people ){	if( people.parentNode.parentNode.parentNode.nodeName == 'FORM' )	{		var roomsObj = people.parentNode.parentNode.parentNode.getElementsByTagName('select')[3];	}		if( parseInt( people.value ) < parseInt( roomsObj.value ) )	{		roomsObj.value = people.value;	}	if( ( people.value > 4 ) && ( roomsObj.value == 1 ) )	{		roomsObj.value = 2;	}	if( ( people.value > 8 ) && ( roomsObj.value <= 2 ) )	{		roomsObj.value = 3;	}	}function removeUnusedBox(){	var size = moreThan4.length;	for( i=0;i<size;i++ )	{		var node = document.getElementById( moreThan4[i] );		if( node.childNodes.length > 1 )		{			var newid = 'ah'+moreThan4[i];			document.getElementById( newid ).innerHTML = '';			var childnode=document.getElementById(newid);			var removednode= document.getElementById( newid ).parentNode.removeChild(childnode);		}	}}function CreateXHR(){	var xmlHttp;	try { xmlHttp=new XMLHttpRequest(); }	catch (e)	{		try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }		catch (e)		{			try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }			catch (e) { return false; }		}	}	return xmlHttp;}function XHROnStateChange( objkey ){	if( httpReq[objkey].readyState == 4 )	{		eval( httpReq[objkey].responseText );		httpReqFolow--;		if( httpReqFolow == 0 )		{			removeUnusedBox();		}	}}function XHROnStateChange3(){}function XHROnStateChange2( objkey ){	if( httpReq[objkey].readyState == 4 )	{		eval( httpReq[objkey].responseText );		httpReqFolow2--;		if( httpReqFolow2 == 0 )			checkIfPriceAval();	}}function call_aval_services(){		var base64mdl = '';	var checkIds = new Array();	var it_t = 0;	httpReqFolow = ( avalcheklr.length+avalchekhd.length );	for( i=0;i<avalcheklr.length;i++ )	{		base64mdl = avalcheklr[i][0];		httpReq[httpReq.length] = CreateXHR();		eval('httpReq['+(httpReq.length-1)+'].onreadystatechange = function() {XHROnStateChange( '+(httpReq.length-1)+' );};');		httpReq[httpReq.length-1].open('GET', base64mdl, true);		httpReq[httpReq.length-1].send( null );	}	for( ii=0;ii<avalchekhd.length;ii++ )	{		base64mdl = avalchekhd[ii][0];		httpReq[httpReq.length] = CreateXHR();		eval('httpReq['+(httpReq.length-1)+'].onreadystatechange = function() {XHROnStateChange( '+(httpReq.length-1)+' );};');		httpReq[httpReq.length-1].open('GET', base64mdl, true);		httpReq[httpReq.length-1].send( null );		moreThan4[ii] = avalchekhd[ii][1];	}}function checkIfPriceAval(){	if( document.getElementById( 'local_hotel_box' ) )	{		var neednode = document.getElementById( 'local_hotel_box' ).childNodes;		var redirect_counter = 0;		for( i=0;i<neednode.length;i++ )		{			if( ( neednode[i].nodeName == 'div' ) || ( neednode[i].nodeName == 'DIV' ) )			{				redirect_counter++;			}		}		if( ( redirect_counter == 0 ) && ( radurlala != '' ) )		{			location.href = radurlala;		}	}}function setingDomain( url ){	var pattern = /http:\/\/[^\/]*\//gi;	var pattern2 = /[\w\d\-\.]*/gi;	var my_baseurl = url.match( pattern2 );	document.domain = my_baseurl[4];}function call_aval_services_odp(){		var base64mdl = '';	var checkIds = new Array();	httpReqFolow2 = ( avalcheklr.length+avalchekhd.length );	if( httpReqFolow2 == 0 )	{		checkIfPriceAval();	}	else	{		for( i=0;i<avalcheklr.length;i++ )		{			base64mdl = avalcheklr[i][0];			httpReq[httpReq.length] = CreateXHR();			eval('httpReq['+(httpReq.length-1)+'].onreadystatechange = function() {XHROnStateChange2( '+(httpReq.length-1)+' );};');			httpReq[httpReq.length-1].open('GET', base64mdl, true);			httpReq[httpReq.length-1].send( null );		}		for( ii=0;ii<avalchekhd.length;ii++ )		{			base64mdl = avalchekhd[ii][0];			httpReq[httpReq.length] = CreateXHR();			eval('httpReq['+(httpReq.length-1)+'].onreadystatechange = function() {XHROnStateChange2( '+(httpReq.length-1)+' );};');			setingDomain( base64mdl );			httpReq[httpReq.length-1].open('GET', base64mdl, true);			httpReq[httpReq.length-1].send( null );			moreThan4[ii] = avalchekhd[ii][1];		}	}}var  my_baseurl = '';function getBaseurl(){	var pattern = /http:\/\/[^\/]*\//gi;	my_baseurl = url.match( pattern )+'services/setsession.php?';}getBaseurl();function set2session( setUrl ){	var httpReqObj = CreateXHR();	httpReqObj.onreadystatechange = XHROnStateChange3;	httpReqObj.open('GET', my_baseurl+setUrl, true);	httpReqObj.send( null );}var OP = (navigator.userAgent.indexOf('Opera') != -1);var IE = (navigator.userAgent.indexOf('MSIE') != -1 && !OP);var GK = (navigator.userAgent.indexOf('Gecko') != -1);var SA = (navigator.userAgent.indexOf('Safari') != -1);var DOM = document.getElementById;var tooltip = null;function TOOLTIP() {//----------------------------------------------------------------------------------------------------// Configuration//----------------------------------------------------------------------------------------------------  this.width = 150;                     // width (pixels)      this.opacity = 85;                    // opacity (0 - 100); doesn't work with all browsers  this.cursorDistance = 10;              // distance from mouse cursor (pixels)      // don't change  this.text = '';  this.height = 0;  this.obj = null;  this.active = false;//----------------------------------------------------------------------------------------------------// Methods//----------------------------------------------------------------------------------------------------  this.create = function() {    if(!this.obj) this.init();    var t = "<table border=0 cellspacing=0 cellpadding=4 width=" + this.width + "><tr>" +            "<td align='center' class='JSToolTip'>" + this.text +            "</td></tr></table>";    if(DOM || IE) this.obj.innerHTML = t;    if(DOM) this.height = this.obj.offsetHeight;    else if(IE) this.height = this.obj.style.pixelHeight;    this.setOpacity();    this.move();    this.show();  }  this.init = function() {    if(DOM) this.obj = document.getElementById('ToolTip');    else if(IE) this.obj = document.all.ToolTip;  }  this.move = function() {    var winX = getWinX() - (((GK && !SA) || OP) ? 17 : 0);    var winY = getWinY() - (((GK && !SA) || OP) ? 17 : 0);    var x = mouseX;    var y = mouseY;    if(x + this.width + this.cursorDistance > winX + getScrX())      x -= this.width + this.cursorDistance;    else x += this.cursorDistance;    if(y + this.height + this.cursorDistance > winY + getScrY())      y -= this.height;    else y += this.cursorDistance;    this.obj.style.left = x + 'px';    this.obj.style.top = y + 'px';  }  this.show = function() {    this.obj.style.visibility = 'visible';    this.obj.style.zIndex = 69;    this.active = true;  }  this.hide = function() {    this.obj.style.visibility = 'hidden';    this.obj.style.zIndex = -1;    this.active = false;  }  this.setOpacity = function() {    this.obj.style.filter = 'alpha(opacity=' + this.opacity + ')';    this.obj.style.mozOpacity = '.1';    if(this.obj.filters) this.obj.filters.alpha.opacity = this.opacity;    if(!document.all && this.obj.style.setProperty)      this.obj.style.setProperty('-moz-opacity', this.opacity / 100, '');  }}//----------------------------------------------------------------------------------------------------// Global functions//----------------------------------------------------------------------------------------------------function getScrX() {  var offset = 0;  if(window.pageXOffset)    offset = window.pageXOffset;  else if(document.documentElement && document.documentElement.scrollLeft)    offset = document.documentElement.scrollLeft;  else if(document.body && document.body.scrollLeft)    offset = document.body.scrollLeft;  return offset;}function getScrY() {  var offset = 0;  if(window.pageYOffset)    offset = window.pageYOffset;  else if(document.documentElement && document.documentElement.scrollTop)    offset = document.documentElement.scrollTop;  else if(document.body && document.body.scrollTop)    offset = document.body.scrollTop;  return offset;}function getWinX() {  var size = 0;  if(window.innerWidth)    size = window.innerWidth;  else if(document.documentElement && document.documentElement.clientWidth)    size = document.documentElement.clientWidth;  else if(document.body && document.body.clientWidth)    size = document.body.clientWidth;  else size = screen.width;  return size;}function getWinY() {  var size = 0;  if(window.innerHeight)    size = window.innerHeight;  else if(document.documentElement && document.documentElement.clientHeight)    size = document.documentElement.clientHeight;  else if(document.body && document.body.clientHeight)    size = document.body.clientHeight;  else size = screen.height;  return size;}function getMouseXY(e) {  if(e && e.pageX != null) {    mouseX = e.pageX;    mouseY = e.pageY;  }  else if(event && event.clientX != null) {    mouseX = event.clientX + getScrX();    mouseY = event.clientY + getScrY();  }  if(mouseX < 0) mouseX = 0;  if(mouseY < 0) mouseY = 0;  if(tooltip && tooltip.active) tooltip.move();}function toolTip(text, width, opacity) {  if(text) {    tooltip = new TOOLTIP();    tooltip.text = text;    if(width) tooltip.width = width;    if(opacity) tooltip.opacity = opacity;    tooltip.create();  }  else if(tooltip) tooltip.hide();}//----------------------------------------------------------------------------------------------------// Build tooltip box//----------------------------------------------------------------------------------------------------document.write('<div id="ToolTip" style="position:absolute; visibility:hidden;"></div>');//----------------------------------------------------------------------------------------------------// Event handlers//----------------------------------------------------------------------------------------------------var mouseX = mouseY = 0;document.onmousemove = getMouseXY;//----------------------------------------------------------------------------------------------------var END_OF_INPUT = -1;var base64Chars = new Array(    'A','B','C','D','E','F','G','H',    'I','J','K','L','M','N','O','P',    'Q','R','S','T','U','V','W','X',    'Y','Z','a','b','c','d','e','f',    'g','h','i','j','k','l','m','n',    'o','p','q','r','s','t','u','v',    'w','x','y','z','0','1','2','3',    '4','5','6','7','8','9','+','/');var reverseBase64Chars = new Array();for (var i=0; i < base64Chars.length; i++){    reverseBase64Chars[base64Chars[i]] = i;}var base64Str;var base64Count;function setBase64Str(str){    base64Str = str;    base64Count = 0;}function readReverseBase64(){       if (!base64Str) return END_OF_INPUT;    while (true){              if (base64Count >= base64Str.length) return END_OF_INPUT;        var nextCharacter = base64Str.charAt(base64Count);        base64Count++;        if (reverseBase64Chars[nextCharacter]){            return reverseBase64Chars[nextCharacter];        }        if (nextCharacter == 'A') return 0;    }    return END_OF_INPUT;}function ntos(n){    n=n.toString(16);    if (n.length == 1) n="0"+n;    n="%"+n;    return unescape(n);}function decodeBase64(str){    setBase64Str(str);    var result = "";    var inBuffer = new Array(4);    var done = false;    while (!done && (inBuffer[0] = readReverseBase64()) != END_OF_INPUT        && (inBuffer[1] = readReverseBase64()) != END_OF_INPUT){        inBuffer[2] = readReverseBase64();        inBuffer[3] = readReverseBase64();        result += ntos((((inBuffer[0] << 2) & 0xff)| inBuffer[1] >> 4));        if (inBuffer[2] != END_OF_INPUT){            result +=  ntos((((inBuffer[1] << 4) & 0xff)| inBuffer[2] >> 2));            if (inBuffer[3] != END_OF_INPUT){                result +=  ntos((((inBuffer[2] << 6)  & 0xff) | inBuffer[3]));            } else {                done = true;            }        } else {            done = true;        }    }    return result;}function utf8_encode ( str_data ) {    // http://kevin.vanzonneveld.net    // +   original by: Webtoolkit.info (http://www.webtoolkit.info/)    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)            // *     example 1: utf8_encode('Kevin van Zonneveld');    // *     returns 1: 'Kevin van Zonneveld'     str_data = str_data.replace(/\r\n/g,"\n");    var tmp_arr = [], ac = 0;     for (var n = 0; n < str_data.length; n++) {        var c = str_data.charCodeAt(n);        if (c < 128) {            tmp_arr[ac++] = String.fromCharCode(c);        } else if((c > 127) && (c < 2048)) {            tmp_arr[ac++] = String.fromCharCode((c >> 6) | 192);            tmp_arr[ac++] = String.fromCharCode((c & 63) | 128);        } else {            tmp_arr[ac++] = String.fromCharCode((c >> 12) | 224);            tmp_arr[ac++] = String.fromCharCode(((c >> 6) & 63) | 128);            tmp_arr[ac++] = String.fromCharCode((c & 63) | 128);        }    }        return tmp_arr.join('');}function base64_encode( data ) {    // http://kevin.vanzonneveld.net    // +   original by: Tyler Akins (http://rumkin.com)    // +   improved by: Bayron Guevara    // +   improved by: Thunder.m    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)            // -    depends on: utf8_encode    // *     example 1: base64_encode('Kevin van Zonneveld');    // *     returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA=='     // mozilla has this native    // - but breaks in 2.0.0.12!    //if (typeof window['atob'] == 'function') {    //    return atob(data);    //}            var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";    var o1, o2, o3, h1, h2, h3, h4, bits, i = ac = 0, enc="", tmp_arr = [];    data = utf8_encode(data);        do { // pack three octets into four hexets        o1 = data.charCodeAt(i++);        o2 = data.charCodeAt(i++);        o3 = data.charCodeAt(i++);         bits = o1<<16 | o2<<8 | o3;         h1 = bits>>18 & 0x3f;        h2 = bits>>12 & 0x3f;        h3 = bits>>6 & 0x3f;        h4 = bits & 0x3f;         // use hexets to index into b64, and append result to encoded string        tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);    } while (i < data.length);        enc = tmp_arr.join('');        switch( data.length % 3 ){        case 1:            enc = enc.slice(0, -2) + '==';        break;        case 2:            enc = enc.slice(0, -1) + '=';        break;    }     return enc;}/////////////////////function changedates(){	if( ( document.getElementById( 'local_hotel_box' ).style.display == '' ) || ( document.getElementById( 'local_hotel_box' ).style.display == 'none' ) )	{		document.getElementById( 'local_hotel_box' ).style.display = 'none';		document.getElementById( 'local_hotel_box_' ).style.display = 'block';	}	else	{		document.getElementById( 'local_hotel_box' ).style.display = 'block';		document.getElementById( 'local_hotel_box_' ).style.display = 'none';	}}function chusrm( selfobj ){	var oldst = selfobj.href;	var newstr = oldst.replace( /!replace_with_real_dot!/i, '.' );	selfobj.href = newstr;	return true;}function showHotelRatings(){	this.httpStatChange = httpStatChange;	this.httpStatChange_simple = httpStatChange_simple;	this.setBrowser = setBrowser;	this.createOpacityString = createOpacityString;	this.getWindowSize = getWindowSize;	this.closeHideUserRating = closeHideUserRating;	this.showHideUserRating = showHideUserRating;	this.reqestHotelRating = reqestHotelRating;	this.setUnsetOpacity_fade = setUnsetOpacity_fade;	this.setUnsetOpacity = setUnsetOpacity;	this.loadAfterOpacity = loadAfterOpacity;	this.setContentAndDimensions = setContentAndDimensions;	this.BrowserName = '';	return this;}function httpStatChange( stat ){	if( stat.readyState == 4 )	{		stat.responseText;		if( stat.responseText == '' )			alert( 'no info available' );		else		{			filler = stat.responseText;			this.loadAfterOpacity();		}	}}function httpStatChange_simple( stat ){	if( stat.readyState == 4 )	{		stat.responseText;		if( stat.responseText == '' )			alert( 'no info available' );		else	{			document.getElementById('reuse2').innerHTML = stat.responseText;			document.getElementById('reuse').style.height = ( document.getElementById( 'hotel_rating_holder_tc' ).offsetHeight + 500 )+'px';			document.getElementById('reuse2').style.height = ( document.getElementById( 'hotel_rating_holder_tc' ).offsetHeight )+'px';			document.getElementById('reuse2').style.width = ( document.getElementById( 'hotel_rating_holder_tc' ).offsetWidth )+'px';		}	}}function setBrowser(){	if( this.BrowserName == '' )	{		var workdiv = document.getElementById('reuse');		if( navigator.appName == 'Microsoft Internet Explorer' )		{			this.BrowserName = 'ie';			document.getElementById('reuse').attachEvent( 'onclick', closeHideUserRating );		}		else		{			this.BrowserName = 'other';			document.getElementById('reuse').addEventListener( 'click', closeHideUserRating, false);		}	}}function createOpacityString( int ){	if( this.BrowserName == 'ie' )		document.getElementById('reuse').style.filter = 'alpha(opacity='+int+'0)';	else		document.getElementById('reuse').style.opacity = '0.'+int;}function getWindowSize(){	var height = document.body.clientHeight;	var width = document.body.clientWidth;	return [width,height];}function closeHideUserRating(){	if( shr.BrowserName == 'ie' )		shr.setUnsetOpacity();	else		shr.setUnsetOpacity_fade();	document.getElementById('reuse2').innerHTML = '';}function setUnsetOpacity_fade(){	if( ( opacityRise == false ) && ( opacityLevel >= 0 ) )	{		opacityLevel--;		shr.createOpacityString( opacityLevel );		if( opacityLevel > 0 )			setTimeout('setUnsetOpacity_fade()',5);		else		{			opacityRise = true;			document.getElementById('reuse').style.width = '0px';			document.getElementById('reuse2').style.width = '0px';			document.getElementById('reuse').style.height = '0px';			document.getElementById('reuse2').style.height = '0px';			document.getElementById('reuse').style.left = '-1000px';			//document.getElementById('reuse2').style.visibility = 'hidden';			document.getElementById('reuse2').style.left = '-1000px';		}	}	else	{		opacityLevel++;		shr.createOpacityString( opacityLevel );		if( opacityLevel < maxOpacityLevel )			setTimeout('setUnsetOpacity_fade()',5);		else		{			document.getElementById('reuse2').style.visibility = 'visible';			opacityRise = false;		}	}	return opacityLevel;}function setUnsetOpacity(){	if( ( opacityRise == false ) && ( opacityLevel >= 0 ) )	{		opacityLevel = 0;		shr.createOpacityString( opacityLevel );		opacityRise = true;		document.getElementById('reuse').style.width = '0px';		document.getElementById('reuse').style.height = '0px';		document.getElementById('reuse').style.left = '-1000px';		document.getElementById('reuse2').style.width = '0px';		document.getElementById('reuse2').style.height = '0px';		document.getElementById('reuse2').style.visibility = 'hidden';	}	else	{		opacityLevel = maxOpacityLevel;		shr.createOpacityString( opacityLevel );		opacityRise = false;		document.getElementById('reuse2').style.visibility = 'visible';	}	return opacityLevel;}function loadAfterOpacity(){	if( opacityRise === false )		shr.setContentAndDimensions();	else		setTimeout( 'loadAfterOpacity()', 10 );}function setContentAndDimensions(){	document.getElementById('reuse2').innerHTML = filler;	document.getElementById('reuse').style.height = ( document.getElementById( 'hotel_rating_holder_tc' ).offsetHeight + 500 )+'px';	document.getElementById('reuse2').style.height = ( document.getElementById( 'hotel_rating_holder_tc' ).offsetHeight )+'px';	document.getElementById('reuse2').style.width = ( document.getElementById( 'hotel_rating_holder_tc' ).offsetWidth )+'px';	// alert( document.getElementById( 'hotel_rating_holder_tc' ).offsetHeight );}function showHideUserRating(){	var windowDomensoin = this.getWindowSize();	document.getElementById('reuse').style.top = '0px';	document.getElementById('reuse').style.left = '0px';	document.getElementById('reuse').style.width = windowDomensoin[0]+'px';	document.getElementById('reuse').style.height = windowDomensoin[1]+'px';	var centerpos = findPos( document.getElementById('htiii') );	document.getElementById('reuse2').style.left = ( centerpos[0]-28 )+'px';	document.getElementById('reuse2').style.top = centerpos[1]+'px';	document.getElementById('reuse2').innerHTML = '<img src="/imgs/loading.gif" alt="" style="display:block;overflow:hidden;margin:0px auto 0px auto;"/>';	shr.setBrowser();	if( shr.BrowserName == 'ie' )	{		shr.setUnsetOpacity();		opacityRise = false;	}	else	{		shr.setUnsetOpacity_fade();		opacityRise = true;	}	//this.loadAfterOpacity();}function reqestHotelRating_rc_only( url ){	url = url+'.html';	httpReq = CreateXHR();	try	{		httpReq.onreadystatechange = function () { httpStatChange_simple( httpReq ) };		httpReq.open( 'GET', url, true );		httpReq.send( null );	}catch( someError )	{		alert( 'request time was to long' );	}}function reqestHotelRating( url ){	url = url+'.html';	shr.showHideUserRating();	httpReq = CreateXHR();	try	{		httpReq.onreadystatechange = function () { httpStatChange( httpReq ) };		httpReq.open( 'GET', url, true );		httpReq.send( null );	}catch( someError )	{		//alert( 'request time was to long' );	}}shr = new showHotelRatings();function classGallery(){	this.galleryAddComment = galleryAddComment;	this.httpCallStatChange = httpCallStatChange;	this.setBrowser_comments = setBrowser_comments;	this.execResponse = execResponse;	this.showErrorsOnVBoxes = showErrorsOnVBoxes;	this.checkBoxes = checkBoxes;	this.branchType = '';	this.BrowserName = '';	this.httpCallStringResult = '';}function setBrowser_comments(){	if( this.BrowserName == '' )	{		if( navigator.appName == 'Microsoft Internet Explorer' )		{			this.BrowserName = 'ie';		}		else		{			this.BrowserName = 'other';		}	}}function httpCallStatChange( httpCallObj ){	if( httpCallObj.readyState == 4 )	{		httpCallObj.responseText;		if( httpCallObj.responseText == '' )			alert( 'still beta' );		else		{			wwg.httpCallStringResult = httpCallObj.responseText;			wwg.execResponse();		}	}}function showErrorsOnVBoxes( chekError ){	if( chekError[1] == 'empty' )	{		alert( chekError[0]+' is '+chekError[1]  );		return false;	}	else	{		return true;	}}function checkBoxes(){	var labels = document.getElementById( 'gallerycommentholder' ).getElementsByTagName('label');	var post_content = '';	for( i=0;i<labels.length;i++ )	{		if( ( labels[i].attributes['class'] == '' ) || ( labels[i].attributes['class'] == 'undefined' ) || ( labels[i].attributes['class'] == false )  || ( !labels[i].attributes['class'] ) )		{			for( ii=0;ii<labels[i].childNodes.length;ii++ )			{				if( ( labels[i].childNodes[ii].nodeName.toLowerCase() == 'textarea' ) || ( labels[i].childNodes[ii].nodeName.toLowerCase() == 'input' ) )				{					post_content += '&'+labels[i].childNodes[ii].name+'='+labels[i].childNodes[ii].value;				}			}			continue;		}		else if( labels[i].attributes['class'].nodeValue == 'add_comment_required_field' )		{			for( ii=0;ii<labels[i].childNodes.length;ii++ )			{				if( ( labels[i].childNodes[ii].nodeName.toLowerCase() == 'textarea' ) || ( labels[i].childNodes[ii].nodeName.toLowerCase() == 'input' ) )				{					if( labels[i].childNodes[ii].name == 'v_title' )					{						if( ( !labels[i].childNodes[ii].value ) || ( labels[i].childNodes[ii].value == '' ) )							return ['v_title','empty',labels[i].childNodes[ii]];						else						{							post_content += '&v_title='+labels[i].childNodes[ii].value;							continue;						}					}					else if( labels[i].childNodes[ii].name == 'v_html' )					{						if( ( !labels[i].childNodes[ii].value ) || ( labels[i].childNodes[ii].value == '' ) )							return ['v_html','empty',labels[i].childNodes[ii]];						else						{							post_content += '&v_html='+base64_encode( labels[i].childNodes[ii].value );							continue;						}					}					else if( labels[i].childNodes[ii].name == 'author_name' )					{						if( ( !labels[i].childNodes[ii].value ) || ( labels[i].childNodes[ii].value == '' ) )							return ['author_name','empty',labels[i].childNodes[ii]];						else						{							post_content += '&author_name='+labels[i].childNodes[ii].value;							continue;						}					}					else					{						post_content += '&'+labels[i].childNodes[ii].name+'='+labels[i].childNodes[ii].value;					}				}				else					continue;			}		}		else		{			continue;		}	}	return [1,post_content];}function execResponse(){	if( wwg.httpCallStringResult == 'ok' )	{		showAddForm();	}	else if( wwg.httpCallStringResult != 'ok' )		alert( wwg.httpCallStringResult );}function galleryAddComment( content, branch ){	this.branchType = branch;	this.setBrowser_comments();	var htmCheck = this.checkBoxes();	if( htmCheck[0] == 1 )	{		content = content+htmCheck[1];		httpCall = CreateXHR();		try		{			httpCall.onreadystatechange = function() { httpCallStatChange( httpCall ) };			httpCall.open( 'POST', '/ajax.get.php?rand='+Math.random(), true );			httpCall.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');			httpCall.setRequestHeader('Content-Length', content.length);			httpCall.setRequestHeader('Connection', 'close');			httpCall.send( content );					}catch( httpReqError )		{			//print some error		}	}	else		this. showErrorsOnVBoxes( htmCheck );}wwg = new classGallery;function resizeVideoAddform(){	if( video_adform_height_ == true )	{		if( video_adform_height < max_height_ )		{			video_adform_height += 10;			setTimeout("resizeVideoAddform()",2);			document.getElementById(maintain_id_).style.height = video_adform_height+'px';		}		else		{			video_adform_height = max_height_;			video_adform_height_ = false;		}	}	else if( video_adform_height_ == false )	{		if( video_adform_height > 0 )		{			video_adform_height -= 10;			setTimeout("resizeVideoAddform()",2);			document.getElementById(maintain_id_).style.height = video_adform_height+'px';		}		else		{			video_adform_height = 0;			video_adform_height_ = true;			document.getElementById(show_id_).style.display = 'block';			document.location = '';		}	}}video_adform_height = 0;video_adform_height_ = true;max_height_ = 220;show_id_ = 'showGallery';maintain_id_ = 'gallerycommentholder';function showAddForm(){	document.getElementById(show_id_).style.display = 'none';	resizeVideoAddform();}