
	//alert("detecting_zone");
function detect_zone(initpath)
{
    var ipv6_ok=false;
    var cookie_name;
    var is_tested;
	//alert("detecting_zone");
    if(initpath=="ZCZYZ001")
    {
        is_tested=checkCookieExist(_TEST_Z1_);
        cookie_name=_TEST_Z1_;
    }
    if(initpath=="ZCZYZ002")
    {
        is_tested=checkCookieExist(_TEST_Z2_);
        cookie_name=_TEST_Z2_;
    }
    if(initpath=="ZCZYZ003")
    {
        is_tested=checkCookieExist(_TEST_Z3_);
        cookie_name=_TEST_Z3_;
    }
    // alert(is_tested);

    var myDate=new Date();
    var minute=myDate.getMinutes();
    var minutes_left=60-minute;
    if(is_tested == false)
    {
        saveCookie(cookie_name, "YES"  , minutes_left*60 ,   "",   "grids.cn",   "");
        ipv6_ok=getCookie(_IPV6_COOKIE_);
        if(ipv6_ok == "OK")
       {
            alert('IPV6_OK');
            document.getElementById('detect_zone_frame').src="/cgi-bin/yj_detect_zone?initpath="+initpath+"&ipv6=YES";
        }
        else
        {
            document.getElementById('detect_zone_frame').src="/cgi-bin/yj_detect_zone?initpath="+initpath+"&ipv6=NO";
        }
    }
}

function loaded(ifload,sname,zoneid,loadStart) {
	var speed;
	var xmlHttp;
	
	if(ifload==0){
		speed=0.0;
	}else{
		//143644 is the sizeof(blockimg.jpg)
		var t2 = new Date();
		speed = 143644/(t2.getTime() - loadStart);
	}
	try{ 
        xmlHttp=new XMLHttpRequest();
        }
	catch (e)
    {
		try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
		catch (e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
		catch (e){alert("Your browser does not support AJAX!");return false;}
		}
    }
		xmlHttp.open("GET", "/cgi-bin/yj_test_submit?sname="+sname+"&zone="+zoneid+"&speed="+speed, true);
		xmlHttp.send(null);
		if(navigator.appName=="Microsoft Internet Explorer"){
			//document.execCommand("stop");
		}else{
			//this.stop();
		}
	//document.write("test_complete!");
}

function copyToClipBoard()
{
	if(navigator.appVersion.match("MSIE"))
	{
		var clipBoardContent="";
		clipBoardContent+=this.location.href;
		window.clipboardData.setData("Text",clipBoardContent);
		alert("复制视频链接地址成功:"+clipBoardContent);
	}
	else
	{
		alert("您使用的浏览器不支持此复制功能，请使用Ctrl+C或鼠标右键。");
	}
}

