/*
	Module Name:- modFeaturedArticle
	File Name  :- featured_article.js
	Create Date:- 25-JUN-2007
	Intially Create By :- 
	Update History:
*/
function frm_test_add_validateform()
{
	with(document.frm_test_add)
	{
		if(isEmpty(txt_pname.value))
		{
			alert("Please enter name/Alias");
			txt_pname.select();
			txt_pname.focus();
			return false;
		}

		if(isEmpty(ta_desc.value))
		{
			alert("Please enter Article Details.");
			ta_desc.select();
			ta_desc.focus();
			return false;
		}

	  	 if(ta_desc.value.length>512)
	   	 {
			alert("Article Description should contain less than 512 characters.");
			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>256)
	   	 {
			alert("Location should contain less than 512 characters.");
			txt_loc.select();
			txt_loc.focus();
			return false;		   	
	   	 }
	   }
	   
	   if(trim(fileimage.value) != "")
		{
			if(checkExt(trim(fileimage.value))==false)
			{
				fileimage.select();
				fileimage.focus();
				return false;
			}
		}
		
		if(isEmpty(trim(txt_code.value)))
		{
			alert("Please enter secret code.");
			txt_code.select();
			txt_code.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,'Testimonial','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;
}

