function validatesymbolwithspaceurl(formName,fieldName)
{
	//alert(formName);
	//alert(fieldName);
	var	doc = "document."
	a=eval(doc+formName+"."+fieldName)
	fieldValue=eval(doc+formName+"."+fieldName + ".value")
	chk1 = "!@#$%^*+=|\~`{}[]:;<>?/.,";
	chk3="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
	for(j=0;j!=fieldValue.length;j++)
	{
		ch1= fieldValue.charAt(j);
		ch2= fieldValue.charAt(0);
		rtn1=chk1.indexOf(ch1);
		rtn3=chk3.indexOf(ch2);
		if(rtn3 < 0)
		{
			eval(doc+formName+"."+fieldName + ".focus()")
			return false;
			break;
		}
		else if(rtn1!=-1)
		{
			eval(doc+formName+"."+fieldName + ".focus()")
			return false;
			break;
		}
	}
	return true;
}
function check_user_type(val)
{
	if(val=="1")
	{
		for(i=0;i<br_array.length;i++){
			eval("document.getElementById('" + br_array[i] + "').style.display = 'none'");
		}
		for(i=0;i<ind_array.length;i++){
			eval("document.getElementById('" + ind_array[i] + "').style.display = ''");
		}

		
		document.getElementById("astrik").innerHTML="E-mail&nbsp;<font class='red'>*</font>";
	}
	else
	{
		document.getElementById("astrik").innerHTML="E-mail&nbsp;<font class='red'>*</font>";
		
		for(i=0;i<br_array.length;i++){
			eval("document.getElementById('" + br_array[i] + "').style.display = ''");
		}
		for(i=0;i<ind_array.length;i++){
			eval("document.getElementById('" + ind_array[i] + "').style.display = 'none'");
		}
	}

	if(val == "1" || val=="2")
	{
		document.getElementById('countryall').style.display = '';
		document.getElementById('countrycorporate').style.display = 'none';
		document.getElementById('cityall').style.display = '';
		document.getElementById('citycorporate').style.display = 'none';
	}
	else if(val == "3" || val == "4")
	{
		document.getElementById('countryall').style.display = 'none';
		document.getElementById('countrycorporate').style.display = '';
		document.getElementById('cityall').style.display = 'none';
		document.getElementById('citycorporate').style.display = '';
	}
	if(val == "4" || val == "1")
	{
		document.getElementById('row_url').style.display = 'none';
	}
	else
	{
		document.getElementById('row_url').style.display = 'none';
	}
	if(val == "2")
	{
		document.getElementById('deal').style.display = '';
	}
	else
	{
		document.getElementById('deal').style.display = 'none';
	}
}



function checkemailcondition()
{
	var separator = '@';
	x=document.registration_frm.email.value;
	ctrl=x.split(separator);
	if(ctrl[1]=="rediff.com")
		document.registration_frm.email.value=ctrl[0]+'@rediffmail.com';
	return true;
}

function change_url_value()
{
	if(document.registration_frm.username.value!="")
	{

		if(document.registration_frm.name.value!="")
			xname=document.registration_frm.name.value;
		else
			xname=false;

		if(document.registration_frm.dob_year.value!="")
			xyear=document.registration_frm.dob_year.value;
		else
			xyear=false;

		document.getElementById('div_usercheck').innerHTML='';
		var chk_len = document.registration_frm.member_type.length;
		for(var counter = 0 ; counter < chk_len; counter++)
		{
			if(document.registration_frm.member_type[counter].checked == true)
			var mem_type = document.registration_frm.member_type[counter].value;
		}

		if(mem_type==1 || mem_type==2)
			var ctrl=document.registration_frm.country_name.options[document.registration_frm.country_name.selectedIndex].text;
		else
			var ctrl=document.registration_frm.country_name2.options[document.registration_frm.country_name2.selectedIndex].text;
		makerequest('/ssi/ajax/check-availability.php?type=userid&xname='+xname+'&dob_year='+xyear+'&value='+escape(document.registration_frm.username.value)+'&country='+ctrl,'div_usercheck');
		//document.registration_frm.url.value=document.registration_frm.loginname.value;
	}
	else
	{
		document.getElementById('div_usercheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a username.";
		document.registration_frm.loginname.focus();
		return false;
	}
}
function check_webpage_value(memberid)
{
	if(document.registration_frm.url.value!="")
	{
		document.getElementById('div_webpagecheck').innerHTML='';
		makerequest('/ssi/ajax/check-webpage-availability.php?memberid='+memberid+'&type=userid&value='+escape(document.registration_frm.url.value),'div_webpagecheck');
	}

/*	else
	{
		document.getElementById('div_webpagecheck').innerHTML = "<img src='/images/alert.gif' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid webpage name";
		document.registration_frm.loginname.focus();
		return false;
	}*/
}

function check_member_url(memberid)
{
	var msgdiv='div_' + memberid;
	var url= eval('document.member_frm.url' + memberid + '.value');
	if(url!="")
	{
		document.getElementById(msgdiv).innerHTML='';
		makerequest('/ssi/ajax/check-webpage-availability.php?memberid='+memberid+'&type=userid&value='+escape(url),msgdiv);
	}
}

/*******************MODIFY PROFILE**************************/

function check_user_type_modifyprofile(val)
{

	if(val=="1")
	{
		for(i=0;i<br_array.length;i++){
			eval("document.getElementById('" + br_array[i] + "').style.display = 'none'");
		}
		for(i=0;i<ind_array.length;i++){
			eval("document.getElementById('" + ind_array[i] + "').style.display = ''");
		}
		document.getElementById("astrik").innerHTML="E-mail&nbsp;<font class='red'>*</font>";
	}
	else
	{
		document.getElementById("astrik").innerHTML="E-mail&nbsp;";
		for(i=0;i<br_array.length;i++){
			eval("document.getElementById('" + br_array[i] + "').style.display = ''");
		}
		for(i=0;i<ind_array.length;i++){
			eval("document.getElementById('" + ind_array[i] + "').style.display = 'none'");
		}
	}
	//alert(val);
	if(val=="2")
	{

		document.getElementById('tr_location').style.display = '';
		document.getElementById('tr_location_other').style.display = '';
	}
	else
	{
		document.getElementById('tr_location').style.display = 'none';
		document.getElementById('tr_location_other').style.display = 'none';
	}
	//alert(document.getElementById('tr_location_other').style.display);
	if(val=="1")
	{
		document.getElementById('row_logo').style.display = 'none';
		document.getElementById('row_logo_tmp').style.display = 'none';
		document.getElementById('row_designation').style.display = 'none';
		document.getElementById('row_add_ph').style.display = 'none';
		document.getElementById('row_education').style.display = '';
		document.getElementById('row_occupation').style.display = '';
		document.getElementById('row_income').style.display = '';
		document.getElementById('row_website').style.display = 'none';
	}
	else
	{
		document.getElementById('row_logo').style.display = '';
		document.getElementById('row_logo_tmp').style.display = '';
		document.getElementById('row_designation').style.display = '';
		document.getElementById('row_add_ph').style.display = '';
		document.getElementById('row_education').style.display = 'none';
		document.getElementById('row_occupation').style.display = 'none';
		document.getElementById('row_income').style.display = 'none';
		document.getElementById('row_website').style.display = '';
	}

	if(val == "1" || val=="2")
	{
		document.getElementById('countryall').style.display = '';
		document.getElementById('countrycorporate').style.display = 'none';
		document.getElementById('cityall').style.display = '';
		document.getElementById('citycorporate').style.display = 'none';
	}
	else if(val == "3" || val == "4")
	{
		document.getElementById('countryall').style.display = 'none';
		document.getElementById('countrycorporate').style.display = '';
		document.getElementById('cityall').style.display = 'none';
		document.getElementById('citycorporate').style.display = '';
	}
	if(val == "4" || val == "1")
	{
		document.getElementById('row_url').style.display = 'none';
	}
	else
	{
		document.getElementById('row_url').style.display = '';
	}
}





function check_modifyregistration_form(frm,validate)
{
	if(!validate) validate=true;
	var chk_len = document.registration_frm.member_type.length;
	var count_bug=0;
	for(var counter = 0 ; counter < chk_len; counter++)
	{
		if(document.registration_frm.member_type[counter].checked == true)
		var mem_type = document.registration_frm.member_type[counter].value;
	}
	var dt = new Date();
	var year  = dt.getUTCFullYear();
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}

	if( document.registration_frm.name.value == "" || !check_name(document.registration_frm.name.value))
	{
		document.getElementById('msg_name').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your name without any special characters.";
		if(eval(count_bug)==0) document.registration_frm.name.focus();
			count_bug+=1;
	}

	if(mem_type==2 || mem_type==3 || mem_type==4)
	{
		if( document.registration_frm.company_name.value == "" || validatesymbolalphanumericwithspace('registration_frm','company_name')==false)
		{
			document.getElementById('msg_company_name').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your company name without any special characters.";
			if(eval(count_bug)==0) document.registration_frm.company_name.focus();
				count_bug+=1;
		}
	}

	if(mem_type==2 || mem_type==3)
	{
		if( document.registration_frm.url.value!="" && validatesymbolwithspaceurl('registration_frm','url')==false)
		{
			document.getElementById('div_webpagecheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your webpage name without any special characters.";
			if(eval(count_bug)==0) document.registration_frm.url.focus();
				count_bug+=1;

		}
	}


	 if(mem_type==2 || mem_type==3 || mem_type==4)
	{
		if( document.registration_frm.address.value == "")
		{
			document.getElementById('msg_address1').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your address without any special characters.";
			if(eval(count_bug)==0) document.registration_frm.address.focus();
				count_bug+=1;
		}
	}

	if(mem_type==3 || mem_type==4)
	{

		if( document.registration_frm.country_name2.value=="0")
		{
			document.getElementById('msg_country2').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select your country.";
			if(eval(count_bug)==0) document.registration_frm.country_name2.focus();
			count_bug+=1;
		}

		if( document.registration_frm.city2.value=="")
		{
			document.getElementById('msg_city2').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select your city.";
			if(eval(count_bug)==0) document.registration_frm.city2.focus();
			count_bug+=1;
		}
		else if(document.registration_frm.city2.value=="other" && (document.registration_frm.city_other.value=="" || document.registration_frm.city_other.value=="Please enter the city name"))
		{
			document.getElementById('msg_cityother').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your city.";
			if(eval(count_bug)==0) document.registration_frm.city_other.focus();
			count_bug+=1;
		}
		if(document.registration_frm.city2.value.indexOf("other") != -1 && (document.registration_frm.city_other.value!="" && !check_name(document.registration_frm.city_other.value)))
		{
			document.getElementById('msg_cityother').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter valid city.";
			if(eval(count_bug)==0) document.registration_frm.city_other.focus();
			count_bug+=1;
		}
	}
	else
	{

		if( document.registration_frm.country_name.value=="0")
		{
			document.getElementById('msg_country').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select your country.";
			if(eval(count_bug)==0) document.registration_frm.country_name.focus();
			count_bug+=1;
		}

		if( document.registration_frm.city.value=="")
		{
			document.getElementById('msg_city').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select your city.";
			if(eval(count_bug)==0) document.registration_frm.city.focus();
			count_bug+=1;
		}
		else if(document.registration_frm.city.value=="other" && (document.registration_frm.city_other.value=="" || document.registration_frm.city_other.value=="Please enter the city name"))
		{
			document.getElementById('msg_cityother').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your city.";
			if(eval(count_bug)==0) document.registration_frm.city_other.focus();
			count_bug+=1;
		}
		if(document.registration_frm.city.value.indexOf("other") != -1 && (document.registration_frm.city_other.value!="" && !check_name(document.registration_frm.city_other.value)))
		{
			document.getElementById('msg_cityother').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter valid city.";
			if(eval(count_bug)==0) document.registration_frm.city_other.focus();
			count_bug+=1;
		}

	}
	if(mem_type==2 && (document.registration_frm.locality_id.value.indexOf("other") != -1))
	{
		if(document.registration_frm.locality_other.value!="" && !check_name(document.registration_frm.locality_other.value))
		{
			document.getElementById('msg_localityother').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter valid locality.";
			if(eval(count_bug)==0) document.registration_frm.locality_other.focus();
				count_bug+=1;
		}
	}
	if(document.registration_frm.mobile.value=="" && document.registration_frm.phone.value=="")
	{
		document.getElementById('msg_mobile').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile/phone.";
		if(eval(count_bug)==0) document.registration_frm.mobile.focus();
		count_bug+=1;
	}
	else if(!ValidateNo(document.registration_frm.mobile.value,"1234567890,-/+") && document.registration_frm.mobile.value!="")
	{
		document.getElementById('msg_mobile').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		if(eval(count_bug)==0) document.registration_frm.mobile.focus();
		count_bug+=1;
	}
	else if(isNaN(document.registration_frm.area_code.value) && document.registration_frm.area_code.value!="")
	{
		document.getElementById('msg_mobile').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid area code.";
		if(eval(count_bug)==0) document.registration_frm.area_code.focus();
		count_bug+=1;
	}
	else if(document.registration_frm.area_code.value!="" && document.registration_frm.phone.value=="")
	{
		document.getElementById('msg_mobile').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid phone.";
		if(eval(count_bug)==0) document.registration_frm.phone.focus();
		count_bug+=1;
	}
	else if(document.registration_frm.area_code.value=="" && document.registration_frm.phone.value!="")
	{
		document.getElementById('msg_mobile').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your area code.";
		if(eval(count_bug)==0) document.registration_frm.area_code.focus();
		count_bug+=1;
	}
	else if(!ValidateNo(document.registration_frm.phone.value,"1234567890,-/+") && document.registration_frm.phone.value!="")
	{
		document.getElementById('msg_mobile').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid phone.";
		if(eval(count_bug)==0) document.registration_frm.phone.focus();
		count_bug+=1;
	}
		

	if(mem_type == 1 || mem_type == 3)
	{
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(registration_frm.email.value))
		{
		}
		else
		{
			document.getElementById('msg_email').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid e-mail.";
			if(eval(count_bug)==0) document.registration_frm.email.focus();
			count_bug+=1;
		}
	}

	if(mem_type == 1)
	{
		if( document.registration_frm.dob_year.value=="YYYY" || document.registration_frm.dob_year.value=="" || validateNumber(document.registration_frm.dob_year.value)==false || Trim(document.registration_frm.dob_year.value.length)!=4)
		{
			document.getElementById('msg_dob').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your year of birth.";
			if(eval(count_bug)==0) document.registration_frm.dob_year.focus();
			count_bug+=1;
		}
		var dob_year = parseInt(Trim(document.registration_frm.dob_year.value));
		if((parseInt(dob_year)<parseInt(year-100)) || (parseInt(dob_year)>parseInt(year)))
		{
			document.getElementById('msg_dob').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid year of birth.";
			if(eval(count_bug)==0) document.registration_frm.dob_year.focus();
				count_bug+=1;
		}

		if(document.registration_frm.dob_day.value=="DD" || document.registration_frm.dob_day.value=="" || document.registration_frm.dob_day.value==0)
		{
			document.getElementById('msg_dob').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your date of birth.";
			if(eval(count_bug)==0) document.registration_frm.dob_day.focus();
				count_bug+=1;
		}
		var flg = validateNumber(document.registration_frm.dob_day.value)
		if(!flg)
		{
			document.getElementById('msg_dob').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid date of birth.";
			if(eval(count_bug)==0) document.registration_frm.dob_day.focus();
			count_bug+=1;
		}
		if(!is_valid_day(document.registration_frm.dob_month.value - 1,document.registration_frm.dob_day.value,document.registration_frm.dob_year.value))
		{
			document.getElementById('msg_dob').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid date of birth.";
			if(eval(count_bug)==0) document.registration_frm.dob_day.focus();
			count_bug+=1;
		}
	}
	
	if(validate == true)
	{
		if( document.registration_frm.code_field.value=="" || document.registration_frm.code_field.value == "-- Please enter the code as seen above --")
		{
			document.getElementById('msg_verify').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter the verification code as seen above.";
			if(eval(count_bug)==0) document.registration_frm.code_field.focus();
			count_bug+=1;
		}
		else if(document.registration_frm.code_field.value.length>6 &&  document.registration_frm.code_field.value!="")
		{
			document.getElementById('msg_verify').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter the correct verification code as seen above.";
			if(eval(count_bug)==0) document.registration_frm.code_field.focus();
			count_bug+=1;
		}
	}
	if(count_bug>0)
		return false;
	else
		return true;
}

/////////
function check_contact_form()
{
var tmp_arr = document.getElementsByTagName("div");

	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}	
var count_bug=0;
var focus_field='';
	if(document.contact_frm.name_id.value == "")
	{
		document.getElementById('div_namecheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your name.";
		if(focus_field=='') focus_field = 'name_id';
			count_bug+=1;		
	}

if(document.contact_frm.desg_id.value == "")
	{
		document.getElementById('div_desgcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your Designation.";
		if(focus_field=='') focus_field = 'desg_id';
			count_bug+=1;		
	}

	if(document.contact_frm.address_id.value ==""){
		document.getElementById('div_addresscheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your Address.";
		if(focus_field=='') focus_field = 'address_id';
			count_bug+=1;
	}

	if(document.contact_frm.city.value ==""){
		document.getElementById('div_citycheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please Select your City.";
		if(focus_field=='') focus_field = 'address_id';
			count_bug+=1;
    
	}

	if(document.contact_frm.phone_id.value ==""){
		document.getElementById('div_phonecheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your Phone No.";
		if(focus_field=='') focus_field = 'phone_id';
			count_bug+=1;
    
	}

	if(document.contact_frm.email_id.value ==""){
		document.getElementById('div_emailcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your Email ID.";
		if(focus_field=='') focus_field = 'email_id';
			count_bug+=1;
    
	}
//////////////////////
	
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(contact_frm.email_id.value))
		{
		}
		else
		{
			document.getElementById('div_emailcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid e-mail.";
			count_bug+=1;
			if(focus_field == "")
				focus_field = "email_id";
		}
	
////////////////
	if(document.contact_frm.query_id.value ==""){
		document.getElementById('div_querycheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your query or comment.";
		if(focus_field=='') focus_field = 'query_id';
			count_bug+=1;
    
	}

	if(document.contact_frm.code_id.value ==""){
		document.getElementById('div_codecheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter code.";
		if(focus_field=='') focus_field = 'code_id';
			count_bug+=1;
    
	}

	 

	if(count_bug>0)
	{
		eval('document.contact_frm.' + focus_field + '.focus();');
		return false;
	}
	else
	{
		
		return true;
	}
}


//////////

function check_registration_form1()
{
var chk_len = document.registration_frm.member_type.length;
	var count_bug=0;
	var focus_field = '';
	for(var counter = 0 ; counter < chk_len; counter++)
	{
		if(document.registration_frm.member_type[counter].checked == true)
		var mem_type = document.registration_frm.member_type[counter].value;
		
	}
	var dt = new Date();
	var year  = dt.getUTCFullYear();
	var tmp_arr = document.getElementsByTagName("div");

	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}

	if(document.registration_frm.name.value == "")
	{
		document.getElementById('msg_name').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your name.";
		if(focus_field=='') focus_field = 'name';
			count_bug+=1;		
	}


	if(mem_type==1)
	{

	if(document.registration_frm.city1.value =="null"){
		document.getElementById('msg_city').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your city.";
		if(focus_field=='') focus_field = 'city1';
			count_bug+=1;
	}

	if(document.registration_frm.email.value ==""){
		document.getElementById('msg_email').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your email.";
		if(focus_field=='') focus_field = 'email';
			count_bug+=1;
    
	}

	if(registration_frm.email.value != "")
	{
		if(!isValidEmail(document.registration_frm.email.value))
		{
			document.getElementById('msg_email').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid e-mail.";
			if(focus_field=='') focus_field = 'email';
			count_bug+=1;
		}
	}

	if( document.registration_frm.dob_year.value=="YYYY" || document.registration_frm.dob_year.value=="" || validateNumber(document.registration_frm.dob_year.value)==false || Trim(document.registration_frm.dob_year.value.length)!=4)
		{
			document.getElementById('msg_dob').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your year of birth.";
			if(focus_field=='') focus_field = 'dob_year';
			count_bug+=1;
		}
		var dob_year = parseInt(Trim(document.registration_frm.dob_year.value));
		if((parseInt(dob_year)<parseInt(year-100)) || (parseInt(dob_year)>parseInt(year)))
		{
			document.getElementById('msg_dob').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid year of birth.";
			if(focus_field=='') focus_field = 'dob_year';
				count_bug+=1;
		}

		if(!is_valid_day(document.registration_frm.dob_month.value - 1,document.registration_frm.dob_day.value,document.registration_frm.dob_year.value))
		{
			document.getElementById('msg_dob').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid date of birth.";
			if(focus_field=='') focus_field = 'dob_month';
			count_bug+=1;
		}
		if(document.registration_frm.dob_day.value=="DD" || document.registration_frm.dob_day.value=="" )
		{
			document.getElementById('msg_dob').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your date of birth.";
			if(focus_field=='') focus_field = 'dob_day';
				count_bug+=1;
		}
		var flg = validateNumber(document.registration_frm.dob_day.value)
		if(!flg || document.registration_frm.dob_day.value==0)
		{
			document.getElementById('msg_dob').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your date of birth.";
			if(focus_field=='') focus_field = 'dob_day';
			count_bug+=1;
		}



		if(document.registration_frm.mobile.value=="" && document.registration_frm.phone.value=="")
	     {
		document.getElementById('msg_mobile').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your mobile/landline.";
		if(focus_field=='') focus_field = 'mobile';
		count_bug+=1;
	      }
	        if(!ValidateNo(document.registration_frm.mobile.value,"1234567890,-/+") && document.registration_frm.mobile.value!="")
	         {
		        document.getElementById('msg_mobile').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		        if(focus_field=='') focus_field = 'mobile';
		          count_bug+=1;
	       }



	}
if(mem_type==2)
{
if( document.registration_frm.company_name.value == "" || validatesymbolalphanumericwithspace('registration_frm','company_name')==false)
		{
			document.getElementById('msg_company_name').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your company name without any special characters.";
			if(focus_field=='') focus_field = 'company_name';
				count_bug+=1;
		}


		if( document.registration_frm.address.value == "")
		{
			document.getElementById('msg_address1').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your company address without any special characters.";
			if(focus_field=='') focus_field = 'address';
				count_bug+=1;
		}


		if(document.registration_frm.city1.value =="null"){
		document.getElementById('msg_city').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your city.";
		if(focus_field=='') focus_field = 'city1';
			count_bug+=1;
	}

	if(document.registration_frm.email.value ==""){
		document.getElementById('msg_email').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your email.";
		if(focus_field=='') focus_field = 'email';
			count_bug+=1;
    
	}


	if(registration_frm.email.value != "")
	{
		if(!isValidEmail(document.registration_frm.email.value))
		{
			document.getElementById('msg_email').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid e-mail.";
			if(focus_field=='') focus_field = 'email';
			count_bug+=1;
		}
	}


	if(document.registration_frm.mobile.value=="" && document.registration_frm.phone.value=="")
	     {
		document.getElementById('msg_mobile').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your mobile/landline.";
		if(focus_field=='') focus_field = 'mobile';
		count_bug+=1;
	      }
	        if(!ValidateNo(document.registration_frm.mobile.value,"1234567890,-/+") && document.registration_frm.mobile.value!="")
	         {
		        document.getElementById('msg_mobile').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		        if(focus_field=='') focus_field = 'mobile';
		          count_bug+=1;
	       }



}

if(mem_type==3 || mem_type==4)
{


if( document.registration_frm.company_name.value == "" || validatesymbolalphanumericwithspace('registration_frm','company_name')==false)
		{
			document.getElementById('msg_company_name').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your company name without any special characters.";
			if(focus_field=='') focus_field = 'company_name';
				count_bug+=1;
		}


		if( document.registration_frm.address.value == "")
		{
			document.getElementById('msg_address1').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your company address without any special characters.";
			if(focus_field=='') focus_field = 'address';
				count_bug+=1;
		}



		if( document.registration_frm.country_name2.value=="0")
		{
			document.getElementById('msg_country2').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select your country.";
			if(focus_field=='') focus_field = 'country_name2';
			count_bug+=1;
		}

		if( document.registration_frm.city2.value=="null")
		{
			document.getElementById('msg_city2').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select your city.";
			if(focus_field=='') focus_field = 'city2';
			count_bug+=1;
		}



		if(document.registration_frm.email.value ==""){
		document.getElementById('msg_email').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your email.";
		if(focus_field=='') focus_field = 'email';
			count_bug+=1;
    
	}


	if(registration_frm.email.value != "")
	{
		if(!isValidEmail(document.registration_frm.email.value))
		{
			document.getElementById('msg_email').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid e-mail.";
			if(focus_field=='') focus_field = 'email';
			count_bug+=1;
		}
	}


	if(document.registration_frm.mobile.value=="" && document.registration_frm.phone.value=="")
	     {
		document.getElementById('msg_mobile').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your mobile/landline.";
		if(focus_field=='') focus_field = 'mobile';
		count_bug+=1;
	      }
	        if(!ValidateNo(document.registration_frm.mobile.value,"1234567890,-/+") && document.registration_frm.mobile.value!="")
	         {
		        document.getElementById('msg_mobile').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		        if(focus_field=='') focus_field = 'mobile';
		          count_bug+=1;
	       }
}


if(document.registration_frm.username.value ==""){
		document.getElementById('msg_usercheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter user name.";
		if(focus_field=='') focus_field = 'username';
			count_bug+=1;     
	}

if(document.registration_frm.code_fields.value ==""){
		document.getElementById('msg_verify').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter the code shown above.";
		if(focus_field=='') focus_field = 'code_fields';
			count_bug+=1;
	}
	
	if(document.registration_frm.password.value == ""  || document.registration_frm.password.value.length<4)
	{
		document.getElementById('msg_pass').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your password with minimum 4 characters.";
		if(focus_field=='') focus_field = 'password';
			count_bug+=1;
	}
	if(hasWhiteSpace(document.registration_frm.password.value))
	{
		document.getElementById('msg_pass').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your password without space.";
		if(focus_field=='') focus_field = 'password';
			count_bug+=1;
	}
	if(document.registration_frm.confirm_password.value=="" || document.registration_frm.confirm_password.value!=document.registration_frm.password.value)
	{
		document.getElementById('msg_cpass').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter correct password.";
		if(focus_field=='') focus_field = 'confirm_password';
			count_bug+=1;
	}
	if(hasWhiteSpace(document.registration_frm.confirm_password.value))
	{
		document.getElementById('msg_cpass').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your password without space.";
		if(focus_field=='') focus_field = 'confirm_password';
			count_bug+=1;
	}

	if(hasWhiteSpace(document.registration_frm.code_fields.value))
	{
		document.getElementById('msg_verify').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter the code shown above.";
		if(focus_field=='') focus_field = 'code_fields';
			count_bug+=1;
	}

	if(count_bug>0)
		return false;
	else
		return true;


}



