﻿// JScript File
function goUrl(ur)
{
	this.location.href=ur;
}

var sec=10;
function TimerPage()
{
    var lan=getCookie("lang"); 
    var label=document.getElementById("btn_go");
    if(sec>0)
    {
        sec--;
        if(lan == "zh-CN")
        {label.innerHTML="同意以上服务条款"+sec+"秒后可选";}
        else
        {label.innerHTML="Agree above-mentioned terms of Service,after "+sec+" second optional.";}
    }else
    {
        document.cookie="protocol=yes";
        var input=document.createElement("img");
        input.type="image";
        if(lan =="zh-CN")
        {input.src="../../Image/UserImg/agree1.png";}
        else
        {input.src="../../Image/UserImg/agreeE1.png";}
        if (navigator.appName=="Microsoft Internet Explorer") 
        {
            input.attachEvent("onclick",goUrlP);
        }
        else
        {  
            input.addEventListener("click",goUrlP,false);
        }
        label.innerHTML="";
        label.appendChild(input);
        clearTimeout(tid);
        return;
    }
    var tid=setTimeout("TimerPage()",1000);
}

function goUrlP()
{
     var url=document.getElementById("btn_go");
     goUrl(url.title);
}

function getCookie(sname)//取cookies函数        
{
    var acookie=document.cookie.split("; ");
    for(var i=0;i<acookie.length;i++)
    {
        var arr=acookie[i].split("=");
        if(sname==arr[0])
        {
            if(arr.length>1)
            return unescape(arr[1]);
            else
            return "";
        }
    }
}
function thisMovie(movieName) 
{
     if (navigator.appName.indexOf("Microsoft") != -1) {
         return document.forms[0][movieName];
     } else {
         return document[movieName];
     }
}

function sendToAction(str) 
{     
      if (thisMovie("try2") != null)
         {
            thisMovie("try2").sendToAction(str);        
         }
}
function changeCSS()
{
    var lan=getCookie("lang");
    var e=document.getElementById("tabs");
    if(lan =="zh-CN")
    {
        e.className="tabs";
    }else
    {
        e.className="tabs1";
    }
}
///获取浏览器版本
function getVersion()
{
	var browser=navigator.appName
	var b_version=navigator.appVersion
	var version=b_version.split(";");
	var trim_Version=version[1].replace(/[ ]/g,"");
	if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE7.0")
	{
		return "IE7";
	}
	else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE6.0")
	{
		return "IE6";
	}
}
function showDialog(layer,pid)
{
    var div;
    if (document.getElementById("dialog")==null)
    {
        div=document.createElement("div");
        div.setAttribute("id","dialog");
        div.style.width="325px";
        div.style.height="300px";
        div.style.position="absolute";
        div.style.top="33%";
        div.style.left="31%";
        div.style.zIndex=999;
        div.style.border="solid 1px #ccc";
        div.style.backgroundColor="#ffffff";
        document.getElementById(layer).appendChild(div);
    }else
    {
        div=document.getElementById("dialog");
    }
    
    var frm;
    if (document.getElementById("mycontent")==null)
    {
        frm=document.createElement("iframe");
        frm.setAttribute("id","mycontent");
        frm.src="sendToFriend.aspx?pid="+pid;
        frm.frameborder=0;
        frm.scrolling="no";
        frm.height="100%";
        frm.width="100%";
        frm.zIndex=1000;
        div.appendChild(frm);
    }else
    {
        frm=document.getElementById("mycontent");
    }

    var mast;
    if (document.getElementById("mast")==null)
    {
        mast=document.createElement("div");
        mast.setAttribute("id","mast");
        mast.style.width="102%";
        mast.style.height="120%";
        if (getVersion()=="IE6") 
        {
            mast.style.height=document.body.clientHeight+700+"px";
            mast.style.width=document.body.clientWidth+20+"px";
        }
        mast.style.backgroundColor="gray";
        mast.style.position="absolute";
        mast.style.left="-1.2%";
        mast.style.top="0px";
        mast.style.zIndex=998;
        var Browser_Name=navigator.appName;
        if(Browser_Name=="Microsoft Internet Explorer")
        {
            mast.style.filter='Alpha(Opacity=60)';
        }else
        {
            mast.style.opacity=0.5;
        }
        document.getElementById(layer).appendChild(mast);
    }else
    {
        mast=document.getElementById("mast");
    }
    
    mast.style.display="block";
    div.style.display="block";
    
    try{
    document.getElementById("main").style.paddingLeft="auto";
    document.getElementById("main").style.paddingRight="auto";
    }catch(e){}
    document.getElementById("div12").className="m1";
    return false;
}