// JavaScript Documentfunctions

// JavaScript Document

function doeditclientvalidate()
{
var frm=document.formedit;
if(GenValidation(frm.txtname,'Client name','','') == 0)
		return false;
		if(GenValidation(frm.txtname,'','Client  name','') == 0)
		return false;
		if(GenValidation(frm.textfield5,'Short description','','') == 0)
		return false;
		if(GenValidation(frm.textfield5,'','Short description','') == 0)
		return false;
		frm.submit();	
}
function addhomepagevalid()
{
	var frm=document.frmpage1;
	if(GenValidation(frm.txtpagename,'page name','','') == 0)
		return false;
		var ftypes=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
		//var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename=frm.file.value;
				dots=filename.split(".");
					ftype	= dots[dots.length-1];
			if((frm.file.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype == "gif" )||( ftype == "jpeg" )||( ftype == "jpg" )||( ftype == "GIF" )||( 	ftype 		== "JPEG" )||( ftype== "JPG" ) ||( ftype == "BMP" ) ||( ftype == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes));
		frm.file.focus();
		return false;
		}
				}
		frm.submit();
}
function edithomepagevalid()
{
	
	var frm=document.frmpage1;
	if(GenValidation(frm.txtpagename,'page name','','') == 0)
		return false;
		var ftypes=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
		//var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename=frm.file.value;
				dots=filename.split(".");
					ftype	= dots[dots.length-1];
			if((frm.file.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype == "gif" )||( ftype == "jpeg" )||( ftype == "jpg" )||( ftype == "GIF" )||( 	ftype 		== "JPEG" )||( ftype== "JPG" ) ||( ftype == "BMP" ) ||( ftype == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes));
		frm.file.focus();
		return false;
		}
				}
		frm.submit();
}
function doaddlogovalidate()
{
	var frm=document.frmaddlogo;
	if(GenValidation(frm.txtname,'logo name','','') == 0)
		return false;
		if(GenValidation(frm.txtname,'','logo  name','') == 0)
		return false;
		var ftypes=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
		//var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename=frm.txtimage.value;
				dots=filename.split(".");
					ftype	= dots[dots.length-1];
			if((frm.txtimage.value !='')||(frm.txtimage.value ==''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
			if(frm.txtimage.value =='')
			{
				alert("please upload logo");
				return false;
			}
			if(frm.txtimage.value !='')
			{
	if(( ftype == "gif" )||( ftype == "jpeg" )||( ftype == "jpg" )||( ftype == "GIF" )||( 	ftype 		== "JPEG" )||( ftype== "JPG" ) ||( ftype == "BMP" ) ||( ftype == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes));
		frm.txtimage.focus();
		return false;
		}
			}}
		frm.submit();
}
function userregister()
{
	
	var frm=document.form1;
if(GenValidation(frm.txtname,'First name','','') == 0)
		return false;
		if(GenValidation(frm.txtname,'','First name','') == 0)
		return false;
		
		if(GenValidation(frm.txtname2,'last name','','') == 0)
		return false;
		if(GenValidation(frm.txtname2,'','last  name','') == 0)
		return false;
		//if(SelectValidation(frm.select1,'Title')==0)
//		return false;
	if (GenValidation(frm.email,'email id','','')==0)
		return false;
		if (GenValidation(frm.email,'','email id','')==0)
		return false;
		if (EmailValidation(frm.email)==0)
		return false;
		if(GenValidation(frm.textfield3,'Password','','') == 0)
		return false;
		if(GenValidation(frm.textfield3,'','Password','') == 0)
		return false;
		/*if(GenValidation(frm.textfield32,'Confirm Password','','') == 0)
		return false;
		if(GenValidation(frm.textfield32,'','Confirm password','') == 0)
		return false;*/
		
		
			if(GenValidation(frm.phone,'phone','','') == 0)
		return false;
//		if(GenValidation(frm.phone,'','phone','') == 0)
//		return false;
		if(SplNumbersworkphone(frm.phone) == 0)
		return false;
		if(GenValidation(frm.textfield32,'Address','','') == 0)
		return false;
		if(GenValidation(frm.textfield32,'','Address','') == 0)
		return false;
		if(GenValidation(frm.textfield5,'City','','') == 0)
		return false;
		if(GenValidation(frm.textfield5,'','City','') == 0)
		return false;
if(GenValidation(frm.textfield6,'State','','') == 0)
		return false;
		if(GenValidation(frm.textfield6,'','State','') == 0)
		return false;
		if (SelectValidation(frm.select3,'Country')==0)
		return false;
	if(GenValidation(frm.textfield8,'Postal','','') == 0)
		return false;
		if(GenValidation(frm.textfield8,'','Postal','') == 0)
		return false;
		 	if(SplNumberszipcode(frm.textfield8) == 0)
		return false;
		var ftypes=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
		//var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename=frm.file.value;
				dots=filename.split(".");
					ftype	= dots[dots.length-1];
			if((frm.file.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype == "gif" )||( ftype == "jpeg" )||( ftype == "jpg" )||( ftype == "GIF" )||( 	ftype 		== "JPEG" )||( ftype== "JPG" ) ||( ftype == "BMP" ) ||( ftype == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes));
		frm.file.focus();
		return false;
		}
				}
	frm.submit();

}
function doeditlogovalidate()
{
	var frm=document.formedit;
	if(GenValidation(frm.txtname,'logo name','','') == 0)
		return false;
		if(GenValidation(frm.txtname,'','logo  name','') == 0)
		return false;
		var ftypes=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
		//var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename=frm.txtimage.value;
				dots=filename.split(".");
					ftype	= dots[dots.length-1];
			if((frm.txtimage.value =='')||(frm.txtimage.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{if((frm.txtimage.value ==''))
		{
			alert("Please upload logo");
			return false;
		}
		if((frm.txtimage.value !=''))
		{
	if(( ftype == "gif" )||( ftype == "jpeg" )||( ftype == "jpg" )||( ftype == "GIF" )||( 	ftype 		== "JPEG" )||( ftype== "JPG" ) ||( ftype == "BMP" ) ||( ftype == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes));
		frm.txtimage.focus();
		return false;
		}
				}
		}
		frm.submit();
}
function doaddsubscribervalidate()
{
	var frm=document.frmaddsubscriber;
	if(GenValidation(frm.txtsubscriber,'subcriber name','','') == 0)
		return false;
		if(GenValidation(frm.txtsubscriber,'','subscriber  name','') == 0)
		return false;
		if (GenValidation(frm.txtsubscriberemail,'email id','','')==0)
		return false;
		if (GenValidation(frm.txtsubscriberemail,'','email id','')==0)
		return false;
		if (EmailValidation(frm.txtsubscriberemail)==0)
		return false;
		frm.submit();
}
function addsubservicevalidate()
{
	var frm=document.frmservice;

		if (SelectValidation(frm.selectservice,'service name')== 0)
	return false;
		if(GenValidation(frm.txtname,'sub service name','','') == 0)
		return false;
		if(GenValidation(frm.txtname,'','sub service name','') == 0)
		return false;
		frm.submit();
}
function indexvalidation()
{
	
	//frm=document.frmreg;
	 if(document.getElementById('txtemail').value =='')
{
document.getElementById('t2').innerHTML = "please enter username ";
document.frmreg.txtname.focus();
}
else if(document.getElementById('password').value =='')
{
document.getElementById('t2').innerHTML = "please enter password ";
document.frmreg.txtname.focus();
return false;
}
return true;
	
}
function doaddservicevalidate()
{
	frm=document.frmaddservice;
		if(GenValidation(frm.txtservicetitle,'service name','','') == 0)
		return false;
	    if(GenValidation(frm.txtservicetitle,'','service name','') == 0)
		return false;	
		   if (GenValidationsh(frm.textshortdescription,'short description','','')==0)
		return false;
		if (GenValidationsh(frm.textshortdescription,'','short description ','')==0)
		return false;
	
		if(TextareaValidation(frm.textshortdescription,'short description',500) == 0)
		return false;
		var ftypes=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
		//var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename=frm.service_image.value;
				dots=filename.split(".");
					ftype	= dots[dots.length-1];
			if((frm.service_image.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype == "gif" )||( ftype == "jpeg" )||( ftype == "jpg" )||( ftype == "GIF" )||( 	ftype 		== "JPEG" )||( ftype== "JPG" ) ||( ftype == "BMP" ) ||( ftype == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes));
		frm.service_image.focus();
		return false;
		}
				}
					var ftypes2=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
		//var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename2=frm.service_image2.value;
				dots2=filename2.split(".");
					ftype2	= dots2[dots2.length-1];
			if((frm.service_image2.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype2 == "gif" )||( ftype2 == "jpeg" )||( ftype2 == "jpg" )||( ftype2 == "GIF" )||( 	ftype2== "JPEG" )||( ftype2== "JPG" ) ||( ftype2 == "BMP" ) ||( ftype2 == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes2));
		frm.service_image2.focus();
		return false;
		}
				}
				var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
		//var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename3=frm.service_image3.value;
				dots3=filename3.split(".");
					ftype3	= dots3[dots3.length-1];
			if((frm.service_image3.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype3 == "gif" )||( ftype3 == "jpeg" )||( ftype3 == "jpg" )||( ftype3 == "GIF" )||( 	ftype3== "JPEG" )||( ftype3== "JPG" ) ||( ftype3 == "BMP" ) ||( ftype3 == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes3));
		frm.service_image3.focus();
		return false;
		}
				}
					
				
					var ftypes4=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
		//var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename4=frm.service_image4.value;
				dots4=filename4.split(".");
					ftype4	= dots4[dots4.length-1];
			if((frm.service_image4.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype4 == "gif" )||( ftype4 == "jpeg" )||( ftype4 == "jpg" )||( ftype4== "GIF" )||( 	ftype4	== "JPEG" )||( ftype4== "JPG" ) ||( ftype4 == "BMP" ) ||( ftype4 == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes4));
		frm.service_image4.focus();
		return false;
		}
				}
					var ftypes5=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
		//var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename5=frm.service_image5.value;
				dots5=filename5.split(".");
					ftype5	= dots5[dots5.length-1];
			if((frm.service_image5.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype5 == "gif" )||( ftype5 == "jpeg" )||( ftype5 == "jpg" )||( ftype5 == "GIF" )||( 	ftype5== "JPEG" )||( ftype5== "JPG" ) ||( ftype5 == "BMP" ) ||( ftype5 == "bmp" ))
		{
					
	}
	else
	{ 
		alert("Valid file types are:\n\n" + (ftypes5));
		frm.service_image5.focus();
		return false;
		}
				}
	
}
function doaddproductvalidate()
{
	 	frm=document.frmaddproduct;
		if(GenValidation(frm.txtproducttitle,'product name','','') == 0)
		return false;
	    if(GenValidation(frm.txtproducttitle,'','product name','') == 0)
		return false;	
		if (SelectValidation(frm.selectproduct,'category')==0)
		return false;

        if (GenValidation(frm.textshortdescription,'short description','','')==0)
		return false;
		if (GenValidation(frm.textshortdescription,'','short description ','')==0)
		return false;
		if(TextareaValidation(frm.textshortdescription,'short description',500) == 0)
		return false;
		
		var ftypes=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
		//var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename=frm.product_image.value;
				dots=filename.split(".");
					ftype	= dots[dots.length-1];
			if((frm.product_image.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype == "gif" )||( ftype == "jpeg" )||( ftype == "jpg" )||( ftype == "GIF" )||( 	ftype 		== "JPEG" )||( ftype== "JPG" ) ||( ftype == "BMP" ) ||( ftype == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes));
		frm.product_image.focus();
		return false;
		}
				}
				
		var ftypes2=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
		//var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename2=frm.product_image2.value;
				dots2=filename2.split(".");
					ftype2	= dots2[dots2.length-1];
			if((frm.product_image2.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype2 == "gif" )||( ftype2 == "jpeg" )||( ftype2 == "jpg" )||( ftype2 == "GIF" )||( 	ftype2		== "JPEG" )||( ftype2== "JPG" ) ||( ftype2 == "BMP" ) ||( ftype2 == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes2));
		frm.product_image2.focus();
		return false;
		}
				}
				var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
		//var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename3=frm.product_image3.value;
				dots3=filename3.split(".");
					ftype3	= dots3[dots3.length-1];
			if((frm.product_image3.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype3 == "gif" )||( ftype3== "jpeg" )||( ftype3 == "jpg" )||( ftype3 == "GIF" )||( 	ftype3== "JPEG" )||( ftype3== "JPG" ) ||( ftype3 == "BMP" ) ||( ftype3 == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes3));
		frm.product_image3.focus();
		return false;
		}
				}
				var ftypes4=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
		//var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename4=frm.product_image4.value;
				dots4=filename4.split(".");
					ftype4	= dots4[dots4.length-1];
			if((frm.product_image4.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype4 == "gif" )||( ftype4 == "jpeg" )||( ftype4 == "jpg" )||( ftype4 == "GIF" )||( 	ftype4	== "JPEG" )||( ftype4== "JPG" ) ||( ftype4 == "BMP" ) ||( ftype4 == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes2));
		frm.product_image4.focus();
		return false;
		}
				}
				var ftypes5=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
		//var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename5=frm.product_image5.value;
				dots5=filename5.split(".");
					ftype5	= dots5[dots5.length-1];
			if((frm.product_image5.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype5 == "gif" )||( ftype5 == "jpeg" )||( ftype5 == "jpg" )||( ftype5 == "GIF" )||( 	ftype5== "JPEG" )||( ftype5== "JPG" ) ||( ftype5 == "BMP" ) ||( ftype5 == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes2));
		frm.product_image5.focus();
		return false;
		}
				}
				var ftypes=['.pdf'];	
		filename=frm.product_pdfdocument.value;	
		dots=filename.split(".");
		ftype 	= dots[dots.length-1];	
		if(frm.product_pdfdocument.value !='')
		{
		if(( ftype == "pdf" ))
		{
			return true;
	     }
	else
		{
		alert("Valid file types are:\n\n" + (ftypes));
		frm.product_pdfdocument.focus();
		return false;
		}
		return false;
		
}
frm.submit();
}
	
function Register()
{
 var frm=document.editletter;
 if(GenValidation(frm.txttitle,'title','','') == 0)
 return false;
 if(GenValidation(frm.txttitle,'','title','') == 0)
 return false;
}
function Register1()
{
 var frm=document.addletter;
 if(GenValidation(frm.txttitle,'title','','') == 0)
 return false;
 if(GenValidation(frm.txttitle,'','title','') == 0)
 return false;
// if (SelectValidation(frm.txtselectuser,'user')==0)
// return false;
 if (SelectValidation(frm.txtselectuser,'user')=="")
		return false;
		frm.submit();
}
function doaddprojectvalidate()
{
	  var frm=document.frmaddproject;
	  
	 	//frm=document.frmaddproject;
		if(GenValidation(frm.txtproducttitle,'project name','','') == 0)
		return false;
	    if(GenValidation(frm.txtproducttitle,'','project name','') == 0)
		return false;
		 if (GenValidationsh(frm.textshortdescription,'short description','','')==0)
		return false;
		if (GenValidationsh(frm.textshortdescription,'','short description ','')==0)
		return false;
		if(GenValidation(frm.txtproductcreated,'created date','','') == 0)
		return false;
	    if(GenValidation(frm.txtproductcreated,'','created date','') == 0)
		return false;
		var ftypes=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
	filename=frm.project_image.value;


	dots=filename.split(".");


	ftype 	= dots[dots.length-1];	

		if((frm.project_image.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype == "gif" )||( ftype == "jpeg" )||( ftype == "jpg" )||( ftype == "GIF" )||( 	ftype 		== "JPEG" )||( ftype == "JPG" ) ||( ftype == "BMP" ) ||( ftype == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes));
		frm.project_image.focus();
		return false;
		}
				}
			var ftypes2=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename2=frm.project_image2.value;
				dots2=filename2.split(".");
					ftype2 	= dots2[dots2.length-1];
			if((frm.project_image2.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype2 == "gif" )||( ftype2 == "jpeg" )||( ftype2 == "jpg" )||( ftype2 == "GIF" )||( 	ftype2 		== "JPEG" )||( ftype2 == "JPG" ) ||( ftype2 == "BMP" ) ||( ftype2 == "bmp" ))
		{
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes2));
		frm.project_image2.focus();
		return false;
		}
				}
				var ftypes3=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename3=frm.project_image3.value;
				dots3=filename3.split(".");
					ftype3	= dots3[dots3.length-1];
			if((frm.project_image3.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype3 == "gif" )||( ftype3 == "jpeg" )||( ftype3 == "jpg" )||( ftype3 == "GIF" )||( 	ftype3 		== "JPEG" )||( ftype3 == "JPG" ) ||( ftype3 == "BMP" ) ||( ftype3 == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes3));
		frm.project_image3.focus();
		return false;
		}
				}
				var ftypes4=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename4=frm.project_image4.value;
				dots4=filename4.split(".");
					ftype4 	= dots4[dots4.length-1];
			if((frm.project_image4.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype4 == "gif" )||( ftype4 == "jpeg" )||( ftype4 == "jpg" )||( ftype4 == "GIF" )||( 	ftype4 		== "JPEG" )||( ftype4 == "JPG" ) ||( ftype4 == "BMP" ) ||( ftype4 == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes2));
		frm.project_image4.focus();
		return false;
		}
				}
		var ftypes5=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];
				filename5=frm.project_image5.value;
				dots5=filename5.split(".");
					ftype5 	= dots5[dots5.length-1];
			if((frm.project_image5.value !=''))//||(frm.project_image3.value !='')||(frm.project_image4.value !='')||(frm.project_image5.value !=''))
		{
	if(( ftype5 == "gif" )||( ftype5 == "jpeg" )||( ftype5 == "jpg" )||( ftype5 == "GIF" )||( 	ftype5 		== "JPEG" )||( ftype5 == "JPG" ) ||( ftype5 == "BMP" ) ||( ftype5 == "bmp" ))
		{
					
	}
	else
	{
		alert("Valid file types are:\n\n" + (ftypes2));
		frm.project_image5.focus();
		return false;
		}
				}
		var ftypes1=['.pdf'];	
		filename1=frm.product_pdfdocument.value;	
		dots1=filename1.split(".");
		ftype1 	= dots1[dots1.length-1];	
		if(frm.product_pdfdocument.value !='')
		{
		if(( ftype1 == "pdf" ))
		{
			return true;
	     }
	else
		{
		alert("Valid file types are:\n\n" + (ftypes1));
		frm.product_pdfdocument.focus();
		return false;
		}
		return false;
		
}
frm.submit();
}

		


function addcategoryvalidate()
{
		 	frm=document.frmcategory;
	if(GenValidation(frm.txtname,'category name','','') == 0)
		return false;
	    if(GenValidation(frm.txtname,'','category name','') == 0)
		return false;
}

function addsubcategoryvalidate()
{
	var frm=document.frmcategory;

		if (SelectValidation(frm.selectcategory,'category ')== 0)
		return false;
	if(GenValidation(frm.txtname,'sub category name','','') == 0)
		return false;
	  else if(GenValidation(frm.txtname,'','sub category name','') == 0)
		return false;
		
frm.submit();
}
function changepassvalidate()
{
  var frm=document.frmchangepass;
  if(GenValidation(frm.txtuser,'user name','','') == 0)
		return false;
	    if(GenValidation(frm.txtuser,'','user name','') == 0)
		return false;
		if(GenValidation(frm.txtold,'old password','','') == 0)
		return false;
	    if(GenValidation(frm.txtold,'','old password','') == 0)
		return false;
		if(GenValidation(frm.txtnew,'new password','','') == 0)
		return false;
	    if(GenValidation(frm.txtnew,'','new password','') == 0)
		return false;
		if(GenValidation(frm.txtconf,'confirm password','','') == 0)
		return false;
	    if(GenValidation(frm.txtconf,'','confirm  password','') == 0)
		return false;
		if(PassValidation(frm.txtconf,frm.txtnew))
		return false;
		
frm.submit();		
}
function vali()
{
	var old=document.frmchangepass.txtold;
	var onew=document.frmchangepass.txtnew;
	var conf=document.frmchangepass.txtconf;
	if((old.value=='')||(old.value==null))
	{
		alert("Please enter old password")
		old.focus()
		return false;
	}
	if((onew.value=='')||(onew.value==null))
	{
		alert("Please enter new password")
		onew.focus()
		return false;
	}
	if((conf.value=='')||(conf.value==null))
	{
		alert("Please enter confirm password")
		conf.focus()
		return false;
	}
	if((conf.value!=onew.value))
	{
		alert("Your passwords do not match,retype again")
		conf.focus()
		return false;
	}
	
	return true;
}


function addfaq()
{
frm=document.frmaddnews;
 if(GenValidation(frm.txttittle,'title ','','') == 0)
		return false;
	    if(GenValidation(frm.txttittle,'','title','') == 0)
		return false;
		 if(GenValidation(frm.txtshort,'short description ','','') == 0)
		return false;
	    if(GenValidation(frm.txtshort,'','short description','') == 0)
		return false;
		
frm.submit();
}



	
function doaddNewsvalid()
{
frm=document.frmaddnews;
   if(GenValidation(frm.txttittle,'title ','','') == 0)
		return false;
	    if(GenValidation(frm.txttittle,'','title','') == 0)
		return false;
		
frm.submit();
}
function doeditNewsvalid()
{
frm=document.editnew;
     if(GenValidation(frm.texttittle,'title ','','') == 0)
		return false;
	    if(GenValidation(frm.texttittle,'','title','') == 0)
		return false;
		 if(GenValidation(frm.txtshort,'short description ','','') == 0)
		return false;
	    if(GenValidation(frm.txtshort,'','short description','') == 0)
		return false;
frm.submit();
}
function doaddcommunityvalid()
{ 
 frm=document.addcommunity;	
		if(GenValidation(frm.txtname,'community name','','spl') == 0)
		return false;
	
	    if(GenValidation(frm.txtname,'','community name','spl') == 0)
		return false;		
		if (GenValidation(frm.txtemail,'email id','','')==0)
		return false;
		if (GenValidation(frm.txtemail,'','email id','')==0)
		return false;
	
		if (GenValidation(frm.shorttext,' short description','','')==0)
		return false;
		if (GenValidation(frm.shorttext,'','short description ','')==0)
		return false;
		if(TextareaValidation(frm.shorttext,'description',300) == 0)
		return false;
		if(GenValidation1(frm.txtinvoice,'invoice code','','') == 0)
		return false;
	    if(GenValidation1(frm.txtinvoice,'','invoice code','') == 0)
		return false;
		if (GenValidation(frm.txtcontact,'contact name','','')==0)
		return false;
		if (GenValidation(frm.txtcontact,'','contact name','')==0)
		return false;
		if (GenValidationimage(frm.txtimage,'image ','','')==0)
		return false;
		if (GenValidationimage(frm.txtimage,'','image','')==0)
		return false;
		var ftypes=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
		filename=frm.txtimage.value;	
		dots=filename.split(".");
		ftype 	= dots[dots.length-1];	
		if(( ftype == "gif" )||( ftype == "jpeg" )||( ftype == "jpg" )||( ftype == "GIF" )||(sftype== "JPEG" )||( ftype == "JPG" ) ||( ftype == "BMP" ) ||( ftype == "bmp" ))
		{
			
	}
	else
		{
		alert("Valid file types are:\n\n" + (ftypes));
		frm.txtimage.focus();
		return false;
		}
frm.submit();
}

function addalbumvalidate()
{
	
	  var frm=document.frmalbum;
	if (SelectValidation(frm.select2,'service name')== 0)
	return false;
		
		 if(GenValidation(frm.textfield,'album name','','') == 0)
		return false;
	    if(GenValidation(frm.textfield,'','album name','') == 0)
		return false;
		
		
 
		
	var ftypes=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
	filename=frm.file.value;	
	if(frm.textfield2.value !='')
	{
	if(frm.file.value =='')
		{
			alert("please select image");
			frm.file.focus();
			return false;
		}
	}
		dots=filename.split(".");
		ftype 	= dots[dots.length-1];	
		if(frm.file.value !='')
		{
		 if(GenValidation(frm.textfield2,'image name','','') == 0)
		return false;
	    if(GenValidation(frm.textfield2,'','image  name','') == 0)
		return false;
	if(( ftype == "gif" )||( ftype == "jpeg" )||( ftype == "jpg" )||( ftype == "GIF" )||( 	ftype 		== "JPEG" )||( ftype == "JPG" ) ||( ftype == "BMP" ) ||( ftype == "bmp" ))
	
		{ 
		return true;
	}
		
	else
	{
		alert("Valid file types are:\n\n" + (ftypes));
		frm.file.focus();
		return false;
		}
		return false;
}
frm.submit();
}


function addImagevalidate1()
{
	
	var frm=document.frmimage1;
	
	
	if (SelectValidation(frm.selectimage,'album ')== 0)
		return false;
		
	var ftypes=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
	filename=frm.file.value;	
	if(frm.imagename1.value !='')
	{
	if(frm.file.value =='')
		{
			alert("please select image");
			frm.file.focus();
			return false;
		}
	}
		dots=filename.split(".");
		ftype 	= dots[dots.length-1];	
		if(frm.file.value !='')
		{
		 if(GenValidation(frm.imagename1,'image name','','') == 0)
		return false;
	    if(GenValidation(frm.imagename1,'','image  name','') == 0)
		return false;
	if(( ftype == "gif" )||( ftype == "jpeg" )||( ftype == "jpg" )||( ftype == "GIF" )||( 	ftype 		== "JPEG" )||( ftype == "JPG" ) ||( ftype == "BMP" ) ||( ftype == "bmp" ))
	
		{ 
		return true;
	}
		
	else
	{
		alert("Valid file types are:\n\n" + (ftypes));
		frm.file.focus();
		return false;
		}
		return false;
}
frm.submit();
}
function addfaqvalidate()
{
	var frm=document.frmaddfaq;
	 if(GenValidation(frm.txtquestion,'Question','','') == 0)
		return false;
	    if(GenValidation(frm.txtquestion,'','Question','') == 0)
		return false;
		 if(GenValidation(frm.txtans,'Answer','','') == 0)
		return false;
	    if(GenValidation(frm.txtans,'','Answer','') == 0)
		return false;
		frm.submit();
}
function editfaqvalid()
{
	var frm=document.frmeditfaq;
	if(GenValidation(frm.txtquestion,'Question','','') == 0)
	return false;
	 if(GenValidation(frm.txtquestion,'','Question','') == 0)
		return false;
		if(GenValidation(frm.txtanswer,'Answer','','') == 0)
	return false;
	if(GenValidation(frm.txtanswer,'','Answer','') == 0)
		return false;
	frm.submit();	
		
}

function addpagevalid()
{
	
	 	frm=document.frmpage;
		if(GenValidation(frm.txtpagename,'page name','','') == 0)
		return false;
	    if(GenValidation(frm.txtpagename,'','page name','') == 0)
		return false;
 
}
function editpagevalidate()
{
	frm=document.frmedit;
	if(GenValidation(frm.txtsname,'Page name','','') == 0)
	return false;
	 if(GenValidation(frm.txtsname,'','Page name','') == 0)
		return false;
		frm.submit();
}
function editsubpage()
{
	frm=document.frmsubedit;
	if(GenValidation(frm.txtsname,'SubPage name','','') ==0)
	return false;
	 if(GenValidation(frm.txtsname,'','SubPage name','') == 0)
	return false;
	frm.submit();
}

function addsubvalid()
{
 frm=document.frmsub;
        if (SelectValidation(frm.txtselect,'requried page')==0)
		return false;
        if(GenValidation(frm.txtsname,'Subpage name ','','') == 0)
		return false;
	    if(GenValidation(frm.txtsname,'','Subpage name','') == 0)
		return false;
frm.submit();
}



function doaddadvertisevalidate()
{
	 	frm=document.frmaddadvertisement;	
		if(GenValidation(frm.txtadvertise,'advertisement name','','') == 0)
		return false;
		 if(GenValidation(frm.txtadvertise,'','advertisement name','') == 0)
		return false;
		if (SelectValidation(frm.selcategory,'requried category')==0)
		return false;
		if (GenValidationimage(frm.txtimage,'image ','','')==0)
		return false;
		if (GenValidationimage(frm.txtimage,'','image','')==0)
		return false;
		var ftypes=['.gif','.jpeg','.jpg','.GIF','.JPEG','.JPG','.BMP','.bmp'];	
		filename=frm.txtimage.value;	
		dots=filename.split(".");
		ftype 	= dots[dots.length-1];	
		if(( ftype == "gif" )||( ftype == "jpeg" )||( ftype == "jpg" )||( ftype == "GIF" )||( ftype== "JPEG" )||( ftype == "JPG" ) ||( ftype == "BMP" ) ||( ftype == "bmp" ))
		{
			
	   }
    else
		{
		alert("Valid file types are:\n\n" + (ftypes));
		frm.txtimage.focus();
		return false;
		}	
frm.submit();
}
function vali()
{
	var old=document.frmchangepass.txtold;
	var onew=document.frmchangepass.txtnew;
	var conf=document.frmchangepass.txtconf;
	if((old.value=='')||(old.value==null))
	{
		alert("Please enter old password")
		old.focus()
		return false;
	}
	if((onew.value=='')||(onew.value==null))
	{
		alert("Please enter new password")
		onew.focus()
		return false;
	}
	
	if((conf.value=='')||(conf.value==null))
	{
		alert("Please enter confirm password")
		conf.focus()
		return false;
	}
	if((conf.value!=onew.value))
	{
		alert("Your passwords do not match,retype again")
		conf.focus()
		return false;
	}
	
	return true;
}
function contactvalidation()
{
frm=document.formcon;
	if(GenValidation(frm.txtname,'username','','') == 0)
	return false;
	    if(GenValidation(frm.txtname,'','username','') == 0)
		return false;
		if (GenValidation(frm.txtemail,'email id','','')==0)
		return false;
		if (GenValidation(frm.txtemail,'','email id','')==0)
		return false;
		if (EmailValidation(frm.txtemail)==0)
		return false;
		if(GenValidation(frm.txtphone,'phone number',' ','') == 0)
		return false;
	    if(GenValidation(frm.txtphone,'',' phone number','') == 0)
		return false;
		frm.submit();
}

 
function valid() {

    var theMessage = "";
    var noErrors = theMessage

    // make sure field is not blank
	if (document.formcon.txtname.value=="") 
	{
    theMessage = theMessage + "\n  Please enter your Name";
	
    }
    
	if (document.formcon.txtemail.value=="") 
	{ 
    theMessage = theMessage + "<br>\n Enter your Email Address";
	
    }
	if (document.formcon.txtemail.value.length >0) {
	 i=document.formcon.txtemail.value.indexOf("@")
	 j=document.formcon.txtemail.value.indexOf(".",i)
	 k=document.formcon.txtemail.value.indexOf(",")
	 kk=document.formcon.txtemail.value.indexOf(" ")
	 jj=document.formcon.txtemail.value.lastIndexOf(".")+1
	 len=document.formcon.txtemail.value.length

 	if ((i>0) && (j>(1+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3)) {
 	}
 	else {
 		  document.getElementById('diverrormessage1').innerHTML="Please enter an exact email address.\n" +
		document.formcon.txtemail.value + " is invalid.";
		
		return false;
 	}

 }
	if (document.formcon.txtphone.value=="") 
	{
    theMessage = theMessage + "<br> Enter your Phone Number";
	
    }
	else
	{
		var re10digit=/^\d{10}$/
if (document.formcon.txtphone.value.search(re10digit)==-1) {
document.getElementById('diverrormessage1').innerHTML="Please enter a valid 10 digit area code";

return false
} 
	}
	
	// If no errors, submit the form
    if (theMessage == noErrors) {
    return true;

    } else {

    // If errors were found, show alert message
   document.getElementById('diverrormessage1').innerHTML=theMessage;
    return false;
    }
	document.formcon.btncontactsubmit();
	formcon.submit();
    }
	
	function contactfrm()
    {
	   var frm=document.contactus;
	   
        if(GenValidation(frm.name,'Name','Name not less than 3 chars','') == 0)
		return false;
 		
		if(GenValidationten(frm.phone,'Mobile number','10 digits','') == 0)
		return false;
	    if(SplNumbersworkphone(frm.phone) == 0)
		return false;
		
		if (GenValidation(frm.email,'Email id','','')==0)
		return false;
		if (GenValidation(frm.email,'','Invalid Email ID','')==0)
		return false;
		if (EmailValidation(frm.email)==0)
		return false;
		
		if(GenValidation(frm.title,'Project Title','','') == 0)
		return false;
		
	    if(GenValidation(frm.description,'Project description','','') == 0)
		return false;
		
		if(GenValidation(frm.code,'Verify Code','','') == 0)
		return false;


 		
       frm.submit();
   }
	
	
	