//var pageactive="[pageactv]";
var prevdiv='info';
var page0101="3305";

function dosubmit(para_event)
{		
	document.frmIBMain.pagevariable.value=para_event;
	document.frmIBMain.submit();
}

function loadperformancePage()
{		

	 window.location.href="http://www.booksinstitute.com/performancePage.php";

}

function lShowDialog(dg_url)
{
	window.showModalDialog(dg_url, 0, "dialogHeight:450px;dialogWidth:600px; status : no;center:yes");
}

function doSubmit0(para_exam)
{
	cmbval=2008;
	if( document.frmIBMain.yearcombo!=null)
		cmbval = document.frmIBMain.yearcombo.options[document.frmIBMain.yearcombo.selectedIndex].value;
	
	var url ="1,"+cmbval+","+para_exam+"i0b1_rep0rt";
	dosubmit(url);

}
function hideFeatureMenu()
{
document.getElementById("mnufeature").style.display="none";
}

function showFeatureMenu(cX,cY)
{

//alert(cX);
   document.getElementById("mnufeature").style.posLeft = cX;
  document.getElementById("mnufeature").style.posTop = cY;
  document.getElementById("mnufeature").style.display="";
}
function showText(divid)
{

if(prevdiv.length < 1)
{
document.getElementById(divid).style.display="none";
}
else
{
document.getElementById(prevdiv).style.display="none";
document.getElementById(divid).style.display="block";
}

prevdiv=divid;


}
function doSearch()
{
	var searchStr = document.getElementById("ibSearch").value;

	document.frmIBMain.pagevariable.value="<data>"+ searchStr+"</data>_I0B00Ks_o1nl33in4ese5a5r6c6h7i7ng";

	document.frmIBMain.submit();
}
function callibnotice()
{
	//document.frmIBMain.pagevariable.value="i0b1_n0o1t2i3c4e";
        document.frmIBMain.pagevariable.value="i0b1_submit_a0l1nk~ibndscA0L1nk";
	document.frmIBMain.submit();
}
function doLogin()
{
	var url ="";

	var usrid	= document.getElementById("ibusrname").value;
	var usrpw	= document.getElementById("ibpswd").value;

//sendurl="<data>"+ usrid+"|"+usrpw+"</data>o1nl33in4el5o5g6i6n77";

	document.frmIBMain.pagevariable.value="<data>"+ usrid+"|"+usrpw+"</data>o1nl33in4el5o5g6i6n77";

//var myFeatures = "directories=no,location=no,menubar=no,status=no,scrollbars=yes,width=750,height=600,resizeable=no";
//var newWin = open ("http://www.booksinstitute.com/ibooks.php3/?"+sendurl, 'Login', myFeatures);

//newWin.document.close();


	document.frmIBMain.method="POST";
	document.frmIBMain.submit();

}
function doLogin000()
{
	var url ="";

	document.frmIBMain.pagevariable.value="_I0B00Ks_o1nl33in4el5o5g6i6n77";

	document.frmIBMain.method="POST";
	document.frmIBMain.submit();
}

function l01convrt(sldata)
{
	var sldatatmp = sldata.replace("<","?l0t1_;");
	sldatatmp = sldatatmp.replace("<","?l0t1_;");
	sldatatmp = sldatatmp.replace(">","?j0t1_;");
	sldatatmp = sldatatmp.replace(">","?j0t1_;");
	sldatatmp = sldatatmp.replace(",","?c0m1_;");
	sldatatmp = sldatatmp.replace(",","?c0m1_;");
}
function l02convrt(sldata)
{
	//dataarr = sldata.tochararray();
	//pagearr = page0101.tochararray();
}

function SaveSuggestion()
{

	<!--txtname,txtdateofbirth,txtemailid,txtcity,txtstate,txtcountry-->

	var suggestion = document.getElementById("txtsuggestion").value.replace("|", " ");
	document.frmIBMain.pagevariable.value="<data>"+ suggestion+"</data>_I0B00Ks_o1nl33in4esu5g5g6e6s7t7n";

	var url ="";

	document.frmIBMain.action = url;
	document.frmIBMain.submit();

}
function body_onload(pageactive)
{
	//document.getElementById("mnufeature").style.display="";

	if(pageactive=="onlineregisteration")
	{
		document.getElementById("cmbyear").value = "2008";
	
		var cmbmonth =  document.getElementById("cmbmonth");
		for(i = 0; i < 12 ; i++)
		{
			if(cmbmonth.options[i].innerText == "[month]") cmbmonth.options[i].setAttribute("selected", "selected");
		}
		var cmbday = document.getElementById("cmbday");
		for(i = 1; i < 32; i++)
		{
			var opt = document.createElement("option");
			opt.value = i.toString();
			opt.innerHTML = i.toString();
			if(opt.innerText == "[day]") opt.setAttribute("selected", "selected");
			cmbday.appendChild(opt);
			cmbday.size = 1;
		}
		Hide_AllSpans();
		Set_Date();	
	}

}
function isValidDate(sText)
{
	var reDate = /(?:0[1-9]|[12][0-9]|3[01])\/(?:0[1-9]|1[0-2])\/(?:19|20\d{2})/;
	return reDate.test(sText);
}
function Hide_AllSpans()
{
	<!--txtname,txtdateofbirth,txtmobno,txtemailid,txtcity,txtstate,txtcountry-->
	document.getElementById("spantxtusrid").style.visibility 	= "hidden";
	document.getElementById("spantxtusrpswd").style.visibility 	= "hidden";
	document.getElementById("spantxtname").style.visibility 	= "hidden";
	document.getElementById("spantxtdateofbirth").style.visibility 	= "hidden";
	document.getElementById("spantxtmobno").style.visibility 	= "hidden";
	document.getElementById("spantxtemailid").style.visibility 	= "hidden";
	document.getElementById("spantxtcity").style.visibility 	= "hidden";
	document.getElementById("spantxtstate").style.visibility 	= "hidden";
	document.getElementById("spantxtcountry").style.visibility 	= "hidden";
}
function Clear_AllSpans()
{
	<!--txtname,txtdateofbirth,txtmobno,txtemailid,txtcity,txtstate,txtcountry-->
	document.getElementById("spantxtusrid").value 	= "";
	document.getElementById("spantxtusrpswd").value = "";
	document.getElementById("txtname").value 	= "";
	document.getElementById("txtdateofbirth").value = "";
	document.getElementById("txtmobno").value 	= "";
	document.getElementById("txtemailid").value 	= "";
	document.getElementById("txtcity").value 	= "";
	document.getElementById("txtstate").value 	= "";
	document.getElementById("txtcountry").value 	= "";
	//document.getElementById("txtsuggestion").value 	= "";
}
function Check_Amount(txt)
{
	val = txt.value;
	var msg ="";
	if ((parseFloat(val).toString() == "NaN" || val.replace(" ", "") == "") ) 
	{
		msg = "Enter Numeric value";
	}
	return msg;
}
function SaveOnlineRegistration()
{
	Hide_AllSpans();
	<!--txtname,txtdateofbirth,txtemailid,txtcity,txtstate,txtcountry-->
	var usrid	= document.getElementById("txtusrid").value;
	var usrpw	= document.getElementById("txtusrpswd").value;
	var name	= document.getElementById("txtname").value;
	var dateofbirth	= document.getElementById("txtdateofbirth").value;
	var mobno	= document.getElementById("txtmobno").value;
	var emailid	= document.getElementById("txtemailid").value;
	var city	= document.getElementById("txtcity").value;
	var state	= document.getElementById("txtstate").value;
	var country	= document.getElementById("txtcountry").value;

	if(usrid.trim().length == 0)
	{
		document.getElementById("spantxtusrid").style.visibility = "visible";
		document.getElementById("txtusrid").focus();
		return;
	}
	if(usrpw.trim().length == 0)
	{
		document.getElementById("spantxtusrpswd").style.visibility = "visible";
		document.getElementById("txtusrpswd").focus();
		return;
	}
	if(name.trim().length == 0)
	{
		document.getElementById("spantxtname").style.visibility = "visible";
		document.getElementById("txtname").focus();
		return;
	}
	if(Set_Date() == false)
	{
		document.getElementById("spantxtdateofbirth").style.visibility = "visible";
		document.getElementById("txtdateofbirth").focus();
		return;
	}
	if(mobno.trim().length > 0 &&  Check_mobno(mobno) == false)
	{
		document.getElementById("spantxtmobno").style.visibility = "visible";
		document.getElementById("txtmobno").focus();
		return;
	}
	if(Check_email(emailid) == false)
	{
		document.getElementById("spantxtemailid").style.visibility = "visible";
		document.getElementById("txtemailid").focus();
		return;
	}
	if(country.trim().length == 0)
	{
		document.getElementById("spantxtcountry").style.visibility = "visible";
		document.getElementById("txtcountry").focus();
		return;
	}
	if(state.trim().length == 0)
	{
		document.getElementById("spantxtstate").style.visibility = "visible";
		document.getElementById("txtstate").focus();
		return;
	}
	if(city.trim().length == 0)
	{
		document.getElementById("spantxtcity").style.visibility = "visible";
		document.getElementById("txtcity").focus();
		return;
	}
	
	
	//Clear_AllSpans();

	var url 	= "<data>" + name+ "|" + dateofbirth + "|" +  mobno + "|" + emailid + "|" + city + "|" + state + "|" + country + "</data>"  + "_I0B00Ks_o1nl33in4ere5g5i6s6t7e7r";
	//document.getElementById("pagevariable").value = data;
	document.frmIBMain.action = url;
	document.frmIBMain.submit();

//	document.URL 	= url + data;	
		
}
function valid_date(month,day,year)
{
	var msg = "";
	var showdate = day + "/" + month + "/" + year ;	
	try
	{
		var da = new Date(year,--month, day);
		if(da.getMonth() != month)
		msg = "Date is not valid " + showdate  + " ! Enter correct Date" ;
	}
	catch(e)
	{
		msg = "Date is not valid " + showdate  + " ! Enter correct Date" ;
	}
	return msg ; 
}
function Set_Date()
{
	document.getElementById("spantxtdateofbirth").style.visibility = "hidden";
	var month = document.getElementById("cmbmonth").value;
	var day   = document.getElementById("cmbday").value;
	var year  = document.getElementById("cmbyear").value.replace(" ", "");
	if ((parseFloat(year).toString() == "NaN" || year.length != 4) || year > [year] ) 
	{
		document.getElementById("cmbyear").focus();
		alert("Enter Correct Year!");
		document.getElementById("spantxtdateofbirth").style.visibility = "visible";
		return false;
		//return;
	}
	else
	{
		document.getElementById("cmbyear").value = year;
		var msg   = valid_date(month,day,year);
		if(msg.length > 0)
		{
			alert(msg);
			document.getElementById("spantxtdateofbirth").style.visibility = "visible";
		}
		else
		{
			if(month.length < 2) month = "0" + month;
			if(day.length < 2) day = "0" + day;
			var showdate = day + "/" + month + "/" + year ;
			document.getElementById("txtdateofbirth").value = showdate ;
		}
		return true;
	}
}
String.prototype.trim = function () 
{
	var reExtraSpace = /^\s+(.*?)\s+$/;
	return this.replace(reExtraSpace, "$1");
};
function Check_email(email)
{
	var reEmail = /^(?:\w+\.?)*\w+@(?:\w+\.?)*\w+$/;
	return reEmail.test(email);
}	
function Check_mobno(mob)
{
	var mobno = /(?:[9]\d{9})/;
	return mobno.test(mob);
}
function loadfeecalculator()
{

 //alert("dfddf");
 var now = new Date();
  var nowdate = '';
  var prefix0='';
  if (eval(now.getDate())<10) prefix0="0";
  nowdate=nowdate+prefix0+now.getDate();
  prefix0='';
  if (eval(now.getMonth()+1)<10) prefix0="0";
  nowdate=nowdate+'/'+prefix0+eval(now.getMonth()+1);
  nowdate=nowdate+'/'+now.getYear();
  var pagevarble="<data>2008$SEP$BBS$BBS$0$0$grand$OTP$L$"+nowdate+"</data>mwaddmmsn=l1o2a3d4c5o6u7r8s9e";
  var var_url_file= "http://" + "192.168.0.11:23506" +"//" + pagevarble;
  //alert(var_url_file+nowdate);
 document.URL = var_url_file;
}
