//获取对象
function $ID(Id){return document.getElementById(Id)}
function $N(Name){return document.getElementsByName(Name)}
//打开连接
function Kefu(){OpenUrl('http://www.53kf.com/company.php?arg=lyhd&style=1','700','470','no')}
//打开连接
function OpenUrl(Url,Width,Height,scrollbars){
window.open(""+Url,"","Width="+Width+"px,Height="+Height+"px,top=100,left=100,status=no,scrollbars="+scrollbars)
}
function GetPage(URL,Type){
	switch(Type){
		case "blank": window.open(URL,"_blank"); break;
		default : location.href=URL; break;
	}
	
}
//判断浏览器
function $GetIE(){ 
   if(navigator.userAgent.indexOf("MSIE")>=0) return "IE"; 
   if(navigator.userAgent.indexOf("Firefox")>=0) return "Firefox"; 
   if(navigator.userAgent.indexOf("Opera")>=0) return "Opera"; 
   return "No"; 
};
//设为首页
function $HomePage(obj,Url){obj.style.behavior='url(#default#homepage)';obj.setHomePage(Url);return false};
//加入收藏夹
function $Favorite(Url,Title){
	switch($GetIE()){
		case "IE": window.external.addFavorite(Url,Title);break;
		case "Firefox": window.sidebar.addPanel(Title, Url, "");break;
		case "Opera":
			var Opera = document.createElement('a');Opera.setAttribute('rel','sidebar');
			Opera.setAttribute('href',Url);Opera.setAttribute('title',Title);Opera.click();break;
	}
}
//在线QQ
function QQMSG(qq,Name){
	if(qq.indexOf("@")==-1){
		location.href="tencent://message/?uin="+qq+"&Site=qq在线客服&Menu=yes";
	}else
	{
		location.href="msnim:chat?contact="+qq;
	}
}
//Flash动画
function Flash(url,width,height,xlink){
	if(xlink!=undefined){
		xlink="<a href=\""+xlink+"\" target=\"_blank\"><IMG style=\"width:"+width+"px;position:absolute;top:0;left:0;height:"+height+"px\" src=\"images/spacer.gif\"></a>"
	}else{
		xlink=""//<IMG style=\"width:"+width+"px;position:absolute;top:0;left:0;height:"+height+"px\" src=\"images/spacer.gif\">"
	}

document.write("<DIV style=\"POSITION:relative;\">\r\
<OBJECT codeBase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" height=\""+height+"\" width=\""+width+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\">\r\
<PARAM NAME=\"Movie\" VALUE=\""+url+"\">\r\
<PARAM NAME=\"Src\" VALUE=\""+url+"\">\r\
<PARAM NAME=\"WMode\" VALUE=\"Transparent\">\r\
<embed src=\""+url+"\" quality=\"high\" allowscriptaccess=\"always\" wmode=\"Transparent\" type=\"application/x-shockwave-flash\"  pluginspage=\"http://www.macromedia.com/go/getflashplayer\" height=\""+height+"\" width=\""+width+"\">\r\
</OBJECT>"+xlink+"</DIV>")
}

var tips; var theTop = 30; var old = theTop; 
function initFloatTips() { 
if(document.getElementById('rightdiv')){
tips = document.getElementById('rightdiv'); <!-- 本段的yy是名称 -->
moveTips(); 
}; 
function moveTips() { 
var tt=1; 
if (window.innerHeight) { 
pos = window.pageYOffset 
} 
else if (document.documentElement && document.documentElement.scrollTop) { 
pos = document.documentElement.scrollTop 
} 
else if (document.body) { 
pos = document.body.scrollTop; 
} 
pos=pos-tips.offsetTop+theTop-80; 
pos=tips.offsetTop+pos/10; 
if (pos < theTop) pos = theTop; 
if (pos != old) { 
tips.style.top = pos+"px"; 
tt=1; 
} 
old = pos; 
setTimeout(moveTips,tt);
}
}

//计算价格
function $GM(){
	var Name=$N("p_item");
	var Max=Name.length;
	var Key="";
	for(M=0;M<Max;M++)if(Name[M].checked==true)Key+="|"+Name[M].value;Key+="|";
	$GetURL("getprice.html?k="+Key.toLowerCase());
}
//全选
function $GS(GT){
	if(GT=="all"){
		var Name=$N("p_item");
		var Max=Name.length;
		for(M=0;M<Max;M++) Name[M].checked=true;
		$ID("tai_web1_c").checked=false;$ID("tai_web2_c").checked=false;
		$GM()
	}
}

function $GN(NW){
	for(M=1;M<4;M++){
		if(M!=NW) $ID("tai_web"+M+"_c").checked=false
	}
}
//AJAX部分
var XMLHTTP;
function $GetURL(Url){
	if(Url.indexOf("?")==-1)Url+="?";
	Url+="&random="+Math.random();
	if(window.XMLHttpRequest){
		XMLHTTP=new XMLHttpRequest();XMLHTTP.onreadystatechange=StateChange;
	try{XMLHTTP.open("GET",Url,true);}catch(e){}
		XMLHTTP.send(null);
	}else if(window.ActiveXObject){
		XMLHTTP=new ActiveXObject("Microsoft.XMLHTTP");
		if(XMLHTTP){
			XMLHTTP.onreadystatechange=StateChange;
			XMLHTTP.open("GET",Url,true);XMLHTTP.send();
		}
	}
}
function StateChange(){
	if(XMLHTTP.readyState==4){
		if(XMLHTTP.status==200){
			var FM,TM;FM=XMLHTTP.responseText;
			if(FM=="")FM="|";
			var TM=FM.split("{$}");$ID("moneyA").innerHTML=TM[0];$ID("moneyB").innerHTML=TM[1];
		}
	}
}
//检测表单
function CheckForm(){
	var Name=$N("p_item");
	var M=0;//选中的记录数
	for (i=0;i<Name.length;i++){
		if(Name[i].checked)M++;
	}
	if(M<1){
		alert("请选择您要购买的产品");
		 return false;
	}
}

function CheckOther(id,Name,M){
	if(M==1){
	if(id.checked){
		for(n=0;n<$N(Name).length;n++){
			$N(Name)[n].checked="";
		}
		id.checked="checked";
	}
	}else{
		if($N(Name)[$N(Name).length-1].value.split("$")[2]!="0")$N(Name)[$N(Name).length-1].checked="";}
}

function LinkChecked(xID,xName,oN){
		if(!xID.checked){
			$N(xName)[oN].checked="";
			$N(xName)[oN].disabled="disabled";
		}else{
			$N(xName)[oN].disabled="";
		}
}