/*
	Hotel Reservation Script 1.0
	created by: Martin Ivanov
	website: http://acidmartin.com or http://acidmartin.wemakesites.net
	email: acid_martin@yahoo.com or martin@yahoo.com
*/
var lancook = "en-US";
window.onload = function()
{	
	localize();

}

function hideWarning(ValidatorId)
{
	document.getElementById(ValidatorId).className = 'validator display-none';
}

function localize()
{	if (getCookie('lancook')!=null)
		lancook = getCookie('lancook');    
	
	var localizationfiles = '/js/v2/Localization/' + lancook + '.xml';
	if(window.ActiveXObject)
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async = false;
		xmlDoc.load(localizationfiles);
		readLocalizationFile();
	}
	else if(document.implementation && document.implementation.createDocument)
   {
   /*
       xmlDoc = document.implementation.createDocument("","",null);
       xmlDoc.load(localizationfiles);
       xmlDoc.onload = readLocalizationFile;
   */ var xmlDoc1= new window.XMLHttpRequest();
       if(xmlDoc1.overrideMimeType)
       {
           xmlDoc1.overrideMimeType('text/xml');
       }
       xmlDoc1.open("GET",localizationfiles,false);
       xmlDoc1.send(null);
       xmlDoc = xmlDoc1.responseXML;
       readLocalizationFile();
   }
}

function createCookie(name,value,days) {
 var expires = "";
   if (days) {
       var date = new Date();
       date.setTime(date.getTime()+(days*24*60*60*1000));
       var expires = "; expires="+date.toGMTString();
   }
   document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
   var nameEQ = name + "=";
   var ca = document.cookie.split(';');
   for(var i=0;i < ca.length;i++) {
       var c = ca[i];
       while (c.charAt(0)==' ') c = c.substring(1,c.length);
       if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
   }
   return null;
}

function eraseCookie(name) {
   createCookie(name,"",-1);
}

function setCookie(name,value,days) {
   createCookie(name,value,days);
}

function getCookie(name) {
   return readCookie(name);
}

function delCookie(name) {
   eraseCookie(name);
}

function readLocalizationFile()
{
	document.getElementById('anatext').innerHTML = xmlDoc.getElementsByTagName("anatext")[0].childNodes[0].nodeValue;
	document.getElementById('icerik2').innerHTML = xmlDoc.getElementsByTagName("icerik2")[0].childNodes[0].nodeValue;
	document.getElementById('icerik3').innerHTML = xmlDoc.getElementsByTagName("icerik3")[0].childNodes[0].nodeValue;
	document.getElementById('icerik4').innerHTML = xmlDoc.getElementsByTagName("icerik4")[0].childNodes[0].nodeValue;
	document.getElementById('icerik5').innerHTML = xmlDoc.getElementsByTagName("icerik5")[0].childNodes[0].nodeValue;
	

}