
function $(id)
{
	return document.getElementById(id);
}

function doRotLayer()
{
	if (arguments[0].length < 2) return;
	$(arguments[0]).style.display = "block";
	for (var i = 1; i < arguments.length; i++)
	{
		$(arguments[i]).style.display = "none";
	}
}

function callFlash(url, w, h)
{
	
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"" + w + "\" height=\"" + h + "\">");
	document.write("<param name=\"movie\" value=\"" + url + "\">");
	document.write("<param name=\"quality\" value=\"high\">");
	document.write("<embed src=\"/images/top.swf\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + w + "\" height=\"" + h + "\">></embed>");
	document.write("</object>");
}

function isIE()
{
	var flag = true;
	if (!window.ActiveXObject)
	{
		flag = false;
	}
	return flag;
}

function sendMail(acc, domain, subject, body, cc, bcc)
{
	email_address = new Array("mailto:", acc, "@", domain, "?subject=", subject, "&body=", body, "&cc=", cc, "&bcc=", bcc);
	location.href(email_address.join(""));
}

function pop(url, w, h)
{
    var winWidth = w;
    var winHeight = h;
    var scrWidth = screen.width;
    var scrHeight = screen.height;
    var thisWidth = screen.width / 2 - winWidth /2;
    var thisHeight = screen.height / 2 - winHeight /2;
    window.open(url, "_blank", "width=" + winWidth + ", height=" + winHeight + ", top=" + thisHeight + ", left=" + thisWidth + ", toolbar=0, menubar=0, scrollbars=0, resizable=0, location=0, status=no");
}
function CheckUserName(namet){
	var lent=judgeString(namet);
	if(lent < 3 || lent > 16)
		return false;
	else
		return true;
}
function judgeString(str){
 	var len = str.length;
	var tt=0;
    for(var i=0;i<len;i++){
       var txt = str.charCodeAt(i);
       if(txt>128){     //ascii码大于128的是汉字
          tt= tt+2;
       } else{
          tt= tt+1;
       }
    }
 	return tt;
}
function checkservice(o){

		if(o.YourName.value==""){
			alert("对不起,请输入姓名!");
			o.YourName.focus();
			return false;
		}

		if(!CheckUserName(o.YourName.value)){
			alert("对不起,姓名长度必须是3到6位!");
			o.YourName.focus();
			return false;
		}
		if(o.Title.value==""){
			alert("对不起,请输入标题!");
			o.Title.focus();
			return false;
		}
		
	
	if(o.Title.value.length>50){
		alert("对不起,标题不得大于50字!");
		o.Title.select();
		return false;
	}
	if(o.lynr.value==""){
			alert("对不起,请输入留言内容!");
			o.lynr.focus();
			return false;
		}
		
	
	if(o.lynr.value.length>1000){
		alert("对不起,留言内容不得大于1000字!");
		o.lynr.select();
		return false;
	}
	
	return true;
}


function catalog(no){
		if (arguments[0].length < 2) return;
		var obj1 = document.getElementById('menu1');
		var obj2 = document.getElementById('menu2');
		var obj3 = document.getElementById('menu3');
		var obj4 = document.getElementById('menu4');
		var obj5 = document.getElementById('menu5');
		var obj6 = document.getElementById('menu6');
		var obj7 = document.getElementById('menu7');
		var obj8 = document.getElementById('menu8');
		if(no == 1){
			
			obj1.style.display = "block";
			obj2.style.display = "none";
			obj3.style.display = "none"; 
			obj4.style.display = "none";
			obj5.style.display = "none";
			obj6.style.display = "none";
			obj7.style.display = "none";
			obj8.style.display = "none";
		}
		else if(no == 2){
			
			
			obj1.style.display = "none";
			obj2.style.display = "block";
			obj3.style.display = "none"; 
			obj4.style.display = "none";
			obj5.style.display = "none";
			obj6.style.display = "none";
			obj7.style.display = "none";
			obj8.style.display = "none";
		}
		else if(no == 3){		
			
			obj1.style.display = "none";
			obj2.style.display = "none";
			obj3.style.display = "block"; 
			obj4.style.display = "none";
			obj5.style.display = "none";
			obj6.style.display = "none";
			obj7.style.display = "none";
			obj8.style.display = "none";
		}
		else if(no == 4){
			
			obj1.style.display = "none";
			obj2.style.display = "none";
			obj3.style.display = "none"; 
			obj4.style.display = "block";
			obj5.style.display = "none";
			obj6.style.display = "none";
			obj7.style.display = "none";
			obj8.style.display = "none";
		}else if(no == 5){
			
			obj1.style.display = "none";
			obj2.style.display = "none";
			obj3.style.display = "none"; 
			obj4.style.display = "none";
			obj5.style.display = "block";
			obj6.style.display = "none";
			obj7.style.display = "none";
			obj8.style.display = "none";
			
		}else if(no == 6){
			
			
			obj1.style.display = "none";
			obj2.style.display = "none";
			obj3.style.display = "none"; 
			obj4.style.display = "none";
			obj5.style.display = "none";
			obj6.style.display = "block";
			obj7.style.display = "none";
			obj8.style.display = "none";
		}else if(no == 7){
			
			obj1.style.display = "none";
			obj2.style.display = "none";
			obj3.style.display = "none"; 
			obj4.style.display = "none";
			obj5.style.display = "none";
			obj6.style.display = "none";
			obj7.style.display = "block";
			obj8.style.display = "none";
		}else if(no == 8){
			
			obj1.style.display = "none";
			obj2.style.display = "none";
			obj3.style.display = "none"; 
			obj4.style.display = "none";
			obj5.style.display = "none";
			obj6.style.display = "none";
			obj7.style.display = "none";
			obj8.style.display = "block";
		}
	}

