function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}



	//////////////////// this is for the others box

	function whatvalue(theparampassed){

		var theparampassed1=theparampassed;
		//alert(theparampassed1.name);
		


	}
	

	//////////////////// this is for the dynamically generated table containing the check boxes

	function clickunclick(theparam){

		var nameofcheckbox2="";
		var nameofcheckbox1="";
		var nameofcheckbox3="";
		var nameofcheckbox4="";
		var nameofcheckbox	=theparam.name;
		var nameofcheckbox4=nameofcheckbox;
		var theindexof_sb=nameofcheckbox.indexOf("[");
		nameofcheckbox=nameofcheckbox.substring(0,theindexof_sb);
		nameofcheckbox3=nameofcheckbox+"[0]";
		var lengthofpassedvar=nameofcheckbox.length;
		
		var lenofallelementsis=document.form1.elements.length;
		var kjj=0;
		
		for (i=0;i<lenofallelementsis;i++){
			nameofcheckbox2	=document.form1.elements[i].name;
			nameofcheckbox1=nameofcheckbox2.substring(0,lengthofpassedvar);

			if (nameofcheckbox1==nameofcheckbox)	{
				var kj=i;
				kjj++
			}

		}

		var kj1=kj-1;
		kjj	=kjj-2;
		kjj	=nameofcheckbox+"["+kjj+"]";

		//alert (theparam.name+"and the nameofcheckbox3 is "+kjj);

		if ((theparam.name==kjj)){

			if (document.form1.elements[kj1].checked){
			for (j=0;j<kj1;j++){
			nameofcheckbox2	=document.form1.elements[j].name;
			nameofcheckbox1=nameofcheckbox2.substring(0,lengthofpassedvar);

					if (nameofcheckbox1==nameofcheckbox){
							
							document.form1.elements[j].checked	= false;

						}



			}

			document.form1.elements[kj].readOnly	=	false; 

			} else{


			document.form1.elements[kj].readOnly	=	true; 
			document.form1.elements[kj].value	=	""; 

			}

		}else{

		for (i=0;i<lenofallelementsis;i++){

			nameofcheckbox2	=document.form1.elements[i].name;

			if (nameofcheckbox3==nameofcheckbox2){
							
							var jk=i;

						}

			nameofcheckbox1=nameofcheckbox2.substring(0,lengthofpassedvar);
			
			if ((nameofcheckbox4==nameofcheckbox3)&&(nameofcheckbox1==nameofcheckbox)&&(theparam.checked)&&(i!=kj)){

				document.form1.elements[i].checked	=	true;
				document.form1.elements[kj1].checked	=	false;
				document.form1.elements[kj].readOnly	=	true; 
				document.form1.elements[kj].value	=	""; 


			}else if ((nameofcheckbox4==nameofcheckbox3)&&(nameofcheckbox1==nameofcheckbox)&&(!theparam.checked)){

				document.form1.elements[i].checked	=	false;
				document.form1.elements[jk].checked	=	false;

				//alert("comes in second");

			}else if ((nameofcheckbox4!=nameofcheckbox3)&&(nameofcheckbox1==nameofcheckbox)&&(!theparam.checked)){

				document.form1.elements[jk].checked		=	false;
				//alert(document.form1.elements[kj1].name);

			}else if ((nameofcheckbox4!=nameofcheckbox3)&&(nameofcheckbox1==nameofcheckbox)&&(theparam.checked)){

				if (document.form1.elements[kj1].checked){
					
				document.form1.elements[kj1].checked		=	false;
				document.form1.elements[kj].readOnly	=	true; 
				document.form1.elements[kj].value	=	""; 

				}

			}




		}
		}
		
		//alert(" at line 80 of asspun "+kj);


	}



f7_droplayer=new Array()
f7_droplayer[0]="drop1"

f7_v4=(parseInt(navigator.appVersion)>=4 && parseInt(navigator.appVersion)<=5)?1:0
f7_ie=(document.all && f7_v4)?1:0
f7_ns=(document.layers && f7_v4)?1:0



function f7_showdrop(thelayer){
	f7_keep=thelayer; f7_hideall(); f7_showitnow=1
	f7_showit(thelayer)
	}

function f7_showit(thelayer){
		if(f7_ie){ eval(f7_droplayer[thelayer]+'.style.visibility="visible"') }
		if(f7_ns){ eval('document.'+f7_droplayer[thelayer]+'.visibility="show"');}
	}


function f7_hidedrop(){
	f7_keep=-1; setTimeout('f7_hideall()',500)
	}

f7_keep=-1

function f7_hideall(){
	for(i=0;i<f7_droplayer.length;i++){  
		f7_hideit=0; f7_checkmousepos(i)
		if(f7_ie && f7_keep!=i){ 
			if(f7_hideit){ eval(f7_droplayer[i]+'.style.visibility="hidden"') } 
			}
		if(f7_ns && f7_keep!=i){ 
			if(f7_hideit){ eval('document.'+f7_droplayer[i]+'.visibility="hide"') }
			}
		}
	}

document.onmousemove = f7_getmousepos
if (f7_ns) document.captureEvents(Event.MOUSEMOVE)

function f7_getmousepos(e){
	if(f7_ns){f7_mousex=e.pageX; f7_mousey=e.pageY}
	if(f7_ie){f7_mousex=event.clientX; f7_mousey=event.clientY;}
	}

function f7_checkmousepos(i){          
	if(f7_ns){     
		f7_x_min=eval('document.'+f7_droplayer[i]+'.left')
		f7_x_max=f7_x_min+eval('document.'+f7_droplayer[i]+'.clip.width')
		f7_y_min=eval('document.'+f7_droplayer[i]+'.top')
		f7_y_max=f7_y_min+eval('document.'+f7_droplayer[i]+'.clip.height')
		}    
	if(f7_ie){     
		f7_x_min=eval(f7_droplayer[i]+'.style.pixelLeft')
		f7_x_max=f7_x_min+eval(f7_droplayer[i]+'.style.pixelWidth')
		f7_y_min=eval(f7_droplayer[i]+'.style.pixelTop')
		f7_y_max=f7_y_min+eval(f7_droplayer[i]+'.style.pixelHeight')
		}
	if (f7_mousex>=f7_x_min && f7_mousex<=f7_x_max && f7_mousey>=f7_y_min && f7_mousey<=f7_y_max){
		f7_hideit=0; setTimeout('f7_hideall()',500)
		}
	else { f7_hideit=1 }
	return f7_hideit
	}





//	countthewords();

	function clickcb(nameofcb) 
	{
		cbox = eval(nameofcb);
		cbox.checked = !cbox.checked;
	}

	function checkiftext()
	{
		if (isNaN(document.form1.yearofestab.value))
		{
			document.form1.yearofestab.value=document.form1.yearofestab.value.substring(0,(document.form1.yearofestab.value.length)-1);
			alert("The year of establishment should be a numeric\n4 digits value after 1600 ");
		}

		if (((document.form1.yearofestab.value.length)>=4)&&(document.form1.yearofestab.value)<1600)	
		{
			alert("The year of establishment should be a numeric\n4 digits value after 1600 eg.1980, 2002");
			document.form1.yearofestab.focus();
		}
	}

	function countthewords()
	{
		var char_count = document.form1.abouttheco.value.length;
		var fullStr = document.form1.abouttheco.value + " ";
		var initial_whitespace_rExp = /^[^A-Za-z0-9]+/gi;
		var left_trimmedStr = fullStr.replace(initial_whitespace_rExp, "");
		var non_alphanumerics_rExp = rExp = /[^A-Za-z0-9]+/gi;
		var cleanedStr = left_trimmedStr.replace(non_alphanumerics_rExp, " ");
		var splitString = cleanedStr.split(" ");
		var word_count = splitString.length -1;
		return word_count;
	}

	function checknoofwords()
	{
		word_count = countthewords();
		word_count_left	= (25-word_count);

		document.form1.totalwords.value = word_count;
		if (word_count_left>=0)
		{
			document.form1.totalwordsleft.value	= word_count_left;
		}else if (word_count_left<0)
		{
			word_count_left=0;
			document.form1.totalwordsleft.value	= word_count_left;
		}

		//if (word_count>=25)	document.getElementById('countertable').style.visibility='hidden';
		//if (word_count<25) document.getElementById('countertable').style.visibility='visible';

		//if (document.form1.totalwords.blur()) document.form1.totalwords.focus()
	}

	function checkthetextarea()
	{		
		var thenoofw = countthewords();
	
		if (thenoofw<25)
		{
			alert("Please fill in atleast 25 words. You have filled in only "+thenoofw+" words");
			document.form1.abouttheco.focus();
		}
	}

	function checkthedt()
	{
		if (((document.form1.yearofestab.value)<1600))	
		{
			alert("The year of establishment should be a numeric\n4 digits value after 1600 eg.1980, 2002");
			document.form1.yearofestab.focus();
		}
	}


	function temppp(){
/*

		var s,sm;
		s=form.pm.options[form.pm.selectedIndex].value;

		sm=s.split("--")

		form.pmt1.value=sm[0];
		form.pmt2.value=sm[1];
		form.pmr1.value=sm[2];
		form.pmr2.value=sm[3];

		if(sm[0]=='N. A.')
		{
			form.pmr1.checked=false;
			form.pmr2.checked=false;
			form.pma.value="";
			tot_pm=0;
			pm_user=0;
		}
		else
		{
			if((form.pmr1.checked==false)&&(form.pmr2.checked==false)) form.pmr1.checked=true;
			showunchecklink(form)
		}

		if(form.pmr1.checked==true)
		{
			form.pma.value=sm[2];

			tot=sm[2];

			sm1=tot.split("~")

			tot_pm=sm1[2];
			pm_user=sm1[3];
		}
		else if(form.pmr2.checked==true)
		{
			form.pma.value=sm[3];

			tot=sm[3];

			sm1=tot.split("~")

			tot_pm=sm1[2];
			pm_user=sm1[3];
		}
		form.tot.value = parseInt(tot_lic) + parseInt(mi_pw) + parseInt(mi_in) + parseInt(mi_ir) + parseInt(tot_mi) + parseInt(tot_pm);

		form.totuser.value = parseInt(bp_user) + parseInt(pw_user) + parseInt(in_user) + parseInt(ir_user) + parseInt(mi_user) + parseInt(pm_user);

		//form.tot.value = parseInt(tot_pm);
*/

	}

	function getIndex(oElement)
{
	var el, i = 0, oForm = oElement.subscribe;
	while (el = oForm.elements[i])
	if (el == oElement)
		return i;
	else ++i;
	return null;
}

function somefunctionputhere(){


}

function disable_ccform(thevar){

	//thevar.checked=true;
	document.subscribe.nameoncard.value="As it appears on card";
	document.subscribe.ccnumber1.value="";
	document.subscribe.ccnumber2.value="";
	document.subscribe.ccnumber3.value="";
	document.subscribe.ccnumber4.value="";

	document.subscribe.cardtype_visa.checked='0';
	document.subscribe.cardtype_master.checked='0';

	document.subscribe.cvn.value="";

	document.subscribe.cc_street.value="As given for the credit card";
	document.subscribe.cc_city.value="As given for the credit card";
	document.subscribe.cc_state.value="As given for the credit card";
	document.subscribe.cc_zip.value="As given for the credit card";
	document.subscribe.cc_telephone.value="As given for the credit card";
	document.subscribe.cc_emailid.value="As given for the credit card";
	disable_cc_form_fields();

}

function disable_cc_form_fields(){

	document.subscribe.nameoncard.readOnly=true;
	document.subscribe.nameoncard.readOnly=true;

	
	document.subscribe.ccnumber1.readOnly=true;
	document.subscribe.ccnumber2.readOnly=true;
	document.subscribe.ccnumber3.readOnly=true;
	document.subscribe.ccnumber4.readOnly=true;

	document.subscribe.cvn.readOnly=true;

	document.subscribe.cc_street.readOnly=true;
	document.subscribe.cc_city.readOnly=true;
	document.subscribe.cc_state.readOnly=true;
	document.subscribe.cc_zip.readOnly=true;
	document.subscribe.cc_telephone.readOnly=true;
	document.subscribe.cc_emailid.readOnly=true;

}

function enable_cc_form_fields(){

	document.subscribe.nameoncard.readOnly=false;
	document.subscribe.nameoncard.readOnly=false;

	
	document.subscribe.ccnumber1.readOnly=false;
	document.subscribe.ccnumber2.readOnly=false;
	document.subscribe.ccnumber3.readOnly=false;
	document.subscribe.ccnumber4.readOnly=false;

	document.subscribe.cvn.readOnly=false;

	document.subscribe.cc_street.readOnly=false;
	document.subscribe.cc_city.readOnly=false;
	document.subscribe.cc_state.readOnly=false;
	document.subscribe.cc_zip.readOnly=false;
	document.subscribe.cc_telephone.readOnly=false;
	document.subscribe.cc_emailid.readOnly=false;

}


	//  End -->
