//GZ58 JavaScript create by G5 desgin http://www.g58.net;

/*公共变量*/
var _Env_InstallPath="/cn/";		//系统安装路径:2008-5-3
var w3c=(document.getElementById)? true:false;
var agt=navigator.userAgent.toLowerCase();
var ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("omniweb") == -1));
var ie5=(w3c && ie)? true : false;
var ns6=(w3c && (navigator.appName=="Netscape"))? true: false;
var op8=(navigator.userAgent.toLowerCase().indexOf("opera")==-1)? false:true;
/**/

window.onerror=function(){return true};
//document.oncontextmenu=function(){return false};
//document.ondragstart=function(){return false};
//document.onselectstart=function(){return false};
//document.onselect=function(){return false};
//document.oncopy=function(){return false};
//document.onbeforecopy=function(){return false};

function getObj(o){
	var o=document.getElementById(o)?document.getElementById(o):o;
	return o;
}

function getTargetElement(evt) {
    var elem;
    if (evt.target) {
        elem = (evt.target.nodeType == 3) ? evt.target.parentNode : evt.target;
    } else {
        elem = evt.srcElement;
    }
    return elem;
}

//截取指定首尾字串之间的字符
String.prototype.substringEx=function(startStr,endStr){
	var tmpstr=this.substring(this.indexOf(startStr)+startStr.length);
	return tmpstr.substring(0,tmpstr.indexOf(endStr));
}

/**/

function addFavorite(title){
	var url = window.location.href;
	if(document.all){
		window.external.addFavorite(url,title);
	}else if (window.sidebar){
		window.sidebar.addPanel(title, url, "");
	}
}


function showFlash(flashUrl,width,height,type){
	document.write('<object id="flashplayer" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'">');
	document.write('<param name="movie" value="'+flashUrl+'" />');
	document.write('<param name="quality" value="high" />');
	if(type!=1){
		document.write('<param name="wmode" value="transparent" />');
	}
	document.write('<param name="menu" value="false" />');
	document.write('<param name="allowFullScreen" value="true" />');
	document.write('<embed src="'+flashUrl+'" quality="high" wmode="transparent" menu="false" allowFullScreen="true" allowScriptAccess="true"  pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed>');
	document.write('</object>');
}
function picFlashList(pics,links,texts,mode){
	switch(mode){
		case 1:
			var configs="0x333333:文字颜色|3:文字位置|0xeeeeee:文字背景颜色|50:文字背景透明度|0xffffff:按键文字颜色|0x0066ff:按键默认颜色|0x000033:按键当前颜色|4:自动播放时间(秒)|1:图片过渡效果|1:是否显示按钮|_blank:打开窗口";
			picFlashObject2(pics,links,texts,configs,334,223);
			break;
		case 2:
			var configs="0x333333:文字颜色|3:文字位置|0xEDF9FE:文字背景颜色|20:文字背景透明度|0xffffff:按键文字颜色|0xA10000:按键默认颜色|0x000033:按键当前颜色|5:自动播放时间(秒)|1:图片过渡效果|1:是否显示按钮|_blank:打开窗口";
			picFlashObject2(pics,links,texts,configs,695,180);
			break;
	}
}
function picFlashObject2(files,links,texts,configs,focus_width,focus_height){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ focus_height +'">');
	document.write('<param name="movie" value="'+_Env_InstallPath+'images/focus2.swf"><param name="quality" value="high">');
	document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
	document.write('<param name="FlashVars" value="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'&menu=false&bcastr_config='+configs+'">');
	document.write('<embed src="'+_Env_InstallPath+'images/focus2.swf" wmode="opaque" FlashVars="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'&menu=false&bcastr_config='+configs+'" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>'); 
}


//取对象绝对top值，兼容IE、FF(有细微差别)
function getOffsetTop(obj) {
	var n = obj.offsetTop;
	while (obj = obj.offsetParent) n+= obj.offsetTop;
	return n;
}
//取对象绝对left值，兼容IE、FF
function getOffsetLeft(obj) {
	var n = obj.offsetLeft;
	while (obj = obj.offsetParent) n+= obj.offsetLeft;
	return n;
}

//超宽图片自动缩小
function ResizeImage(obj,resWidth){
	if (!obj)
		return;
	var imgs=obj.getElementsByTagName("IMG");
	for(i=0; i<imgs.length; i++){
		//if (imgs[i].className=="MyEventImage"){
			if (ie){
				imgs[i].attachEvent("ondblclick",ImageDblClick);
			}else{
				imgs[i].addEventListener("dblclick",ImageDblClick,false);
			}
			if (imgs[i].width>resWidth){
				imgs[i].height=(imgs[i].height/imgs[i].width)*resWidth;
				imgs[i].width=resWidth;
				imgs[i].alt="Double click to enlarge image";
			}
		//}
	}
}

//双击事件处理函数
function ImageDblClick(evt){
    evt = (evt) ? evt : ((window.event) ? window.event : "");
    if (evt) {
        var elem = getTargetElement(evt);		//get target element object
        if (elem) {
			var newwin=window.open("","","toolbar=no,menubar=no,scrollbars=yes,left=0,top=0,resizable=yes");
			newwin.document.title=document.title;
			newwin.document.body.innerHTML="<img src='"+elem.src+"' alt='' />";
        }
    }
}


function winOpen(urls,winName,width,height) {
	window.open(urls,winName,"toolbar=no,menubar=no,scrollbars=no,left=0,top=0,resizable=no,width="+width+",height="+height+",status=no,location=no");
}




//菜单选择
//自动判断并选择当前页面所在菜单，并修正显示背景
function focusCurrentMenu(tagid){
	var isHereNum,urlPre,pagePath,menuPath,pagePathPre,menuPathPre;
	var obj=document.getElementById(tagid);
	isHereNum=-1;
	urlPre="http://"+location.host+_Env_InstallPath;
	if (location.href.indexOf(urlPre)!=-1){
		pagePathPre=location.href.substr(urlPre.length);
		pagePathPre=pagePathPre.substring(0,pagePathPre.indexOf("/"));	//取第一个目录名
		if(obj){
			var liObjs=obj.getElementsByTagName("LI");
			//判断当前页面URL是否与菜单项URL完全相同，相同则选择
			for (var i=0;i<liObjs.length ;i++ ){
				if(liObjs[i].parentNode==obj){
					menuPath=liObjs[i].getElementsByTagName("A")[0].href;
					if(location.href==menuPath)
						isHereNum=i; 
					else
						liObjs[i].className="";
				}
			}
			if(isHereNum==-1){
				//判断当前页面目录是否与菜单项目录相同，相同则选择
				for (var i=0;i<liObjs.length ;i++ ){
					if(liObjs[i].parentNode==obj){
						menuPath=liObjs[i].getElementsByTagName("A")[0].href;
						if (menuPath.indexOf(urlPre)==-1) continue;
						menuPathPre=menuPath.substr(urlPre.length);
						menuPathPre=menuPathPre.substring(0,menuPathPre.indexOf("/"));
						if(menuPathPre==pagePathPre)
							isHereNum=i;
						else
							liObjs[i].className="";
					}
				}
			}
			if(isHereNum==-1)
				isHereNum=0;
			if(isHereNum>=0){
				liObjs[isHereNum].className="isHere";
				window.__CurrentMenuItem=liObjs[isHereNum].childNodes[0];	//记录当前选中菜单项
				window.__HoverMenuItem=null;
			}
			//if(liObjs[isHereNum-1]) liObjs[isHereNum-1].className="isHerePrev";
		}	
	}
}
function focusCurrentMenu2(tagid){
	var isHereNum,urlPre,pagePath,menuPath,pagePathPre,menuPathPre;
	var obj=document.getElementById(tagid);
	isHereNum=-1;
	urlPre="http://"+location.host+"/";
	if (location.href.indexOf(urlPre)!=-1){
		pagePathPre=location.href.substr(urlPre.length);
		pagePathPre=pagePathPre.substring(0,pagePathPre.indexOf("/"));	//取第一个目录名
		if(obj){
			var liObjs=obj.getElementsByTagName("LI");
			//判断当前页面URL是否与菜单项URL完全相同，相同则选择
			for (var i=0;i<liObjs.length ;i++ ){
				menuPath=liObjs[i].getElementsByTagName("A")[0].href;
				if(location.href==menuPath)
					isHereNum=i; 
				else
					liObjs[i].className="close";
			}
			if(isHereNum>=0){
				liObjs[isHereNum].className="open";
				if(liObjs[isHereNum].parentNode.parentNode.tagName=="LI"){
					liObjs[isHereNum].parentNode.parentNode.className="open";
				}
			}else{
				focusCurrentMenu3(tagid);
			}
		}	
	}
}
function focusCurrentMenu3(tagid){
	var isHereNum,urlPre,pagePath,menuPath,pagePathPre,menuPathPre;
	var obj=document.getElementById(tagid);
	isHereNum=-1;
	urlPre="http://"+location.host+"/";
	if (location.href.indexOf(urlPre)!=-1){
		pagePathPre=location.href.substr(urlPre.length);
		pagePathPre=pagePathPre.substring(0,pagePathPre.lastIndexOf("/"));	//取第一个目录名
		if(obj){
			var liObjs=obj.getElementsByTagName("LI");
			//判断当前页面目录是否与菜单项目录相同，相同则选择
			for (var i=0;i<liObjs.length ;i++ ){
				menuPath=liObjs[i].getElementsByTagName("A")[0].href;
				if (menuPath.indexOf(urlPre)==-1) continue;
				menuPathPre=menuPath.substr(urlPre.length);
				menuPathPre=menuPathPre.substring(0,menuPathPre.lastIndexOf("/"));
				if(menuPathPre==pagePathPre)
					isHereNum=i;
				else
					liObjs[i].className="close";
			}
			if(isHereNum>=0)liObjs[isHereNum].className="open";
		}	
	}
}

//切换tab标签
function switchMenuTab(obj,subObjPre){
	if(!obj)return;
	obj.blur();
	var tabTleObjs=obj.parentNode.parentNode.getElementsByTagName("LI");
	for (var i=0;i<tabTleObjs.length;i++) {
		if(tabTleObjs[i]!=__CurrentMenuItem.parentNode && tabTleObjs[i]!=__CurrentMenuItem.parentNode.previousSibling)tabTleObjs[i].className="";
		if(tabTleObjs[i].parentNode!=obj.parentNode.parentNode) continue;
		if(tabTleObjs[i]==obj.parentNode){
			if(document.getElementById(subObjPre+"_"+i)) document.getElementById(subObjPre+"_"+i).style.display="block";
		}else{
			if(document.getElementById(subObjPre+"_"+i)) document.getElementById(subObjPre+"_"+i).style.display="none";
		}
	}
	if(obj!=__CurrentMenuItem){
		if(__HoverMenuItem==null)
			__CurrentMenuItem.parentNode.className="";
		else
			__HoverMenuItem.parentNode.className="";
		obj.parentNode.className="isHere";
		if(obj.parentNode.previousSibling)obj.parentNode.previousSibling.className="isHerePrev";
		window.__HoverMenuItem=obj;
	}else if(__HoverMenuItem!=null && __HoverMenuItem!=__CurrentMenuItem){
		__HoverMenuItem.parentNode.className="";
		__HoverMenuItem=null;
		__CurrentMenuItem.parentNode.className="isHere";
		if(__CurrentMenuItem.parentNode.previousSibling)__CurrentMenuItem.parentNode.previousSibling.className="isHerePrev";
	}
}

//切换tab标签
function switchTab(obj,subObjPre){
	if(!obj)return;
	obj.blur();
	var tabTleObjs=obj.parentNode.parentNode.getElementsByTagName("LI");
	for (var i=0;i<tabTleObjs.length;i++) {
		if(tabTleObjs[i]==obj.parentNode){
			tabTleObjs[i].className="isHere";
			if(document.getElementById(subObjPre+"_"+i)) document.getElementById(subObjPre+"_"+i).style.display="block";
		}else{
			tabTleObjs[i].className="";
			if(document.getElementById(subObjPre+"_"+i)) document.getElementById(subObjPre+"_"+i).style.display="none";
		}
	}
}
//切换tab标签2
function switchTabShow(obj){
	if(!obj)return;
	obj.blur();
	var tobjs=obj.parentNode.parentNode.parentNode.getElementsByTagName("LI");
	for (var i=0;i<tobjs.length;i++) {
		if(tobjs[i]==obj.parentNode.parentNode){
			tobjs[i].className="isHere";
		}else{
			tobjs[i].className="";
		}
	}
}

//阻此当事件对象向上冒泡
function stopBubble(e){
	var e=e?e:window.event;
	if(window.event){
		e.cancelBubble=true;
	}else{
		e.stopPropagation();
	}
}

//顶部菜单显示
function TopMenuShow(objname) {
	var mainObj=document.getElementById(objname);
	if(!mainObj) return;

	var MenuObj = mainObj.getElementsByTagName("li");
	for (var i=0; i<MenuObj.length; i++) {
		if(MenuObj[i].parentNode!=mainObj) continue;	//如是子菜单的LI则跳过
		MenuObj[i].onmouseover=function() {
			this.className+=(this.className.length>0? " ": "") + "menuHover";
			//修正当前LI项显示
			var mainObj=document.getElementById(objname);
			if(!mainObj) return;
			if(mainObj!=__CurrentMenuItem){
				if(__HoverMenuItem==null)
					__CurrentMenuItem.parentNode.className="";
				else
					__HoverMenuItem.parentNode.className="";
				mainObj.parentNode.className="isHere";
				window.__HoverMenuItem=mainObj;
			}else if(__HoverMenuItem!=null && __HoverMenuItem!=__CurrentMenuItem){
				__HoverMenuItem.parentNode.className="";
				__HoverMenuItem=null;
				__CurrentMenuItem.parentNode.className="isHere";
			}
			//
		}
		MenuObj[i].onMouseDown=function() {
			this.className+=(this.className.length>0? " ": "") + "menuHover";
		}
		MenuObj[i].onMouseUp=function() {
			this.className+=(this.className.length>0? " ": "") + "menuHover";
		}
		MenuObj[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp("( ?|^)menuHover\\b"), "");
		}
	}
}
//**


//**
function checkSearchForm(frmobj) {	
	if(!frmobj)return false;
	if(frmobj.keyword.value.replace(/\s/g,"")==""){
		alert("请输入查询关键字!");
		frmobj.keyword.focus();
		return false;
	}
	return true;
}

//
function checkCommentForm(frmobj){
	if(!frmobj)return false;
	if(frmobj.contact.value.replace(/\s/g,"")==""){
		if(!frmobj.isAnonymous.checked){
			alert("Please enter your name");
			frmobj.contact.focus();return false;
		}
	}
	if(frmobj.content.value.replace(/\s/g,"")==""){
		alert("Please enter comments");
		frmobj.content.focus();return false;
	}
	if(frmobj.checkCode.value.replace(/\s/g,"")==""){
		alert("Please enter the validate code");
		frmobj.checkCode.focus();return false;
	}
	return true;
}


//Cookie操作函数
//获得Cookie解码后的值
function GetCookieVal(offset)
{
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
//设定Cookie值
function SetCookie(name, value)
{
	var expdate = new Date();
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	if(expires!=null) expdate.setTime(expdate.getTime() + ( expires * 1000 ));
	document.cookie = name + "=" + escape (value) +((expires == null) ? "" : ("; expires="+ expdate.toGMTString()))
	+((path == null) ? "" : ("; path=" + path)) +((domain == null) ? "" : ("; domain=" + domain))
	+((secure == true) ? "; secure" : "");
}
//获得Cookie的原始值
function GetCookie(name)
{
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen)
	{
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		return GetCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}
//end


//Form 操作函数
function inputFocus(obj){
	if(obj)
		obj.parentNode.parentNode.style.backgroundColor='#F5F7FF';
}
function inputBlur(obj){
	if(obj)
		obj.parentNode.parentNode.style.backgroundColor='white';
}



///*选择checkbox函数*/
//objs - checkbox类型的input集合
//flag - 动作标志 1为全选 -1为反选
function selectAll(objs,flag){
	if (objs){
		if (objs.length){
			for (var i=0;i<objs.length ;i++ ){
				if (flag==1)
					objs[i].checked=true;
				if (flag==-1)
					objs[i].checked=!objs[i].checked;
			}
		}else{
			if (flag==1)
				objs.checked=true;
			if (flag==-1)
				objs.checked=!objs.checked;
		}
	}
}

function SelectInputAll(thisObj,parentObj,checkInputName)
{
	if(thisObj && parentObj)
	{
		var chkObjs=parentObj.getElementsByTagName("INPUT");
		for (var i=0;i<chkObjs.length;i++)
		{
			if (chkObjs[i].name == checkInputName)
				chkObjs[i].checked = thisObj.checked;
		}
	}
}

//是否有选择input项目
function isInputSelected(obj,checkInputName){
	if(!obj) return false;
	var chkObjs=obj.getElementsByTagName("INPUT");
	for (var i=0;i<chkObjs.length;i++){
		if(chkObjs[i].name==checkInputName && chkObjs[i].checked) return true;
	}
	return false;
}

//end





//改变字体大小
function ChangeFontSize(objId,size)
{
	var obj=document.getElementById(objId);
	if (obj){
		obj.style.fontSize=size+"px";
	}
	var tagArr="DIV,P,SPAN,TD,LI,DD,PRE".split(",")
	for (var t=0;t<tagArr.length ;t++ )
	{
		var objs=obj.getElementsByTagName(tagArr[t]);
		for (var i=0;i<objs.length ;i++ )
		{
			objs[i].style.fontSize=size+"px";
		}
	}
}


//DOM兼容的showModalDialog对话框
function __ShowModalDialog(url,win,width,height){
	if (url=="" || url=="#") return false;
	if (document.all){	//IE
		window.showModalDialog(url,win,"dialogWidth="+width+"px;dialogHeight="+height+"px;scroll=yes;unadorned=no;dialogHide=yes;resizable=no;status=no;help=no;");
	}else{
		var modalWin=window.open(url,win,"width="+width+",height="+height+",menubar=no,resizable=no,toolbar=no,location=no,scrollbars=no,status=no,modal=yes");
		modalWin.moveTo((document.body.clientWidth-width)/2,(document.body.clientHeight-height)/2+100);
	}
}




//滚动函数类
function StandardScroll(root,child,cloneChild,direction,speed){
	var rootObj;
	var upT,downT,leftT,rightT;

	rootObj=document.getElementById(root);
	run=function(){
		if (direction=="up"){
			if(rootObj.parentNode.scrollTop<rootObj.offsetHeight/2)
				rootObj.parentNode.scrollTop++;
			else
				rootObj.parentNode.scrollTop=0;
		}
		if (direction=="down"){
			if(rootObj.parentNode.scrollTop>rootObj.offsetHeight/2)
				rootObj.parentNode.scrollTop--;
			else
				rootObj.parentNode.scrollTop=rootObj.offsetHeight;
		}
		if (direction=="left"){
			if(rootObj.parentNode.scrollLeft<rootObj.offsetWidth/2)
				rootObj.parentNode.scrollLeft++;
			else
				rootObj.parentNode.scrollLeft=0;
		}
		if (direction=="right"){
			if(rootObj.parentNode.scrollLeft>rootObj.offsetWidth/2)
				rootObj.parentNode.scrollLeft--;
			else
				rootObj.parentNode.scrollLeft=rootObj.offsetWidth;
		}
	}
	stop=function(){
		clearInterval(t);
	}

	start=function(){
		t=setInterval(run,speed);
	}
	
	this.init=function(){
		if (rootObj){
			document.getElementById(cloneChild).innerHTML=document.getElementById(child).innerHTML;
			start();
			if (document.all){
				rootObj.attachEvent("onmouseover",stop);
				rootObj.attachEvent("onmouseout",start);
			}else{
				rootObj.addEventListener("mouseover",stop,false);
				rootObj.addEventListener("mouseout",start,false);
			}
		}
	}
}



//JS版修正xmlhttp返回乱码，For IE
function gb2utf8(data){
	var glbEncode = [];
	gb2utf8_data = data;
	execScript("gb2utf8_data = MidB(gb2utf8_data, 1)", "VBScript");
	var t=escape(gb2utf8_data).replace(/%u/g,"").replace(/(.{2})(.{2})/g,"%$2%$1").replace(/%([A-Z].)%(.{2})/g,"@$1$2");
	t=t.split("@");
	var i=0,j=t.length,k;
	while(++i<j) {
		k=t[i].substring(0,4);
		if(!glbEncode[k]) {
			gb2utf8_char = eval("0x"+k);
			execScript("gb2utf8_char = Chr(gb2utf8_char)", "VBScript");
			glbEncode[k]=escape(gb2utf8_char).substring(1,6);
		}
		t[i]=glbEncode[k]+t[i].substring(4);
	}
	gb2utf8_data = gb2utf8_char = null;
	return unescape(t.join("%"));
}





function CheckLoginForm()
{
	if(document.loginForm.username.value=="")
	{
		alert("请输入您的EMAIL帐号地址！");
		document.loginForm.username.focus();
		return false;
	}
	if(document.loginForm.password.value == "")
	{
		alert("请输入帐号密码！");
		document.loginForm.password.focus();
		return false;
	}
	if(document.loginForm.checkCode.value == "")
	{
		alert("请输入验证码！");
		document.loginForm.checkCode.focus();
		return false;
	}
	return true;
}



//统计点击
function countHits(url){
	this.CallBack=function(strs){
		if(strs.replace(/\s/g,"")!="")eval(strs);
	};
	this.WaitProc=function(){};
	__xmlhttp.GetRemoteData(url,this.CallBack,this.WaitProc);
}

function getRemoteData(url,obj){
	this.CallBack=function(strs){
		if(strs.replace(/\s/g,"")!=""){
			if(typeof(obj)=="object")
				obj.innerHTML=strs;
			else if(typeof(obj)=="function")
				obj(strs);
			else
				eval(strs);
		}
	};
	this.WaitProc=function(){};
	__xmlhttp.GetRemoteData(url,this.CallBack,this.WaitProc);
}


//取URL参数值
function getUrlParam(pname){
	var arr=new Array;
	if(location.search=="")return null;
	var params=location.search.substr(1);
	if(location.search.indexOf(pname+"=")==-1)return null;
	var re = new RegExp("(&|^)[^&]*(" + pname + ")\=([^&]*)","ig");
	while(re.exec(params)){
		arr.push(RegExp.$3);
	}
	if(arr.length==0)
		return null;
	else if(arr.length==1)
		return arr[0];
	else if(arr.length>1)
		return arr;
}


function pageprint(){
	var content="";
	if(!document.getElementById("printcontent")) return;
	content=document.getElementById("printcontent").innerHTML;
	var newwin=window.open(_Env_InstallPath+"print.htm","printWindow","");
	alert("Please click on the \"Print\" button to print the contents of the page");
	newwin.document.title=document.title;
	if(ie){
		newwin.document.body.innerHTML="<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT><div class='printbar'><a href='javascript:window.print()'>[Print]</a>&nbsp;<a href='#' onclick='document.getElementById(\"WebBrowser\").ExecWB(7,1);return false;'>[Print Preview]</a>&nbsp;<a href='#' onclick='document.getElementById(\"WebBrowser\").ExecWB(8,1);return false;'>[Setting]</a></div>"+content;
	}else{
		newwin.document.body.innerHTML="<div class='printbar'><a href='javascript:window.print()'>[CLICK TO PRINT]</a></div>"+content;
	}
	newwin.document.body.style.background="none";
	if(newwin.document.getElementById("footer")){
		newwin.document.getElementById("footer").innerHTML="";
	}
	newwin.window.focus();
}

function Order_RecalcTotal(obj,guid){
	var amount=obj.value;
	if (amount=="") return;
	if (/[^0-9]/gi.test(amount)==true){
		alert("Can only enter numbers");
		obj.select();
		obj.focus();
	}
	if(document.getElementById("price_"+guid)){
		document.getElementById("total_"+guid).innerHTML="$ "+eval(document.getElementById("price_"+guid).value)*eval(amount);
	}
}

/*菜单树事件处理*/
function menuTree(id){
	var obj=getObj(id);
	var imgs=obj.getElementsByTagName("IMG");
	for (i=0; i<imgs.length; i++){
		if (imgs[i].className=="click"){
			if (ie){
				imgs[i].attachEvent("onclick",menuClick);	//add event for ie
			}else{
				imgs[i].addEventListener("click",menuClick,false);	//add event for w3c
			}
		}
	}
}

function menuClick(evt){
    evt = (evt) ? evt : ((window.event) ? window.event : "");
    if (evt) {
        var elem = getTargetElement(evt);
        if (elem) {
            elem.parentNode.className=elem.parentNode.className=="open"?"close":"open";		//exchange node's class name
        }
    }
}
/**/

function AlbumShow(thumbObj,imgId,imgSrc){
	var imgObj=document.getElementById(imgId);
	if(!imgObj || imgSrc=="")return false;
	imgObj.src=imgSrc;
	imgObj.parentNode.href=imgSrc;
	thumbObj.parentNode.blur();
}

function CheckProductQuantity(quantityObj,minNumber){
	if (!quantityObj)return false;
	if(quantityObj.value=="" || /[^0-9]/ig.test(quantityObj.value)){
		alert("Input values must be numerical");
		quantityObj.select();
		return false;
	}else if(quantityObj.value<minNumber){
		alert("Order Quantity must be greater than "+minNumber);
		quantityObj.value=minNumber;
		quantityObj.select();
		return false;
	}
	return true;
}

function showTips(obj,htmlcode){
//	if(window.mouseOverFlag==true) return;
	if(typeof(window.mouseOverFlag)=="undefined")
		window.mouseOverFlag=true;
	var event = window.event || arguments.callee.caller.arguments[0];
	if(!obj) return;
	if($("#showTipsBox"))
		$("#showTipsBox").remove();
	var tipobj=document.createElement("DIV");
	tipobj.id="showTipsBox";
	tipobj.innerHTML=htmlcode;
	tipobj.style.position="absolute";
//	tipobj.style.left=event.clientX+5+"px";
//	tipobj.style.top=event.clientY+5+"px";
	tipobj.style.left=$(obj).offset().left+5+"px";
	tipobj.style.top=$(obj).offset().top+5+"px";
	tipobj.onmouseout=removeTips;
	tipobj.onmouseover=function(){window.mouseOverFlag=true};
	document.body.appendChild(tipobj);
}

function removeTips(){
	window.mouseOverFlag=false;
	if($("#showTipsBox"))
		$("#showTipsBox").remove();
}


function getDocumentObj(){return (document.documentElement.clientWidth>0)?document.documentElement:document.body;}

//取对象绝对top值，兼容IE、FF(有细微差别)
function getOffsetTop(obj) {
	var n = obj.offsetTop;
	while (obj = obj.offsetParent) n+= obj.offsetTop;
	return n;
}
//取对象绝对left值，兼容IE、FF
function getOffsetLeft(obj) {
	var n = obj.offsetLeft;
	while (obj = obj.offsetParent) n+= obj.offsetLeft;
	return n;
}

//取菜单对象Y值，兼容IE、FF
function getClientY(obj,evt) {
	var dobj=getDocumentObj();
	var y=evt.clientY+dobj.scrollTop;
	//if(y>dobj.clientHeight) y=dobj.clientHeight-16;
	return y;
}
//取菜单对象X值，兼容IE、FF
function getClientX(obj,evt) {
	var dobj=getDocumentObj();
	var x=evt.clientX+dobj.scrollLeft;
	//if(x>dobj.clientWidth) x=dobj.clientWidth-16;
	return x;
}
//显示浮动菜单
function float_Show(obj,htmlcode){
	var theEvent = window.event || arguments.callee.caller.arguments[0];
	var eventObj=getTargetElement(theEvent);
	strs="";
	window.showTipsBoxOverFlag=false;	//是否选择了浮动菜单全局标志
	//window.showTipsBoxT=null;
	theEvent.cancelBubble = true;
	if (document.getElementById("showTipsBox")) document.body.removeChild(document.getElementById("showTipsBox"));
	//弹出菜单，但未将鼠标覆盖至菜单上即移动到它处时，3秒后自动消失菜单
	if(window.showTipsBoxT)window.clearTimeout(window.showTipsBoxT);
	window.showTipsBoxT=window.setTimeout("if(showTipsBoxOverFlag==false){showTipsBoxOverFlag=true;var obj=document.getElementById('showTipsBox');if(obj)document.body.removeChild(obj);}",3000);
	//显示菜单
	var showTipsBox=document.createElement("DIV");
	showTipsBox.id="showTipsBox";
	showTipsBox.style.display="none";
	showTipsBox.innerHTML=htmlcode;
	document.body.appendChild(showTipsBox);

	showTipsBox.style.position="absolute";
	showTipsBox.style.left=getClientX(showTipsBox,theEvent)+5+"px";
	showTipsBox.style.top=getClientY(showTipsBox,theEvent)+5+"px";
	showTipsBox.onmouseout=float_Hidden;
	showTipsBox.onmouseover=function(){showTipsBoxOverFlag=true};
	showTipsBox.style.display="";
}
//移除浮动菜单
function float_Hidden(theEvent){
	var x,y;
	if (!theEvent) theEvent=window.event;
	var floatObj=document.getElementById("showTipsBox");
	if (floatObj && showTipsBoxOverFlag==true)
	{
		x=theEvent.clientX+document.documentElement.scrollLeft;
		y=theEvent.clientY+document.documentElement.scrollTop;
		//判断当前鼠标位置是否在对象的坐标框内，不在则移除菜单
		if (x<getOffsetLeft(floatObj) || x>=(getOffsetLeft(floatObj)+floatObj.offsetWidth) || y<getOffsetTop(floatObj) || y>=(getOffsetTop(floatObj)+floatObj.offsetHeight))
			document.body.removeChild(floatObj);
		showTipsBoxOverFlag=false;
	}
}
/**/

