function adminuser_validation()
{
	if(!IsBlank(document.frmAdminuser.txtusername,'Please Enter Username'))
		return false;
	if(!IsBlank(document.frmAdminuser.txtemail,'Please Enter Email Address'))
		return false;
	if(!IsEmail(document.frmAdminuser.txtemail,'Entered Email Address is not a valid email address'))
		return false;		
	if(!IsBlank(document.frmAdminuser.txtpassword,'Please Enter Password'))
		return false;
	if(document.frmAdminuser.txtpassword.value!=document.frmAdminuser.txtconfirmpassword.value){
		alert("Please enter your password again. Both password and retype password should be same");
		document.frmAdminuser.txtconfirmpassword.value='';
		document.frmAdminuser.txtconfirmpassword.focus();		
		return false;
	}
	return true;
}

function configuration_validate()
{

	var field = document.frmSettings;
	var counter=0;
	for (i = 0; i < field.length; i++) {
		if ((field.elements[i].type == "text")) {
			if(!IsBlank(document.frmSettings.elements[i],'Values for configuration can not be blank'))
				return false;
		}
	}
		return true;
}


function currencies_validate()
{

	var field = document.frmCurrency;
	var counter=0;
	for (i = 0; i < field.length; i++) {
		if ((field.elements[i].type == "text")) {
			if(!IsBlank(document.frmCurrency.elements[i],'Values for currency can not be blank.'))
				return false;
			if(!IsFloat(document.frmCurrency.elements[i],'Please Enter Float Value.'))
				return false;
		}
	}
		return true;
}

function shipping_validate()
{
	var field = document.frmShip;
	for (i = 0; i < field.length; i++) {
		if ((field.elements[i].type == "text")) {
			if(!IsBlank(document.frmShip.elements[i],'Values for shipping rate can not be blank.'))
				return false;
			if(!IsFloat(document.frmShip.elements[i],'Please Enter Float Value.'))
				return false;	
		}
	}
		return true;
}

function vat_validate()
{
	var field = document.frmVAT;
	for (i = 0; i < field.length; i++) {
		if ((field.elements[i].type == "text")) {
			if(!IsBlank(document.frmVAT.elements[i],'Values for Vat not be blank.'))
				return false;
			if(!IsFloat(document.frmVAT.elements[i],'Please Enter Float Value.'))
				return false;				
		}
	}
		return true;
}

function spacem_validate() {
	if(!IsBlank(document.frmSpacem.txtSpacem,'Please Enter SPACEM Percent'))
		return false;
}

function cms_validation()
{
	if(!IsBlank(document.frmCms.txtKeyValue,'Please Enter Page Title'))
		return false;
	return true;
}

function forgetpwd_validation()
{
	if(!IsBlank(document.frmforgetpassword.txtEmail,'Please Enter Email Address'))
		return false;
	if(!IsEmail(document.frmforgetpassword.txtEmail,'Entered Email Address is not a valid email address'))
		return false;		

	return true;
}

function forgetprodpwd_validation()
{
	if(!IsBlank(document.frmProdforgetpassword.txtEmail,'Please Enter Email Address'))
		return false;
	if(!IsEmail(document.frmProdforgetpassword.txtEmail,'Entered Email Address is not a valid email address'))
		return false;		

	return true;
}

function managagealbum_validation()
{
	if(!IsBlank(document.frmGenre.txtAlbumName,'Please Enter Albumname'))
		return false;
	if(!IsBlank(document.frmGenre.txtYear,'Please Enter Year'))
		return false;
	if(!IsYear(document.frmGenre.txtYear,'Please Enter Valid Year'))
		return false;
	if(!IsBlank(document.frmGenre.txtPrice,'Please Enter Price'))
		return false;
	if(!IsFloat(document.frmGenre.txtPrice,'Please Enter Float Value For Price'))
		return false;
	return true;
}
function managagebanner_validation()
{
	if(!IsBlank(document.frmBanner.txtClientName,'Please Enter Client Name'))
		return false;
	if(!IsBlank(document.frmBanner.txtNoOfDisplay,'Please Enter How Many Times Your Banner Display'))
		return false;
	if(!IsNum(document.frmBanner.txtNoOfDisplay,'Please Enter Number of Display In Number only'))
		return false;
	if(!Validate_image(document.frmBanner.fileUploadbanner))
		return false;	
	return true;
}

function managegenre_validation() {
	if(!IsBlank(document.frmGenre.txtGenreName,'Please Enter Genre Name'))
		return false;
	return true;
}

function managenews_validation() {
	if(!IsBlank(document.frmNews.txtNewsTitle,'Please Enter News Title'))
		return false;
	if(!IsBlank(document.frmNews.txtNewsDate,'Please Enter Date of news'))
		return false;
	if(!IsDate(document.frmNews.txtNewsDate,'Please Enter Valid Date'))
		return false;		
	return true;
}

function validate_searchrate() {
	if(document.frmSearch.txtYear.value != '') {
		if(!IsYear(document.frmSearch.txtYear,'Please Enter Valid Year'))
			return false;
	}
	return true;
}

function validate_searchalbum() {
	if(document.frmSearch.txtYear.value != '') {
		if(!IsYear(document.frmSearch.txtYear,'Please Enter Valid Year'))
			return false;
	}
	return true;
}

function validate_songsearch() {
	if(document.frmSearch.txtYear.value != '') {
		if(!IsYear(document.frmSearch.txtYear,'Please Enter Valid Year'))
			return false;
	}
	return true;
}

function managenewletter_validation()
{
	if(!IsBlank(document.frmNewsletter.txtNewsTitle,'Please Enter News Title'))
		return false;
	if(!IsBlank(document.frmNewsletter.txtNewsDate,'Please Enter Date of News'))
		return false;
	if(!IsDate(document.frmNewsletter.txtNewsDate,'Please Enter Valid Date'))
		return false;
	if(document.frmNewsletter.txtSendEmail.value != '') {
		if(!IsEmail(document.frmNewsletter.txtSendEmail,'Invalid Email'))
			return false;
	}		
	return true;
}
function manageproducer_validation()
{
	if(!IsBlank(document.frmProducer.txtProducerName,'Please Enter Producer Name'))
		return false;
	if(!IsBlank(document.frmProducer.txtProducerEmail,"Please Enter Producer's Email Addres"))
		return false;
	if(!IsEmail(document.frmProducer.txtProducerEmail,"Invalied Email Addres"))
		return false;
	if(!IsBlank(document.frmProducer.txtProducerUsername,'Please Enter Username'))
		return false;
	if(!IsBlank(document.frmProducer.txtProducerPassword,'Please Enter Password'))
		return false;
	if(!IsBlank(document.frmProducer.txtProducerEarnings,'Please Enter Earning of producer'))
		return false;
	if(!IsFloat(document.frmProducer.txtProducerEarnings,'Please Enter Numeric Value In Earning'))
		return false;
	if(document.frmProducer.txtProducerPassword.value!=document.frmProducer.txtProducerRetypePassword.value){
		alert("Please enter your password again. Both password and retype password should be same");
		document.frmProducer.txtProducerRetypePassword.value='';
		document.frmProducer.txtProducerRetypePassword.focus();		
		return false;
	}
	return true;
}

function validate_usersearch(){
	if(document.frmsearch.txtemail.value != '') {		
		if(!IsEmail(document.frmsearch.txtemail,"Invalid Email Address")) {
			return false;		
		}
	}
}
function manageuser_validation()
{
	if(!IsBlank(document.frmAddMember.txtfname,'Please Enter First Name'))
		return false;
	if(!IsBlank(document.frmAddMember.txtlname,"Please Enter Last Name"))
		return false;
	if(!IsBlank(document.frmAddMember.txtmail,"Please Enter Email Addres"))
		return false;
	if(!IsEmail(document.frmAddMember.txtmail,"Invalid Email Addres"))
		return false;
	if(document.frmAddMember.txtzip.value != '') {
		if(!IsNum(document.frmAddMember.txtzip,"Please Enter Valid ZIP Code")) {
			return false;		
		}
	}
	if(!IsBlank(document.frmAddMember.txtuname,'Please Enter Username'))
		return false;
	if(!IsBlank(document.frmAddMember.txtpassword,'Please Enter Password'))
		return false;
	if(document.frmAddMember.txtpassword.value!=document.frmAddMember.txtRpassword.value){
		alert("Please enter your password again. Both password and retype password should be same");
		document.frmAddMember.txtRpassword.value='';
		document.frmAddMember.txtRpassword.focus();		
		return false;
	}
	return true;
}

function managesong_validation() {
	if(!IsBlank(document.frmSong.txtSongTitle,'Please Enter Title of the Song'))
		return false;
	if(!IsBlank(document.frmSong.txtAuthor,'Please Enter Author For the Song'))
		return false;
	if(!IsBlank(document.frmSong.txtArtist,'Please Enter Artist For the Song'))
		return false;
	if(!IsBlank(document.frmSong.txtPrice,'Please Enter Price'))
		return false;
	if(!IsFloat(document.frmSong.txtPrice,'Please Enter Price in number only'))
		return false;	
	return true;
}
function managelang_validation() {
	if(!IsBlank(document.frmGenre1.txtLanguage,'Please Enter Language'))
		return false;
	return true;
}

//Javascript for front
function frontLogin(){
	
	if(document.getElementById('txtUsername').value=="")
	{
		alert("Please Enter Username");
		document.getElementById('txtUsername').focus();
		return false;
	}
	else if(document.getElementById('txtPassword').value=="")
	{
		alert("Please Enter Password");
		document.getElementById('txtPassword').focus();
		return false;
	}
	else
	{
		return true;
	}
	/*if(!IsBlank(document.frmLogin.txtUsername,'Please Enter Username'))
			return false;
	else if(!IsBlank(document.frmLogin.txtPassword,'Please Enter Password'))
		return false;
	else {
		document.frmLogin.submit();
		return true;
	}*/
}

function frontforgetprodpwd()
{
	if(!IsBlank(document.frmForget.txtEmail,'Please Enter Email Address'))
		return false;
	if(!IsEmail(document.frmForget.txtEmail,'Entered Email Address is not a valid email address'))
		return false;		

	return true;
}
function frontcreateaccount()
{
	//alert("sss");
	if(!IsBlank(document.frmCrRegister.txtfname,"Please Enter First Name"))
		return false;
	if(!IsBlank(document.frmCrRegister.txtlname,"Please Enter Last Name"))
		return false;
	if(!IsBlank(document.frmCrRegister.txtmail,"Please Enter Email Addres"))
		return false;
	if(!IsEmail(document.frmCrRegister.txtmail,"Invalied Email Addres"))
		return false;
	if(!IsBlank(document.frmCrRegister.txtuname,'Please Enter Username'))
		return false;
	if(!IsBlank(document.frmCrRegister.txtpassword,'Please Enter Password'))
		return false;
	if(document.frmCrRegister.txtpassword.value!=document.frmCrRegister.txtRpassword.value){
		alert("Please enter your password again. Both password and retype password should be same");
		document.frmCrRegister.txtpassword.value='';
		document.frmCrRegister.txtRpassword.value='';
		document.frmCrRegister.txtpassword.focus();		
		return false;
	}
	return true;
}

/*function frontcreateaccount()
{
	if(document.getElementById('txtfname').value=="")
	{
		alert("Please Enter First name");
		document.getElementById('txtfname').focus();
		return false;
	}
	else if(document.getElementById('txtlname').value=="")
	{
		alert("Please Enter Last name");
		document.getElementById('txtlname').focus();
		return false;
	}
	else
	{
		return true;
	}
}*/

function frontmyaccount()
{
	if(!IsBlank(document.frmmyaccount.txtFirstname,'Please Enter First Name'))
		return false;
	if(!IsBlank(document.frmmyaccount.txtLastname,"Please Enter Last Name"))
		return false;
	if(!IsBlank(document.frmmyaccount.txtEmail,"Please Enter Email Addres"))
		return false;
	if(!IsEmail(document.frmmyaccount.txtEmail,"Invalied Email Addres"))
		return false;
	if(!IsBlank(document.frmmyaccount.txtUsername,'Please Enter Username'))
		return false;
	if(!IsBlank(document.frmmyaccount.txtPassword,'Please Enter Password'))
		return false;
	if(document.frmmyaccount.txtPassword.value!=document.frmmyaccount.txtRePwd.value){
		alert("Please enter your password again. Both password and retype password should be same");
		document.frmmyaccount.txtPassword.value='';
		document.frmmyaccount.txtRePwd.value='';
		document.frmmyaccount.txtPassword.focus();		
		return false;
	}
	return true;
}
function frontorderaddress()
{
	if(!IsBlank(document.frmShipingAddress.txtFirstName,'Please Enter First Name'))
		return false;
	if(!IsBlank(document.frmShipingAddress.txtLastName,"Please Enter Last Name"))
		return false;
	if(!IsBlank(document.frmShipingAddress.txtAddress,'Please Enter Address'))
		return false;
	if(!IsBlank(document.frmShipingAddress.txtPhone,'Please Enter Phone'))
		return false;
	if(!IsBlank(document.frmShipingAddress.txtCity,'Please Enter Cityname'))
		return false;
	if(!IsBlank(document.frmShipingAddress.txtState,'Please Enter State'))
		return false;
	if(!IsBlank(document.frmShipingAddress.txtZIP,'Please Enter Zipcode'))
		return false;
	if(!IsBlank(document.frmShipingAddress.txtEmail,"Please Enter Email Addres"))
		return false;
	if(!IsEmail(document.frmShipingAddress.txtEmail,"Invalied Email Addres"))
		return false;

	return true;
}

function frontalbumdetails(thisform)
{
	myoption=-1;
	for (i=thisform.radsong.length-1; i > -1; i--) {
		if (thisform.radsong[i].checked) {
			myOption = i; i = -1;
		}
	}
	if (myOption == -1) {
		alert("You must select a radio button");
		return false;
	}

}
