/*-------------------------------------------------------------
版权信息：
(1)原始版本:2003
(2)原版作者:GE(中国)
(3)改写作者:蓝晓华
(4)改写时间:2003.9
(5)所属公司:新动力互动媒体/中国玩具礼品网
(6)使用范围:通用/docc目录下的文件
*****请尊重作者劳动成果，保留此版权信息！*****
-------------------------------------------------------------*/
/*-------------------------------------------------------------
函数说明：
(1)divopen函数用于打开当前所在的导航菜单
(2)divchange函数在鼠标事件时调用，用于菜单的弹出
(3)comparehref函数用于显示不同的色块
-------------------------------------------------------------*/
/*-------------------------------------------------------------
使用说明：
(1)请将归类文件存放在Arrayfilename数组中
(2)colorvalue中可存放色值
(3)当页面重载时需要自动弹出菜单时，请配合divopen.js一同使用
-------------------------------------------------------------*/
var loc=stringA=location.href.toLowerCase();
var strlocation="/";
var len=strlocation.length;
var tempfilename,temp,content,pic1,pic2;
var systemhref,webhref;


var Arrayfilename=new Array('i=1','i=2','i=3','i=4','r_infocenter');
var colorvalue;
var divopen;
colorvalue="#cccCFF";

function filename(stringA){
var pos=stringA.indexOf(strlocation)
if (pos>=0){
	stringA=stringA.substring(pos+len,stringA.length);
	while (stringA.indexOf("/")>=0){
		pos=stringA.indexOf("/")
		stringA=stringA.substring(pos+1,stringA.length);
	}
}
return stringA
}

function filefoldername(stringA){
var pos=stringA.indexOf(strlocation)
if (pos>=0){
	var pos1,pos2
	pos1 = stringA.lastIndexOf("/")
	stringA=stringA.substring(pos+len,pos1);
	pos2 = stringA.lastIndexOf("/")
	stringA=stringA.substring(pos2+1,pos1)
}
return stringA
}

systemhref=filename(stringA)
systemfolderhref=filefoldername(stringA)

function comparehref(webhref,colorvalue1){
	temp=filename(webhref)
	var href00;
	href00 = systemhref.indexOf(temp)
	if (href00 != -1){
		content=""
	}
	else{
		content="<table width='7' height='19' bgcolor=" + colorvalue + " border='0' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>"
	}
	return content
/*
	temp=filename(webhref)
	if (temp==systemhref){
		content=""
	}
	else{
		content="<table width='7' height='19' bgcolor=" + colorvalue + " border='0' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>"
	}
	return content
*/
}

function comparefolderhref(webhref,pic1,pic2){
	if (webhref==systemfolderhref){
		content="<img name=" + pic2 + " src='" + pic2 + "' border=0>"
	}
	else{
		content='<a href=../' + webhref + '/ onMouseOut=MM_swapImgRestore() onMouseOver=MM_swapImage("'+pic1+'","","'+pic2+'",1)><img name='+pic1+' src='+pic1+' border=0></a>'
	}
	return content
}

function divopen(){
	if (Arrayfilename[4]==systemfolderhref){
		divopen=0;
		divchange(0);
	}

}

function divchange(num){
	var divtemp,i;
	for(i=0;i<=0;i++){
		if (i==num){
			divtemp = "div" + i
			if (eval(divtemp).style.display=="none")
				eval(divtemp).style.display=""
			else
				if (divopen!=i)
					eval(divtemp).style.display="none"
		}
		else{
			if (divopen!=i){
				divtemp = "div" + i
				eval(divtemp).style.display="none"
			}
		}
	}
}
