//*********************//
//AJAX fns for order_form
//*********************//
//var xmlHttp

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;
}
////////////////////////////////////////////////////////////////////////
// Show the currency on the country selection
////////////////////////////////////////////////////////////////////////
function setPreferedCurrency()
{
	var con = document.frm.country.options[document.frm.country.selectedIndex].text;
	var whereToWrite = 'PreferedCurrency';   
	var strVariables = 'action=PreferedCurrency&type=Normal&country='+con;
	makeRequest('ajax_function.php?'+strVariables, whereToWrite);
}

function validate()
{
	var con = document.frm.country.options[document.frm.country.selectedIndex].value;
	if(con=='0')
	{
		alert('Please select the Shipping Country');
		return false;
	}
	var con = document.frm.curr.options[document.frm.curr.selectedIndex].value;
	if(con=='0')
	{
		alert('Select your preferred currency');
		return false;
	}
	return true;
}

function setPreferedCurrencySplash()
{
//	var con = document.frm.countrySplash.options[document.frm.countrySplash.selectedIndex].text;
	var con1 = document.getElementById("countrySplash");
	con = con1.options[con1.selectedIndex].text;
//	alert(con)
	var whereToWrite = 'PreferedCurrencySplash';   
	var strVariables = 'action=PreferedCurrency&type=Splash&country='+con;
	makeRequest('ajax_function.php?'+strVariables, whereToWrite);
}

function validateSplash()
{
	var con = document.getElementById("countrySplash").value;
	if(con=='0')
	{
		alert('Please select the Shipping Country');
		return false;
	}
	var con = document.getElementById("currSplash").value;
	if(con=='0')
	{
		alert('Select your preferred currency');
		return false;
	}
	return true;
}

//***********//
//screen desc
//**********//
function _geo_ip()
{
		
	var fl = document.getElementById("f");
	fl.style.visibility="hidden";
//	alert()
//	var fl = document.getElementById("flag_table");
//	fl.style.visibility="hidden";
//	document.getElementById('flag_table').style.dispaly="none";
	xmlHttp_s_d=GetXmlHttpObject()
	if (xmlHttp_s_d==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	var url="geoip_intl.php"
	xmlHttp_s_d.onreadystatechange=stateChanged_screen_desc
	xmlHttp_s_d.open("GET",url,true)
	xmlHttp_s_d.send(null);

}

function stateChanged_screen_desc() 
{ 
	if (xmlHttp_s_d.readyState==4 || xmlHttp_s_d.readyState=="complete")
	{ 
		c = document.getElementById("intl_ship")
		c.style.visibility="visible"
		var newdiv = document.createElement('div');
		newdiv.setAttribute('id', '1');
		newdiv.style.background = "white";
		newdiv.style.opacity=".70";
		newdiv.style.filter = "alpha(opacity=70); -moz-opacity: 0.5;border:1px solid black;";
		//newdiv.style.filter="alpha(opacity=70)";
		newdiv.style.width = document.body.clientWidth;
		newdiv.style.height = document.body.scrollHeight;

		newdiv.style.position = "absolute";
		newdiv.style.left = 0;
		newdiv.style.top = 0;
		c.appendChild(newdiv);
		var newdiv1 = document.createElement('div');
		newdiv1.setAttribute('id', '2');
		newdiv1.style.paddingTop=0+"px";
		newdiv1.style.paddingLeft="35px";
		newdiv1.style.width =(document.body.clientWidth/1.7);
		newdiv1.style.height = (document.body.clientHeight/2);
		newdiv1.style.position = "absolute";
		newdiv1.style.zIndex = 1;
		newdiv1.style.left = (document.body.clientWidth/6)+100;
		newdiv1.style.top = (document.body.clientWidth/6)-5;
		newdiv1.style.backgroundImage="url(images/splash_graphic.png)";
		newdiv1.style.backgroundRepeat="no-repeat";
		newdiv1.innerHTML = xmlHttp_s_d.responseText;
		c.appendChild(newdiv1);
	
	}

		
}
//***********//
//screen desc
//**********//

//************//
//preloader
//***********//
function _show_msg_demo()
{
		c = document.getElementById("intl_ship")
		c.style.visibility="visible"
		var newdiv = document.createElement('div');
		newdiv.setAttribute('id', '1');
		newdiv.style.filter="alpha(opacity="+50;

		newdiv.style.width = document.body.clientWidth;
		newdiv.style.height = document.body.clientHeight+600;
		newdiv.style.position = "absolute";
		newdiv.style.left = 0;
		newdiv.style.top = 0;
		newdiv.style.background = "black";
		c.appendChild(newdiv);
		var newdiv1 = document.createElement('div');
		newdiv1.setAttribute('id', '2');
		newdiv1.style.width =(document.body.clientWidth/2);
		newdiv1.style.height = (document.body.clientHeight+1000);
		newdiv1.style.position = "absolute";
		newdiv1.style.left = (document.body.clientWidth/3.5);
		newdiv1.style.top = (document.body.clientWidth/4.5);
		newdiv1.style.backgroundImage="url(images/btn_bg.png)";
		newdiv1.style.backgroundRepeat="no-repeat";
		newdiv1.innerHTML = "<div style=padding-top:100px; padding-left:40px; align=left ><img src=images/order_more_screen.gif onclick=_show_msg_demo_rem()><a href = shoppingcart.php><img src=images/checkout.gif border=0></div>";
		c.appendChild(newdiv1);
		//new div for text
}
function _form_val()
{
	a = document.getElementById("curr")
		if (a.value == 'Select Preferred Currency')
		{
			alert('Select Your Preferred Currency')
				return false
		}
			else
		{
			return true
		}
}

function _rem_splash()
{
		var fl = document.getElementById("f");
		c9 = document.getElementById("intl_ship")
		//c9.innerHTML="";
		c9.style.visibility="hidden"
		//c9.style.zIndex=-20
		
		fl.style.visibility="visible";
//		document.getElementById('flag_table').style.dispaly="";
//	var fl = document.getElementById("flag_table");
//	fl.style.visibility="visible";
		
}
//************//
//preloader
//***********//