function validate()
{
	//alert("hi");
	//var uploadImage;
	var uploadFile;

	var errorMessage = "Please Enter Required Field!";
	var errorMessage1 = "Image Must Be In JPG,PNG and GIF";
	var errorMessage2 = "File Must Be In PDF,DOC,DOCX,PPT,RTF and Excel";
	//var errorMessage2 = "Please Upload Image";
	
	



	//var pattern = /^([a-zA-Z0-9\s_()\\.\-:])+(.jpeg ||.jpg ||.png ||.gif)$/;
	var attachUploadPattern = "/^([a-zA-Z0-9\s_()\\.\-:])+(.pdf ||.PDF ||.doc ||.docx ||.ppt ||.PPT ||.DOC ||.DOCX ||.rtf ||.RTF ||.xlsx || .XLsX)$/";

	  // /.*\.pdf$/;

	//var attachUploadPattern = /^([a-zA-Z0-9\s_\\.\-:])+(.doc||.docx)$/;
	//
	//var uploadFile = document.getElementById('file').value;
	var mainTitle = document.getElementById('mtitle1').value;
	var subTitle = document.getElementById('stitle1').value;
	var subMainTitle = document.getElementById('smtitle1').value;
	var urlTitle = document.getElementById('url1').value;
	//var desTitle = document.getElementById('des1').value;
	var uploadImage = document.getElementById('uimage1');
	var filePath1 = uploadImage.value;
	var allowedExtensions1 = /(\.jpg|\.jpeg|\.png|\.gif)$/i;
	var uploadFile = document.getElementById('file');
	var filePath = uploadFile.value;
	var allowedExtensions = /(\.pdf|\.doc|\.docx|\.ppt|\.rtf|\.xls|\.xlsx)$/i;
	var rightLeft = document.getElementsByName('radFloat');
	var rMore = document.getElementById('rmore1').value;

	if(mainTitle.length == 0)
	{

	    document.getElementById("error").innerHTML = errorMessage;

	    document.getElementById("mtitle1").focus();

	    document.getElementById("mtitle1").style.border = '1px solid red';

	    return false;

	}
	if(subTitle.length == 0)
	{

	    document.getElementById("error1").innerHTML = errorMessage;

	    document.getElementById("stitle1").focus();

	    document.getElementById("stitle1").style.border = '1px solid red';

	    return false;

	}
	if(subMainTitle.length == 0)
	{

	    document.getElementById("error2").innerHTML = errorMessage;

	    document.getElementById("smtitle1").focus();

	    document.getElementById("smtitle1").style.border = '1px solid red';

	    return false;

	}
	if(urlTitle.length == 0)
	{

	    document.getElementById("error3").innerHTML = errorMessage;

	    document.getElementById("url1").focus();

	    document.getElementById("url1").style.border = '1px solid red';

	    return false;

	}
	/*if(desTitle.length == 0)
	{

	    document.getElementById("error4").innerHTML = errorMessage;

	    document.getElementById("des1").focus();

	    document.getElementById("des1").style.border = '1px solid red';

	    return false;

	}*/
	if(filePath1.length !== 0)
	{
		if(!allowedExtensions1.exec(filePath1))
		{
	        document.getElementById("error5").innerHTML = errorMessage1;

		    document.getElementById("uimage1").focus();

		    document.getElementById("uimage1").style.border = '1px solid red';

		    document.getElementById('uimage1').value = '';

		    return false;
	    }
	    if(rightLeft[0].checked == true) 
		{

	       //alert("Your Image Alignment is Right");
	    } 
	    else if(rightLeft[1].checked == true) 
	    {
	       //alert("Your Image Alignment is Left");
	    } else 
	    {
	                    // no checked
	        var msg = '<span style="color:red;">You must select your Alignment!</span><br /><br />';
	        document.getElementById('error7').innerHTML = msg;
	        return false;
	    }
		/*else
		{
		    document.getElementById("file").style.border = '1px solid green';

		}*/
	}
	/*else
	{
		document.getElementByName('radFloat').disable = true;
	}*/
	
	if(filePath.length !== 0)
	{
		if(!allowedExtensions.exec(filePath))
		{
	        document.getElementById("error6").innerHTML = errorMessage2;

		    document.getElementById("file").focus();

		    document.getElementById("file").style.border = '1px solid red';

		    document.getElementById('file').value = '';

		    return false;
	    }
		/*else
		{
		    document.getElementById("file").style.border = '1px solid green';

		}*/
	}
	if(rMore.length == 0)
	{

	    document.getElementById("error8").innerHTML = errorMessage;

	    document.getElementById("rmore1").focus();

	    document.getElementById("rmore1").style.border = '1px solid red';

	    return false;

	}
	 

}