﻿function ChangeFuwushang(index){
   for(i=0;i<7;i++) {
		document.getElementById("ul_Fuwushang" + i ).style.display = "none";
   }
   document.getElementById("ul_Fuwushang" + index).style.display = "block";
}
function ChangeNews(index){
    for(i=0;i<2;i++) {
		document.getElementById("ul_YunjiaNews" + i).style.display = "none";
    }
    document.getElementById("ul_YunjiaNews" + index).style.display = "block";
}
function showOut(){
	var oOutList = document.getElementById("DV_OUT_LIST");
	var oInList = document.getElementById("DV_IN_LIST");
	var oLocalList = document.getElementById("DV_LOCAL_LIST");
	var oIFrame = document.getElementById("tabnav").src= "../../e/YunjiaData/YunjiaData_index.php?id=out&type=1";
	var oInOutBg = document.getElementById("in-out-bg");
	var isIE = !-[1,];
	if(isIE){
		oInOutBg.style.background = "url('skin/default/images/in-out-bg-out.gif') no-repeat top -2px";
	}else{
		oInOutBg.style.background = "url('skin/default/images/in-out-bg-out.gif') no-repeat top left";
	}
	oOutList.style.display = "block";
	oInList.style.display = "none";
	oLocalList.style.display = "none";
}
function showIn(){
	var oOutList = document.getElementById("DV_OUT_LIST");
	var oInList = document.getElementById("DV_IN_LIST");
	var oLocalList = document.getElementById("DV_LOCAL_LIST");
	var oIFrame = document.getElementById("tabnav").src= "../../e/YunjiaData/YunjiaData_index.php?id=in&type=2";
	var oInOutBg = document.getElementById("in-out-bg");
	var isIE = !-[1,];
	if(isIE){
		oInOutBg.style.background = "url('skin/default/images/in-out-bg-in.gif') no-repeat top -2px";
	}else{
		oInOutBg.style.background = "url('skin/default/images/in-out-bg-in.gif') no-repeat top left";
	}
	oOutList.style.display = "none";
	oInList.style.display = "block";
	oLocalList.style.display = "none";
}
function showLocal(){
	var oOutList = document.getElementById("DV_OUT_LIST");
	var oInList = document.getElementById("DV_IN_LIST");
	var oLocalList = document.getElementById("DV_LOCAL_LIST");
	var oIFrame = document.getElementById("tabnav").src= "../../e/YunjiaData/YunjiaData_index.php?id=local&type=3";
	var oInOutBg = document.getElementById("in-out-bg");
	var isIE = !-[1,];
	if(isIE){
		oInOutBg.style.background = "url('skin/default/images/in-out-bg-local.gif') no-repeat top -2px";
	}else{
		oInOutBg.style.background = "url('skin/default/images/in-out-bg-local.gif') no-repeat top left";
	}
	oOutList.style.display = "none";
	oInList.style.display = "none";
	oLocalList.style.display = "block";
}
function addBookmark(title) {
    var url=parent.location.href;
    if (window.sidebar) {
           window.sidebar.addPanel(title, url,"");
    } else if( document.all ) {
    window.external.AddFavorite( url, title);
    } else if( window.opera && window.print ) {
    return true;
    }
}

function loginClearText(object){
	object.value="";
}
function loginAddText(object){
	if(!object.value)
		object.value = "请输入用户名\\邮箱\\手机";
}
function loginAddText2(object){
	if(!object.value)
		object.value = "ID\\Mail is available";
}

/*跟踪页滑动门*/
function showchuan(){
	var chuan = document.getElementById("contentone");
	var hangKong = document.getElementById("contenttwo");
	var kuaiDi = document.getElementById("contentthree");
	chuan.style.display = "block";
	hangKong.style.display = "none";
	kuaiDi.style.display = "none";
	}
function showkong(){
	var chuan = document.getElementById("contentone");
	var hangKong = document.getElementById("contenttwo");
	var kuaiDi = document.getElementById("contentthree");
	hangKong.style.display = "block";
	chuan.style.display = "none";
	kuaiDi.style.display = "none";
	}
function showkuaidi(){
	var chuan = document.getElementById("contentone");
	var hangKong = document.getElementById("contenttwo");
	var kuaiDi = document.getElementById("contentthree");
	kuaiDi.style.display = "block";
	chuan.style.display = "none";
	hangKong.style.display = "none";
	}
function showhaiyun(){
	var haiYun = document.getElementById("contenthaiyun");
	var hangKongGongSi = document.getElementById("contenthangkong");
	haiYun.style.display = "block";
	hangKongGongSi.style.display = "none";
	}
function showhangkong(){
	var haiYun = document.getElementById("contenthaiyun");
	var hangKongGongSi = document.getElementById("contenthangkong");
	haiYun.style.display = "none";
	hangKongGongSi.style.display = "block";
	}
/*时钟*/
function tick() {
	var hours, minutes, seconds, xfile;
	var intHours, intMinutes, intSeconds;
	var today, theday;
	today = new Date();
	function initArray() {
		this.length = initArray.arguments.length
		for ( var i = 0; i < this.length; i++)
			this[i + 1] = initArray.arguments[i]
	}
	var d = new initArray("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
	theday = today.getFullYear() + "年" + [ today.getMonth() + 1 ] + "月"
			+ today.getDate() + "日 " + d[today.getDay() + 1];
	intHours = today.getHours();
	intMinutes = today.getMinutes();
	intSeconds = today.getSeconds();
	if (intHours == 0) {
		hours = "12:";
		xfile = "午夜";
	} else if (intHours < 12) {
		hours = intHours + ":";
		xfile = "上午";
	} else if (intHours == 12) {
		hours = "12:";
		xfile = "正午";
	} else {
		intHours = intHours;
		hours = intHours + ":";
		xfile = "下午";
	}
	if (intMinutes < 10) {
		minutes = "0" + intMinutes + ":";
	} else {
		minutes = intMinutes + ":";
	}
	if (intSeconds < 10) {
		seconds = "0" + intSeconds + " ";
	} else {
		seconds = intSeconds + " ";
	}
	timeString = theday + " " + xfile + " " + hours + minutes + seconds;
	var oClock = document.getElementById("Clock");
	if(oClock)oClock.innerHTML = timeString;
	window.setTimeout("tick();", 100);
}
window.onload = tick;

//CharMode函数
//source:www.web2bar.cn  
//测试某个字符是属于哪一类.  
function CharMode(iN){  
	if (iN>=48 && iN <=57) //数字  
		return 1;  
	if (iN>=65 && iN <=90) //大写字母  
		return 2;  
	if (iN>=97 && iN <=122) //小写  
		return 4;  
	else  
		return 8; //特殊字符  
}  
//bitTotal函数  
//计算出当前密码当中一共有多少种模式  
function bitTotal(num){  
	modes=0;  
	for (i=0;i<4;i++){  
		if (num & 1) modes++;  
			num>>>=1;  
	}  
	return modes;  
}  
//checkStrong函数  
//返回密码的强度级别  
function checkStrong(sPW){  
	if (sPW.length<=4)  
		return 0; //密码太短  
	Modes=0;  
	for (i=0;i<sPW.length;i++){  
		//测试每一个字符的类别并统计一共有多少种模式.  
		Modes|=CharMode(sPW.charCodeAt(i));  
	}  
	return bitTotal(Modes);  
}  
//pwStrength函数  
//当用户放开键盘或密码输入框失去焦点时,根据不同的级别显示不同的颜色  
function pwStrength(pwd){
	O_color="transparent url(../../../skin/default/images/eeeeee.gif) repeat-x scroll 0 0";  
	L_color="transparent url(../../../skin/default/images/ff0000.gif) repeat-x scroll 0 0";  
	M_color="transparent url(../../../skin/default/images/ff9900.gif) repeat-x scroll 0 0";  
	H_color="transparent url(../../../skin/default/images/33cc00.gif) repeat-x scroll 0 0";  
	if (pwd==null||pwd==''){  
		Lcolor=Mcolor=Hcolor=O_color;  
	}  
	else{  
		S_level=checkStrong(pwd);  
		switch(S_level) {  
			case 0:  
				Lcolor=Mcolor=Hcolor=O_color;  
			case 1:  
				Lcolor=L_color;  
				Mcolor=Hcolor=O_color;	  
				break;  
			case 2:  
				Lcolor=Mcolor=M_color;  
				Hcolor=O_color;  
				break;  
			default:  
				Lcolor=Mcolor=Hcolor=H_color;  
		}  
	}
	document.getElementById("strength_L").style.background=Lcolor;  
	document.getElementById("strength_M").style.background=Mcolor;  
	document.getElementById("strength_H").style.background=Hcolor;  
	return;  
}  

function repasswdInfo(){
	var passwd = document.getElementById("password1").value;
	var repasswd = document.getElementById("repassword").value;
	if(repasswd == "")
	{
		document.getElementById("repasswdinfo").innerHTML = "<font style=\"color:#ff0000;\">请输入重复密码</font>";
	}
	else
	{
		if(passwd == repasswd){
			document.getElementById("repasswdinfo").innerHTML = "重复密码正确";
		}else{
			document.getElementById("repasswdinfo").innerHTML = "<font style=\"color:#ff0000;\">重复密码错误</font>";
		}
	}
}

function Texthidden(object,info){
	if(object.value == info)
	{
	object.value="";
	}
	object.select();
}

function Textshow(object,info){
	if(!object.value)
		object.value = info;
}

function fuwushow(leix){
	alert (leix);
	document.getElementById("fuwushow").src = "../../../e/fuwushow/fuwushow.php?leix=" + leix;
	/*document.getElementById("fuwuinfo").src = '../../../e/fuwushow/fuwuinfo.php?type=' + type;*/
}

function SubmitForms(){
	keyboard = document.getElementById("key").value;
	document.getElementById("fuwuinfo").src = "../../../e/fuwushow/fuwuinfo.php?keyboard=" + keyboard;
}


function pageadv(id){
	
	var hdid = parseInt(document.getElementById("adv_page_id").value);
	var pagenum = parseInt(document.getElementById("adv_page_num").value);
	
	if(id >= 0)
	{
		hdid  = hdid + 1;
	}
	else
	{
		hdid = hdid - 1;
	}
	
	document.getElementById("adv_page_id").value = hdid;
	
	checkpage(hdid);
	for(i = 0; i< pagenum; i++)
	{
		if((hdid - 1) == i ){
			document.getElementById("qm" + i).style.display = "block";
		}
		else
		{
			document.getElementById("qm" + i).style.display = "none";
		}
	}
}

function checkpage (hdid){
	var pagenum = document.getElementById("adv_page_num").value;
	if(pagenum == 1)
	{
		document.getElementById("advleft").style.display = "none";
		document.getElementById("advright").style.display = "none";
	}
	else
	{
		if(hdid == 1)
		{
			document.getElementById("advleft").style.display = "none";
			document.getElementById("advright").style.display = "block";
		}
		else if(hdid == pagenum){
			document.getElementById("advright").style.display = "none";
			document.getElementById("advleft").style.display = "block";
		}
		else
		{
			document.getElementById("advleft").style.display = "block";
			document.getElementById("advright").style.display = "block";
		}
	}
}

function ToOutIn(id)
{
	if(id==0)
	{
		document.getElementById("chart3").style.display = "none";
		document.getElementById("chart2").style.display = "block";
		
		document.getElementById("Trend2").style.display = "none";
		document.getElementById("Trend1").style.display = "block";
		
		document.getElementById("inoutword2").style.color = "#ffffff";
		document.getElementById("inoutword1").style.color = "#ff0000";
		
		
	}
	else
	{
		document.getElementById("chart2").style.display = "none";
		document.getElementById("chart3").style.display = "block";
		
		document.getElementById("Trend1").style.display = "none";
		document.getElementById("Trend2").style.display = "block";
		
		document.getElementById("inoutword1").style.color = "#ffffff";
		document.getElementById("inoutword2").style.color = "#ff0000";
	}
}



