//Store locator below
var xmlHttp;
function storeLocator(str, lang){ 
	if (str=='country1'){
		document.getElementById('region').style.display = 'block';
	} else {
		document.getElementById('region').style.display = 'none';
	}
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="storelocator.php";
	url=url+"?q="+str;
	url=url+"&lang="+lang;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged(){ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
	} 
}
function GetXmlHttpObject(){
	var xmlHttp=null;
	try{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}catch (e){
		//Internet Explorer
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

//Region below
var xmlHttp;
function regionLocator(str, lang){ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="regionlocator.php";
	url=url+"?q="+str;
	url=url+"&lang="+lang;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged(){
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
	}
}
function GetXmlHttpObject(){
	var xmlHttp=null;
	try{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}catch (e){
		//Internet Explorer
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

//Subscribe below
$(document).ready(function(){
	$('#subscribe_start').click(function() {
		$('#subscribe_start').animate({'margin':'-19px 0 0 0'});
	});	
});

//Subscribe restart below
function subscribeRestart(){
	$('#subscribe_start').animate({'margin':'-19px 0 0 0'});
};

//Subscribe AJAX below
var xmlHttp;
function subscribe(str, lang){ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="subscribe_ajax.php";
	url=url+"?s="+str;
	url=url+"&lang="+lang;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged3;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged3(){
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById("subscribe_result").innerHTML=xmlHttp.responseText;
		$('#subscribe_start').animate({'margin':'-39px 0 0 0'});
	}
}
function GetXmlHttpObject(){
	var xmlHttp=null;
	try{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}catch (e){
		//Internet Explorer
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

//Lifestyle below
$(document).ready(function(){
	//$('#lifestyle').css({'display':'block', 'z-index':'1'});
	//$('#lifestyle_flash').css('z-index','2');
	//$('#lifestyle').animate({opacity: '0.95'}, 200);	
});

function lifestyleOpen() {
	$('#lifestyle').css({'display':'block', 'z-index':'1'});
	$('#lifestyle_flash').css('z-index','2');
	$('#lifestyle').animate({opacity: '0.95'}, 200);
}

function lifestyleClose() {
	$('#lifestyle').animate({opacity: '0'}, 200, function(){
		$('#lifestyle').css('display','none');
	});
}