function Juge()
{
    with(document.form123)
	{
		if (uname.value == "")
		{
			alert("Name can not be empty!");
			uname.focus();
			return (false);
		}
		if (email.value == "")
		{
			alert("E-mail can not be empty!");
			email.focus();
			return (false);
		}
		else if (!isEmail(email.value))
		{
			alert("E-mail Format Error!");
			email.focus();
			return (false);
		}
		if (!isNumber(tel.value)&&tel.value!="")
		{
			alert("Please enter the phone number!");
			tel.focus();
			return (false);
		}
		if (content.value == "")
		{
			alert("Content can not be empty!");
			content.focus();
			return (false);
		}
	}
	return true;
}

function isNumber(oNum){ 
	if(!oNum) return false; 
	var strP=/^\d+(\.\d+)?$/; 
	if(!strP.test(oNum)) return false; 
	try{ 
		if(parseFloat(oNum)!=oNum) return false; 
	}catch(ex){ 
		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;	
	}
}

function checkform2()
{
    with(document.form2)
	{
		if (size.value == "")
		{
			alert("Size can not be empty!");
			size.focus();
			return (false);
		}
	}
	return true;
}

function checksearchform()
{
    with(document.searchform)
	{
		if (searchCate.value == "")
		{
			alert("Search categories can not be empty!");
			searchCate.focus();
			return (false);
		}
	}
	return true;
}

function AjaxFavorites(idPro)
{ 
	$.ajax({
	type: "get",
	url: "ajax_favorites.asp?idPro="+idPro,
	success: function(msg){
		alert(msg);
	},
	error:function(msg){
		alert(msg);
	}
	});
}
