var globals,global1,global2,global3,max1=3,global5=0,global6,global7=0;
function dologin(){
    var e = document.getElementById('login');
    e.innerHTML='<img src="/mitra/images/ajax-loader-login.gif" border="0"/>';
    var username=document.getElementById("CandidateLoginForm_cname").value;
    var password=document.getElementById("CandidateLoginForm_cpassword").value;
    var icicifparam="/talkserver/servlet/talkserver.servlet.WorkflowMasterServlet?rid=-2&PTNAME=candidate_login&PSNAME=start&layout_name=show&username="+username+"&password="+password;
	 new Ajax.Request(icicifparam,{
      onSuccess: function(t){
   		var e1 = document.getElementById('login');
      	e1.innerHTML='<img src="/mitra/images/bt_login.gif" width="47" height="18" border="0" class="login_bt"/>'; 
      }
  	 });
}
function editAccount(){
    /*var e = document.getElementById('login');
    e.innerHTML='<img src="/mitra/images/ajax-loader-login.gif" border="0"/>';*/
    var aname=document.getElementById("name").value;
    var lname=document.getElementById("lname").value;
    var address=document.getElementById("address").value;
    var city=document.getElementById("city").value;
    var state=document.getElementById("state").value;
    var country=document.getElementById("country").value;
    var postal=document.getElementById("postal").value;
    var mobile=document.getElementById("mobile").value;
    var phone1=document.getElementById("phone1").value;
    var phone2=document.getElementById("phone2").value;
    var phone3=document.getElementById("phone3").value;
    var age=document.getElementById("age").value;
    var email=document.getElementById("email").value;
    var icicifparam="/talkserver/servlet/talkserver.servlet.WorkflowMasterServlet?rid=-2&PTNAME=EditAccount&PSNAME=start&layout_name=show&name="+aname+"&city="+city+"&mobile="+mobile+"&age="+age+"&email="+email+"&lname="+lname+"&address="+address+"&state="+state+"&country="+country+"&postal="+postal+"&phone1="+phone1+"&phone2="+phone2+"&phone3="+phone3;
	 new Ajax.Request(icicifparam,{
      onSuccess: function(t){
   		/*var e1 = document.getElementById('login');
      	e1.innerHTML='<img src="/mitra/images/bt_login.gif" width="47" height="18" border="0" class="login_bt"/>'; 
      */
	}
  	 });
}

function ChangePwd(){
    /*var e = document.getElementById('login');
    e.innerHTML='<img src="/mitra/images/ajax-loader-login.gif" border="0"/>';*/
    var oldpwd=document.getElementById("oldPassword").value;
    var newpwd=document.getElementById("newPassword").value;
   var cnewpwd=document.getElementById("cPassword").value;
    var icicifparam="/talkserver/servlet/talkserver.servlet.WorkflowMasterServlet?rid=-2&PTNAME=ChangePassword&PSNAME=start&layout_name=show&oldpwd="+oldpwd+"&newpwd="+newpwd+"&cnewpwd="+cnewpwd;
	 new Ajax.Request(icicifparam,{
      onSuccess: function(t){
   		/*var e1 = document.getElementById('login');
      	e1.innerHTML='<img src="/mitra/images/bt_login.gif" width="47" height="18" border="0" class="login_bt"/>'; 
      */
	}
  	 });
}

function forget(){
//alert("hiii");
    var e = document.getElementById('forget');
    e.innerHTML='<img src="/mitra/images/ajax-loader.gif" border="0"/>';
    var email=document.getElementById("email").value;
    var icicifparam="/talkserver/servlet/talkserver.servlet.WorkflowMasterServlet?rid=-2&PTNAME=IciciForget&PSNAME=start&layout_name=show&email="+email;
	 new Ajax.Request(icicifparam,{
      onSuccess: function(t){
   		var e1 = document.getElementById('forget');
      	e1.innerHTML='<img src="/mitra/images/btn_submit1.gif" alt="Submit" name="Image3" width="68" height="21" border="0"  title="Submit" />'; 
      }
  	 });
}

function submitenter(myfield,e,f)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13){
   //alert(f);
	eval(f);
   return false;
}else
   return true;
}

function hello(){
	if(document.getElementById("other2_board1")!=null){
		globals=1;
		if(document.getElementById("other2_board2")!=null){
			globals=2;
			if(document.getElementById("other2_board3")!=null){
				globals=3;
			}
		}	
   }else{
		globals=0;
   }

   	
   if((globals < max1)){
		var divTag = document.createElement("div");
		divTag.id = "board";
		divTag.className ="board";
		if(globals!=0){
		divTag.innerHTML="<div style='margin: 10px;'></div>";
		}
		var other = document.createElement("div");
		other.id = "other";
		other.className ="gradetxt";
		
		var divTag1 = document.createElement("div");
		divTag1.id = "school";    
		divTag1.className ="school";
		if(globals!=0){
		divTag1.innerHTML="<div style='margin: 10px;'></div>";
		}
		var divTag5 = document.createElement("div");
		divTag5.id = "acity";  
		divTag5.className ="school";
		if(globals!=0){
		divTag5.innerHTML="<div style='margin: 10px;'></div>";
		}
		var divTag2 = document.createElement("div");divTag2.id = "specification";  
		divTag2.className ="specification";
		if(globals!=0){
		divTag2.innerHTML="<div style='margin: 10px;'></div>";
		}
		var divTag3 = document.createElement("div");divTag3.id = "month";  
		divTag3.className ="month";
		if(globals!=0){
		divTag3.innerHTML="<div style='margin: 10px;'></div>";
		}
		var divTag4 = document.createElement("div");divTag4.id = "percentage";  
		divTag4.className ="percentage";
		if(globals!=0){
		divTag4.innerHTML="<div style='margin: 10px;'></div>";
		}
		var foo = document.getElementById("academicmain2");
	
		var board="other2_board"+(globals+1);
		var element = document.createElement("input");
		element.setAttribute("type","text");
		element.setAttribute("name",board);
		element.setAttribute("value","");
		element.setAttribute("id",board);
		element.setAttribute("class","boardtextboxT");	
	
		var school="other2_school"+(globals+1);
		var element1 = document.createElement("input");
 		element1.setAttribute("type","text");
		element1.setAttribute("id",school);
		element1.setAttribute("name",school);
		element1.setAttribute("class","schooltextboxT");

		var city="other2_city"+(globals+1);
		var element5 = document.createElement("input");
 		element5.setAttribute("type","text");
		element5.setAttribute("id",city);
		element5.setAttribute("name",city);
		element5.setAttribute("class","schooltextboxT");

		var spec="other2_spec"+(globals+1);
		var element2 = document.createElement("input");
 		element2.setAttribute("type","text");
		element2.setAttribute("id",spec);
		element2.setAttribute("name",spec);
		element2.setAttribute("class","specialtextboxT");

	 	var month="other2_month"+(globals+1);
		var element3 = document.createElement("input");
 		element3.setAttribute("type","text");	
		element3.setAttribute("id",month);
		element3.setAttribute("name",month);
		element3.setAttribute("class","monthtextboxT");

	 	var percent="other2_percent"+(globals+1);
		var element4 = document.createElement("input");
 		element4.setAttribute("type","text");	
		element4.setAttribute("id",percent);
		element4.setAttribute("name",percent);
		element4.setAttribute("class","percenttextboxT");
		globals++;
		
	   	foo.appendChild(other);
		foo.appendChild(divTag);
		foo.appendChild(divTag1);
		foo.appendChild(divTag5)
		foo.appendChild(divTag2);
		foo.appendChild(divTag3);
		foo.appendChild(divTag4);
	
		var foo2 = document.getElementById("board");foo2.appendChild(element);
		var foo7 = document.getElementById("acity");foo7.appendChild(element5);
		var foo3 = document.getElementById("school");foo3.appendChild(element1);
		var foo4 = document.getElementById("specification");foo4.appendChild(element2);
		var foo5 = document.getElementById("month");foo5.appendChild(element3);
		var foo6 = document.getElementById("percentage");foo6.appendChild(element4);
	}else{alert("Max reached");}
}

function hello2(){
	if(document.getElementById("act_acitvity1")!=null){
		global1=1;
		if(document.getElementById("act_acitvity2")!=null){
			global1=2;
			if(document.getElementById("act_acitvity3")!=null){
				global1=3;
			}
		}
	}else{
		global1=0;
	}
	
	if((global1 < max1)){
		var br = document.createElement("br"); 	
		var divtag1 = document.createElement("div");divtag1.id = "activity_txt";  
      divtag1.className ="activity_txt";
	if(global1!=0){
		divtag1.innerHTML="<div style='margin: 10px;'></div>";
		}
      var divtag2 = document.createElement("div");divtag2.id = "year_txt";  
      divtag2.className ="year_txt";
	if(global1!=0){
		divtag2.innerHTML="<div style='margin: 10px;'></div>";
		}
      var divtag3 = document.createElement("div");divtag3.id = "position_txt";  
      divtag3.className ="position_txt";
       if(global1!=0){
		divtag3.innerHTML="<div style='margin: 10px;'></div>";
		}
      var divtag4 = document.createElement("div");divtag4.id = "pos_accom";  
      divtag4.className ="pos_accom";
	if(global1!=0){
		divtag4.innerHTML="<div style='margin: 10px;'></div>";
		}
   	var nam="act_acitvity"+(global1+1);
   
      var elements1 = document.createElement("input");
      elements1.setAttribute("type","text");
	   elements1.setAttribute("name",nam);
	   elements1.setAttribute("value","");
	   elements1.setAttribute("id",nam);
	   elements1.setAttribute("class","activity_textbox");
	
	   var voo = document.getElementById("academicmains");
	   var elements2 = document.createElement("input");
	   var year="act_year"+(global1+1);
      elements2.setAttribute("type","text");
	   elements2.setAttribute("id",year);
	   elements2.setAttribute("name",year);
	   elements2.setAttribute("class","year_textbox");

	   var elements3 = document.createElement("input");
		var position="act_position"+(global1+1);
	   elements3.setAttribute("type","text");
	   elements3.setAttribute("id",position);
	   elements3.setAttribute("name",position);
	   elements3.setAttribute("class","position_textbox");

	   var elements4 = document.createElement("input");
		var remark="act_remark"+(global1+1);
 	   elements4.setAttribute("type","text");
	   elements4.setAttribute("id",remark);
	   elements4.setAttribute("name",remark);
	   elements4.setAttribute("class","accom_textbox");	
	   global1++;
	
		voo.appendChild(divtag1);
		voo.appendChild(divtag2);
		voo.appendChild(divtag3);
		voo.appendChild(divtag4);
		voo.appendChild(br);
		
		var voo1 = document.getElementById("activity_txt");voo1.appendChild(elements1);voo1.appendChild(br);voo1.appendChild(br);
		var voo2 = document.getElementById("year_txt");voo2.appendChild(elements2);voo2.appendChild(br);
		var voo3 = document.getElementById("position_txt");voo3.appendChild(elements3);voo3.appendChild(br);
		var voo4 = document.getElementById("pos_accom");voo4.appendChild(elements4);voo4.appendChild(br);
	}else{
		alert("Maximum Reached");
	}
}

function hello4(){
	if(document.getElementById("lorgname1")!=null){
		global2=1;
		if(document.getElementById("lorgname2")!=null){
			global2=2;
			if(document.getElementById("lorgname3")!=null){
				global2=3;
			}
		}
	}else{
		global2=0;
	}
	
	if((global2 < max1)){
		var tag1 = document.createElement("div");tag1.id = "postxt";  
   	tag1.className ="postxt";
	if(global2!=0){
		tag1.innerHTML="<div style='margin: 10px;'></div>";
		}
      var tag2 = document.createElement("div");tag2.id = "posperiod";  
      tag2.className ="posperiod";
	if(global2!=0){
		tag2.innerHTML="<div style='margin: 10px;'></div>";
		}
	   var tag3 = document.createElement("div");tag3.id = "posroletxt";  
      tag3.className ="posroletxt";
	if(global2!=0){
		tag3.innerHTML="<div style='margin: 10px;'></div>";
		}
      var tag4 = document.createElement("div");tag4.id = "pos_accom1";  
      tag4.className ="pos_accom";
	if(global2!=0){
		tag4.innerHTML="<div style='margin: 10px;'></div>";
		}
	   var e1 = document.createElement("input");
      var lorg="lorgname"+(global2+1);	
    	e1.setAttribute("type","text");
	   e1.setAttribute("name",lorg);
	   e1.setAttribute("value","");
	   e1.setAttribute("id",lorg);
	   e1.setAttribute("class","orgtextbox");
	
     	var too = document.getElementById("academicmain4");
	   var e2 = document.createElement("input");
	   var servperiod="servperiod"+(global2+1);	
    	e2.setAttribute("type","text");
	   e2.setAttribute("id",servperiod);
	   e2.setAttribute("name",servperiod);
	   e2.setAttribute("class","period_textbox");

	   var e3 = document.createElement("input");
		var prole="prole"+(global2+1);	
    	e3.setAttribute("type","text");
	   e3.setAttribute("id",prole);
	   e3.setAttribute("name",prole);
	   e3.setAttribute("class","role_textbox");
      
      var e4 = document.createElement("input");
		var accom="accom"+(global2+1);	
 		e4.setAttribute("type","text");
	   e4.setAttribute("id",accom);
	   e4.setAttribute("name",accom);
	   e4.setAttribute("class","accom_textbox");	
	 		
		too.appendChild(tag1);
		too.appendChild(tag2);
		too.appendChild(tag3);
		too.appendChild(tag4);

		var too1 = document.getElementById("postxt");too1.appendChild(e1);
		var too2 = document.getElementById("posperiod");too2.appendChild(e2);
		var too3 = document.getElementById("posroletxt");too3.appendChild(e3);
		var too4 = document.getElementById("pos_accom1");too4.appendChild(e4);
	   global2++;
	}else{
		alert("Maximum Reached");
	}
}

function hello5(){
	if(document.getElementById("title1")!=null){
		global3=1;
		if(document.getElementById("title2")!=null){
			global3=2;
			if(document.getElementById("title3")!=null){
				global3=3;
			}
		}
	}else{
		global3=0;
	}
		
	if((global3 < max1)){
		var mytag = document.createElement("div");mytag.id = "academicmain5";  
      mytag.className ="academicmain";
		mytag.innerHTML='<div class="academicmain"><div class="worktxt">From</div><div class="workexpto">To</div><div class="workeorgname">Org Name, Location</div></div><div class="academicmain"><div class="worktxt"><select name="from_month'+(global3+1)+'" id="from_month'+(global3+1)+'" class="workdropdown"><option value=""></option><option value="January">January</option><option value="February">February</option><option value="March">March</option><option value="April">April</option><option value="May">May</option><option value="June">June</option><option value="July">July</option><option value="August">August</option><option value="September">September</option><option value="October">October</option><option value="November">November</option><option value="December">December</option><option value="Present">Present</option></select> &nbsp;<select name="from_year'+(global3+1)+'" id="from_year'+(global3+1)+'" class="workdropdown"><option value=""></option><option value="1989">1989</option><option value="1990">1990</option><option value="1991">1991</option><option value="1992">1992</option><option value="1993">1993</option><option value="1994">1994</option><option value="1995">1995</option><option value="1996">1996</option><option value="1997">1997</option><option value="1998">1998</option><option value="1999">1999</option><option value="2000">2000</option><option value="2001">2001</option><option value="2002">2002</option><option value="2003">2003</option><option value="2004">2004</option><option value="2005">2005</option><option value="2006">2006</option><option value="2007">2007</option><option value="2008">2008</option><option value="2009">2009</option><option value="Present">Present</option></select></div><div class="workexpto"><select name="to_month'+(global3+1)+'" id="to_month'+(global3+1)+'" class="workdropdown"><option value=""></option><option value="January">January</option><option value="February">February</option><option value="March">March</option><option value="April">April</option><option value="May">May</option><option value="June">June</option><option value="July">July</option><option value="August">August</option><option value="September">September</option><option value="October">October</option><option value="November">November</option><option value="December">December</option><option value="Present">Present</option></select> &nbsp;<select name="to_year'+(global3+1)+'" id="to_year'+(global3+1)+'" class="workdropdown"><option value=""><option value="1989">1989</option><option value="1990">1990</option><option value="1991">1991</option><option value="1992">1992</option><option value="1993">1993</option><option value="1994">1994</option><option value="1995">1995</option><option value="1996">1996</option><option value="1997">1997</option><option value="1998">1998</option><option value="1999">1999</option><option value="2000">2000</option><option value="2001">2001</option><option value="2002">2002</option><option value="2003">2003</option><option value="2004">2004</option><option value="2005">2005</option><option value="2006">2006</option><option value="2007">2007</option><option value="2008">2008</option><option value="2009">2009</option><option>Present</option></select></div><div class="workeorgname"><input name="orgname'+(global3+1)+'" id="orgname'+(global3+1)+'" value="" class="worktextbox" type="text"></div></div><div class="academicmain"><div class="worktxt">Job Title</div><div class="workexpto">Responsibility</div><div class="workeorgname">Achievements</div></div><div class="academicmain"><div class="worktxt"><input name="title'+(global3+1)+'" id="title'+(global3+1)+'" value="" class="jobworktextbox" type="text"></div><div class="workexpto"><input name="respon'+(global3+1)+'" id="respon'+(global3+1)+'" value="" class="jobworktextbox" type="text"></div><div class="workeorgname"><input name="achieve'+(global3+1)+'" id="achieve'+(global3+1)+'" value="" class="worktextbox" type="text"></div></div>';
		var main = document.getElementById("academicmain5");
		main.appendChild(mytag);
		global3++;	
	}else {alert("Maximum Reached");}	 
}

function refpersonal(){
	if(document.getElementById("ref_name1")!=null){
		global5=1;
		if(document.getElementById("ref_name2")!=null){
			global5=2;
			if(document.getElementById("ref_name3")!=null){
				global5=3;
			}
		}
	}else{
		global5=0;
	}
	
	if((global5 < max1)){
		var mytag1 = document.createElement("div");mytag1.id = "pro_name";  
      mytag1.className ="pro_name";
	if(global5!=0){
		mytag1.innerHTML="<div style='margin: 7px;'></div>";
		}
      var mytag2 = document.createElement("div");mytag2.id = "pre_add";  
      mytag2.className ="pre_add";
	if(global5!=0){
		mytag2.innerHTML="<div style='margin: 7px;'></div>";
		}
      var mytag3 = document.createElement("div");mytag3.id = "pre_email";  
      mytag3.className ="pre_email";
	if(global5!=0){
		mytag3.innerHTML="<div style='margin: 7px;'></div>";
		}
      var mytag4 = document.createElement("div");mytag4.id = "pre_cell";  
      mytag4.className ="pre_cell";
	if(global5!=0){
		mytag4.innerHTML="<div style='margin: 7px;'></div>";
		}
      var mytag5 = document.createElement("div");mytag5.id = "pre_phone";  
      mytag5.className ="pre_phone";
	if(global5!=0){
		mytag5.innerHTML="<div style='margin: 7px;'></div>";
		}
      var mytag6 = document.createElement("div");mytag6.id = "pro_phone";  
      mytag6.className ="pro_phone";
	if(global5!=0){
		mytag6.innerHTML="<div style='margin: 7px;'></div>";
		}
	   var m1 = document.createElement("input");
		var ref_name="ref_name"+(global5+1);	
    	m1.setAttribute("type","text");
	   m1.setAttribute("name",ref_name);
	   m1.setAttribute("value","");
	   m1.setAttribute("id",ref_name);
	   m1.setAttribute("class","pro_nametextbox");
		   
     	var main = document.getElementById("personalid");
	   var m2 = document.createElement("input");
		var ref_address="ref_address"+(global5+1);	
    	m2.setAttribute("type","text");
	   m2.setAttribute("id",ref_address);
	   m2.setAttribute("name",ref_address);
	   m2.setAttribute("class","pre_addtextbox");

	   var m3 = document.createElement("input");
		var ref_email="ref_email"+(global5+1);	
    	m3.setAttribute("type","text");
	   m3.setAttribute("id",ref_email);
	   m3.setAttribute("name",ref_email);
	   m3.setAttribute("class","pre_emailtextbox");

      var m4 = document.createElement("input");
		var ref_phone="ref_phone"+(global5+1);	
    	m4.setAttribute("type","text");
	   m4.setAttribute("id",ref_phone);
	   m4.setAttribute("name",ref_phone);
	   m4.setAttribute("class","pre_phonetextbox");

	   var m5 = document.createElement("input");
		var ref_occu="ref_occu"+(global5+1);	
    	m5.setAttribute("type","text");
	   m5.setAttribute("id",ref_occu);
	   m5.setAttribute("name",ref_occu);
	   m5.setAttribute("class","pro_relationtextbox");

      var m6 = document.createElement("input");
	   var ref_relation="ref_relation"+(global5+1);	
      m6.setAttribute("type","text");
	   m6.setAttribute("id",ref_relation);
	   m6.setAttribute("name",ref_relation);
	   m6.setAttribute("class","pro_relationtextbox");

		main.appendChild(mytag1);
		main.appendChild(mytag2);
		main.appendChild(mytag3);
		main.appendChild(mytag4);
		main.appendChild(mytag5);
		main.appendChild(mytag6);
	
   	var main1 = document.getElementById("pro_name");main1.appendChild(m1);
		var main2 = document.getElementById("pre_add");main2.appendChild(m2);
		var main3 = document.getElementById("pre_email");main3.appendChild(m3);
		var main4 = document.getElementById("pre_cell");main4.appendChild(m4);
		var main5 = document.getElementById("pre_phone");main5.appendChild(m5);
		var main6 = document.getElementById("pro_phone");main6.appendChild(m6);
	 	 global5++;	
	}else {alert("Maximum Reached");}	 
}

function addMoreLang(){
	if(document.getElementById("lang0")!=null){
		global7=1;
		if(document.getElementById("lang1")!=null){
			global7=2;
			if(document.getElementById("lang2")!=null){
				global7=3;
			}
		}
	}else{
		global7=0;
	}
	
	if((global7 < max1)){
		var mytag = document.createElement("div");mytag.id = "addmorelang";  
   	mytag.className ="academicmain";
		mytag.innerHTML='<div id="personal_formbox1"><div class="namediv_top"></div><div class="textboxdiv_top"><input name="lang'+global7+'" class="nametextbox" id="lang'+global7+'" maxlength="200" type="text"></div><div class="chkbox"><input name="speak'+global7+'" id="speak'+global7+'" value="speak'+global7+'" type="checkbox"></div><div class="chkboxtxt">Speak</div><div class="chkbox"><input name="read'+global7+'" id="read'+global7+'" value="read'+global7+'" type="checkbox"></div><div class="chkboxtxt">Read</div><div class="chkbox"><input name="write'+global7+'" id="write'+global7+'" value="write'+global7+'" type="checkbox"></div><div class="chkboxtxt">Write</div></div>';
		var main = document.getElementById("addmorelang");
		main.appendChild(mytag);
		global7++;	
	}else {alert("Maximum Reached");}
}

function refprof(){
	if(document.getElementById("prof_name1")!=null){
		global6=1;
		if(document.getElementById("prof_name2")!=null){
			global6=2;
			if(document.getElementById("prof_name3")!=null){
				global6=3;
			}
		}
	}else{
		global6=0;
	}

   if((global6 < max1)){
		var mytag1 = document.createElement("div");mytag1.id = "pro_name1";  
      mytag1.className ="pro_name";
	if(global6!=0){
		mytag1.innerHTML="<div style='margin: 7px;'></div>";
		}
      var mytag2 = document.createElement("div");mytag2.id = "pro_add1";  
      mytag2.className ="pro_add";
	if(global6!=0){
		mytag2.innerHTML="<div style='margin: 7px;'></div>";
		}
      var mytag3 = document.createElement("div");mytag3.id = "pro_email1";  
      mytag3.className ="pro_email";
	if(global6!=0){
		mytag3.innerHTML="<div style='margin: 7px;'></div>";
		}
      var mytag4 = document.createElement("div");mytag4.id = "pro_phone2";  
      mytag4.className ="pro_phone";
	if(global6!=0){
		mytag4.innerHTML="<div style='margin: 7px;'></div>";
		}
      var mytag5 = document.createElement("div");mytag5.id = "pro_name2";  
      mytag5.className ="pro_name";
	if(global6!=0){
		mytag5.innerHTML="<div style='margin: 7px;'></div>";
		}
      var mytag6 = document.createElement("div");mytag6.id = "pro_phone3";  
      mytag6.className ="pro_phone";
	if(global6!=0){
		mytag6.innerHTML="<div style='margin: 7px;'></div>";
		}
      var mytag7 = document.createElement("div");mytag7.id = "pro_phone4";  
      mytag7.className ="pro_phone";
	if(global6!=0){
		mytag7.innerHTML="<div style='margin: 7px;'></div>";
		}
	   
	   var m1 = document.createElement("input");
		var prof_name="prof_name"+(global6+1);	
    	m1.setAttribute("type","text");
	   m1.setAttribute("name",prof_name);
	   m1.setAttribute("value","");
	   m1.setAttribute("id",prof_name);
	   m1.setAttribute("class","pro_nametextbox");
	
	   var main = document.getElementById("profid");
	   var m2 = document.createElement("input");
	   var prof_add="prof_add"+(global6+1);	
      m2.setAttribute("type","text");
	   m2.setAttribute("id",prof_add);
	   m2.setAttribute("name",prof_add);
	   m2.setAttribute("class","pro_addtextbox");

	   var m3 = document.createElement("input");
	   var prof_email="prof_email"+(global6+1);	
      m3.setAttribute("type","text");
	   m3.setAttribute("id",prof_email);
	   m3.setAttribute("name",prof_email);
	   m3.setAttribute("class","pro_emailtextbox");

      var m4 = document.createElement("input");
		var prof_phone="prof_phone"+(global6+1);	
    	m4.setAttribute("type","text");
	   m4.setAttribute("id",prof_phone);
	   m4.setAttribute("name",prof_phone);
	   m4.setAttribute("class","pro_phonetextbox");

      var m5 = document.createElement("input");
	   var prof_title="prof_title"+(global6+1);	
      m5.setAttribute("type","text");
	   m5.setAttribute("id",prof_title);
	   m5.setAttribute("name",prof_title);
	   m5.setAttribute("class","pro_titletextbox");

      var m6 = document.createElement("input");
	   var prof_org="prof_org"+(global6+1);	
      m6.setAttribute("type","text");
	   m6.setAttribute("id",prof_org);
	   m6.setAttribute("name",prof_org);
	   m6.setAttribute("class","pro_orgtextbox");

	   var m7 = document.createElement("input");
 	   var prof_relation="prof_relation"+(global6+1);	
    	m7.setAttribute("type","text");
	   m7.setAttribute("id",prof_relation);
	   m7.setAttribute("name",prof_relation);
	   m7.setAttribute("class","pro_relationtextbox");
	  	
		main.appendChild(mytag1);
		main.appendChild(mytag2);
		main.appendChild(mytag3);
		main.appendChild(mytag4);
		main.appendChild(mytag5);
		main.appendChild(mytag6);
		main.appendChild(mytag7);
		
	 	var main1 = document.getElementById("pro_name1");main1.appendChild(m1);
		var main2 = document.getElementById("pro_add1");main2.appendChild(m2);
		var main3 = document.getElementById("pro_email1");main3.appendChild(m3);
		var main4 = document.getElementById("pro_phone2");main4.appendChild(m4);
		var main5 = document.getElementById("pro_name2");main5.appendChild(m5);
		var main6 = document.getElementById("pro_phone3");main6.appendChild(m6);
		var main7 = document.getElementById("pro_phone4");main7.appendChild(m7);	
		global6++;	
	}else {alert("Maximum Reached");}
}

function emptyField1(error){
	if(document.getElementById("errordiv") != null){
		document.getElementById("errordiv").style.display="none";
	}
   document.getElementById("errordivLogin").style.display="";
   document.getElementById("errordivLogin").innerHTML=error;
}
function emptyField2(error){
	if(document.getElementById("errordiv") != null){
		document.getElementById("errordiv").style.display="none";
	}
   document.getElementById("errordivAccount").style.display="";
   document.getElementById("errordivAccount").innerHTML=error;
}

function emptyField(error){
	if(document.getElementById("errordivAccount") != null){
		document.getElementById("errordivAccount").style.display="none";
	}
	document.getElementById("errordivLogin").style.display="none";
	document.getElementById("errordiv").style.display="";       
   	document.getElementById("errorid").innerHTML=error;
	
	window.scrollTo(0,0);
}

function doSignUp(){	
	var e = document.getElementById('signup');
   e.innerHTML='<img src="/mitra/images/ajax-loader.gif" border="0"/>';
  	var params = Form.serialize('IciciRegisterForm');   
	if(document.getElementById('checkbox').checked==false){
		document.getElementById("errordiv").style.display="";
      document.getElementById("errorid").innerHTML="You must agree to terms of service";
		var e1 = document.getElementById('signup');
      e1.innerHTML='<img src="/mitra/images/btn_submit.gif" width="68" height="21" border="0" title="Submit"/>'; 
	}else{
	   var icicifparam="/talkserver/servlet/talkserver.servlet.WorkflowMasterServlet?rid=-2&PTNAME=IciciRegister&PSNAME=start&layout_name=show";
      new Ajax.Request(icicifparam,{
			parameters: params,
         onSuccess: function test(){
				var e1 = document.getElementById('signup');
            e1.innerHTML='<img src="/mitra/images/btn_submit.gif"/>'; 
		   }
      });
	}
}

function successLogin(){
	location.href="/talkserver/page/ApplicationForm/show";
}

function tellAFriend(){
	document.location.href="/talkserver/page/TFThankYou/show";
}

function shareAFeedback(){
	document.location.href="/talkserver/page/SFThankYou/show";
}

function ChangePassword(){
	document.location.href="/talkserver/page/CPThankYou/show";
}
function Sforget(){
	document.location.href="/talkserver/page/FThankYou/show";
}
function successEditAccount(){
	document.location.href="/talkserver/page/EAThankYou/show";
}
function successEmail(){	
	var e = document.getElementById('tafrd');
   e.innerHTML='<img src="/mitra/images/ajax-loader.gif" border="0"/>';
	var params = Form.serialize('FriendForm');   
	var icicifparam="/talkserver/servlet/talkserver.servlet.WorkflowMasterServlet?rid=-2&PTNAME=icici_friend&PSNAME=start&layout_name=show&";
   new Ajax.Request(icicifparam,{
		parameters: params,	
	   onSuccess: function test(){
			var e1 = document.getElementById('tafrd');
         e1.innerHTML='<img src="/mitra/images/btn_submit.gif" title="Submit" border="0" height="21" width="68"/>'; 
      }
   });
}

function successSignUp(){
	document.location.href="/talkserver/page/RegisterThankYou/show";
}

var showMessage1=function(){
	document.location.href='/talkserver/page/Register/show';
}

function successAppForm(icicifparam){
	document.location.href=icicifparam;
}

function submitAppForm(id){
	if(id == "all"){
		new_id = "appform";
	}else{
		new_id = "partialsave";
	}

	var e = document.getElementById(new_id);
   e.innerHTML='<img src="/mitra/images/ajax-loader.gif" border="0"/>';

	var url="/talkserver/d/IciciSignUp/start/show";
	var icicifparam="";
  for(i=0; i<document.IciciProfileForm.elements.length; i++){
	   if(document.IciciProfileForm.elements[i].type!="image" && document.IciciProfileForm.elements[i].type!="radio" && document.IciciProfileForm.elements[i].type!="checkbox"){
      	if(i==0)
         	icicifparam=icicifparam+document.IciciProfileForm.elements[i].name+"="+escape(document.IciciProfileForm.elements[i].value);
			else
            icicifparam=icicifparam+"&"+document.IciciProfileForm.elements[i].name+"="+escape(document.IciciProfileForm.elements[i].value);
      }	
	  	if(document.IciciProfileForm.elements[i].type=="checkbox"){
			if(document.IciciProfileForm.elements[i].checked){
				icicifparam=icicifparam+"&"+document.IciciProfileForm.elements[i].name+"="+escape(document.IciciProfileForm.elements[i].value);
			}
		}
		if(document.IciciProfileForm.elements[i].type=="radio"){
			if(document.IciciProfileForm.elements[i].checked){
				icicifparam=icicifparam+"&"+document.IciciProfileForm.elements[i].name+"="+escape(document.IciciProfileForm.elements[i].value);
			}
		}
	}

	if(document.getElementById("other2_board1")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("other2_board1").name+"="+escape(document.getElementById("other2_board1").value)+"&"+document.getElementById("other2_school1").name+"="+escape(document.getElementById("other2_school1").value)+"&"+document.getElementById("other2_spec1").name+"="+escape(document.getElementById("other2_spec1").value)+"&"+document.getElementById("other2_month1").name+"="+escape(document.getElementById("other2_month1").value)+"&"+document.getElementById("other2_percent1").name+"="+escape(document.getElementById("other2_percent1").value)+"&"+document.getElementById("other2_city1").name+"="+escape(document.getElementById("other2_city1").value)
	}

	if(document.getElementById("other2_board2")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("other2_board2").name+"="+escape(document.getElementById("other2_board2").value)+"&"+document.getElementById("other2_school2").name+"="+escape(document.getElementById("other2_school2").value)+"&"+document.getElementById("other2_spec2").name+"="+escape(document.getElementById("other2_spec2").value)+"&"+document.getElementById("other2_month2").name+"="+escape(document.getElementById("other2_month2").value)+"&"+document.getElementById("other2_percent2").name+"="+escape(document.getElementById("other2_percent2").value)+"&"+document.getElementById("other2_city2").name+"="+escape(document.getElementById("other2_city2").value)
	}

	if(document.getElementById("other2_board3")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("other2_board3").name+"="+escape(document.getElementById("other2_board3").value)+"&"+document.getElementById("other2_school3").name+"="+escape(document.getElementById("other2_school3").value)+"&"+document.getElementById("other2_spec3").name+"="+escape(document.getElementById("other2_spec3").value)+"&"+document.getElementById("other2_month3").name+"="+escape(document.getElementById("other2_month3").value)+"&"+document.getElementById("other2_percent3").name+"="+escape(document.getElementById("other2_percent3").value)+"&"+document.getElementById("other2_city3").name+"="+escape(document.getElementById("other2_city3").value)
	}	
	
	if(document.getElementById("act_acitvity1")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("act_acitvity1").name+"="+escape(document.getElementById("act_acitvity1").value)+"&"+document.getElementById("act_year1").name+"="+escape(document.getElementById("act_year1").value)+"&"+document.getElementById("act_position1").name+"="+escape(document.getElementById("act_position1").value)+"&"+document.getElementById("act_remark1").name+"="+escape(document.getElementById("act_remark1").value)
	}
	
	if(document.getElementById("act_acitvity2")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("act_acitvity2").name+"="+escape(document.getElementById("act_acitvity2").value)+"&"+document.getElementById("act_year2").name+"="+escape(document.getElementById("act_year2").value)+"&"+document.getElementById("act_position2").name+"="+escape(document.getElementById("act_position2").value)+"&"+document.getElementById("act_remark2").name+"="+escape(document.getElementById("act_remark2").value)
	}

	if(document.getElementById("act_acitvity3")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("act_acitvity3").name+"="+escape(document.getElementById("act_acitvity3").value)+"&"+document.getElementById("act_year3").name+"="+escape(document.getElementById("act_year3").value)+"&"+document.getElementById("act_position3").name+"="+escape(document.getElementById("act_position3").value)+"&"+document.getElementById("act_remark3").name+"="+escape(document.getElementById("act_remark3").value)
	}

	if(document.getElementById("lorgname1")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("lorgname1").name+"="+escape(document.getElementById("lorgname1").value)+"&"+document.getElementById("servperiod1").name+"="+escape(document.getElementById("servperiod1").value)+"&"+document.getElementById("prole1").name+"="+escape(document.getElementById("prole1").value)+"&"+document.getElementById("accom1").name+"="+escape(document.getElementById("accom1").value)
	}
	
	if(document.getElementById("lorgname2")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("lorgname2").name+"="+escape(document.getElementById("lorgname2").value)+"&"+document.getElementById("servperiod2").name+"="+escape(document.getElementById("servperiod2").value)+"&"+document.getElementById("prole2").name+"="+escape(document.getElementById("prole2").value)+"&"+document.getElementById("accom2").name+"="+escape(document.getElementById("accom2").value)
	}
	
	if(document.getElementById("lorgname3")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("lorgname3").name+"="+escape(document.getElementById("lorgname3").value)+"&"+document.getElementById("servperiod3").name+"="+escape(document.getElementById("servperiod3").value)+"&"+document.getElementById("prole3").name+"="+escape(document.getElementById("prole3").value)+"&"+document.getElementById("accom3").name+"="+escape(document.getElementById("accom3").value)
	}
     
	if(document.getElementById("title1")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("title1").name+"="+escape(document.getElementById("title1").value)+"&"+document.getElementById("respon1").name+"="+escape(document.getElementById("respon1").value)+"&"+document.getElementById("achieve1").name+"="+escape(document.getElementById("achieve1").value)+"&"+document.getElementById("from_month1").name+"="+escape(document.getElementById("from_month1").value)+"&"+document.getElementById("from_year1").name+"="+escape(document.getElementById("from_year1").value)+"&"+document.getElementById("to_month1").name+"="+escape(document.getElementById("to_month1").value)+"&"+document.getElementById("to_year1").name+"="+escape(document.getElementById("to_year1").value)+"&"+document.getElementById("orgname1").name+"="+escape(document.getElementById("orgname1").value)
	}
	
	if(document.getElementById("title2")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("title2").name+"="+escape(document.getElementById("title2").value)+"&"+document.getElementById("respon2").name+"="+escape(document.getElementById("respon2").value)+"&"+document.getElementById("achieve2").name+"="+escape(document.getElementById("achieve2").value)+"&"+document.getElementById("from_month2").name+"="+escape(document.getElementById("from_month2").value)+"&"+document.getElementById("from_year2").name+"="+escape(document.getElementById("from_year2").value)+"&"+document.getElementById("to_month2").name+"="+escape(document.getElementById("to_month2").value)+"&"+document.getElementById("to_year2").name+"="+escape(document.getElementById("to_year2").value)+"&"+document.getElementById("orgname2").name+"="+escape(document.getElementById("orgname2").value)
	}
	
	if(document.getElementById("title3")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("title3").name+"="+escape(document.getElementById("title3").value)+"&"+document.getElementById("respon3").name+"="+escape(document.getElementById("respon3").value)+"&"+document.getElementById("achieve3").name+"="+escape(document.getElementById("achieve3").value)+"&"+document.getElementById("from_month3").name+"="+escape(document.getElementById("from_month3").value)+"&"+document.getElementById("from_year3").name+"="+escape(document.getElementById("from_year3").value)+"&"+document.getElementById("to_month3").name+"="+escape(document.getElementById("to_month3").value)+"&"+document.getElementById("to_year3").name+"="+escape(document.getElementById("to_year3").value)+"&"+document.getElementById("orgname3").name+"="+escape(document.getElementById("orgname3").value)
	}

	if(document.getElementById("ref_name1")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("ref_name1").name+"="+escape(document.getElementById("ref_name1").value)+"&"+document.getElementById("ref_address1").name+"="+escape(document.getElementById("ref_address1").value)+"&"+document.getElementById("ref_email1").name+"="+escape(document.getElementById("ref_email1").value)+"&"+document.getElementById("ref_phone1").name+"="+escape(document.getElementById("ref_phone1").value)+"&"+document.getElementById("ref_occu1").name+"="+escape(document.getElementById("ref_occu1").value)+"&"+document.getElementById("ref_relation1").name+"="+escape(document.getElementById("ref_relation1").value)
	}

	if(document.getElementById("ref_name2")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("ref_name2").name+"="+escape(document.getElementById("ref_name2").value)+"&"+document.getElementById("ref_address2").name+"="+escape(document.getElementById("ref_address2").value)+"&"+document.getElementById("ref_email2").name+"="+escape(document.getElementById("ref_email2").value)+"&"+document.getElementById("ref_phone2").name+"="+escape(document.getElementById("ref_phone2").value)+"&"+document.getElementById("ref_occu2").name+"="+escape(document.getElementById("ref_occu2").value)+"&"+document.getElementById("ref_relation2").name+"="+escape(document.getElementById("ref_relation2").value)
	}

	if(document.getElementById("ref_name3")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("ref_name3").name+"="+escape(document.getElementById("ref_name3").value)+"&"+document.getElementById("ref_address3").name+"="+escape(document.getElementById("ref_address3").value)+"&"+document.getElementById("ref_email3").name+"="+escape(document.getElementById("ref_email3").value)+"&"+document.getElementById("ref_phone3").name+"="+escape(document.getElementById("ref_phone3").value)+"&"+document.getElementById("ref_occu3").name+"="+escape(document.getElementById("ref_occu3").value)+"&"+document.getElementById("ref_relation3").name+"="+escape(document.getElementById("ref_relation3").value)
	}

	if(document.getElementById("prof_name1")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("prof_name1").name+"="+escape(document.getElementById("prof_name1").value)+"&"+document.getElementById("prof_add1").name+"="+escape(document.getElementById("prof_add1").value)+"&"+document.getElementById("prof_email1").name+"="+escape(document.getElementById("prof_email1").value)+"&"+document.getElementById("prof_phone1").name+"="+escape(document.getElementById("prof_phone1").value)+"&"+document.getElementById("prof_title1").name+"="+escape(document.getElementById("prof_title1").value)+"&"+document.getElementById("prof_org1").name+"="+escape(document.getElementById("prof_org1").value)+"&"+document.getElementById("prof_relation1").name+"="+escape(document.getElementById("prof_relation1").value)
	}

	if(document.getElementById("prof_name2")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("prof_name2").name+"="+escape(document.getElementById("prof_name2").value)+"&"+document.getElementById("prof_add2").name+"="+escape(document.getElementById("prof_add2").value)+"&"+document.getElementById("prof_email2").name+"="+escape(document.getElementById("prof_email2").value)+"&"+document.getElementById("prof_phone2").name+"="+escape(document.getElementById("prof_phone2").value)+"&"+document.getElementById("prof_title2").name+"="+escape(document.getElementById("prof_title2").value)+"&"+document.getElementById("prof_org2").name+"="+escape(document.getElementById("prof_org2").value)+"&"+document.getElementById("prof_relation2").name+"="+escape(document.getElementById("prof_relation2").value)
	}

	if(document.getElementById("prof_name3")!=null){
		icicifparam=icicifparam+"&"+document.getElementById("prof_name3").name+"="+escape(document.getElementById("prof_name3").value)+"&"+document.getElementById("prof_add3").name+"="+escape(document.getElementById("prof_add3").value)+"&"+document.getElementById("prof_email3").name+"="+escape(document.getElementById("prof_email3").value)+"&"+document.getElementById("prof_phone3").name+"="+escape(document.getElementById("prof_phone3").value)+"&"+document.getElementById("prof_title3").name+"="+escape(document.getElementById("prof_title3").value)+"&"+document.getElementById("prof_org3").name+"="+escape(document.getElementById("prof_org3").value)+"&"+document.getElementById("prof_relation3").name+"="+escape(document.getElementById("prof_relation3").value)
	}

   var i = 0;
   while(i<global7){
   	if(document.getElementById("speak"+i).checked){
			icicifparam=icicifparam+"&speak"+i+"="+escape(document.getElementById("speak"+i).value)
		}
		if(document.getElementById("read"+i).checked){
			icicifparam=icicifparam+"&read"+i+"="+escape(document.getElementById("read"+i).value)
		}
		if(document.getElementById("write"+i).checked){
			icicifparam=icicifparam+"&write"+i+"="+escape(document.getElementById("write"+i).value)
		}
		
		if(document.getElementById("lang"+i)!=null){
			icicifparam=icicifparam+"&lang"+i+"="+escape(document.getElementById("lang"+i).value)
		}
		i++;
   }
	icicifparam=icicifparam+"&new_id="+new_id+"&lang_size="+global7;

   new Ajax.Request(url,{
		parameters: icicifparam,
		method: 'Post',	
   	onSuccess: function test(){
			if(id == "all"){
				var e1 = document.getElementById("appform");
				e1.innerHTML='<img src="/mitra/images/btn_submit.gif" title="Submit" border="0" height="21" width="68/">';
			}else{
				var e1 = document.getElementById("partialsave");
		      e1.innerHTML='<img src="/mitra/images/btn_partialsave.gif" border="0"/>';
			}
      }
   });   
}

function doPost(name){
	var params = Form.serialize('FeedbackForm');   
	var e = document.getElementById('empupb');
 	e.innerHTML='<img src="/mitra/images/ajax-loader.gif" border="0"/>';
   var icicifparam="/talkserver/servlet/talkserver.servlet.WorkflowMasterServlet?rid=-2&PTNAME=feedback&PSNAME=start&layout_name=show&p="+name+"&";
   new Ajax.Request(icicifparam,{
	   parameters: params,	
      onSuccess: function test(){
			var e1 = document.getElementById('empupb');
         e1.innerHTML='<img src="/mitra/images/btn_submit.gif" width="68" height="21" border="0" title="Submit"/>';
		}
   });
}

var showMessage=function(){
	document.location.href='/talkserver/page/FeedBackPage/show';
}

function successFeedback(){
	document.location.href="/talkserver/page/AQThankYou/show";
}

function start(){
	var params = Form.serialize('FeedbackForm');   
	var radio=document.getElementById("what").value;
	var icicifparam="/talkserver/servlet/talkserver.servlet.WorkflowMasterServlet?rid=-2&PTNAME=IciciSignUp&PSNAME=start&layout_name=candidate_layout&";
   new Ajax.Request(icicifparam,{
		parameters: params,	
      onSuccess: function(t){
		}
   });
}

function CheckEmail(stremail){
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
   return filter.test(stremail);
}

function CheckAlert(){
}

//Forum start

function resetDis(){
    document.getElementById('topics').value=''
    document.getElementById('descriptions').value='';
}

function addPost(){
    var e = document.getElementById('Image11');
    e.innerHTML='<img src="/mitra/images/ajax-loader.gif" border="0"/>';
		var url="/talkserver/d/ReplytTouchpoint/staff/staff?flag="+1;
 		new Ajax.Request(url,{
 			parameters: Form.serialize('replyForm'),
      	onSuccess: function(t){
            var e1 = document.getElementById('Image11');
            e1.innerHTML='<img src="/mitra/images/btn_submitnew.gif" alt="Submit" name="Image11" width="68" height="21" border="0"  title="Submit" />'; 
         }
      });
}

function addTopic(){
    var e = document.getElementById('Image11');
    e.innerHTML='<img src="/mitra/images/ajax-loader.gif" border="0"/>';
    
    var url="/talkserver/d/CreateNewTopic/staff/staff?flag="+1;
    new Ajax.Request(url,{
        parameters: Form.serialize('newTopic'),
        onSuccess: function(t){
            var e1 = document.getElementById('Image11');
            e1.innerHTML='<img src="/mitra/images/btn_submitnew.gif" alt="Submit" name="Image11" width="68" height="21" border="0"  title="Submit" />'; 
         }
    });
    
}

function successTopic(){
	document.location.href="/talkserver/page/TopicThankYou/show";
}

function successPost(){
	document.location.href="/talkserver/page/PostThankYou/show";
}

function refreshURL(divId,category_id, page_num, max_rows){
    var url = "/talkserver/servlet/mitra.servlet.GetTopicByCategoryServlet?catId="+category_id+"&pageNum="+page_num+"&maxRows="+max_rows;
    new Ajax.Updater("category_"+divId, url);
}

function refreshreplyURL(receriverinfo, catId, pageNum, maxRows, flag){
    
    var url = "/talkserver/servlet/mitra.servlet.GetPostByTopicServlet?receriverinfo="+receriverinfo+"&catId="+catId+"&pageNum="+pageNum+"&maxRows="+maxRows+"&flag="+flag;
    
    new Ajax.Updater("replyBox", url);
}

function postURL(receiverId){
    document.location.href="/talkserver/page/post_reply/show&fid="+receiverId;
}

function topicURL(catId){
    document.location.href="/talkserver/page/startdiscussion/show&catid="+catId;
}

function homeURL(){
    document.location.href="/talkserver/page/Home/s"
    alert("You need to login before you can use this part of the forum.");
}

//Forum End
function textCounter(field,icnt,imax){
    var v = field.value;
    maxl = parseInt(imax);
    a = v.split(' '); // words are separated by a comma
    if(a.length > maxl){ 
        var i=0;
        var result="";
        while(i<maxl){
	        result=result+v.split(' ')[i]+" ";
	        i++;
        }
    //result=result.substring(0,result.length()-1);
    //field.value = field.value.replace(/,+[A-Za-z0-9+]$/,'');
    field.value=result;
    }
   // element(icnt).value=a.length-1+" of "+imax;
}

function element(id){
    return document.getElementById(id);
}


function deadline(){
	alert("Last date of application form submission was 15 February 2010.");
}

