function IdYesNo(IdName){
	if(document.getElementById){
		return eval('document.getElementById("' + IdName + '")');
	}else{
		return eval('document.all.' + IdName);
	}
}

function classnew(num1,num2,cn1,cn2,classurl){
	for(var i = 0;i <= 10;i++){
		if(IdYesNo("wanda" + num1 + i)){
			IdYesNo("wanda" + num1 + i).className = cn2;
		}
		if(IdYesNo("wandas" + num1 + i)){
			IdYesNo("wandas" + num1 + i).style.display = 'none';
		}
	}
	if(IdYesNo("wanda" + num1 + num2)){
		IdYesNo("wanda" + num1 + num2).className = cn1;
	}
	if(IdYesNo("wandas" + num1 + num2)){
		IdYesNo("wandas" + num1 + num2).style.display = 'block';
	}
	if(IdYesNo("wanda")){
		IdYesNo("wanda").href = classurl;
	}
}
function nTabs(thisObj,Num){
	if(thisObj.className == "active")return;
	var tabObj = thisObj.parentNode.id;
	var tabList = document.getElementById(tabObj).getElementsByTagName("li");
	for(i=0; i <tabList.length; i++)
	{
		if (i == Num)
		{
			thisObj.className = "active";
			document.getElementById(tabObj+"_Content"+i).style.display = "block";
		}else{
			tabList[i].className = "normal";
			document.getElementById(tabObj+"_Content"+i).style.display = "none";
		}
	}
}

function checks(){
	if (document.form1.zt.value==""){
		alert("���������������⣡");
		document.form1.zt.focus();
		return false
	}
	if (document.form1.msg.value==""){
		alert("���������������ݣ�");
		document.form1.msg.focus();
		return false
	}
	if (document.form1.name.value==""){
		alert("��������ϵ������");
		document.form1.name.focus();
		return false
	}
	if (document.form1.company.value==""){
		alert("��������Ĺ�˾��");
		document.form1.company.focus();
		return false
	}
	if (document.form1.tel.value==""){
		alert("��������ĵ绰");
		document.form1.tel.focus();
		return false
	}
	if (document.form1.mail.value==""){
		alert("�������������");
		document.form1.mail.focus();
		return false
	}
	return true;
}

function AddFavorite(){
	window.external.AddFavorite(location.href, document.title);
}
function CopyUrl(){
	var content = document.title;
	content+="\r\n"+location.href;	
	window.clipboardData.setData("Text",content);
	alert("Site title and URL have been copied, you can CTRL + V in like: QQ, MSN in the paste to send to a friend!");
}
function getFlashObject(flashSrc, objWidth, objHeight, etcParam) { 
	var tag = "";
	var baseFlashDir="";
	flashSrc = baseFlashDir + flashSrc;
	if ( etcParam != "" || etcParam != null ) {
		if ( etcParam.substr(0, 1) == "?" )
			flashSrc += etcParam;
		else
			flashSrc += "?" + etcParam;
	}
	tag += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";
	tag += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" ";
	tag += "width=\"" + objWidth + "\" height=\"" + objHeight + "\">";
	tag += "<param name=\"movie\" value=\"" + flashSrc + "\" />";
	tag += "<param name=\"quality\" value=\"high\" />";
	tag += "<param name=\"wmode\" value=\"transparent\" />";
	tag += "<embed src=\"" + flashSrc + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ";
	tag += "type=\"application/x-shockwave-flash\" width=\"" + objWidth + "\" height=\"" + objHeight + "\" ";
	tag += "wmode=\"transparent\"></embed>";
	tag += "</object>";
	document.write(tag);
}

$(function(){
	var name = $('#imNotAd');  //滚动广告的ID
	function showAd(time){
		setTimeout(function(){
			$(name).show();
		},time);
	}

	function hideAd(time){
		setTimeout(function(){
			$(name).hide();
		},time);
	}

	$('#close').click(function(){
		$(name).hide();
	});


	showAd(1000); //页面加载完毕多久后显示广告

	//hideAd(31000); //页面加载完毕多久后关闭广告

	function scrollAd(){
		var offset = $(window).height() - $(name).height() + $(document).scrollTop();
		$(name).animate({
			top:offset
		},{
			duration:800,
			queue:false
		});
	}

	scrollAd();

	$(window).scroll(scrollAd);
});

