﻿//以下是pop
function showpop(id)
{
    var divobj=document.getElementById("popdiv");
    divobj.innerHTML="<div style=\"width:506;text-align:right\"><span onclick=\"hidepop()\" style=\"cursor:hand\"> × </span></div>"
    +"<iframe id=\"popframe\" src=\"pop.aspx?ID="+id+"\" frameborder=0 scrolling=no width=\"508\"></iframe>";
    divobj.style.display="";
    divobj.style.overflow="visible";
    
   divobj.style.left=(document.body.clientWidth/2-divobj.clientWidth/2)+"px";
   //divobj.style.top=(document.body.scrollTop+document.body.clientHeight/2-divobj.clientHeight/2)+"px";
   divobj.style.top=(document.body.scrollTop+document.body.clientHeight/2-divobj.clientHeight/2)-150+"px";
   //divobj.style.top=document.documentElement.scrollTop+window.event.clientY-120;
}

function hidepop()
{
    var divobj=document.getElementById("popdiv");
    divobj.style.display="none";
}


function selChirMenu(parentID,paddingleft)
{
    var obj=document.getElementById("divchirMenu");
    var start="<div style=\"line-height:28px;width:908px;padding-left:"+paddingleft+"px\">";
    var endstr="";
    //根据主菜单写子菜单
    switch(parentID)
    {
        case 2 :
            endstr= "<a href=\"/intro/index.aspx\" class=\"white\">公司简介</a> / "+
                    "<a href=\"/intro/index.aspx#ll\" class=\"white\">经营理念</a> / "+
                    "<a href=\"/intro/history.aspx\" class=\"white\">发展史</a> / "+
                    "<a href=\"/intro/team.aspx\" class=\"white\">公司团队</a> / "+
					 "<a href=\"/intro/Citation.aspx\" class=\"white\">屡获殊荣</a> / ";
           break;
        
        case 7 :
            endstr="<a href=\"/service/default.aspx\" class=\"white\">在线演示</a> / "+
                   "<a href=\"/service/faq.aspx\" class=\"white\">常见问答</a> / ";
           break;
    }
    
    obj.innerHTML="";
    obj.innerHTML=start+endstr+"</div>";
}

function hideMenu()
{
     var obj=document.getElementById("divchirMenu");
     obj.innerHTML="";
}

function download(filename)
{
   window.open("/download.aspx?fn="+filename);
   return false;
}

function openwav(filename)
{
   window.open("/FreeOnline.aspx?fn="+filename);
   return false;
}


//调用 <img onmousedown="scroll(-3)" onmouseover="scroll(-3)" style="cursor: hand" onmouseout="scroll(0)"
//                                   border="0" src="Selbt_Up.gif" width="16" height="16" title="按下鼠标速度会更快">
function scroll(n)
{
    temp=n;
    content.scrollTop=content.scrollTop+temp;
    
    if (temp==0) return;
        setTimeout("scroll(temp)",20);
}


function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
{
	for(var i=0; i<document.images.length; i++)
	{
		var img = document.images[i]
		var imgName = img.src.toUpperCase()
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
		{
			var imgID = (img.id) ? "id='" + img.id + "' " : ""
			var imgClass = (img.className) ? "class='" + img.className + "' " : ""
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
			var imgStyle = "display:inline-block;" + img.style.cssText
			var imgAttribs = img.attributes;
			for (var j=0; j<imgAttribs.length; j++)
			{
				var imgAttrib = imgAttribs[j];
				if (imgAttrib.nodeName == "align")
				{
					if (imgAttrib.nodeValue == "left") imgStyle = "float:left;" + imgStyle
					if (imgAttrib.nodeValue == "right") imgStyle = "float:right;" + imgStyle
					break
				}
			}
			var strNewHTML = "<span " + imgID + imgClass + imgTitle
			strNewHTML += " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
			strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			strNewHTML += "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
			img.outerHTML = strNewHTML
			i = i-1
		}
	}
}
window.attachEvent("onload", correctPNG);
