/*
	Module Name:- modblog
	File Name  :- testomonial.js
	Create Date:- 16-MAY-2007
	Intially Create By :- 
	Update History:
*/
function frm_test_add_validateform()
{
	with(document.frm_test_add)
	{
		if(isEmpty(txt_pname.value))
		{
			alert("Please enter person name.");
			txt_pname.select();
			txt_pname.focus();
			return false;
		}

		if(isEmpty(ta_desc.value))
		{
			alert("Please enter Comments.");
			ta_desc.select();
			ta_desc.focus();
			return false;
		}

		if(isEmpty(txt_email.value))
		{
			alert("Please enter Email Id.");
			txt_email.select();
			txt_email.focus();
			return false;
		}
		
		if(trim(txt_email.value)!="")
	   {
			if(!sValidateMailAddress(txt_email.value))
			{
				alert("Please enter valid email address. Format:email@domain.com");
				txt_email.select();
				txt_email.focus();
				return false;
			}
	   }
	   
	   
	   if(trim(txt_loc.value)!="")
	   {
	  	 if(txt_loc.value.length>255)
	   	 {
			alert("Location should contain less than 256 characters.");
			txt_loc.select();
			txt_loc.focus();
			return false;		   	
	   	 }
	   }
		
		if(txt_code.value == "")
		{
			alert("Please enter Secret Code.");
			txt_code.focus();
			txt_code.select();
			return false;
		}		

//	   if(trim(fileimage.value) != "")
//		{
//			if(checkExt(trim(fileimage.value))==false)
//			{
//				fileimage.select();
//				fileimage.focus();
//				return false;
//			}
//		}
		
//		if(trim(txt_url.value)!="")
//		{
//			if(!isValidUrl(trim(txt_url.value)))
//			{
//				txt_url.select();
//				txt_url.focus();
//				return false;
//			}
//		}
		
	}
	return true;
}


function show_details(url)
{
	window.open(url,'Blog','left=50,top=20,scrollbars=yes,width=570,height=520,resizable=yes');
	return false;
}

function frmAdd_Validate(no)
{
	if(no==1)
	{
		document.frm_test_add.hdnSubmit.value=1;
	}
	else 
	{
		document.frm_test_add.hdnSubmit.value=2;
	}
	return true;
}

