if(typeof String.prototype.trim !== 'function') {
  String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g, ''); 
  }
}

function addMorePersonalInfo(blockid,country,baseurl)
{
	if(navigator.appName=="Microsoft Internet Explorer")
 	{
		 var i;
		document.getElementById('Count_'+blockid).value=eval(document.getElementById('Count_'+blockid).value)+1;
		var totalBlock=document.getElementById('Count_'+blockid).value;
		var responsestr='';
		
		if(blockid=='Phone')
		{
			responsestr='<div id="'+totalBlock+'_'+blockid+'"><br><select name="phOf_'+totalBlock+'" id="phOf_'+totalBlock+'"><option value="W">Work</option><option value="H">Home</option>	</select> <input type="text"  size="6" id="psnl_ph_no_isd_'+totalBlock+'"  name="psnl_ph_no_isd_'+totalBlock+'"   maxlength="6" title="ISD (Country Code)" onFocus=if(this.value=="ISD")this.value="" onBlur=if(this.value=="")this.value="ISD"';
			if(country=="" || country=="94" )
				responsestr +=' value="91" >';
			else	
				responsestr +=' value="ISD" >';
			responsestr +=' <input type="text" value="STD&nbsp;CODE" size="9"   maxlength="5"  onBlur=if(this.value=="")this.value="STD&nbsp;CODE"  onFocus=if(this.value=="STD&nbsp;CODE")this.value=""  name="psnl_ph_no_std_'+totalBlock+'" id="psnl_ph_no_std_'+totalBlock+'"> <input type="text" value="PHONE" size="13" onFocus=if(this.value=="PHONE")this.value="" onBlur=if(this.value=="")this.value="PHONE"  name="psnl_ph_no_no1_'+totalBlock+'" id="psnl_ph_no_no1_'+totalBlock+'" title="Please enter phone no." maxlength="9">&nbsp;<a style="cursor:pointer"  onclick=hs.htmlExpand(this,{headingText:"Phone&nbsp;Number&nbsp;Format"}) ><img src="'+baseurl+'/public/images/help.gif" > </a>  <div class="highslide-maincontent" >Please enter valid phone no. Valid format is Country Code(ISD), State Code(STD) , Number(PHONE). <br>Example 91-151-234657.This is how it will appear to Prospects.</div></div>';
			 //document.getElementById('Remove_'+blockid).style.display="";
		}
		else if(blockid=='FirmPhone')
		{
			responsestr='<div id="'+totalBlock+'_'+blockid+'"><br><select name="firm_phOf_'+totalBlock+'" id="firm_phOf_'+totalBlock+'"><option value="W">Work</option><option value="H">Home</option>	</select> <input type="text"  size="6" id="firm_psnl_ph_no_isd_'+totalBlock+'"  name="firm_psnl_ph_no_isd_'+totalBlock+'"   maxlength="6" title="ISD (Country Code)" onFocus=if(this.value=="ISD")this.value="" onBlur=if(this.value=="")this.value="ISD"';
			if(country=="" || country=="94" )
				responsestr +=' value="91" >';
			else	
				responsestr +=' value="ISD" >';
			responsestr +=' <input type="text" value="STD&nbsp;CODE" size="9"   maxlength="5"  onBlur=if(this.value=="")this.value="STD&nbsp;CODE"  onFocus=if(this.value=="STD&nbsp;CODE")this.value=""  name="firm_psnl_ph_no_std_'+totalBlock+'" id="firm_psnl_ph_no_std_'+totalBlock+'"> <input type="text" value="PHONE" size="13" onFocus=if(this.value=="PHONE")this.value="" onBlur=if(this.value=="")this.value="PHONE"  name="firm_psnl_ph_no_no1_'+totalBlock+'" id="firm_psnl_ph_no_no1_'+totalBlock+'" title="Please enter phone no." maxlength="9">&nbsp;<a style="cursor:pointer"  onclick=hs.htmlExpand(this,{headingText:"Phone&nbsp;Number&nbsp;Format"}) ><img src="'+baseurl+'/public/images/help.gif" > </a>  <div class="highslide-maincontent" >Please enter valid phone no. Valid format is Country Code(ISD), State Code(STD) , Number(PHONE). <br>Example 91-151-234657.This is how it will appear to Prospects.</div></div>';
			 //document.getElementById('firm_rmv').style.display="";
		}
		else if(blockid=='brPhone')
		{
			responsestr='<div id="'+totalBlock+'_'+blockid+'"><br><select name="br_phOf_'+totalBlock+'" id="br_phOf_'+totalBlock+'"><option value="W">Work</option><option value="H">Home</option>	</select> <input type="text"  size="6" id="br_psnl_ph_no_isd_'+totalBlock+'"  name="br_psnl_ph_no_isd_'+totalBlock+'"   maxlength="6" title="ISD (Country Code)" onFocus=if(this.value=="ISD")this.value="" onBlur=if(this.value=="")this.value="ISD"';
			if(country=="" || country=="94" )
				responsestr +=' value="91" >';
			else	
				responsestr +=' value="ISD" >';
			responsestr +=' <input type="text" value="STD&nbsp;CODE" size="9"   maxlength="5"  onBlur=if(this.value=="")this.value="STD&nbsp;CODE"  onFocus=if(this.value=="STD&nbsp;CODE")this.value=""  name="br_psnl_ph_no_std_'+totalBlock+'" id="br_psnl_ph_no_std_'+totalBlock+'"> <input type="text" value="PHONE" size="13" onFocus=if(this.value=="PHONE")this.value="" onBlur=if(this.value=="")this.value="PHONE"  name="br_psnl_ph_no_no1_'+totalBlock+'" id="br_psnl_ph_no_no1_'+totalBlock+'" title="Please enter phone no." maxlength="9">&nbsp;<a style="cursor:pointer"  onclick=hs.htmlExpand(this,{headingText:"Phone&nbsp;Number&nbsp;Format"}) ><img src="'+baseurl+'/public/images/help.gif" > </a>  <div class="highslide-maincontent" >Please enter valid phone no. Valid format is Country Code(ISD), State Code(STD) , Number(PHONE). <br>Example 91-151-234657.This is how it will appear to Prospects.</div></div>';
			 //document.getElementById('br_rmv').style.display="";
		}
		else if(blockid=='FirmFax')
		{
			responsestr='<div id="'+totalBlock+'_'+blockid+'"><br><select name="firm_FaxOf_'+totalBlock+'" id="firm_FaxOf_'+totalBlock+'"><option value="W">Work</option><option value="H">Home</option>	</select> <input type="text"  size="6" id="firm_fax_no_isd_'+totalBlock+'"  name="firm_fax_no_isd_'+totalBlock+'"   maxlength="6" title="ISD (Country Code)" onFocus=if(this.value=="ISD")this.value="" onBlur=if(this.value=="")this.value="ISD"';
			if(country=="" || country=="94" )
				responsestr +=' value="91" >';
			else	
				responsestr +=' value="ISD" >';
			responsestr +=' <input type="text" value="STD&nbsp;CODE" size="9"   maxlength="5"  onBlur=if(this.value=="")this.value="STD&nbsp;CODE"  onFocus=if(this.value=="STD&nbsp;CODE")this.value=""  name="firm_fax_no_std_'+totalBlock+'" id="firm_fax_no_std_'+totalBlock+'"> <input type="text" value="FAX" size="13" onFocus=if(this.value=="FAX")this.value="" onBlur=if(this.value=="")this.value="FAX"  name="firm_fax_no_no1_'+totalBlock+'" id="firm_fax_no_no1_'+totalBlock+'" title="Please enter phone no." maxlength="9">&nbsp;<a style="cursor:pointer"  onclick=hs.htmlExpand(this,{headingText:"Fax&nbsp;Number&nbsp;Format"}) ><img src="'+baseurl+'/public/images/help.gif" > </a>  <div class="highslide-maincontent" >Please enter valid fax no. Valid format is Country Code(ISD), State Code(STD) , Number(FAX). <br>Example 91-151-234657.This is how it will appear to Prospects.</div></div>';
			// document.getElementById('firm_fax_rmv').style.display="";
		}
		else if(blockid=='brFax')
		{
			responsestr='<div id="'+totalBlock+'_'+blockid+'"><br><select name="br_faxOf_'+totalBlock+'" id="br_faxOf_'+totalBlock+'"><option value="W">Work</option><option value="H">Home</option>	</select> <input type="text"  size="6" id="br_fax_no_isd_'+totalBlock+'"  name="br_fax_no_isd_'+totalBlock+'"   maxlength="6" title="ISD (Country Code)" onFocus=if(this.value=="ISD")this.value="" onBlur=if(this.value=="")this.value="ISD"';
			if(country=="" || country=="94" )
				responsestr +=' value="91" >';
			else	
				responsestr +=' value="ISD" >';
			responsestr +=' <input type="text" value="STD&nbsp;CODE" size="9"   maxlength="5"  onBlur=if(this.value=="")this.value="STD&nbsp;CODE"  onFocus=if(this.value=="STD&nbsp;CODE")this.value=""  name="br_fax_no_std_'+totalBlock+'" id="br_fax_no_std_'+totalBlock+'"> <input type="text" value="FAX" size="13" onFocus=if(this.value=="FAX")this.value="" onBlur=if(this.value=="")this.value="FAX"  name="br_fax_no_no1_'+totalBlock+'" id="br_fax_no_no1_'+totalBlock+'" title="Please enter phone no." maxlength="9">&nbsp;<a style="cursor:pointer"  onclick=hs.htmlExpand(this,{headingText:"Fax&nbsp;Number&nbsp;Format"}) ><img src="'+baseurl+'/public/images/help.gif" > </a>  <div class="highslide-maincontent" >Please enter valid fax no. Valid format is Country Code(ISD), State Code(STD) , Number(FAX). <br>Example 91-151-234657.This is how it will appear to Prospects.</div></div>';
			// document.getElementById('br_fax_rmv').style.display="";
		}
		else if(blockid=='Mobile')
		{
			responsestr='<div id="'+totalBlock+'_'+blockid+'"><br><select name="mphOf_'+totalBlock+'" id="mphOf_'+totalBlock+'"><option value="W">Work</option><option value="H">Home</option>	</select> <input type="text"  size="6" id="mob_no_isd_'+totalBlock+'"  name="mob_no_isd_'+totalBlock+'"   maxlength="6" title="ISD (Country Code)" onFocus=if(this.value=="ISD")this.value="" onBlur=if(this.value=="")this.value="ISD"';
			if(country=="" || country=="94" )
				responsestr +=' value="91" >';
			else	
				responsestr +=' value="ISD" >';
			responsestr +=' <input type="text" value="MOBILE" size="15" onFocus=if(this.value=="MOBILE")this.value="" onBlur=if(this.value=="")this.value="MOBILE"  name="mob_no_mob_'+totalBlock+'" id="mob_no_mob_'+totalBlock+'" title="Please enter mobile no." maxlength="12">&nbsp;<a style="cursor:pointer"  onclick=hs.htmlExpand(this,{headingText:"Mobile&nbsp;Number&nbsp;Format"}) ><img src="'+baseurl+'/public/images/help.gif" > </a>  <div class="highslide-maincontent" >Please enter valid mobile no. Valid format is Country Code(ISD), Number(MOBILE). <br>Example: 91-9826234657.This is how it will appear to Prospects.</div></div>';
			// document.getElementById('rmvm').style.display="";
		}
		else if(blockid=='FirmMobile')
		{
			responsestr='<div id="'+totalBlock+'_'+blockid+'"><br><select name="firm_mphOf_'+totalBlock+'" id="firm_mphOf_'+totalBlock+'"><option value="W">Work</option><option value="H">Home</option>	</select> <input type="text"  size="6" id="firm_mob_no_isd_'+totalBlock+'"  name="firm_mob_no_isd_'+totalBlock+'"   maxlength="6" title="ISD (Country Code)" onFocus=if(this.value=="ISD")this.value="" onBlur=if(this.value=="")this.value="ISD"';
			if(country=="" || country=="94" )
				responsestr +=' value="91" >';
			else	
				responsestr +=' value="ISD" >';
			responsestr +=' <input type="text" value="MOBILE" size="15" onFocus=if(this.value=="MOBILE")this.value="" onBlur=if(this.value=="")this.value="MOBILE"  name="firm_mob_no_mob_'+totalBlock+'" id="firm_mob_no_mob_'+totalBlock+'" title="Please enter mobile no." maxlength="12">&nbsp;<a style="cursor:pointer"  onclick=hs.htmlExpand(this,{headingText:"Mobile&nbsp;Number&nbsp;Format"}) ><img src="'+baseurl+'/public/images/help.gif" > </a>  <div class="highslide-maincontent" >Please enter valid mobile no. Valid format is Country Code(ISD), Number(MOBILE). <br>Example: 91-9826234657.This is how it will appear to Prospects.</div></div>';
			// document.getElementById('firm_rmvm').style.display="";
		
		}
		else if(blockid=='brMobile')
		{
			responsestr='<div id="'+totalBlock+'_'+blockid+'"><br><select name="br_mphOf_'+totalBlock+'" id="br_mphOf_'+totalBlock+'"><option value="W">Work</option><option value="H">Home</option>	</select> <input type="text"  size="6" id="br_mob_no_isd_'+totalBlock+'"  name="br_mob_no_isd_'+totalBlock+'"   maxlength="6" title="ISD (Country Code)" onFocus=if(this.value=="ISD")this.value="" onBlur=if(this.value=="")this.value="ISD"';
			if(country=="" || country=="94" )
				responsestr +=' value="91" >';
			else	
				responsestr +=' value="ISD" >';
			responsestr +=' <input type="text" value="MOBILE" size="15" onFocus=if(this.value=="MOBILE")this.value="" onBlur=if(this.value=="")this.value="MOBILE"  name="br_mob_no_mob_'+totalBlock+'" id="br_mob_no_mob_'+totalBlock+'" title="Please enter mobile no." maxlength="12">&nbsp;<a style="cursor:pointer"  onclick=hs.htmlExpand(this,{headingText:"Mobile&nbsp;Number&nbsp;Format"}) ><img src="'+baseurl+'/public/images/help.gif" > </a>  <div class="highslide-maincontent" >Please enter valid mobile no. Valid format is Country Code(ISD), Number(MOBILE). <br>Example: 91-9826234657.This is how it will appear to Prospects.</div></div>';
			// document.getElementById('br_rmvm').style.display="";
		}
		 document.getElementById('Remove_'+blockid).style.display="";
		document.getElementById('More_'+blockid).innerHTML+=responsestr;
		document.getElementById('More_'+blockid).style.display='inline';

	}
	else
	{
	 var i;
	document.getElementById('Count_'+blockid).value=eval(document.getElementById('Count_'+blockid).value)+1;
	var totalBlock=document.getElementById('Count_'+blockid).value;
	var responsestr='';
	
	if(blockid=='Phone')
	{
		
		var phof = document.createElement("select");
		phof.setAttribute("id", 'phOf_'+totalBlock);
		 /*phof.setAttribute("size", '10');*/
		 /*phof.setAttribute("multiple", 'multiple');*/
		phof.setAttribute("name", 'phOf_'+totalBlock);
		phof.options[0] = new Option('Work','W');
		phof.options[1] = new Option('Home','H');
		
		isd = document.createElement("input");
		isd.setAttribute("type", 'text');
		isd.setAttribute("value", '91');
		isd.setAttribute("size", '6');
		isd.setAttribute("maxlength", '5');
		isd.setAttribute("name", 'psnl_ph_no_isd_'+totalBlock);
		isd.setAttribute("id", 'psnl_ph_no_isd_'+totalBlock);
		isd.setAttribute("onFocus", 'if(this.value=="ISD")this.value=""');
		isd.setAttribute("onBlur", 'if(this.value=="")this.value="ISD"');
		
		std = document.createElement("input");
		std.setAttribute("type", 'text');
		std.setAttribute("value", 'STD CODE');
		std.setAttribute("size", '9');
		std.setAttribute("maxlength", '5');
		std.setAttribute("name", 'psnl_ph_no_std_'+totalBlock);
		std.setAttribute("id", 'psnl_ph_no_std_'+totalBlock);
		std.setAttribute("onFocus", 'if(this.value=="STD CODE")this.value=""');
		std.setAttribute("onBlur", 'if(this.value=="")this.value="STD CODE"');
		
		phone = document.createElement("input");
		phone.setAttribute("type", 'text');
		phone.setAttribute("value", 'PHONE');
		phone.setAttribute("size", '13');
		phone.setAttribute("maxlength", '9');
		phone.setAttribute("name", 'psnl_ph_no_no1_'+totalBlock);
		phone.setAttribute("id", 'psnl_ph_no_no1_'+totalBlock);
		phone.setAttribute("onFocus", 'if(this.value=="PHONE")this.value=""');
		phone.setAttribute("onBlur", 'if(this.value=="")this.value="PHONE"');
		
		tdiv = document.createElement("div");
		tdiv.setAttribute("id", totalBlock+'_'+blockid);
		tdiv.setAttribute("style", 'margin-top:5px;');
		
		var help = document.createElement('a');
		help.setAttribute('onclick', 'hs.htmlExpand(this,{headingText:"Phone&nbsp;Number&nbsp;Format"})');
		//help.setAttribute('title', 'mainpage');
		help.setAttribute('style', 'cursor:pointer');
		
		var image = document.createElement('img');
		image.setAttribute('title', 'mainpage');
		image.setAttribute('src', baseurl+'/public/images/help.gif');
		
		help.appendChild(image);
		
		dtdiv = document.createElement("div");
		dtdiv.setAttribute("class", 'highslide-maincontent');
		
		var message = document.createTextNode("Please enter valid phone no. Valid format is Country Code(ISD), State Code(STD) ,Number(PHONE). \nExample 91-151-234657.This is how it will appear to Prospects.");
		
		dtdiv.appendChild(message);
		
		var theBR = document.createTextNode("   ");
		var theBR1 = document.createTextNode('   ');
		var theBR2 = document.createTextNode('   ');
		var theBR3 = document.createTextNode('   ');
		
		tdiv.appendChild(phof);
		tdiv.appendChild(theBR);
		tdiv.appendChild(isd);
		tdiv.appendChild(theBR1);
		tdiv.appendChild(std);
		tdiv.appendChild(theBR2);
		tdiv.appendChild(phone);
		tdiv.appendChild(theBR3);
		tdiv.appendChild(help);
		tdiv.appendChild(dtdiv);
		
		
		
	
	}
	else if(blockid=='FirmPhone')
	{
		
			
		var phof = document.createElement("select");
		phof.setAttribute("id", 'firm_phOf_'+totalBlock);
		phof.setAttribute("name", 'firm_phOf_'+totalBlock);
		phof.options[0] = new Option('Work','W');
		phof.options[1] = new Option('Home','H');
		
		isd = document.createElement("input");
		isd.setAttribute("type", 'text');
		isd.setAttribute("value", '91');
		isd.setAttribute("size", '6');
		isd.setAttribute("maxlength", '5');
		isd.setAttribute("name", 'firm_psnl_ph_no_isd_'+totalBlock);
		isd.setAttribute("id", 'firm_psnl_ph_no_isd_'+totalBlock);
		isd.setAttribute("onFocus", 'if(this.value=="ISD")this.value=""');
		isd.setAttribute("onBlur", 'if(this.value=="")this.value="ISD"');
		
		std = document.createElement("input");
		std.setAttribute("type", 'text');
		std.setAttribute("value", 'STD CODE');
		std.setAttribute("size", '9');
		std.setAttribute("maxlength", '5');
		std.setAttribute("name", 'firm_psnl_ph_no_std_'+totalBlock);
		std.setAttribute("id", 'firm_psnl_ph_no_std_'+totalBlock);
		std.setAttribute("onFocus", 'if(this.value=="STD CODE")this.value=""');
		std.setAttribute("onBlur", 'if(this.value=="")this.value="STD CODE"');
		
		phone = document.createElement("input");
		phone.setAttribute("type", 'text');
		phone.setAttribute("value", 'PHONE');
		phone.setAttribute("size", '13');
		phone.setAttribute("maxlength", '9');
		phone.setAttribute("name", 'firm_psnl_ph_no_no1_'+totalBlock);
		phone.setAttribute("id", 'firm_psnl_ph_no_no1_'+totalBlock);
		phone.setAttribute("onFocus", 'if(this.value=="PHONE")this.value=""');
		phone.setAttribute("onBlur", 'if(this.value=="")this.value="PHONE"');
		
		tdiv = document.createElement("div");
		tdiv.setAttribute("id", totalBlock+'_'+blockid);
		tdiv.setAttribute("style", 'margin-top:5px;');
		
		var help = document.createElement('a');
		help.setAttribute('onclick', 'hs.htmlExpand(this,{headingText:"Phone&nbsp;Number&nbsp;Format"})');
		//help.setAttribute('title', 'mainpage');
		help.setAttribute('style', 'cursor:pointer');
		
		var image = document.createElement('img');
		image.setAttribute('title', 'mainpage');
		image.setAttribute('src', baseurl+'/public/images/help.gif');
		
		help.appendChild(image);
		
		dtdiv = document.createElement("div");
		dtdiv.setAttribute("class", 'highslide-maincontent');
		
		var message = document.createTextNode("Please enter valid phone no. Valid format is Country Code(ISD), State Code(STD) ,Number(PHONE). \nExample 91-151-234657.This is how it will appear to Prospects.");
		
		dtdiv.appendChild(message);
		
		var theBR = document.createTextNode("   ");
		var theBR1 = document.createTextNode('   ');
		var theBR2 = document.createTextNode('   ');
		var theBR3 = document.createTextNode('   ');
		
		tdiv.appendChild(phof);
		tdiv.appendChild(theBR);
		tdiv.appendChild(isd);
		tdiv.appendChild(theBR1);
		tdiv.appendChild(std);
		tdiv.appendChild(theBR2);
		tdiv.appendChild(phone);
		tdiv.appendChild(theBR3);
		tdiv.appendChild(help);
		tdiv.appendChild(dtdiv);
		
	}
	else if(blockid=='brPhone')
	{
				
		var phof = document.createElement("select");
		phof.setAttribute("id", 'br_phOf_'+totalBlock);
		phof.setAttribute("name", 'br_phOf_'+totalBlock);
		phof.options[0] = new Option('Work','W');
		phof.options[1] = new Option('Home','H');
		
		isd = document.createElement("input");
		isd.setAttribute("type", 'text');
		isd.setAttribute("value", '91');
		isd.setAttribute("size", '6');
		isd.setAttribute("maxlength", '6');
		isd.setAttribute("name", 'br_psnl_ph_no_isd_'+totalBlock);
		isd.setAttribute("id", 'br_psnl_ph_no_isd_'+totalBlock);
		isd.setAttribute("onFocus", 'if(this.value=="ISD")this.value=""');
		isd.setAttribute("onBlur", 'if(this.value=="")this.value="ISD"');
		
		std = document.createElement("input");
		std.setAttribute("type", 'text');
		std.setAttribute("value", 'STD CODE');
		std.setAttribute("size", '9');
		std.setAttribute("maxlength", '5');
		std.setAttribute("name", 'br_psnl_ph_no_std_'+totalBlock);
		std.setAttribute("id", 'br_psnl_ph_no_std_'+totalBlock);
		std.setAttribute("onFocus", 'if(this.value=="STD CODE")this.value=""');
		std.setAttribute("onBlur", 'if(this.value=="")this.value="STD CODE"');
		
		phone = document.createElement("input");
		phone.setAttribute("type", 'text');
		phone.setAttribute("value", 'PHONE');
		phone.setAttribute("size", '13');
		phone.setAttribute("maxlength", '9');
		phone.setAttribute("name", 'br_psnl_ph_no_no1_'+totalBlock);
		phone.setAttribute("id", 'br_psnl_ph_no_no1_'+totalBlock);
		phone.setAttribute("onFocus", 'if(this.value=="PHONE")this.value=""');
		phone.setAttribute("onBlur", 'if(this.value=="")this.value="PHONE"');
		
		tdiv = document.createElement("div");
		tdiv.setAttribute("id", totalBlock+'_'+blockid);
		tdiv.setAttribute("style", 'margin-top:5px;');
		
		var help = document.createElement('a');
		help.setAttribute('onclick', 'hs.htmlExpand(this,{headingText:"Phone&nbsp;Number&nbsp;Format"})');
		//help.setAttribute('title', 'mainpage');
		help.setAttribute('style', 'cursor:pointer');
		
		var image = document.createElement('img');
		image.setAttribute('title', 'mainpage');
		image.setAttribute('src', baseurl+'/public/images/help.gif');
		
		help.appendChild(image);
		
		dtdiv = document.createElement("div");
		dtdiv.setAttribute("class", 'highslide-maincontent');
		
		var message = document.createTextNode("Please enter valid phone no. Valid format is Country Code(ISD), State Code(STD) ,Number(PHONE). \nExample 91-151-234657.This is how it will appear to Prospects.");
		
		dtdiv.appendChild(message);
		
		var theBR = document.createTextNode("   ");
		var theBR1 = document.createTextNode('   ');
		var theBR2 = document.createTextNode('   ');
		var theBR3 = document.createTextNode('   ');
		
		tdiv.appendChild(phof);
		tdiv.appendChild(theBR);
		tdiv.appendChild(isd);
		tdiv.appendChild(theBR1);
		tdiv.appendChild(std);
		tdiv.appendChild(theBR2);
		tdiv.appendChild(phone);
		tdiv.appendChild(theBR3);
		tdiv.appendChild(help);
		tdiv.appendChild(dtdiv);
		
	}
	
	else if(blockid=='FirmFax')
	{
		
			
		var phof = document.createElement("select");
		phof.setAttribute("id", 'firm_FaxOf_'+totalBlock);
		phof.setAttribute("name", 'firm_FaxOf_'+totalBlock);
		phof.options[0] = new Option('Work','W');
		phof.options[1] = new Option('Home','H');
		
		isd = document.createElement("input");
		isd.setAttribute("type", 'text');
		isd.setAttribute("value", '91');
		isd.setAttribute("size", '6');
		isd.setAttribute("maxlength", '6');
		isd.setAttribute("name", 'firm_fax_no_isd_'+totalBlock);
		isd.setAttribute("id", 'firm_fax_no_isd_'+totalBlock);
		isd.setAttribute("onFocus", 'if(this.value=="ISD")this.value=""');
		isd.setAttribute("onBlur", 'if(this.value=="")this.value="ISD"');
		
		std = document.createElement("input");
		std.setAttribute("type", 'text');
		std.setAttribute("value", 'STD CODE');
		std.setAttribute("size", '9');
		std.setAttribute("maxlength", '5');
		std.setAttribute("name", 'firm_fax_no_std_'+totalBlock);
		std.setAttribute("id", 'firm_fax_no_std_'+totalBlock);
		std.setAttribute("onFocus", 'if(this.value=="STD CODE")this.value=""');
		std.setAttribute("onBlur", 'if(this.value=="")this.value="STD CODE"');
		
		phone = document.createElement("input");
		phone.setAttribute("type", 'text');
		phone.setAttribute("value", 'FAX');
		phone.setAttribute("size", '13');
		phone.setAttribute("maxlength", '9');
		phone.setAttribute("name", 'firm_fax_no_no1_'+totalBlock);
		phone.setAttribute("id", 'firm_fax_no_no1_'+totalBlock);
		phone.setAttribute("onFocus", 'if(this.value=="FAX")this.value=""');
		phone.setAttribute("onBlur", 'if(this.value=="")this.value="FAX"');
		
		tdiv = document.createElement("div");
		tdiv.setAttribute("id", totalBlock+'_'+blockid);
		tdiv.setAttribute("style", 'margin-top:5px;');
		
		var help = document.createElement('a');
		help.setAttribute('onclick', 'hs.htmlExpand(this,{headingText:"Phone&nbsp;Number&nbsp;Format"})');
		//help.setAttribute('title', 'mainpage');
		help.setAttribute('style', 'cursor:pointer');
		
		var image = document.createElement('img');
		image.setAttribute('title', 'mainpage');
		image.setAttribute('src', baseurl+'/public/images/help.gif');
		
		help.appendChild(image);
		
		dtdiv = document.createElement("div");
		dtdiv.setAttribute("class", 'highslide-maincontent');
		
		var message = document.createTextNode("Please enter valid fax no. Valid format is Country Code(ISD), State Code(STD) , Number(FAX). \n Example 91-151-234657.This is how it will appear to Prospects.");
		
		dtdiv.appendChild(message);
		
		var theBR = document.createTextNode("   ");
		var theBR1 = document.createTextNode('   ');
		var theBR2 = document.createTextNode('   ');
		var theBR3 = document.createTextNode('   ');
		
		tdiv.appendChild(phof);
		tdiv.appendChild(theBR);
		tdiv.appendChild(isd);
		tdiv.appendChild(theBR1);
		tdiv.appendChild(std);
		tdiv.appendChild(theBR2);
		tdiv.appendChild(phone);
		tdiv.appendChild(theBR3);
		tdiv.appendChild(help);
		tdiv.appendChild(dtdiv);
		
	}
	else if(blockid=='brFax')
	{
		var phof = document.createElement("select");
		phof.setAttribute("id", 'br_faxOf_'+totalBlock);
		phof.setAttribute("name", 'br_faxOf_'+totalBlock);
		phof.options[0] = new Option('Work','W');
		phof.options[1] = new Option('Home','H');
		
		isd = document.createElement("input");
		isd.setAttribute("type", 'text');
		isd.setAttribute("value", '91');
		isd.setAttribute("size", '6');
		isd.setAttribute("maxlength", '6');
		isd.setAttribute("name", 'br_fax_no_isd_'+totalBlock);
		isd.setAttribute("id", 'br_fax_no_isd_'+totalBlock);
		isd.setAttribute("onFocus", 'if(this.value=="ISD")this.value=""');
		isd.setAttribute("onBlur", 'if(this.value=="")this.value="ISD"');
		
		std = document.createElement("input");
		std.setAttribute("type", 'text');
		std.setAttribute("value", 'STD CODE');
		std.setAttribute("size", '9');
		std.setAttribute("maxlength", '5');
		std.setAttribute("name", 'br_fax_no_std_'+totalBlock);
		std.setAttribute("id", 'br_fax_no_std_'+totalBlock);
		std.setAttribute("onFocus", 'if(this.value=="STD CODE")this.value=""');
		std.setAttribute("onBlur", 'if(this.value=="")this.value="STD CODE"');
		
		phone = document.createElement("input");
		phone.setAttribute("type", 'text');
		phone.setAttribute("value", 'FAX');
		phone.setAttribute("size", '13');
		phone.setAttribute("maxlength", '9');
		phone.setAttribute("name", 'br_fax_no_no1_'+totalBlock);
		phone.setAttribute("id", 'br_fax_no_no1_'+totalBlock);
		phone.setAttribute("onFocus", 'if(this.value=="FAX")this.value=""');
		phone.setAttribute("onBlur", 'if(this.value=="")this.value="FAX"');
		
		tdiv = document.createElement("div");
		tdiv.setAttribute("id", totalBlock+'_'+blockid);
		tdiv.setAttribute("style", 'margin-top:5px;');
		
		var help = document.createElement('a');
		help.setAttribute('onclick', 'hs.htmlExpand(this,{headingText:"Phone&nbsp;Number&nbsp;Format"})');
		//help.setAttribute('title', 'mainpage');
		help.setAttribute('style', 'cursor:pointer');
		
		var image = document.createElement('img');
		image.setAttribute('title', 'mainpage');
		image.setAttribute('src', baseurl+'/public/images/help.gif');
		
		help.appendChild(image);
		
		dtdiv = document.createElement("div");
		dtdiv.setAttribute("class", 'highslide-maincontent');
		
		var message = document.createTextNode("Please enter valid fax no. Valid format is Country Code(ISD), State Code(STD) , Number(FAX). \n Example 91-151-234657.This is how it will appear to Prospects.");
		
		dtdiv.appendChild(message);
		
		var theBR = document.createTextNode("   ");
		var theBR1 = document.createTextNode('   ');
		var theBR2 = document.createTextNode('   ');
		var theBR3 = document.createTextNode('   ');
		
		tdiv.appendChild(phof);
		tdiv.appendChild(theBR);
		tdiv.appendChild(isd);
		tdiv.appendChild(theBR1);
		tdiv.appendChild(std);
		tdiv.appendChild(theBR2);
		tdiv.appendChild(phone);
		tdiv.appendChild(theBR3);
		tdiv.appendChild(help);
		tdiv.appendChild(dtdiv);
		
	}
	else if(blockid=='Mobile')
	{
		
		var phof = document.createElement("select");
		phof.setAttribute("id", 'mphOf_'+totalBlock);
		phof.setAttribute("name", 'mphOf_'+totalBlock);
		phof.options[0] = new Option('Work','W');
		phof.options[1] = new Option('Home','H');
		
		isd = document.createElement("input");
		isd.setAttribute("type", 'text');
		isd.setAttribute("value", '91');
		isd.setAttribute("size", '6');
		isd.setAttribute("maxlength", '5');
		isd.setAttribute("name", 'mob_no_isd_'+totalBlock);
		isd.setAttribute("id", 'mob_no_isd_'+totalBlock);
		isd.setAttribute("onFocus", 'if(this.value=="ISD")this.value=""');
		isd.setAttribute("onBlur", 'if(this.value=="")this.value="ISD"');
		
		
		phone = document.createElement("input");
		phone.setAttribute("type", 'text');
		phone.setAttribute("value", 'MOBILE');
		phone.setAttribute("size", '15');
		phone.setAttribute("maxlength", '12');
		phone.setAttribute("name", 'mob_no_mob_'+totalBlock);
		phone.setAttribute("id", 'mob_no_mob_'+totalBlock);
		phone.setAttribute("onFocus", 'if(this.value=="MOBILE")this.value=""');
		phone.setAttribute("onBlur", 'if(this.value=="")this.value="MOBILE"');
		
		tdiv = document.createElement("div");
		tdiv.setAttribute("id", totalBlock+'_'+blockid);
		tdiv.setAttribute("style", 'margin-top:5px;');
		
		var help = document.createElement('a');
		help.setAttribute('onclick', 'hs.htmlExpand(this,{headingText:"Phone&nbsp;Number&nbsp;Format"})');
		//help.setAttribute('title', 'mainpage');
		help.setAttribute('style', 'cursor:pointer');
		
		var image = document.createElement('img');
		image.setAttribute('title', 'mainpage');
		image.setAttribute('src', baseurl+'/public/images/help.gif');
		
		help.appendChild(image);
		
		dtdiv = document.createElement("div");
		dtdiv.setAttribute("class", 'highslide-maincontent');
		
		var message = document.createTextNode("Please enter valid mobile no. Valid format is Country Code(ISD), Number(MOBILE). \n Example: 91-9826234657.This is how it will appear to Prospects.");
		
		dtdiv.appendChild(message);
		
		var theBR = document.createTextNode("   ");
		var theBR1 = document.createTextNode('   ');
		var theBR2 = document.createTextNode('   ');
		var theBR3 = document.createTextNode('   ');
		
		tdiv.appendChild(phof);
		tdiv.appendChild(theBR);
		tdiv.appendChild(isd);
		tdiv.appendChild(theBR1);
		tdiv.appendChild(phone);
		tdiv.appendChild(theBR3);
		tdiv.appendChild(help);
		tdiv.appendChild(dtdiv);
		}
	else if(blockid=='FirmMobile')
	{
			
		var phof = document.createElement("select");
		phof.setAttribute("id", 'firm_mphOf_'+totalBlock);
		phof.setAttribute("name", 'firm_mphOf_'+totalBlock);
		phof.options[0] = new Option('Work','W');
		phof.options[1] = new Option('Home','H');
		
		isd = document.createElement("input");
		isd.setAttribute("type", 'text');
		isd.setAttribute("value", '91');
		isd.setAttribute("size", '6');
		isd.setAttribute("maxlength", '5');
		isd.setAttribute("name", 'firm_mob_no_isd_'+totalBlock);
		isd.setAttribute("id", 'firm_mob_no_isd_'+totalBlock);
		isd.setAttribute("onFocus", 'if(this.value=="ISD")this.value=""');
		isd.setAttribute("onBlur", 'if(this.value=="")this.value="ISD"');
		
		
		phone = document.createElement("input");
		phone.setAttribute("type", 'text');
		phone.setAttribute("value", 'MOBILE');
		phone.setAttribute("size", '15');
		phone.setAttribute("maxlength", '12');
		phone.setAttribute("name", 'firm_mob_no_mob_'+totalBlock);
		phone.setAttribute("id", 'firm_mob_no_mob_'+totalBlock);
		phone.setAttribute("onFocus", 'if(this.value=="MOBILE")this.value=""');
		phone.setAttribute("onBlur", 'if(this.value=="")this.value="MOBILE"');
		
		tdiv = document.createElement("div");
		tdiv.setAttribute("id", totalBlock+'_'+blockid);
		tdiv.setAttribute("style", 'margin-top:5px;');
		
		var help = document.createElement('a');
		help.setAttribute('onclick', 'hs.htmlExpand(this,{headingText:"Phone&nbsp;Number&nbsp;Format"})');
		//help.setAttribute('title', 'mainpage');
		help.setAttribute('style', 'cursor:pointer');
		
		var image = document.createElement('img');
		image.setAttribute('title', 'mainpage');
		image.setAttribute('src', baseurl+'/public/images/help.gif');
		
		help.appendChild(image);
		
		dtdiv = document.createElement("div");
		dtdiv.setAttribute("class", 'highslide-maincontent');
		
		var message = document.createTextNode("Please enter valid mobile no. Valid format is Country Code(ISD), Number(MOBILE). \n Example: 91-9826234657.This is how it will appear to Prospects.");
		
		dtdiv.appendChild(message);
		
		var theBR = document.createTextNode("   ");
		var theBR1 = document.createTextNode('   ');
		var theBR2 = document.createTextNode('   ');
		var theBR3 = document.createTextNode('   ');
		
		tdiv.appendChild(phof);
		tdiv.appendChild(theBR);
		tdiv.appendChild(isd);
		tdiv.appendChild(theBR1);
		tdiv.appendChild(phone);
		tdiv.appendChild(theBR3);
		tdiv.appendChild(help);
		tdiv.appendChild(dtdiv);
		
	}
	else if(blockid=='brMobile')
	{
		var phof = document.createElement("select");
		phof.setAttribute("id", 'br_mphOf_'+totalBlock);
		phof.setAttribute("name", 'br_mphOf_'+totalBlock);
		phof.options[0] = new Option('Work','W');
		phof.options[1] = new Option('Home','H');
		
		isd = document.createElement("input");
		isd.setAttribute("type", 'text');
		isd.setAttribute("value", '91');
		isd.setAttribute("size", '6');
		isd.setAttribute("maxlength", '6');
		isd.setAttribute("name", 'br_mob_no_isd_'+totalBlock);
		isd.setAttribute("id", 'br_mob_no_isd_'+totalBlock);
		isd.setAttribute("onFocus", 'if(this.value=="ISD")this.value=""');
		isd.setAttribute("onBlur", 'if(this.value=="")this.value="ISD"');
		
		
		phone = document.createElement("input");
		phone.setAttribute("type", 'text');
		phone.setAttribute("value", 'MOBILE');
		phone.setAttribute("size", '15');
		phone.setAttribute("maxlength", '12');
		phone.setAttribute("name", 'br_mob_no_mob_'+totalBlock);
		phone.setAttribute("id", 'br_mob_no_mob_'+totalBlock);
		phone.setAttribute("onFocus", 'if(this.value=="MOBILE")this.value=""');
		phone.setAttribute("onBlur", 'if(this.value=="")this.value="MOBILE"');
		
		tdiv = document.createElement("div");
		tdiv.setAttribute("id", totalBlock+'_'+blockid);
		tdiv.setAttribute("style", 'margin-top:5px;');
		
		var help = document.createElement('a');
		help.setAttribute('onclick', 'hs.htmlExpand(this,{headingText:"Phone&nbsp;Number&nbsp;Format"})');
		//help.setAttribute('title', 'mainpage');
		help.setAttribute('style', 'cursor:pointer');
		
		var image = document.createElement('img');
		image.setAttribute('title', 'mainpage');
		image.setAttribute('src', baseurl+'/public/images/help.gif');
		
		help.appendChild(image);
		
		dtdiv = document.createElement("div");
		dtdiv.setAttribute("class", 'highslide-maincontent');
		
		var message = document.createTextNode("Please enter valid mobile no. Valid format is Country Code(ISD), Number(MOBILE). \n Example: 91-9826234657.This is how it will appear to Prospects.");
		
		dtdiv.appendChild(message);
		
		var theBR = document.createTextNode("   ");
		var theBR1 = document.createTextNode('   ');
		var theBR2 = document.createTextNode('   ');
		var theBR3 = document.createTextNode('   ');
		
		tdiv.appendChild(phof);
		tdiv.appendChild(theBR);
		tdiv.appendChild(isd);
		tdiv.appendChild(theBR1);
		tdiv.appendChild(phone);
		tdiv.appendChild(theBR3);
		tdiv.appendChild(help);
		tdiv.appendChild(dtdiv);
		
	
	}
	document.getElementById('Remove_'+blockid).style.display="";
	document.getElementById('More_'+blockid).appendChild(tdiv);
	document.getElementById('More_'+blockid).style.display='inline';
	
	}
	
}
function addMoreInfo(blockid)
{
	basepath=document.getElementById('basepath').value;
	if(navigator.appName=="Microsoft Internet Explorer")
 	{	
		var i;
		document.getElementById('Count_'+blockid).value=eval(document.getElementById('Count_'+blockid).value)+1;
		
		var totalBlock=document.getElementById('Count_'+blockid).value;
		var responsestr='';
		
		if(blockid=='Education')
		{
			//alert('This is IE');  
			var acctype= document.form1.acctype.value;
			
			//fetch month
			var arrMonths= document.form1.month_1.options;
			var monthlist;
			for(i=0; i < arrMonths.length; i++)
			{
				textMonth=document.form1.month_1.options[i].text;
				valueMonth=document.form1.month_1.options[i].value;
				 monthlist+= '<option value="'+valueMonth+'">'+textMonth+'</option>';
				
			}
			//fetch year
			var arryears= document.form1.yercourse_1.options;
			var yearlist;
			for(i=0; i < arryears.length; i++)
			{
				textyear=document.form1.yercourse_1.options[i].text;
				valueyear=document.form1.yercourse_1.options[i].value;
				 yearlist+= '<option value="'+valueyear+'">'+textyear+'</option>';
				
			}
			
			
			responsestr='<div id="'+totalBlock+'_'+blockid+'"><input type="hidden" id="id_'+totalBlock+'" name="id_'+totalBlock+'"><input type="hidden" id="ins_id_'+totalBlock+'" name="ins_id_'+totalBlock+'"><input type="hidden" id="logo_'+totalBlock+'" name="logo_'+totalBlock+'"><input type="hidden" id="mode_'+totalBlock+'" value="new" name="mode_'+totalBlock+'"><table width=100% align="center" cellpadding="0" cellspacing="0"><tr><td  class="td" colspan="2"> <table width="100%" cellspacing="0" cellpadding="0" border="0" align="left" ><tbody><tr></td><td  class="lightbgtd" height="25" align="center" style="font-weight:bold">Education details - '+totalBlock+' </th></tr> <tr><td colspan="3" height="10"></td></tr>	</tbody></table></td></tr>	<tr>	<td valign="top" class="td" align="right">	<label>				Institute Name :<font color="#FF0000"><strong>*</strong>	</font>				</label>			</td>   			 <td valign="top" class="td" align="left"> <input name="ins_name_'+totalBlock+'" id="ins_name_'+totalBlock+'"  class="requiredfield" size="30" autocomplete="off" onkeyup="insNames(encodeURIComponent(this.value),\''+basepath+'\',\''+totalBlock+'\');" type="text"> <br> <div id="inamesdiv_'+totalBlock+'" class="mainpopdiv" style="display:none;" > </div> </td> </tr><tr class="tr"><td valign="top" class="td" align="right"><label>Institute Address :<font color="#FF0000"><strong>*</strong></font> </label>		</td><td valign="top" class="td" align="left"><textarea name="ins_address_'+totalBlock+'"  class="requiredfield" id="ins_address_'+totalBlock+'" cols="20" rows="4"></textarea></td></tr> <tr class="tr"><td valign="top"   align="right"  class="td"><label>Institute Email :</label> </td><td valign="top"  align="left" class="td"><input name="ins_email_'+totalBlock+'" id="ins_email_'+totalBlock+'" type="text" size="30"> </td></tr><tr class="tr"><td valign="top"   align="right"  class="td"><label>Institute Website :</label> </td><td valign="top"  align="left" class="td"><input name="ins_website_'+totalBlock+'" id="ins_website_'+totalBlock+'" type="text" size="30"> </td></tr><tr class="tr"><td valign="top"   align="right"  class="td"><label>Institute Logo :</label> </td><td valign="top"  align="left" class="td"> <img id="show_logo_'+totalBlock+'" height="70" width="70" src="'+basepath+'/public/uploadimages/img_not_avi.gif" /><br /><input name="ins_logo_'+totalBlock+'" id="ins_logo_'+totalBlock+'" type="file" size="30"><br><label class="highlight_msg">(Preferable upload size 2 MB.)</label> </td></tr><tr class="tr"><td valign="top" class="td" align="right"><label>Course:<font color="#FF0000"><strong>*</strong></font></label> </td>	<td valign="top" class="td" align="left"><input type="text" class="requiredfield" name="course_going_'+totalBlock+'" id="course_going_'+totalBlock+'"></td></tr>	';
			if(acctype=="S")
			{
				 
				responsestr +='<tr><td valign="top" align="right" height="28"><label>Current :</label> </td>    <td valign="top" class="sml01red" align="left"><input name="current_'+totalBlock+'" id="current_'+totalBlock+'" type="checkbox" onclick="changeYear('+totalBlock+')" value=y size="30"> </td></tr>';
				responsestr +='<tr id="co_year_'+totalBlock+'" style="display:none"><td valign="top" align="right" height="28"><label>Year of Course:</label></td>    <td valign="top" class="sml01red" align="left"><select name="year_course_'+totalBlock+'" id="year_course_'+totalBlock+'" ><option value="">Select Year</option><option value="First Year">First Year</option><option value="Second Year">Second Year</option><option value="Third Year">Third Year</option><option value="Fourth Year">Fourth Year</option><option value="Fiveth Year">Fiveth Year</option><option value="Sixth Year">Sixth Year</option></select></td></tr>';
		
			}
			responsestr +='<tr class="tr">    <td valign="top" align="right" class="td"><label>Year of completion :<font color="#FF0000"><strong>*</strong>	</font></label> </td>	<td valign="top" align="left" class="td"><select name="month_'+totalBlock+'" id="month_'+totalBlock+'"  class="requiredfield">'+monthlist+'</select><select onfocus="changeYear('+totalBlock+')"  name="yercourse_'+totalBlock+'" id="yercourse_'+totalBlock+'"  class="requiredfield">'+yearlist+'</select></td></tr></table></div>';
		}
		
		document.getElementById('More_'+blockid).innerHTML+=responsestr;
		document.getElementById('More_'+blockid).style.display='inline';

}
else
{
	 var i;
	document.getElementById('Count_'+blockid).value=eval(document.getElementById('Count_'+blockid).value)+1;
	var totalBlock=document.getElementById('Count_'+blockid).value;
	var responsestr='';
	
	if(blockid=='Education')
	{
		//alert('Not IE'); 
		var acctype= document.form1.acctype.value;
		//start education through DOM
		Edu_div = document.createElement("div");
		Edu_div.setAttribute("id", totalBlock+'_'+blockid);
		
		Edu_table = document.createElement("table");
		Edu_table.setAttribute("width", '100%');
		Edu_table.setAttribute("align", 'center');
		Edu_table.setAttribute("cellpadding", '0');
		Edu_table.setAttribute("cellspacing", '0');
			
				
		Edu_table_tr = document.createElement("tr");
		
		Edu_table_td = document.createElement("td");
		Edu_table_td.setAttribute("class", 'lightbgtd');
		Edu_table_td.setAttribute("height", '25');
		Edu_table_td.setAttribute("colspan", '2');
		Edu_table_td.setAttribute("align", 'center');
		Edu_table_td.setAttribute("style", 'font-weight:bold');
		
		var heading = document.createTextNode('Education details - '+totalBlock);
		
		Edu_table_td.appendChild(heading);
		Edu_table_tr.appendChild(Edu_table_td);
		Edu_table.appendChild(Edu_table_tr);
		
		blank_tr = document.createElement("tr");
		
		blank_td = document.createElement("td");
		blank_td.setAttribute("height", '5');
		blank_td.setAttribute("colspan", '2');
		blank_tr.appendChild(blank_td);
		Edu_table.appendChild(blank_tr);
		
		Edu_table_tr_inst = document.createElement("tr");
		
		Edu_table_td_inst_label = document.createElement("td");
		Edu_table_td_inst_label.setAttribute("class", 'td');
		Edu_table_td_inst_label.setAttribute("valign", 'top');
		Edu_table_td_inst_label.setAttribute("align", 'right');
		
		Edu_table_label_ins = document.createElement("label");
		
		insname_lbl = document.createTextNode('Institute name:');
		
		font = document.createElement("font");
		font.setAttribute("color", '#FF0000');
		
		strong = document.createElement("strong");
		
		mandentory = document.createTextNode('*');
		
		
		strong.appendChild(mandentory);
		font.appendChild(strong);
		Edu_table_label_ins.appendChild(insname_lbl);
		Edu_table_td_inst_label.appendChild(Edu_table_label_ins);
		Edu_table_td_inst_label.appendChild(font);
		
		Edu_table_tr_inst.appendChild(Edu_table_td_inst_label);
		
		
		
		Edu_table_td_inst_text = document.createElement("td");
		Edu_table_td_inst_text.setAttribute("class", 'td');
		Edu_table_td_inst_text.setAttribute("valign", 'top');
		Edu_table_td_inst_text.setAttribute("align", 'left');
		
		Edu_table_text_ins = document.createElement("input");
		Edu_table_text_ins.setAttribute("type", 'text');	
		Edu_table_text_ins.setAttribute("name", 'ins_name_'+totalBlock);
		Edu_table_text_ins.setAttribute("id", 'ins_name_'+totalBlock);
		Edu_table_text_ins.setAttribute("size", '30');	
		Edu_table_text_ins.setAttribute("autocomplete", 'off');
		Edu_table_text_ins.setAttribute("class","requiredfield");
		Edu_table_text_ins.setAttribute("onkeyup", 'insNames(encodeURIComponent(this.value),"'+basepath+'","'+totalBlock+'")');	
		inamesdiv = document.createElement("div");
		inamesdiv.setAttribute("id", 'inamesdiv_'+totalBlock);
		inamesdiv.setAttribute("class", 'mainpopdiv');
		inamesdiv.setAttribute("style", 'display:none;');
		breakdiv = document.createElement("br");
		
		Edu_table_td_inst_text.appendChild(Edu_table_text_ins);
		Edu_table_td_inst_text.appendChild(breakdiv);
		Edu_table_td_inst_text.appendChild(inamesdiv);
		Edu_table_tr_inst.appendChild(Edu_table_td_inst_text);

		Edu_table.appendChild(Edu_table_tr_inst);
	
	
	
	
	
		Edu_table_tr_ins_add = document.createElement("tr");
		
		Edu_table_td_ins_add_label = document.createElement("td");
		Edu_table_td_ins_add_label.setAttribute("class", 'td');
		Edu_table_td_ins_add_label.setAttribute("valign", 'top');
		Edu_table_td_ins_add_label.setAttribute("align", 'right');
		
		Edu_table_label_ins = document.createElement("label");
		
		insname_lbl = document.createTextNode('Institute address:');
		
		font = document.createElement("font");
		font.setAttribute("color", '#FF0000');
		
		strong = document.createElement("strong");
		
		mandentory = document.createTextNode('*');
		
		
		strong.appendChild(mandentory);
		font.appendChild(strong);
		Edu_table_label_ins.appendChild(insname_lbl);
		Edu_table_td_ins_add_label.appendChild(Edu_table_label_ins);
		Edu_table_td_ins_add_label.appendChild(font);
		
		Edu_table_tr_ins_add.appendChild(Edu_table_td_ins_add_label);
		
		
		
		Edu_table_td_ins_add_text = document.createElement("td");
		Edu_table_td_ins_add_text.setAttribute("class", 'td');
		Edu_table_td_ins_add_text.setAttribute("valign", 'top');
		Edu_table_td_ins_add_text.setAttribute("align", 'left');
		
		Edu_table_text_ins = document.createElement("textarea");
		Edu_table_text_ins.setAttribute("name", 'ins_address_'+totalBlock);
		Edu_table_text_ins.setAttribute("id", 'ins_address_'+totalBlock);
		Edu_table_text_ins.setAttribute("size", '30');	
		
		Edu_table_td_ins_add_text.appendChild(Edu_table_text_ins);
		Edu_table_tr_ins_add.appendChild(Edu_table_td_ins_add_text);
		
		Edu_table.appendChild(Edu_table_tr_ins_add);
		
		// start  email
		
		Edu_table_tr_email = document.createElement("tr");
		
		Edu_table_td_email_label = document.createElement("td");
		Edu_table_td_email_label.setAttribute("class", 'td');
		Edu_table_td_email_label.setAttribute("valign", 'top');
		Edu_table_td_email_label.setAttribute("align", 'right');
		
		Edu_table_label_ins = document.createElement("label");
		
		insname_lbl = document.createTextNode('Institute Email :');
		
		
		Edu_table_label_ins.appendChild(insname_lbl);
		Edu_table_td_email_label.appendChild(Edu_table_label_ins);
		//Edu_table_td_email_label.appendChild(font);
		
		Edu_table_tr_email.appendChild(Edu_table_td_email_label);
		
		
		
		Edu_table_td_email_text = document.createElement("td");
		Edu_table_td_email_text.setAttribute("class", 'td');
		Edu_table_td_email_text.setAttribute("valign", 'top');
		Edu_table_td_email_text.setAttribute("align", 'left');
		
		Edu_table_text_email = document.createElement("input");
		Edu_table_text_email.setAttribute("type", 'text');	
		Edu_table_text_email.setAttribute("name", 'ins_email_'+totalBlock);
		Edu_table_text_email.setAttribute("id", 'ins_email_'+totalBlock);
		Edu_table_text_email.setAttribute("size", '30');	
		
		Edu_table_td_email_text.appendChild(Edu_table_text_email);
		Edu_table_tr_email.appendChild(Edu_table_td_email_text);
		
		Edu_table.appendChild(Edu_table_tr_email);
		//email
		// start website
		
		Edu_table_tr_website = document.createElement("tr");
		
		Edu_table_td_website_label = document.createElement("td");
		Edu_table_td_website_label.setAttribute("class", 'td');
		Edu_table_td_website_label.setAttribute("valign", 'top');
		Edu_table_td_website_label.setAttribute("align", 'right');
		
		Edu_table_label_ins = document.createElement("label");
		
		insname_lbl = document.createTextNode('Institute Website :');
		
		
		Edu_table_label_ins.appendChild(insname_lbl);
		Edu_table_td_website_label.appendChild(Edu_table_label_ins);
		//Edu_table_td_website_label.appendChild(font);
		
		Edu_table_tr_website.appendChild(Edu_table_td_website_label);
		
		
		
		Edu_table_td_website_text = document.createElement("td");
		Edu_table_td_website_text.setAttribute("class", 'td');
		Edu_table_td_website_text.setAttribute("valign", 'top');
		Edu_table_td_website_text.setAttribute("align", 'left');
		
		Edu_table_text_website = document.createElement("input");
		Edu_table_text_website.setAttribute("type", 'text');	
		Edu_table_text_website.setAttribute("name", 'ins_website_'+totalBlock);
		Edu_table_text_website.setAttribute("id", 'ins_website_'+totalBlock);
		Edu_table_text_website.setAttribute("size", '30');	
		
		Edu_table_td_website_text.appendChild(Edu_table_text_website);
		Edu_table_tr_website.appendChild(Edu_table_td_website_text);
		
		Edu_table.appendChild(Edu_table_tr_website);
		//website
		// start logo
		
		Edu_table_tr_logo = document.createElement("tr");
		
		Edu_table_td_logo_label = document.createElement("td");
		Edu_table_td_logo_label.setAttribute("class", 'td');
		Edu_table_td_logo_label.setAttribute("valign", 'top');
		Edu_table_td_logo_label.setAttribute("align", 'right');
		
		Edu_table_label_ins = document.createElement("label");
		
		insname_lbl = document.createTextNode('Institute Logo :');
		
		
		Edu_table_label_ins.appendChild(insname_lbl);
		Edu_table_td_logo_label.appendChild(Edu_table_label_ins);
		//Edu_table_td_logo_label.appendChild(font);
		
		Edu_table_tr_logo.appendChild(Edu_table_td_logo_label);
		
		
		
		Edu_table_td_logo_text = document.createElement("td");
		Edu_table_td_logo_text.setAttribute("class", 'td');
		Edu_table_td_logo_text.setAttribute("valign", 'top');
		Edu_table_td_logo_text.setAttribute("align", 'left');
		
		Edu_table_text_logo = document.createElement("input");
		Edu_table_text_logo.setAttribute("type", 'file');	
		Edu_table_text_logo.setAttribute("name", 'ins_logo_'+totalBlock);
		Edu_table_text_logo.setAttribute("id", 'ins_logo_'+totalBlock);
		
		Edu_table_show_logo = document.createElement("img");
		Edu_table_show_logo.setAttribute("src", basepath+'/public/uploadimages/img_not_avi.gif');
		Edu_table_show_logo.setAttribute("id", 'show_logo_'+totalBlock);
		Edu_table_show_logo.setAttribute("height", '70');
		Edu_table_show_logo.setAttribute("width", '70');
		
		Edu_table_br = document.createElement("br");
			
		Edu_table_br_lbl= document.createElement("br");
		Max_size_label= document.createElement("label"); //
		Max_size_label.setAttribute("class", 'highlight_msg');//
		Max_size_label_text = document.createTextNode('(Preferable upload size 2 MB.)');//
		Max_size_label.appendChild(Max_size_label_text);//
		// alert(Max_size_label+Max_size_label_lbl);//
		
		
		Edu_table_td_logo_text.appendChild(Edu_table_show_logo);
		Edu_table_td_logo_text.appendChild(Edu_table_br);
		Edu_table_td_logo_text.appendChild(Edu_table_text_logo);
		Edu_table_td_logo_text.appendChild(Edu_table_br_lbl); //
		Edu_table_td_logo_text.appendChild(Max_size_label); //
		Edu_table_tr_logo.appendChild(Edu_table_td_logo_text);
		
		Edu_table.appendChild(Edu_table_tr_logo);
		//logo
		//<br><label class="highlight_msg">(Preferable upload size 2 MB.)</label>
		
		
		Edu_table_tr_cour = document.createElement("tr");
		
		Edu_table_td_cour_label = document.createElement("td");
		Edu_table_td_cour_label.setAttribute("class", 'td');
		Edu_table_td_cour_label.setAttribute("valign", 'top');
		Edu_table_td_cour_label.setAttribute("align", 'right');
		
		Edu_table_label_ins = document.createElement("label");
		
		insname_lbl = document.createTextNode('Course:');
		
		
		Edu_table_label_ins.appendChild(insname_lbl);
		Edu_table_td_cour_label.appendChild(Edu_table_label_ins);
		Edu_table_td_cour_label.appendChild(font);
		
		Edu_table_tr_cour.appendChild(Edu_table_td_cour_label);
		
		
		
		Edu_table_td_cour_text = document.createElement("td");
		Edu_table_td_cour_text.setAttribute("class", 'td');
		Edu_table_td_cour_text.setAttribute("valign", 'top');
		Edu_table_td_cour_text.setAttribute("align", 'left');
		
		Edu_table_text_cour = document.createElement("input");
		Edu_table_text_cour.setAttribute("type", 'text');	
		Edu_table_text_cour.setAttribute("name", 'course_going_'+totalBlock);
		Edu_table_text_cour.setAttribute("id", 'course_going_'+totalBlock);
		Edu_table_text_cour.setAttribute("size", '30');	
		Edu_table_text_cour.setAttribute("class", 'requiredfield');	
		
		Edu_table_td_cour_text.appendChild(Edu_table_text_cour);
		Edu_table_tr_cour.appendChild(Edu_table_td_cour_text);
		
		Edu_table.appendChild(Edu_table_tr_cour);
		
		
		
		
		if(acctype=="S")
		{
			Edu_table_tr_cour_go = document.createElement("tr");
			Edu_table_td_cour_go_label = document.createElement("td");
			Edu_table_td_cour_go_label.setAttribute("class", 'td');
			Edu_table_td_cour_go_label.setAttribute("valign", 'top');
			Edu_table_td_cour_go_label.setAttribute("align", 'right');
			
			Edu_table_label_ins = document.createElement("label");
			
			insname_lbl = document.createTextNode('Current:');
			
			strong.appendChild(mandentory);
			font.appendChild(strong);
			Edu_table_label_ins.appendChild(insname_lbl);
			Edu_table_td_cour_go_label.appendChild(Edu_table_label_ins);
			//Edu_table_td_cour_go_label.appendChild(font);
			
			Edu_table_tr_cour_go.appendChild(Edu_table_td_cour_go_label);
			
			
			
			Edu_table_td_cour_go_text = document.createElement("td");
			Edu_table_td_cour_go_text.setAttribute("class", 'td');
			Edu_table_td_cour_go_text.setAttribute("valign", 'top');
			Edu_table_td_cour_go_text.setAttribute("align", 'left');
			
			Edu_table_text_ins = document.createElement("input");
			Edu_table_text_ins.setAttribute("type", 'checkbox');	
			Edu_table_text_ins.setAttribute("name", 'current_'+totalBlock);
			Edu_table_text_ins.setAttribute("id", 'current_'+totalBlock);
			Edu_table_text_ins.setAttribute("size", '30');	
			Edu_table_text_ins.setAttribute("onclick", 'changeYear('+totalBlock+')');	
			
			Edu_table_td_cour_go_text.appendChild(Edu_table_text_ins);
			Edu_table_tr_cour_go.appendChild(Edu_table_td_cour_go_text);
			
			Edu_table.appendChild(Edu_table_tr_cour_go);
			
			
			
			Edu_table_tr_yoc = document.createElement("tr");
			Edu_table_tr_yoc.setAttribute("style", 'display:none');
			Edu_table_tr_yoc.setAttribute("id", 'co_year_'+totalBlock);
			
			Edu_table_td_yoc_label = document.createElement("td");
			Edu_table_td_yoc_label.setAttribute("class", 'td');
			Edu_table_td_yoc_label.setAttribute("valign", 'top');
			Edu_table_td_yoc_label.setAttribute("align", 'right');
			
			Edu_table_label_ins = document.createElement("label");
			
			insname_lbl = document.createTextNode('Year of Course:');
			
			strong.appendChild(mandentory);
			font.appendChild(strong);
			Edu_table_label_ins.appendChild(insname_lbl);
			Edu_table_td_yoc_label.appendChild(Edu_table_label_ins);
			//Edu_table_td_yoc_label.appendChild(font);
			
			Edu_table_tr_yoc.appendChild(Edu_table_td_yoc_label);
			
			
			
			Edu_table_td_yoc_text = document.createElement("td");
			Edu_table_td_yoc_text.setAttribute("class", 'td');
			Edu_table_td_yoc_text.setAttribute("valign", 'top');
			Edu_table_td_yoc_text.setAttribute("align", 'left');
			
			
			
			Edu_table_text_yoc = document.createElement("select");
			Edu_table_text_yoc.setAttribute("name", 'year_course_'+totalBlock);
			Edu_table_text_yoc.setAttribute("id", 'year_course_'+totalBlock);
			Edu_table_text_yoc.options[0] = new Option('Select Year','');
			Edu_table_text_yoc.options[1] = new Option('First Year','First Year');	
			Edu_table_text_yoc.options[2] = new Option('Second Year','Second Year');	
			Edu_table_text_yoc.options[3] = new Option('Third Year','Third Year');	
			Edu_table_text_yoc.options[4] = new Option('Fourth Year','Fourth Year');	
			Edu_table_text_yoc.options[5] = new Option('Fifth Year','Fifth Year');	
			Edu_table_text_yoc.options[6] = new Option('Sixth Year','Sixth Year');	
			
			Edu_table_td_yoc_text.appendChild(Edu_table_text_yoc);
			Edu_table_tr_yoc.appendChild(Edu_table_td_yoc_text);
			
			Edu_table.appendChild(Edu_table_tr_yoc);
		}
		
		Edu_table_tr_yr_comp = document.createElement("tr");
		
		Edu_table_td_yr_comp_label = document.createElement("td");
		Edu_table_td_yr_comp_label.setAttribute("class", 'td');
		Edu_table_td_yr_comp_label.setAttribute("valign", 'top');
		Edu_table_td_yr_comp_label.setAttribute("align", 'right');
		
		Edu_table_label_ins = document.createElement("label");
		
		insname_lbl = document.createTextNode('Year of completion:');
		
		font = document.createElement("font");
		font.setAttribute("color", '#FF0000');
		
		strong = document.createElement("strong");
		
		mandentory = document.createTextNode('*');
		
		
		strong.appendChild(mandentory);
		font.appendChild(strong);
		Edu_table_label_ins.appendChild(insname_lbl);
		Edu_table_td_yr_comp_label.appendChild(Edu_table_label_ins);
		Edu_table_td_yr_comp_label.appendChild(font);
		
		Edu_table_tr_yr_comp.appendChild(Edu_table_td_yr_comp_label);
		
		
		
		Edu_table_td_yr_comp_text = document.createElement("td");
		Edu_table_td_yr_comp_text.setAttribute("class", 'td');
		Edu_table_td_yr_comp_text.setAttribute("valign", 'top');
		Edu_table_td_yr_comp_text.setAttribute("align", 'left');
		
		Edu_table_text_month_comp = document.createElement("select");
		Edu_table_text_month_comp.setAttribute("name", 'month_'+totalBlock);
		Edu_table_text_month_comp.setAttribute("id", 'month_'+totalBlock);
		
		//fetch month
		var arrMonths= document.form1.month_1.options;
		var monthlist;
		for(i=0; i < arrMonths.length; i++)
		{
			textMonth=document.form1.month_1.options[i].text;
			valueMonth=document.form1.month_1.options[i].value;
			Edu_table_text_month_comp.options[i] = new Option(textMonth,valueMonth);
			
		}
		
		
		Edu_table_text_yr_comp = document.createElement("select");
		Edu_table_text_yr_comp.setAttribute("name", 'yercourse_'+totalBlock);
		Edu_table_text_yr_comp.setAttribute("id", 'yercourse_'+totalBlock);
		Edu_table_text_yr_comp.setAttribute("onfocus", 'changeYear('+totalBlock+')');
		//fetch year
		var arryears= document.form1.yercourse_1.options;
		var yearlist;
		for(i=0; i < arryears.length; i++)
		{
			textyear=document.form1.yercourse_1.options[i].text;
			valueyear=document.form1.yercourse_1.options[i].value;
			Edu_table_text_yr_comp.options[i] = new Option(textyear,valueyear);
		}
		
		
		
		Edu_table_td_yr_comp_text.appendChild(Edu_table_text_month_comp);
		Edu_table_td_yr_comp_text.appendChild(Edu_table_text_yr_comp);
		Edu_table_tr_yr_comp.appendChild(Edu_table_td_yr_comp_text);
		
		
		Edu_table.appendChild(Edu_table_tr_yr_comp);
		
		
		insid = document.createElement("input");
		insid.setAttribute("type", 'hidden');	
		insid.setAttribute("name", 'ins_id_'+totalBlock);
		insid.setAttribute("id", 'ins_id_'+totalBlock);
		insid.setAttribute("size", '30');	
		
		logo = document.createElement("input");
		logo.setAttribute("type", 'hidden');	
		logo.setAttribute("name", 'logo_'+totalBlock);
		logo.setAttribute("id", 'logo_'+totalBlock);
		logo.setAttribute("size", '30');	
		
		mode = document.createElement("input");
		mode.setAttribute("type", 'hidden');	
		mode.setAttribute("name", 'mode_'+totalBlock);
		mode.setAttribute("id", 'mode_'+totalBlock);
		mode.setAttribute("size", '30');	
		
		Edu_div.appendChild(insid);
		Edu_div.appendChild(logo);
		Edu_div.appendChild(mode);
		Edu_div.appendChild(Edu_table);
		
	
	}
	
	document.getElementById('More_'+blockid).appendChild(Edu_div);;
	document.getElementById('More_'+blockid).style.display='inline';
	
	if(eval(document.getElementById('Count_'+blockid).value) > 0)
			document.getElementById('remove').disabled=false;
	}
}


function backup_addMoreInfo(blockid)
{
var i;
document.getElementById('Count_'+blockid).value=eval(document.getElementById('Count_'+blockid).value)+1;
var totalBlock=document.getElementById('Count_'+blockid).value;
var responsestr='';

if(blockid=='Education')
{
	var acctype= document.form1.acctype.value;
	
	//fetch month
	var arrMonths= document.form1.month_1.options;
	var monthlist;
	for(i=0; i < arrMonths.length; i++)
	{
		textMonth=document.form1.month_1.options[i].text;
		valueMonth=document.form1.month_1.options[i].value;
		 monthlist+= '<option value="'+valueMonth+'">'+textMonth+'</option>';
		
	}
	//fetch year
	var arryears= document.form1.yercourse_1.options;
	var yearlist;
	for(i=0; i < arryears.length; i++)
	{
		textyear=document.form1.yercourse_1.options[i].text;
		valueyear=document.form1.yercourse_1.options[i].value;
		 yearlist+= '<option value="'+valueyear+'">'+textyear+'</option>';
		
	}
	
	responsestr='<div id="'+totalBlock+'_'+blockid+'"><table width=100% align="center" cellpadding="0" cellspacing="0"><tr><td  class="td" colspan="2"> <table width="100%" cellspacing="0" cellpadding="0" border="0" align="left" ><tbody><tr></td><th  class="th">Education details - '+totalBlock+' </th></tr>	</tbody></table></td></tr>	<tr>	<td valign="top" class="td" align="right">	<label>				Institute Name :<font color="#FF0000"><strong>*</strong>	</font>				</label>			</td>   			 <td valign="top" class="td" align="left"> <input name="ins_name_'+totalBlock+'" id="ins_name_'+totalBlock+'"  class="requiredfield" size="30" " type="text"> </td> </tr><tr class="tr"><td valign="top" class="td" align="right"><label>Institute Address :<font color="#FF0000"><strong>*</strong></font> </label>		</td><td valign="top" class="td" align="left"><textarea name="ins_address_'+totalBlock+'"  class="requiredfield" id="ins_address_'+totalBlock+'" cols="20" rows="4"></textarea></td></tr><tr class="tr"><td valign="top" class="td" align="right"><label>Course :</label> </td>	<td valign="top" class="td" align="left"><input type="text" name="course_going_'+totalBlock+'" id="course_going_'+totalBlock+'"></td></tr>	';
	if(acctype=="S")
	{
		 
		responsestr +='<tr><td valign="top" align="right" height="28"><label>Current :</label> </td>    <td valign="top" class="sml01red" align="left"><input name="current_'+totalBlock+'" id="current_'+totalBlock+'" type="checkbox" onclick="changeYear('+totalBlock+')" value=y size="30"> </td></tr>';
		responsestr +='<tr id="co_year_'+totalBlock+'" style="display:none"><td valign="top" align="right" height="28"><label>Year of Course:</label></td>    <td valign="top" class="sml01red" align="left"><select name="year_course_'+totalBlock+'" id="year_course_'+totalBlock+'" ><option value="">Select Year</option><option value="First Year">First Year</option><option value="Second Year">Second Year</option><option value="Third Year">Third Year</option><option value="Fourth Year">Fourth Year</option><option value="Fiveth Year">Fiveth Year</option><option value="Sixth Year">Sixth Year</option></select></td></tr>';

	}
	responsestr +='<tr class="tr">    <td valign="top" align="right" class="td"><label>Year of completion :<font color="#FF0000"><strong>*</strong>	</font></label> </td>	<td valign="top" align="left" class="td"><select name="month_'+totalBlock+'" id="month_'+totalBlock+'"  class="requiredfield">'+monthlist+'</select><select name="yercourse_'+totalBlock+'" id="yercourse_'+totalBlock+'"  class="requiredfield">'+yearlist+'</select></td></tr></table></div>';
}

document.getElementById('More_'+blockid).innerHTML+=responsestr;
document.getElementById('More_'+blockid).style.display='inline';

if(eval(document.getElementById('Count_'+blockid).value) > 0)
 		document.getElementById('remove').disabled=false;
}
function removeMoreInfo(blockid,baseurl) 
{
var totalBlock=document.getElementById('Count_'+blockid).value;
//if(totalBlock==2)
//document.getElementById('Remove_'+totalBlock).style.display="none";
//alert(totalBlock+'_'+blockid);
//alert(document.getElementById('More_Reputation').innerHTML);
//document.getElementById(totalBlock+'_'+blockid).innerHTML='';

var parentDiv= document.getElementById('More_'+blockid);
var childDiv= document.getElementById(totalBlock+'_'+blockid);
parentDiv.removeChild(childDiv);
document.getElementById('Count_'+blockid).value=eval(document.getElementById('Count_'+blockid).value)-1;
if(totalBlock==1)
	addMorePersonalInfo(blockid,'94',baseurl);
/* if(eval(document.getElementById('Count_'+blockid).value) == 0)
 {
 
 document.getElementById('Remove_'+totalBlock).style.display="none";
 }*/
}

function backup_removeMoreInfo(blockid) 
{
var totalBlock=document.getElementById('Count_'+blockid).value;

//alert(totalBlock+'_'+blockid);
//alert(document.getElementById('More_Reputation').innerHTML);
//document.getElementById(totalBlock+'_'+blockid).innerHTML='';

//updated on 26 march 2010 by seema
var parentDiv= document.getElementById('More_'+blockid);
var childDiv= document.getElementById(totalBlock+'_'+blockid);
parentDiv.removeChild(childDiv);
//end

document.getElementById('Count_'+blockid).value=eval(document.getElementById('Count_'+blockid).value)-1;
 if(eval(document.getElementById('Count_'+blockid).value) == 0)
 		document.getElementById('remove').disabled=true;

}


/*Function chech numeric value also allow .-,*/
function IsNumeric(strString)
//  check for valid numeric strings	
{
	var strValidChars = "0123456789.-*/,";
	var strnoValidChars = ".-,*/";
	var strChar;
	var blnResult = true;
	
	if (strString.length == 0) return false;
	err=0;
		for (i = 0; i < strString.length ; i++)
		{
			strChar = strString.charAt(i);
			if (strnoValidChars.indexOf(strChar) != -1)
			{
				err++;
			}
		}
		//alert(err+"=="+strString.length);
		if(err==strString.length)	
		{
			blnResult = false;
			}
		//  test strString consists of valid characters listed above
		for (i = 0; i < strString.length && blnResult == true; i++)
		{
			strChar = strString.charAt(i);
			if (strValidChars.indexOf(strChar) == -1)
			{
				blnResult = false;
			}
		}
return blnResult;
}
//end
//==============================================================================================================================
//=====================================Validation for alphanumeric values=======================================================
//............................function for validation for only alphabetic values.................................................
function IsAlphaNum(val) 
{	
	//msg = msg || 'alphanumeric value';
	//alert(val.value.length);
  if (val.value.length != 0)
   {
		if (val.value.length >= 3)
    	{
			   for (i = 0; i < val.value.length; i++)
			   {
				   var ch = val.value.charAt(i);
				  // if ((ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z") || (ch >= "0" && ch <= "9")  || (ch == " ") || (ch == ".") || (ch == ",") || (ch == "-")|| (ch == "/")|| (ch == "|")|| (ch == "\\"))
				   if ((ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z") || (ch >= "0" && ch <= "9")  || (ch == " ") || (ch == ".") || (ch == ",") || (ch == "-") || (ch == "/") || (ch == "&") || (ch == "+") || (ch == "@"))
				   {
					  continue;
					} 
				   else
				   {
					val.value='';
					//alert("Please enter valid "+msg+" .");
					//val.focus();
					return false;
				   }
			  }
		}
		else
		{
			val.value='';
			//alert("Please enter atleast 3 characters.");
			//val.focus();
			return false;
		}
  }

   return true;
}
//=====================================================
//=====================================================
//THE FOLLOWING FUNCTION WILL CHECK THE EMAIL ID
//=====================================================

function CheckEmailId(val) {
// Check for a properly formatted email address
  if ((val.value.length == 0)) {
      return false;
   }

   if (val.value.length != 0) {
     // var emailformat = /^.+@.+\..{2,3}$/;
	 
      var emailformat = /^[^@\s]+@([-a-z0-9]{3,500}\.)+([a-z]{2}|com|net|edu|org|gov|mil|int|biz|pro|info|arpa|aero|coop|name|museum|nic|in|co.in|co|inc|ac.in)$/;
      if (!emailformat.test(val.value))
	   {
	     //alert("Please enter valid email.");
		 val.value="";
		 //val.focus();
		 return false;
      }
   }
   return true;
}
//=====================================================
//=====================================================
//THE FOLLOWING FUNCTION WILL CHANGE YEAR
//=====================================================
function changeYear(id)
 {
	currentyear=document.getElementById('cyear').value;
	var object= document.getElementById('current_'+id);
	var arryears= document.getElementById('yercourse_'+id).options;
	//alert(arryears.length);
	//alert(currentyear);	
	
	 if(object.checked==true)
	 {
		 document.getElementById('co_year_'+id).style.display='' ;
		for(j=1; j < arryears.length; j++)
		{
			
			//alert(document.getElementById('yercourse_'+id).options[j].value);
			if(document.getElementById('yercourse_'+id).options[j].value<currentyear)	
			{	
				//document.getElementById('yercourse_'+id).options[j]= null;
			
				document.getElementById('yercourse_'+id).options[j].disabled=true ;
				
			}
			else
			{
				
				document.getElementById('yercourse_'+id).options[j].disabled=false; 
			}
			 
		}
		if(document.getElementById('yercourse_'+id).value<currentyear)
		{
			document.getElementById('yercourse_'+id).options[0].selected=true;
		}
	 }
	 else
	 {
		 document.getElementById('co_year_'+id).style.display='none' ;
		 document.getElementById('year_course_'+id).value='' ;
		for(j=1; j <arryears.length; j++)
		{
			//alert(document.getElementById('yercourse_'+id).options[j].value);
			if(document.getElementById('yercourse_'+id).options[j].value>currentyear)	
			{	
				//document.getElementById('yercourse_'+id).options[j]= null;
				document.getElementById('yercourse_'+id).options[j].disabled=true;
			}
			else
			{
				document.getElementById('yercourse_'+id).options[j].disabled=false ;
			}
		}
		if(document.getElementById('yercourse_'+id).value>currentyear)
		{
			document.getElementById('yercourse_'+id).options[0].selected=true;
		}
	 }
 }
 
function getfirmdetail(val,base_path)
{
	
	var keyword=val;

	document.getElementById('firmdiv').style.display='';
	document.getElementById('fd').style.display='none';
	id=document.getElementById('guid').value;
	base_path=document.getElementById('basepath').value;
	document.getElementById("firmdiv").innerHTML='<br><br><br><table align="center" border=0><tr><td><label>Loading....</label></td></tr></table><br><br><br>';
	//alert(base_path);
	  $.ajax({
				 url:  base_path + "profile/firmnames/",
				data: "keyword="+keyword+"&guid="+id,
				type: 'GET',
			 success: function (resp) 
			 {
			 		$("#firmdiv").html(resp);
			 },
				error: function(e){  alert('Error: '+e);  }  
			});

}
 function insNames(val,base_path,divid)
{
	
	var keyword=val;
	document.getElementById('inamesdiv_'+divid).style.display='';
	//alert(base_path);
	  $.ajax({
				 url:  base_path + "/education/insnames/",
				data: "keyword="+keyword+"&divid="+divid,
				type: 'GET',
			 success: function (resp) 
			 {
			 		$("#inamesdiv_"+divid).html(resp);
			 },
				error: function(e){  alert('Error: '+e);  }  
			});

}
function check_email(val,base_path)
{

	var email=val;
	
	  $.ajax({
				 url:  base_path + "/profile/emailcheck/",
				data: "email="+email,
				type: 'GET',
			 success: function (resp) 
			 {
	
				 document.getElementById('firm_email_message').style.display='';

			 		$("#firm_email_message").html(resp);
			 },
				error: function(e){  alert('Error: '+e);  }  
			});
}
function changedisplay()
{
	
	document.getElementById('firmdiv').style.display='none';
}

function getnextFocuse(e,over)
{
	setcss(over);
	/* var key;
	
	 var id=document.getElementById('nextkey').value;
		 if(window.event)
			  key = window.event.keyCode;     
		 else
			  key = e.which;   
			  
			//alert(key);  
		if(over>0)
		{
				if(id)
					removecss(id)
				
				
				document.getElementById('nextkey').value=over;
			}
		else
		{
		if(key==40)
		{
			 document.getElementById('nextkey').focus();
			if(id)
			{
				removecss(id)
				setcss(++id);
				document.getElementById('nextkey').value=id;
				}
			else
			{
				setcss(1);
				document.getElementById('nextkey').value=1;
			}
		}
			
		if(key==38)
		{
			if(id)
			{
				removecss(id)
				setcss(--id);
				document.getElementById('nextkey').value=id;
				}
			else
			{
				setcss(1);	
				document.getElementById('nextkey').value=1;
			}
	}
		}
			  */
}
function setvalue(name,id,acctype,base_path)
{
 $.ajax({
				 url:  base_path + "/profile/firmcheck/",
				data: "fname="+name+"&acc_type="+acctype+"&guid="+id,
				type: 'POST',
			 success: function (resp) 
			 {

				 document.getElementById('firm_email_message').style.display='';

			 		$("#firm_email_message").html(resp);
			 },
				error: function(e){  alert('Error: '+e);  }  
			});
	}
function backup_setvalue(name,id,acctype,base_path)
{

document.getElementById('firm_id').value=id;
document.getElementById('fdview').style.display='none';
if(name!='new')
{
document.getElementById('firm_name').value=name;
document.getElementById('firmdiv').style.display='none';

}
else
{
	document.getElementById('fd').style.display='block';
}
document.getElementById('fd').innerHTML='<br><br><br><table align="center" border=0><tr><td align="center"><img src="'+base_path+'/public/images/loading.gif"></td></tr><tr><td><label>Loading....</label></td></tr></table><br><br><br>';
document.getElementById('fd').style.display='block';


//alert(name);
//alert(base_path);
if((acctype=='EA' || acctype=='SA' ||  acctype=='IA') && name!='new')
{

	  $.ajax({
				 url:  base_path + "/profile/firmview/",
				data: "firm_id="+id,
				type: 'GET',
			 success: function (resp) 
			 {// document.getElementById('firmdiv').innerHTML=html(resp);
			 	
			 		$("#fd").html(resp);
			 },
				error: function(e){  alert('Error: '+e);  }  
			});

}
else if(name=='new')
{	

	  $.ajax({
				 url:  base_path + "/profile/firmadd/",
				type: 'POST',
			 success: function (resp) 
			 {
		
			 		$("#fd").html(resp);
			 },
				error: function(e){  alert('Error: '+e);  }  
			});

}
else if(name!='new' && acctype=='FO')
{
	//alert("3");
	  $.ajax({
				 url:  base_path + "/profile/firmupdate/",
				data: "firm_id="+id,
				type: 'GET',
			 success: function (resp) 
			 {
			 	
			 		$("#fd").html(resp);
			 },
				error: function(e){  alert('Error: '+e);  }  
			});

}

}
function setcss(tableid)
{
document.getElementById("table_"+tableid).style.background="#F0F4F5";

}
function removecss(tableid)
{
document.getElementById("table_"+tableid).style.background="#ffffff";

}
function verification(name,id,acctype)
{
	setvalue(name,id);
	//if(confirm(name+" firm already exist. Would to continue with this firm ?"))
	document.getElementById('firm_id').value=id;
	//changeType(acctype);
	
}
function showhide(show,hide,firm_id)
{
		document.getElementById(show).style.display='inline';
		document.getElementById(hide).style.display='none';
		document.getElementById('fd').style.display='none';
		document.getElementById('firm_id').value=firm_id;
}

function showarchitects(type)
{


			  $.ajax({
						 url:  base_path + "home/newarchitects/",
						data: "type="+type,
						type: 'POST',
					 success: function (resp) { 
					// alert(resp);
					 $('#architects').html(resp);},
						error: function(e){  alert('Error: '+e);  }  
					});
	
}

function showstudents()
{

			$.ajax({
						 url:  base_path + "home/newstudents/",
					
						type: 'POST',
					 success: function (resp) { 
					// alert(resp);
					 $('#newstudents').html(resp);},
						error: function(e){  alert('Error: '+e);  }  
					});
	
}
function showproject()
{

	
			  $.ajax({
						 url:  base_path + "home/featuredproject/",
					
						type: 'POST',
					 success: function (resp) { 
					// alert(resp);
					 $('#homepageproject').html(resp);},
						error: function(e){  alert('Error: '+e);  }  
					});
	
}
function showinternship()
{

	
			  $.ajax({
						 url:  base_path + "home/internship/",
					
						type: 'POST',
					 success: function (resp) { 
					// alert(resp);
					 $('#internship').html(resp);},
						error: function(e){  alert('Error: '+e);  }  
					});
	
}
function showinterarchi()
{

	
			  $.ajax({
						 url:  base_path + "home/interarchi/",
					
						type: 'POST',
					 success: function (resp) { 
					// alert(resp);
					 $('#interarchi').html(resp);},
						error: function(e){  alert('Error: '+e);  }  
					});
	
}
function showjobopening()
{

	
			  $.ajax({
						 url:  base_path + "home/jobopening/",
					
						type: 'POST',
					 success: function (resp) { 
					// alert(resp);
					 $('#jobopening').html(resp);},
						error: function(e){  alert('Error: '+e);  }  
					});
	
}
function showleftproject()
{

	
			  $.ajax({
						 url:  base_path + "home/otherproject/",
					
						type: 'POST',
					 success: function (resp) { 
					// alert(resp);
					 $('#leftproject').html(resp);},
						error: function(e){  alert('Error: '+e);  }  
					});
	
}




function flashsidebar()
{
		  $.ajax({
						 url:  base_path + "home/flashsidebar/",
					
						type: 'POST',
					 success: function (resp) { 
					// alert(resp);
					 $('#flashsidebar').html(resp);},
						error: function(e){  alert('Error: '+e);  }  
					});
	
}
function showregloginbox(val)
{



	if(val=='login')
	{
	  $.ajax({
				 url:  base_path + "login/quicklogin/",
				type: 'GET',
			 success: function (resp) 
			 {
			
				$("#regloginbox").html(resp);
			 },
				error: function(e){  alert('Error: '+e);  }  
			});
		}	
		
	else
	{
	  $.ajax({
				 url:  base_path + "registration/quickregister/",
				type: 'GET',
			 success: function (resp) 
			 {
			
				$("#regloginbox").html(resp);
			 },
				error: function(e){  alert('Error: '+e);  }  
			});
		}	
}


function searchboxtype(type,code)
{
	var menu=new Array();
	menu[0]='Architects';
	menu[1]='Contractors';
	menu[2]='Builders';
	menu[3]='Developers';
	menu[4]='Vendors';

	for(var i=0 ; i < 5 ; i++)
	{

		if(type==menu[i])
			document.getElementById(menu[i]).className='formactivetab';
		else
			document.getElementById(menu[i]).className='forminactivetab';
	}
	
	document.getElementById('regtype').value=code;
	if(type!='Architects')
	{
		document.getElementById('women_td').style.display='none';
	}
	else
	{
		document.getElementById('women_td').style.display='';
	}
	changeservice(type); 
	
}

function changeType(acctype)
{

	if(!acctype)
		acctype=document.getElementById('acctype').value;
		
	if(document.getElementById('firm_id').value!="")
	{
		if(acctype=="FO")
		{	
			//document.getElementById('empdtl').style.display='none';
			document.getElementById('fd').style.display='block';
		}else
		{
			//document.getElementById('empdtl').style.display='';
			document.getElementById('fd').style.display='none';
			}
	}
	else
	{
		if(acctype=="FO")
		{	
			//document.getElementById('empdtl').style.display='none';
			document.getElementById('fd').style.display='block';
		}else
		{
			//document.getElementById('empdtl').style.display='';
			document.getElementById('fd').style.display='block';
			}
	}
	

}
function putdata(data,blockid,mode)
{
	basepath=document.getElementById('basepath').value;
	if(mode=='new')
	{
		document.getElementById("mode_"+blockid).value="new";
		document.getElementById("ins_address_"+blockid).value="";
		document.getElementById("ins_email_"+blockid).value="";
		document.getElementById("ins_website_"+blockid).value="";
		document.getElementById("ins_id_"+blockid).value="";
		document.getElementById("logo_"+blockid).value="";
		document.getElementById("ins_email_"+blockid).readOnly=false;
		document.getElementById("ins_address_"+blockid).readOnly=false;
		document.getElementById("ins_website_"+blockid).readOnly=false;
		document.getElementById("ins_logo_"+blockid).readOnly=false;
		document.getElementById("show_logo_"+blockid).src=basepath+'/public/uploadimages/img_not_avi.gif';
	}else{
		values =data.split("__");
		//alert(blockid);
		document.getElementById("mode_"+blockid).value="update";
		document.getElementById("ins_name_"+blockid).value=values[0];
		if(values[1])
		{
			document.getElementById("ins_address_"+blockid).readOnly="readOnly";
			document.getElementById("ins_address_"+blockid).value=values[1];
		}
		else
		{
			document.getElementById("ins_address_"+blockid).readOnly=false;
			document.getElementById("ins_address_"+blockid).value="";
		}
		if(values[2])
		{
			document.getElementById("ins_email_"+blockid).readOnly="readOnly";
			document.getElementById("ins_email_"+blockid).value=values[2];
		}
		else
		{
			document.getElementById("ins_email_"+blockid).readOnly=false;
			document.getElementById("ins_email_"+blockid).value="";
		}
		if(values[3])
		{
			document.getElementById("ins_website_"+blockid).readOnly="readOnly";
			document.getElementById("ins_website_"+blockid).value=values[3];
		}
		else
		{
			document.getElementById("ins_website_"+blockid).readOnly=false;
			document.getElementById("ins_website_"+blockid).value="";
		}
		if(values[4])
		{
			document.getElementById("ins_logo_"+blockid).readOnly="readOnly";
			document.getElementById("show_logo_"+blockid).src=basepath+'/public/uploadimages/'+values[4];
		}
		else
		{
			document.getElementById("ins_logo_"+blockid).readOnly=false;
			document.getElementById("show_logo_"+blockid).src=basepath+'/public/uploadimages/img_not_avi.gif';
		}
		document.getElementById("logo_"+blockid).value=values[4];
		document.getElementById("ins_id_"+blockid).value=values[5];
	}
}
function gettabdetails(val)
{
	/*var menu=new Array();

	menu[0]='search';
	menu[1]='students';
	menu[2]='events';
	menu[3]='news';

	
	for(var i=0 ; i < 4 ; i++)
	{

		if(val==menu[i])
		document.getElementById(menu[i]).className='activemenu';
		else
		document.getElementById(menu[i]).className='inactivemenu';
	}*/

	document.getElementById('homepagetabcontent').innerHTML='<br><br><br><table align="center" border=0><tr><td align="center"><img src="http://www.allindiaarchitects.com/public/images/loading.gif"></td></tr><tr><td><label>Loading....</label></td></tr></table><br><br><br>';
	
		  $.ajax({
					 url:  base_path + "home/"+val+"/",
					type: 'POST',
					success: function (resp) { 
						// alert(resp);
						 $('#homepagetabcontent').html(resp);},
							error: function(e){  alert('Error: '+e);  }  
						});
}

function getMax_sal(min_sal, max_sal)
{
	if(min_sal!='')
	{
		var htmlcode = "<select name='max_salary' id='max_salary'><option value=''>Max</option>";
		
		if(min_sal>='50')
		{
			var limit = '99';
		}
		else 
		{
			var limit = '50';
		}
		for(var i = min_sal; i<=limit; i++)
		{

			if(max_sal==i)
			{
				htmlcode+="<option value="+i+" selected >"+i+"</option>";
			}
			else
			{
				htmlcode+="<option value="+i+">"+i+"</option>";
			}

		}
		if(limit=='99')
		{
			htmlcode+="<option value='100'>1Cr.</option>"; 
		}
		htmlcode+="</select>";

		document.getElementById('max_sal').innerHTML=htmlcode;

				
	}
}

function changelimit(val)
{
	document.getElementById('limit').value = val;
	document.frmsearch.submit();
}
function commanSearch(column,cvalue)
{
	document.getElementById('column').value = column;
	document.getElementById('cvalue').value = cvalue;
	document.frmsearch.submit();
}
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

function checkSearch()
{
	var keyword = document.getElementById('keyword');
	
	var category = document.getElementById('category');
	
	var experience = document.getElementById('experience');
	
	var min_salary = document.getElementById('min_salary');
	
	if(trim(keyword.value)=="" && experience.value=="" && category.value=="" && min_salary.value=="")
	{
		alert("Please select atleast one search criteria.");
		return false;
	}
	else
	{
		return true;
	}
}

	function disableEnterKey(e)
	{
		 var key;
		//alert(window.event);	
		 if(window.event)
			  key = window.event.keyCode;     //IE
		 else
			  key = e.which;     //firefox
	
		//alert(key);	
 
		 if(key == 13)
			  return false;
		 else
			  return true;
	}
	
function deleterecord(path, extra_msg)
{
		//alert(path);
	if(extra_msg)
	{
		if(confirm(extra_msg+"\n Do you really want to delete this record?"))
		{
			window.location=path;
		}
	}
	else
	{
		if(confirm("Do you really want to delete this record?"))
		{
			window.location=path;
		}
	}		
}

function displaytr(id,val)
{
	if(val=='Y')
		document.getElementById(id).style.display='block';
	else	
		document.getElementById(id).style.display='none';
}

