// JavaScript Document
//star rating for blogs
function blog_star(s) {
	var i;
	var im="";
	
	for(i=1;i<=s;i++) {
		im="star"+i;
		document.getElementById(im).src="images/star.gif"; 
	}
	for(i=s+1;i<=5;i++) {
		im="star"+i;
		document.getElementById(im).src="images/star-empty.gif"; 
	}
	document.getElementById("comm_rate").value=s; 
}


//hide or display div
function div_view(actype)
{
	if(actype=="Featured Professional")	
		document.getElementById("div_actype").style.display="block"; 
	else	
		document.getElementById("div_actype").style.display="none"; 
}

//membership level validation
function check_membership(f)
{
	var mship=f.elements["membership_level"];
	var i,j=0;
	for(i=0;i<mship.length;i++) 
		if(mship[i].checked==true) 
		{
			j=1;
			break;
		}	
		
	if(j==0)
	{
		alert("Please select Membership level");
		return false;
	}	
	return true;
}


//restrictions in register as tutor

function reg_tutor_check(f)
{
	var membid=f.membership_level.value;
	//standard listing memberships
	if(membid==5 || membid==6 || membid==7)
	{
		if(f.u_phone1.value.length)	
		{
			alert("This feature is not available for standard listings. If you would like to have a picture or logo in your listing, please choose a premium or company registration.");
			f.u_phone1.value='';
			return false;
		}
		if(f.u_phone2.value.length)	
		{
			alert("This feature is not available for standard listings. If you would like to have a picture or logo in your listing, please choose a premium or company registration.");
			f.u_phone2.value='';
			return false;
		}
		if(f.u_phone3.value.length)	
		{
			alert("This feature is not available for standard listings. If you would like to have a picture or logo in your listing, please choose a premium or company registration.");
			f.u_phone3.value='';
			return false;
		}
		if(f.u_org.value.length)	
		{
			alert("This feature is not available for standard listings. If you would like to have a picture or logo in your listing, please choose a premium or company registration.");
			f.u_org.value='';
			return false;
		}
		if(f.u_title.value.length)	
		{
			alert("This feature is not available for standard listings. If you would like to have a picture or logo in your listing, please choose a premium or company registration.");
			f.u_title.value='';
			return false;
		}
		if(f.u_notutors.value.length)	
		{
			alert("This feature is not available for standard listings. If you would like to have a picture or logo in your listing, please choose a premium or company registration.");
			f.u_notutors.value='';
			return false;
		}
		if(f.u_wbf.value.length)	
		{
			alert("This feature is not available for standard listings. If you would like to have a picture or logo in your listing, please choose a premium or company registration.");
			f.u_wbf.value='';
			return false;
		}
		if(f.u_photo.value.length)	
		{
			alert("This feature is not available for standard listings. If you would like to have a picture or logo in your listing, please choose a premium or company registration.");
			f.u_photo.value='';
			return false;
		}
		if(f.u_fax1.value.length)	
		{
			alert("This feature is not available for standard listings. If you would like to have a picture or logo in your listing, please choose a premium or company registration.");
			f.u_fax1.value='';
			return false;
		}
		if(f.u_fax2.value.length)	
		{
			alert("This feature is not available for standard listings. If you would like to have a picture or logo in your listing, please choose a premium or company registration.");
			f.u_fax2.value='';
			return false;
		}
		if(f.u_fax3.value.length)	
		{
			alert("This feature is not available for standard listings. If you would like to have a picture or logo in your listing, please choose a premium or company registration.");
			f.u_fax3.value='';
			return false;
		}
		if(f.u_address.value.length)	
		{
			alert("This feature is not available for standard listings. If you would like to have a picture or logo in your listing, please choose a premium or company registration.");
			f.u_address.value='';
			return false;
		}
		if(f.u_sunivers.value.length)	
		{
			alert("This feature is not available for standard listings. If you would like to have a picture or logo in your listing, please choose a premium or company registration.");
			f.u_sunivers.value='';
			return false;
		}
		if(f.u_special.value.length)	
		{
			alert("This feature is not available for standard listings. If you would like to have a picture or logo in your listing, please choose a premium or company registration.");
			f.u_special.value='';
			return false;
		}
	}
	
	//premium listing memberships
	if(membid==2 || membid==3 || membid==4)
	{
		if(f.u_phone1.value.length)	
		{
			alert("This feature is not available with this membership. If you would like to have this information in your listing, please choose a company registration.");
			f.u_phone1.value='';
			return false;
		}
		if(f.u_phone2.value.length)	
		{
			alert("This feature is not available with this membership. If you would like to have this information in your listing, please choose a company registration.");
			f.u_phone2.value='';
			return false;
		}
		if(f.u_phone3.value.length)	
		{
			alert("This feature is not available with this membership. If you would like to have this information in your listing, please choose a company registration.");
			f.u_phone3.value='';
			return false;
		}
		if(f.u_org.value.length)	
		{
			alert("This feature is not available with this membership. If you would like to have this information in your listing, please choose a company registration.");
			f.u_org.value='';
			return false;
		}
		if(f.u_title.value.length)	
		{
			alert("This feature is not available with this membership. If you would like to have this information in your listing, please choose a company registration.");
			f.u_title.value='';
			return false;
		}
		if(f.u_notutors.value.length)	
		{
			alert("This feature is not available with this membership. If you would like to have this information in your listing, please choose a company registration.");
			f.u_notutors.value='';
			return false;
		}
		if(f.u_wbf.value.length)	
		{
			alert("This feature is not available with this membership. If you would like to have this information in your listing, please choose a company registration.");
			f.u_wbf.value='';
			return false;
		}
		if(f.u_fax1.value.length)	
		{
			alert("This feature is not available with this membership. If you would like to have this information in your listing, please choose a company registration.");
			f.u_fax1.value='';
			return false;
		}
		if(f.u_fax2.value.length)	
		{
			alert("This feature is not available with this membership. If you would like to have this information in your listing, please choose a company registration.");
			f.u_fax2.value='';
			return false;
		}
		if(f.u_fax3.value.length)	
		{
			alert("This feature is not available with this membership. If you would like to have this information in your listing, please choose a company registration.");
			f.u_fax3.value='';
			return false;
		}
		if(f.u_address.value.length)	
		{
			alert("This feature is not available with this membership. If you would like to have this information in your listing, please choose a company registration.");
			f.u_address.value='';
			return false;
		}
		if(f.u_sunivers.value.length)	
		{
			alert("This feature is not available with this membership. If you would like to have this information in your listing, please choose a company registration.");
			f.u_sunivers.value='';
			return false;
		}
		if(f.u_special.value.length)	
		{
			alert("This feature is not available with this membership. If you would like to have this information in your listing, please choose a company registration.");
			f.u_special.value='';
			return false;
		}    
	}
}




