﻿
    var hellotext="Welcome to Hueway technogoly";
    var thetext="";
    var started=false;
    var step=0;
    var times=1;

    function welcometext()
    {
      times--
      if (times==0)
      { 
        if (started==false)
        {
          started = true;
          window.status = hellotext;
          setTimeout("anim()",1); 
        }
        thetext = hellotext;
      }
    }
    function showstatustext(txt)
    {
      thetext = txt;
      setTimeout("welcometext()",4000)
      times++
    }

    function anim()
    {
      step++
      if (step==7) {step=1}
      if (step==1) {window.status='>==='+thetext+'===<'}
      if (step==2) {window.status='=>=='+thetext+'==<='}
      if (step==3) {window.status='>=>='+thetext+'=<=<'}
      if (step==4) {window.status='=>=>'+thetext+'<=<='}
      if (step==5) {window.status='==>='+thetext+'=<=='}
      if (step==6) {window.status='===>'+thetext+'<==='}
      setTimeout("anim()",200);
    }

function InitWeb()
{
    welcometext();
    document.title= document.title+"- cartridge.cn";
}
function InitContacts()
{
    for(var i=1;i<13;i++)
    {
        document.getElementById("server"+i).style.display = "none";
    }
    document.getElementById("server2").style.display = "block";
}
function nocopy()

{
event.returnValue=false;

}
function stop(){

return false;

}
document.oncontextmenu=stop;

function StoreInit()
{
    var lis =document.getElementById("ProductStore").getElementsByTagName("li");
    for(var i=0;i<lis.length;i++)
    {
        lis[i].style.background="#FFB6B6";
        i = i+1;
    }
}
function ShowMember(obj,num)
{
    document.getElementById("iframText").innerHTML= obj.innerHTML;
    document.getElementById("bannerContent").innerHTML= obj.innerHTML;
    document.title= obj.innerHTML+"- cartridge.cn";
    var lis = document.getElementById("aboutul").getElementsByTagName("li");
   for(var i=0;i<lis.length;i++)
   { 
        lis[i].getElementsByTagName("a")[0].style.color="#999";
        lis[i].getElementsByTagName("a")[0].style.background="#FFF";
   }
    obj.style.color="#fff";
    obj.style.background ="#16387c";
    
    document.getElementById("MyFrame").src="/member/"+num+".aspx";
}
function ShowContact(obj,num)
{
    document.getElementById("iframText").innerHTML= obj.innerHTML;
    document.getElementById("bannerContent").innerHTML= obj.innerHTML;
    document.title= obj.innerHTML+"- cartridge.cn";
    var lis = document.getElementById("aboutul").getElementsByTagName("li");
   for(var i=0;i<lis.length;i++)
   { 
        lis[i].getElementsByTagName("a")[0].style.color="#999";
        lis[i].getElementsByTagName("a")[0].style.background="#FFF";
   }
    obj.style.color="#fff";
    obj.style.background ="#16387c";
    
    document.getElementById("MyFrame").src="http://www.cartridge.cn/Contact/"+num+".aspx";
}

function showMsn(tag)
{
    var msn = document.getElementById(tag);
    if(msn.style.display != "none")
        msn.style.display ="none";
    else
        msn.style.display = "block";
}
function ShowServerInfo(id)
{
    for(var i=1;i<13;i++)
    {
        document.getElementById("server"+i).style.display = "none";
    }
    document.getElementById(id).style.display = "block";
}
function backTop()
{
		window.onscroll=null;
        document.documentElement.scrollTop-=Math.ceil(document.documentElement.scrollTop*2);
};
function ShowProductData(id)
{
    var xmlhttp = new JavaScript.Common.HttpRequest();
    xmlhttp.Url ="/Action/ReturnJson.aspx";
    xmlhttp.Method = "POST";
    xmlhttp.addFormData("id",id);
    xmlhttp.OnComplete = ShowData_Comlete;
    xmlhttp.OnError = ShowData_Error;
    xmlhttp.DoCallBack(); 
}
function ShowData_Comlete(responseText, responseXML)
{    
    if(responseText!="")
    {
        backTop();
        var str = responseText;
        var obj = eval("("+ str + ")");
        document.getElementById("HiddenId").value = obj.ID;
        var table = document.getElementById("ShowTable");
        var tds = table.getElementsByTagName("td");
        tds[0].innerHTML = obj.Type;
        tds[1].innerHTML = obj.Feature;
        tds[2].innerHTML = obj.BrandName;
        tds[3].innerHTML = obj.Color;
        tds[4].innerHTML = obj.FullName+"("+obj.Abbreviation+")";
        tds[5].innerHTML = obj.Status;
        tds[6].innerHTML = obj.Capacity;
        tds[7].innerHTML = obj.Suitable;
        var table1 = document.getElementById("ShowTable1");
        var tds1 = table1.getElementsByTagName("td");
        tds1[0].innerHTML = obj.Quantity+"Piece/Pieces";
        tds1[1].innerHTML = obj.Port;
        tds1[2].innerHTML = obj.Details;
        tds1[3].innerHTML = obj.Delivery;
        
        var image1 = document.getElementById("ProdcutSmallPic")
        image1.src ="/Admin/file/"+obj.Pic_small;
        image1.parentNode.href="/Admin/file/"+obj.Pic_big;
        image1.parentNode.title = obj.FullName+obj.Suitable;
        document.getElementById("ProductTitle").innerHTML = obj.Feature+" " + obj.BrandName+" " + obj.FullName+"("+obj.Abbreviation+")"+" " + "Printer " + obj.Type;
        document.title = obj.BrandName+" " + obj.FullName+" " + document.title ;
        document.getElementById("MyFrame").src = "/discuss/Default.aspx?aid="+ obj.ID;
    }
    else
    {
        alert("response Text is null");
    }
};

function ShowData_Error(status, statusText, responseText)
{    
    window.location=window.location;
};

function GetParam()
{
    var url = document.location.href;
    var name="";
    if (url.indexOf("=")>0)
    {
        name = url.substring(url.indexOf("=")+1,url.length);
    }
    else
    {
    var url=document.location.pathname;//获取完整URL    
    var tmp= new Array();
    tmp=url.split("/");   
    var pp = tmp[tmp.length-1];  
    tmp=pp.split("."); 
    name =tmp[0];


    }
    return name;
};

function ProductInit()
{
    ShowProductData(GetParam());
};

function ServerInfoMsn1(obj)
{
    var lis =document.getElementById("AllServerInfoMsn").getElementsByTagName("li");
    for(var i=0;i<lis.length;i++)
    {
        lis[i].style.display = "none";
    }
    document.getElementById(obj).style.display = "block";
}

function onloadMove()
{
    var id = GetParam();
    if(id!="Contacts")
    {
        document.getElementById("MyFrame").src = "/Contact/4.aspx?id="+id;
    }
    else
    {
        document.getElementById("MyFrame").src = "/Contact/1.aspx";
    }
}