//显示Flash
function ShowFlash(url,width,height){
        document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'" VIEWASTEXT>');
        document.write('<param name="movie" value="' + url + '">');
        document.write('<param name="quality" value="high"> ');
        document.write('<param name="wmode" value="transparent"> ');
        document.write('<param name="menu" value="false"> ');
        document.write('<embed src="' + url + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed> ');
        document.write('</object> ');
}

//在页面中调用
//<script type="text/javascript" language="javascript">ShowFlash('images/flash/9.swf',957,180);</sc ript>

function CheckSubmit(){
	if (document.getElementById("Header1_LoginCtr1_txtName").value==""){
		alert('请输入用户名!');
		document.getElementById("Header1_LoginCtr1_txtName").focus();
		return false;
	}
	if (document.getElementById("Header1_LoginCtr1_txtPassword").value==""){
		alert('请输入密码!');
		document.getElementById("Header1_LoginCtr1_txtPassword").focus();
		return false;
	}
}

var theForm = document.forms['Form1'];
if (!theForm) {
    theForm = document.Form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}

function Search()
{
	var con = document.all.keyword.value;
	if(con.Trim() != "")
	{
		document.location.reload('ProductList.aspx?keyword='+ con);
		return true;
	}
	else
	{
		alert('请输入搜索关键字!');
		document.all.keyword.focus();
		return false;
	}
}	
function keydown() 
{
	if(event.keyCode==13) 	
	{ 
		try
		{ 
			Search();			
			event.returnValue=false;       //取消事件
		}
		catch(e)		
		{
			alert(e.message);
		}
	} 
	return false;
} 
	String.prototype.Trim = function() 
	{ 
		return this.replace(/(^\s*)|(\s*$)/g, ""); 
	} 	
	
	String.prototype.LTrim = function() 
	{ 
		return this.replace(/(^\s*)/g, ""); 
	} 

	String.prototype.RTrim = function() 
	{ 
		return this.replace(/(\s*$)/g, ""); 
	}


function Juge()
{
    with(document.form123)
	{
		if (uname.value == "")
		{
			alert("请输入用户名！");
			uname.focus();
			return (false);
		}
		if (email.value == "")
		{
			alert("邮箱不能为空!");
			email.focus();
			return (false);
		}
		else if (!isEmail(email.value))
		{
			alert("邮箱格式错误!");
			email.focus();
			return (false);
		}
		if (content.value == "")
		{
			alert("留言内容不能为空!");
			content.focus();
			return (false);
		}
	}
	return true;
}

function isEmail(emailStr){
	if(emailStr.charAt(0) == "." || emailStr.charAt(0) == "@" || emailStr.indexOf('@', 0) == -1|| emailStr.indexOf('.', 0) == -1 || emailStr.lastIndexOf("@") == emailStr.length-1 || emailStr.lastIndexOf(".") == emailStr.length-1){
		return false;	
	}else{
		return true;	
	}
}

