// JavaScript Document
function Check_Details(frm)
{
	with(frm)
	{
		
		if(!IsEmpty(usr_email, JS_Email))
		{
			return false;
		}	
		else if(!IsEmail(usr_email, JS_Valid_Email))
		{
			return false;
		}
		if(!IsEmpty(usr_login, JS_Login))
		{
			return false;
		}
		if(usr_login.value.length > 100)
		{
			alert(JS_Login_Length);
			return false;	
		}
		if(!IsValidString(usr_login, JS_Valid_User_Login))
		{
			return false;	
		}
		if(!IsEmpty(usr_password, JS_Password))
		{
			return false;
		}
		
		if(frm.ust_id.value == 0)
		{
			alert(JS_User_Type); 
			return false;
		}
		if(!IsCheckedBoxChecked(document.getElementById('privacy'), JS_Privacy))
		{
			return false;
		}
		if(frm.ust_id.value == 1)
		{
			if(!IsCheckedBoxChecked(document.getElementById('mem_con'), JS_Term_Use))
			{
				return false;
			}
			if(!IsCheckedBoxChecked(document.getElementById('art_con'), JS_Artist_Contract))
			{
				return false;
			}
		}
		if(frm.ust_id.value == 2)
		{
			if(!IsCheckedBoxChecked(document.getElementById('mem_con'), JS_Term_Use))
			{
				return false;
			}
		}
		if(frm.ust_id.value == 1)
		{
			if(frm.joined_siae.value == 0)
			{
				alert(JS_Joined_Siae_err); 
				return false;
			}
			if(frm.joined_siae.value == 3)
			{
				if(!IsEmpty(other, JS_other))
				{
					return false;
				}
			}
		}
						
		return true;
	}
}

function Show_Hide_Other(fid)
{
	//alert(fid.value);
	
	if(fid.value==3)
	{
		document.getElementById('other_text').style.visibility='visible';
		document.getElementById('other_text').style.display='';
	}
	else
	{
		document.getElementById('other_text').style.visibility='hidden';
		document.getElementById('other_text').style.display='none';
	}
}
function Show_Hide_SAIE(fid)
{
	//alert(fid.value);
	
	if(fid.value==1)
	{
		document.getElementById('artist_contract').style.visibility='visible';
		document.getElementById('artist_contract').style.display='block';
		
		//document.getElementById('member_contract').style.visibility='visible';
		//document.getElementById('member_contract').style.display='block';
			
		document.getElementById('joined_siae2').style.visibility='visible';
		document.getElementById('joined_siae2').style.display='';
		
		document.getElementById('joined_siae1').style.visibility='visible';
		document.getElementById('joined_siae1').style.display='';
	}
	else
	{
		document.getElementById('artist_contract').style.visibility='hidden';
		document.getElementById('artist_contract').style.display='none';
		
		//document.getElementById('member_contract').style.visibility='hidden';
		//document.getElementById('member_contract').style.display='none';
		
		document.getElementById('joined_siae2').style.visibility='hidden';
		document.getElementById('joined_siae2').style.display='none';
		
		document.getElementById('joined_siae').selectedIndex = 0;
		document.getElementById('joined_siae1').style.visibility='hidden';
		document.getElementById('joined_siae1').style.display='none';
		
		document.frmsinup.other.value = '';
		document.getElementById('other_text').style.visibility='hidden';
		document.getElementById('other_text').style.display='none';
		
	}
	if(fid.value==2)
	{
		document.getElementById('artist_contract').style.visibility='hidden';
		document.getElementById('artist_contract').style.display='none';
		
		//document.getElementById('member_contract').style.visibility='visible';
		//document.getElementById('member_contract').style.display='block';
	}
}
function Click_privacy()
{
	//alert(frm.mainpic1.value);
	popupWindowURL('signup.php?Action=Privacy','','638','200','false','false','false');	
}
//function Click_Released()
//{
//	//alert(frm.mainpic1.value);
//	popupWindowURL('signup.php?Action=Released','','638','200','false','false','false');	
//}
function Click_condition()
{
	//alert(frm.mainpic1.value);
	popupWindowURL('signup.php?Action=Condition','','638','200','false','false','false');	
}

