<!--
function check_pwd()
{
fld_length=spaceStripper(document.form1.pwd.value," ","");
if((fld_length.length==0) || (fld_length.length<=4) || (fld_length.length>=11))
alert("Please enter password 5 - 10 chars of alphabets & numbers." );
}

//
function open_file(id)
{
filename="download_file2.asp?Id="+id

window.open(filename,"newwin","width=300,height=300,left=200,top=250,toolbar=no,directories=no,scrollbars=no,status=no,resizable=no,location=no");
window.self.close;
}

function play_sample(filename)
{

window.open("play_ringtone.asp?ID="+filename,"newwin","width=350,height=250,left=100,top=100,toolbar=no,directories=no,scrollbars=no");
window.close;
}
function play_sample_song(filename)
{
window.open("play_song_sample.asp?ID="+filename,"newwin","width=350,height=250,left=100,top=100,toolbar=no,directories=no,scrollbars=no");
window.close;
}
//

function check_email()
{

	document.form1.method="post";
		document.form1.action="check_email.asp";
		document.form1.submit();

}
///
function check_username()
{
index=1
fld_length=spaceStripper(document.form1.user.value," ","");
		if((fld_length.length==0) || (document.form1.user.value =="") || (fld_length.length<=4) ||  (fld_length.length>=11)) 
		{
		   alert("Please enter/select the user name. Enter 5-8 chars only");		   
		   index=0
		   document.form1.user.focus();
	    }
	    
     if(fld_length.length!=0)
        {
			if (!isAlpNum(document.form1.user))
			{
			index=0			
			document.form1.user.focus();
			}
			 else
			 {			
			var firstCharectar = document.form1.user.value;
			if ( (firstCharectar.substr(0,1)=="0") || (firstCharectar.substr(0,1)=="1") || (firstCharectar.substr(0,1)=="2") || (firstCharectar.substr(0,1)=="3") || (firstCharectar.substr(0,1)=="4") || (firstCharectar.substr(0,1)=="5") || (firstCharectar.substr(0,1)=="6") || (firstCharectar.substr(0,1)=="7") || (firstCharectar.substr(0,1)=="8") || (firstCharectar.substr(0,1)=="9") )
					{
					index=0
				alert("User name should not start with a number");
				//document.form1.user.value="";
				document.form1.user.focus();				
					}
			  }
		}	  
	   	   
	   if (index==1) 
	   {  
	   	document.form1.method="post";
		document.form1.action="check_user.asp";
		document.form1.submit();
		}
	
}


///


function spaceStripper(incomingText,str1,str2)
	{
		workString=incomingText;
		while (workString.indexOf(str1)!=-1)
		{
			workString=workString.substring(0,workString.indexOf(str1))+str2+workString.substring(workString.indexOf(str1)+str1.length,workString.length);
		}
		return workString;
	}

//Function to check whether the input is of alphanumeric type 
	var isAlphabetNum=0;
	function isAlpNum(incomingText)
	{
		isAlphabetNum=0;
		alphastr="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_#";
		Name=incomingText.name;
		textvalue=incomingText.value;
			for (counter=0;counter<textvalue.length;counter++)
			{
				find=textvalue.charAt(counter);
				if(alphastr.indexOf(find)==-1)
				{
					isAlphabetNum=1;
				}
			}
			if(isAlphabetNum==1)
			{
				alert("Please enter alphabets & numbers only for Password");
				incomingText.value="";
				incomingText.focus();
				return false;
			}
			else 
			{
				return true;
			}
	}
	
///
var testresults
function checkemail()
{
var str=spaceStripper(document.form1.email.value," ","");
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
testresults=true;
else{
alert("Please enter a valid email address!")
testresults=false;
}
return (testresults)
}

function checkbae(){
if (document.layers||document.getElementById||document.all)
return checkemail()
else
return true
}	

///

function submit_values()
	{
	
//validation for email		
	email_length=spaceStripper(document.form1.email.value," ","");
	if((email_length.length >0) && (!checkbae()))
		{	
	return false;
		}
		
		if (document.form1.email.value=="")
		{
		alert("Please enter your email");
		return false;
		}

index1=document.form1.city.selectedIndex;
index2=document.form1.state.selectedIndex;
	if ((document.form1.custname.value=="") || (document.form1.address.value=="") || (document.form1.pin.value=="") || (document.form1.city.options[index1].value=="") || (document.form1.state.options[index2].value=="") ||   (document.form1.phone.value=="") )

	{
	 alert("Please fill all details marked as * Required ");
	return false;
	}
	if (document.form1.securityCode.value=="") 
	{
	alert("Please enter Security code");
	return false;
	}
	
	
}

///
function submit_values2()
	{
		
		
//Validation of the password field
		fld_length=spaceStripper(document.form1.pwd.value," ","");
		if ((fld_length.length==0) || (fld_length.length<=4) || (fld_length.length>=11))  
		{
		   alert("Please enter/change password to 5-10 chars");
		   document.form1.pwd.focus();
		   return false; 
		}
			
			if (!isAlpNum(document.form1.pwd))
		{
			return false;
		}	 


if (document.form1.pwd.value !=document.form1.pwd2.value) 
{
{
	 alert("Passwords do not match!");
	return false;
	}
}
	
	if ( (document.form1.custname.value=="") || (document.form1.address.value=="") || (document.form1.pin.value=="") || (document.form1.country.value=="") || (document.form1.city.value=="") || (document.form1.phone.value=="") || (document.form1.email.value==""))

	{
	 alert("Please fill all details marked as * Required ");
	return false;
	}
	

document.form1.mode.value="Modify"
//alert(document.form1.mode.value);
	document.form1.method="post"
	document.form1.action="profile_modify.asp"
	document.form1.submit()	

		
	
	
}



function check_search_ext()

{	
	if ((document.form1.track.value=="") && (document.form1.album.value=="") && (document.form1.artist.value=="") && (document.form1.composer.value=="") && (document.form1.lyricist.value=="") && (document.form1.language.value=="") && (document.form1.raga_tala.value=="") && (document.form1.label.value=="") )

	{
	 alert("Please enter keywords agianst atleast one column.");
	return false;
	}
}



//-->