﻿<!--[CDATA[

        var Sys = {};
        var ua = navigator.userAgent.toLowerCase();
        var s;
        (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
        (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
        (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
        (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
        (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;

        //以下进行测试
       // if (Sys.ie) document.write('IE: ' + Sys.ie);
       // if (Sys.firefox) document.write('Firefox: ' + Sys.firefox);
       // if (Sys.chrome) document.write('Chrome: ' + Sys.chrome);
       // if (Sys.opera) document.write('Opera: ' + Sys.opera);
       // if (Sys.safari) document.write('Safari: ' + Sys.safari);



		   var strkey="";
		   	var inter=null;
		function $(id)
		   {
			   return document.getElementById(id);
		}
		function SelectClass()
		{
		    var obj=$("ClassDIV");
		    var tag=$("classList");
		    if(tag)
		    {
		        tag.style.zIndex="999";
		        tag.style.visibility="visible";		        
		        setOffsets(obj,"classList");  
		        obj.style.color="#FF0000";
		        explan();//展开效果
		    }
		}
		//计算显示位置
function calculateOffset(field,attr) {
      var offset = 0;
      while(field) {
          offset += field[attr];
          field = field.offsetParent;
      }
      return offset;
}
function setOffsets(obj,id)
{
	  strkey=obj;
	  //AddLiOnMouse();//添加鼠标移动上去的效果
      $(id).style.width =strkey.offsetWidth-2+"px";
	  $(id).style.height=strkey.offsetHeight-2+"px";
      var left = calculateOffset(strkey, "offsetLeft");
      var top = calculateOffset(strkey, "offsetTop")+strkey.offsetHeight;;
      $(id).style.left = left + "px";
      $(id).style.top = top + "px";
}
	function setValue(num,str)
	{
	    $("type").value=num;
	    $("ClassDIV").innerHTML=str;
	    Close();//关闭动画
	}

function explan()
{
    inter=window.setInterval(kai,2);
}
function Close()
{
    inter=window.setInterval(guan,2);
}
function kai()
{
    var ht=$("classList").getElementsByTagName("ul")[0].offsetHeight;
    if($("classList").offsetHeight<ht)
    {
        $("classList").style.height=($("classList").offsetHeight+25)+"px";
    }
    else
    {
        window.clearInterval(inter);
    }
}
function guan()
{
    if($("classList").offsetHeight>=25)
    {
        $("classList").style.height=($("classList").offsetHeight-25)+"px";
    }
    else
    {
        window.clearInterval(inter);
        $("classList").style.height="0px";
        $("classList").style.visibility="hidden";        
    }
}
function showQQ()
{
    //QQshow
    //QQlist
    $("QQlist").style.display="block";
      var left = calculateOffset($("QQshow"), "offsetLeft")+$("QQshow").offsetWidth-$("QQlist").offsetWidth;
      var top = calculateOffset($("QQshow"), "offsetTop")+$("QQshow").offsetHeight;
      $("QQlist").style.left = left + "px";
      $("QQlist").style.top = top + "px";
      document.documentElement.onclick=function(){HideQQ();document.documentElement.onclick=null;}
}
function HideQQ()
{
    $("QQlist").style.display="none";
}
function ShowShops()
{
      $("webShops").style.display="block";
      var left = calculateOffset($("shops"), "offsetLeft");
      var top = calculateOffset($("shops"), "offsetTop")+$("shops").offsetHeight;
      $("webShops").style.left = left + "px";
      $("webShops").style.top = top + "px";
      $("webShops").style.width=$("shops").offsetWidth-2+"px";
      document.documentElement.onclick=function(){$("webShops").style.display="none";document.documentElement.onclick=null;}
}
function HideShops()
{
    $("webShops").style.display=$("webShops").style.display=="block"?"none":"block";
}
function loadPng(o)
{
    if(Sys.ie)
    {
        try
        {
            var img = o;
            var imgName = o.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;
	            if (img.align == "left") imgStyle = "float:left;" + imgStyle;
	            if (img.align == "right") imgStyle = "float:right;" + imgStyle;
	            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle ;
	            var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='image');\"></span>"; 
	            img.outerHTML = strNewHTML;
	        }
        }
	    catch(e){}
    }
}
