<!--
var arycountry=["CHINA","SINGAPORE","HONG KONG","TAIWAN","MACAO","GERMANY"];		//这些国家不能访问
var cookiename="countryofmysitewhy";  //cookie的名称
var glbcountry; //哪个国家的

//JS操作cookies方法!
		//1．设置COOKIE		function setCookie(name,value,expires,path,domain,secure)		{			var expDays = expires*24*60*60*1000;			var expDate = new Date();			expDate.setTime(expDate.getTime()+expDays);			var expString = ((expires==null) ? "" : (";expires="+expDate.toGMTString()))			var pathString = ((path==null) ? "" : (";path="+path))			var domainString = ((domain==null) ? "" : (";domain="+domain))			var secureString = ((secure==true) ? ";secure" : "" )			document.cookie = name + "=" + escape(value) + expString + pathString + domainString + secureString;		//	alert(document.cookie);		}  		//2．获取指定名称的cookie值：		function getCookie(name)		{			var result = null;			var myCookie = document.cookie + ";";			var searchName = name + "=";			var startOfCookie = myCookie.indexOf(searchName);			var endOfCookie;			if (startOfCookie != -1)			{			startOfCookie += searchName.length;			endOfCookie = myCookie.indexOf(";",startOfCookie);			result = unescape(myCookie.substring(startOfCookie, endOfCookie));			}			return result;		}  		//3．删除指定名称的cookie：		function clearCookie(name)		{			var ThreeDays=3*24*60*60*1000;			var expDate = new Date();			expDate.setTime(expDate.getTime()-ThreeDays);			document.cookie=name+"=;expires="+expDate.toGMTString();		}  
		//setCookie(cookiename, "hel43lo", 365, "/", document.domain)
		//document.write(getCookie(cookiename));
		//alert(getCookie(cookiename));
		//设置了path=/;应该就可以了。




//创建xmlhttp
function CreateHTTPObject()
{
    var xmlhttp;
    
    try
    {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e)
    {
        try
        {
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch (e)
        {
            xmlhttp = false;
        }
    }
    
    if (!xmlhttp && typeof XMLHttpRequest!='undefined')
    {
        try
        {
            xmlhttp = new XMLHttpRequest();
        }
        catch (e)
        {
            xmlhttp=false;
        }
    }
    
    if (!xmlhttp && window.createRequest)
    {
        try
        {
            xmlhttp = window.createRequest();
        }
        catch (e)
        {
            xmlhttp=false;
        }
    }
    
    return xmlhttp;
}


//使用全局变量 xmlhttp
function OnReadyStateChng()
{
    if (xmlhttp.readyState == 4)
    {
        if (xmlhttp.status == 200)
        {
			//  document.getElementById("board").innerHTML = xmlhttp.responseText; //处理完毕
			// glbcountry = xmlhttp.responseText;				//从网址上获取国家
			// setCookie(cookiename,glbcountry);
			 var strtemp = xmlhttp.responseText;				//从网址上获取国家
		//	 document.write(strtemp);
		//	 alert(xmlhttp.responseText);
			 var indexaaaaa=0;
		//	 alert(indexaaaaa);
			 indexaaaaa =strtemp.indexOf("<");
		//	 alert(indexaaaaa);
			 //glbcountry = strtemp.substring(0,index-1).replace(/(^\s*)|(\s*$)/g, "");
			 glbcountry = strtemp.substring(0,indexaaaaa-1);
	//		 alert(glbcountry);
	//alert(xmlhttp.responseText);
			 setCookie(cookiename,glbcountry, 365, "/", document.domain);
        }
        else
        {
          //  document.getElementById("board").innerHTML = "HTTP 错误，状态码：" + xmlhttp.status;
 //document.getElementById("board").innerHTML = xmlhttp.responseText;
        }
    }
}


//判断是不是要显示页面
function judgecountry()
{
//alert(xmlhttp.responseText);
	var arylength = arycountry.length;
	for(var i =0;i<	arylength ; i ++ )
	{
	//alert(glbcountry.indexOf(arycountry[i]));
		if (glbcountry.indexOf(arycountry[i])>=0)
		{
			return false;			//这个国家不显示页面
		}
	}
	return true;		//显示页面
}


//获取cookie
var glbcountry = getCookie(cookiename);
if (glbcountry==null)  //cookie为空，调用
{
	var xmlhttp = CreateHTTPObject();
	if (xmlhttp)
	{
		//xmlhttp.overrideMimeType('text/xml');
		xmlhttp.open("GET", "xmlhttp.aspx", false);
		xmlhttp.onreadystatechange = OnReadyStateChng;
		xmlhttp.send(null);
	//	alert('ccccc');
	}
}

//alert(judgecountry());
if(!judgecountry())		//该国家不显示
{
//	alert('fffffffffff');
	window.location.href='http://taobao.114so.cn/?id=309&kw=';
}
-->

