/*
function hidestatus(){
	window.status=''
	return true
}
if (document.layers)
	document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
	document.onmouseover=hidestatus
	document.onmouseout=hidestatus
*/
//----------------------------------------------------------------- Newsletter
var resultFrom;
var resultTo;
function checkEmail(){
	if(document.subscribe.newsletter.value == ""){
		alert("Please check - Text Field Empty!");
		document.subscribe.newsletter.focus();
	}
	else if(document.subscribe.newsletter.value != "")
	{
		var returnvalue = checkMail(window.document.subscribe.newsletter);
		if (returnvalue==true){
			document.subscribe.submit();
		}
	}
}
function checkNewsletter(){
	if(document.frmSubscribe.email.value == "" || document.frmSubscribe.email.value == "Enter your email here"){
		alert("Enter Email");
		document.frmSubscribe.email.focus();
		return;
	}
	if(document.frmSubscribe.country.value == "nothing"){
		alert("Enter Country");
		document.frmSubscribe.country.focus();
		return;
	}
	if(document.frmSubscribe.email.value != "")
	{
		var returnvalue = checkMail(window.document.frmSubscribe.email);
		if (returnvalue==true){
			document.frmSubscribe.submit();
		}
	}
}
var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;
function checkMail(e){
	var returnval=emailfilter.test(e.value)
	if (returnval==false){
		alert("Please enter a valid email address.")
		e.select()
	}
	return returnval;
}
function MM_openBrWindow(theURL,winName,type_features) {
	window.open(theURL,winName,type_features);
}
//----------------------------------------------------------------- E-shop
//----------------------------------------------------------------- Paging
var xmlHttpPaging;
function paginglist(cat_id,pagenum){
	xmlHttpPaging=GetXmlHttpObject()
	if (xmlHttpPaging==null){
		alert ("Browser does not support HTTP Request");
		return;
	}
	document.getElementById("txtPaging").innerHTML='';
	var url="rightnextpre.php";
	url=url+"?cat_id="+cat_id;
	url=url+"&page="+pagenum;
	url=url+"&sid="+Math.random();
	xmlHttpPaging.onreadystatechange=stateChangedPaging;
	xmlHttpPaging.open("GET",url,true);
	xmlHttpPaging.send(null);
}
function stateChangedPaging(){ 
	if (xmlHttpPaging.readyState==4 || xmlHttpPaging.readyState=="complete"){
		document.getElementById("txtPaging").innerHTML=xmlHttpPaging.responseText;
	} 
}

var xmlHttp
function ShowDetail(cat_id, prod_id){ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="productdetail.php";
	url=url+"?cat_id="+cat_id;
	url=url+"&prod_id="+prod_id;
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged(){ 
	if (xmlHttp.readyState==4){
		if (xmlHttp.status==200){
			setTimeout("document.getElementById('dtlsec').innerHTML=xmlHttp.responseText;",2000);
		}
		document.getElementById("dtlsec").innerHTML=
			'<table cellspacing="0" cellpadding="0" border="0" align="center" width="550">'+
				'<tr>'+
					'<td align="center" valign="middle" width="550" style="height:200px;"><img src="images/ajax-loader.gif" width="126" height="22" border="0" alt="" /></td>'+
				'</tr>'+
			'</table>';
	} 
}
var xmlHttpReload;
function CaptchReload(){
	xmlHttpReload=GetXmlHttpObject();
	var xmlHttpReload1=GetXmlHttpObject();
	if (xmlHttpReload==null){
		alert ("Browser does not support HTTP Request");
		return;
	}
	xmlHttpReload1.open("POST","get_captcha.php",true);
	xmlHttpReload1.send(null);
	var url="make_captcha.php";
	url=url+"?sid="+Math.random();
	xmlHttpReload.onreadystatechange=SCCaptchReload;
	xmlHttpReload.open("POST",url,true);
	xmlHttpReload.send(null);
}
function SCCaptchReload(){ 
	if (xmlHttpReload.readyState==4 || xmlHttpReload.readyState=="complete"){
		document.getElementById("cap_re").innerHTML=xmlHttpReload.responseText;
	} 
}
//----------------------------------------------- Getting XmlHttp Object
function GetXmlHttpObject(){
	var objXMLHttp=null;
	try{
		// Firefox, Opera 8.0+, Safari
		objXMLHttp=new XMLHttpRequest();
	}
	catch (e){
		// Internet Explorer
		try{
			objXMLHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e){
			try{
				objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e){
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	return objXMLHttp;
}
function mywin(name){
	windowHandle = window.open('pic.php?n='+name,'UserPicture','height=130,width=250,screenX=10,screenY=10,top=10,left=150');
	windowHandle.focus();
}