<!--#include file="header.asp"-->
function validateSignIn(myform) {
	
		
	if (myform.userName.value == "" || myform.passWord.value == "") {
		alert("Please enter your user name and/or password.");
		return false;
	}
	if (myform.userName.value.length > 10 || myform.passWord.value.length > 10) {
		alert("User name or Password entered is too large");
		return false;
		
	} else {
		validateText(myform)
		myform.signin.value = "Please wait";
		myform.signin.disabled = true;
		myform.submit();
		return true;
	}
}
function redirect(myLocation) {
	alter(myLocation);
	//window.location.href = myLocation;
}
function setHome(ssit_arg, url){
	if(navigator.appVersion.charAt(navigator.appVersion.indexOf("MSIE") + 5) >= 5 && navigator.platform.indexOf("Win16") == -1 
		&& navigator.platform.indexOf("Mac") == -1){
		ssit_arg.style.behavior='url(#default#homepage)';
		ssit_arg.setHomePage(url);
		ssit_arg.href="#";
		return true;
	} else {
		return false
	}
}

function validateText1(myform){
	//var i;
	for (var j=0; j<myform.elements.length; j++) {
		if (myform.elements(j).type == "text" || myform.elements(j).type == "password"){			
			if(myform.elements(j).value.indexOf("'") > -1){
				
				var re = new RegExp ("''", "gi");
				while  (myform.elements(j).value.indexOf("''") > -1) {
					//alert("i am in");
					myform.elements(j).value = myform.elements(j).value.replace(re, "'");
				}
				var re1 = new RegExp ("'", "gi");
				myform.elements(j).value = myform.elements(j).value.replace(re1, "''");
			}
		}
	}
	
}

function formatCurrency(form) {
	num = form.instCommission.value
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
		num = "0";
		
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	
	if(cents<10)
		cents = "0" + cents;
		
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3))+','+
		
	num.substring(num.length-(4*i+3));
	return 0;//(((sign)?'':'-') + '$' + num + '.' + cents);
}

function expandCollapse(listItem, dataItem)
{
	if (document.all(dataItem).runtimeStyle.display == "none")
	{
		document.all(dataItem).runtimeStyle.display = "";
		
	}
	else
	{
		document.all(dataItem).runtimeStyle.display= "none";
	}
}


<!--
/*
Slide-in Menu by Al Sparber (www.projectseven.com)
To add more shock to your site, visit www.DHTML Shock.com
*/

//Variables to be defined by user. Pee=-200 is the ending position of the menu upon closing
//It must match the left position of the searcBar layer as defined in the Style Sheet
//drec and speed can be experimented with to adjust smoothness and speed of animation

var pee = -610
var drec = 10;
var speed = 10;

//Don't touch!
var l = pee;

//Don't touch. This is the function that closes the menu
function Proj7GlideBack () {
  
	l += drec;
	
	if (document.layers) 
	{
		document.searcBar.left = l;
	}
	else if (document.all) 
	{
		document.all.searcBar.style.pixelLeft = l;
	}
	else if (document.getElementById) 
	{
		document.getElementById('searcBar').style.left = l + 'px';
	}
	if (l < 0)
		setTimeout('Proj7GlideBack()', speed);
  
}
//Don't touch. This is the function that opens the menu
function Proj7GlideOut () 
{
	l -= drec;
	if (document.layers) {
		document.searcBar.left = l;
		
	}
	else if (document.all) {
	    
		document.all.searcBar.style.pixelLeft = l;
	}
	else if (document.getElementById) {
		
		document.getElementById('searcBar').style.left = l + 'px';		
	}
	
	if (l > (pee))
			setTimeout('Proj7GlideOut()', speed);
  
}

function moveIn () 
{	
	Proj7GlideOut();
	return false;
}
function help()
{
    document.getElementById('searcBar').style.top = 104;
    Proj7GlideBack();
    var yPos = document.getElementById('searcBar').style.top.substr(0, 
							        document.getElementById('searcBar').style.top.length-2);
							        //alert(document.getElementById('searcBar').style.top.length+2);
	return false;
}


function moveSearch() 
{
//alert(document.all.currenttab.value);
   // alert(document.a);
	//alert(document.body.scrollTop);
	//document.getElementById('searcBar').style.top = 104;
	//if (document.body.scrollTop > 104)
	//	document.getElementById('searcBar').style.top = document.body.scrollTop + 5;
		
	//Proj7GlideBack();
	//return false;
	if(document.all.currenttab.value== 1 || document.all.currenttab.value== 3 || document.all.currenttab.value== 6 || document.all.currenttab.value== 7)
	window.location=('Search.asp?pageno=0&tab=1')
	else if (document.all.currenttab.value== 2)
	window.location=('UserManagerSearch.asp?pageno=0&tab=2')
	else if(document.all.currenttab.value == 4)
	window.location=('InvoiceManagerSearch.asp?pageno=0&tab=4')
	else if(document.all.currenttab.value == 5)
	window.location=('InstManagerSearch.asp?pageno=0&tab=5')
	
		
}
function moveList() 
{
   if(document.all.currenttab.value== 1 || document.all.currenttab.value== 6 || document.all.currenttab.value== 7)
	window.location=('ListAll.asp?pageno=0&tab=1')
	else if (document.all.currenttab.value== 2)
	window.location=('UserManager.asp?pageno=0&tab=2')
	else if (document.all.currenttab.value== 3)
	window.location=('OfficeManager.asp?pageno=0&tab=3')
	else if(document.all.currenttab.value == 4)
	window.location=('InvoiceManager.asp?pageno=0&tab=4')
	else if(document.all.currenttab.value == 5)
	window.location=('InstManager.asp?pageno=0&tab=5')
}
function moveAdd() 
{
   if(document.all.currenttab.value== 1 || document.all.currenttab.value== 6 || document.all.currenttab.value== 7)
	window.location=('StudentRecordAdd.asp?pageno=0&tab=1')
	else if (document.all.currenttab.value== 2)
	window.location=('UserManagerAdd.asp?pageno=0&tab=2')
	else if (document.all.currenttab.value== 3)
	window.location=('OfficeManagerAdd.asp?pageno=0&tab=3')
	else if(document.all.currenttab.value == 4)
	window.location=('InvoiceManagerAdd.asp?pageno=0&tab=4')
	else if(document.all.currenttab.value == 5)
	window.location=('InstManagerAdd.asp?pageno=0&tab=5')
}
var searchVisible = false;
function IEKeyCap() 
{
	
	//Escape Key Pressed
	if (window.event.keyCode == 27)
	{   //alert();
		if (searchVisible == true)
		{	
							
	
			moveIn();
			searchVisible = false;
		}
	}

	//Ctrl key pressed
	if (window.event.ctrlKey) 
	{
	        //q key pressed for search
	        if (window.event.keyCode == 17) {
    				
		        if (searchVisible == false)
		        {					
                    moveSearch();
			        searchVisible = true;			
		        } 
		        else if (searchVisible)
		        {
			        //alert(document.body.scrollTop > document.getElementById('searcBar').style.top.substr(0, document.getElementById('searcBar').style.top.length-2));
			        var yPos = document.getElementById('searcBar').style.top.substr(0, 
							        document.getElementById('searcBar').style.top.length-2);
			        if (document.body.scrollTop > yPos)
			        {
				        document.getElementById('searcBar').style.top = document.body.scrollTop + 5;
				        return;
			        }	
		        }
    			
	        }
	        // t key pressed for list all
	        if (window.event.keyCode == 20) {
    				
		        if (searchVisible == false)
		        {					
    				 moveList();
			        searchVisible = true;			
		        } 
		        else if (searchVisible)
		        {
			        //alert(document.body.scrollTop > document.getElementById('searcBar').style.top.substr(0, document.getElementById('searcBar').style.top.length-2));
			        var yPos = document.getElementById('searcBar').style.top.substr(0, 
							        document.getElementById('searcBar').style.top.length-2);
			        if (document.body.scrollTop > yPos)
			        {
				        document.getElementById('searcBar').style.top = document.body.scrollTop + 5;
				        return;
			        }	
		        }
	        }
	         // d key pressed for list all
	        if (window.event.keyCode == 11) {
    				
		        if (searchVisible == false)
		        {					
    				 moveAdd();
			        searchVisible = true;			
		        } 
		        else if (searchVisible)
		        {
			        //alert(document.body.scrollTop > document.getElementById('searcBar').style.top.substr(0, document.getElementById('searcBar').style.top.length-2));
			        var yPos = document.getElementById('searcBar').style.top.substr(0, 
							        document.getElementById('searcBar').style.top.length-2);
			        if (document.body.scrollTop > yPos)
			        {
				        document.getElementById('searcBar').style.top = document.body.scrollTop + 5;
				        return;
			        }	
		        }
	        }
	       
        }
        

}    

var win = null
var cWin;
var docViewWin = null
var reportODAPFWins = null
var reportPTPFWins = null
var reportPSPFWins = null
var reportIMPFWins = null
var reportIAPFWins = null


////////////////////////////////////////////////////////////////////////////////////
// Function ShowUploadImageWindow launches the file uploader
//
//
////////////////////////////////////////////////////////////////////////////////////
function showUploadImageWindow(imageFieldName, imageTXTFieldName, imageFileNameFieldName, imageLocalFileNameFieldName, upLoadPath, studentID, pageno, from,searchfor,searchby,parentform) {

    
	var rStr;
	var d = new Date();
	rStr = "LBL_Heading=Document%20Details&" + "LBL_SELECT_FILE=Document%20File&";
	rStr = rStr + "IMAGE_IMG_FIELD=" + imageFieldName + "&";
	rStr = rStr + "IMAGE_TXT_FIELD=" + imageTXTFieldName + "&";
	rStr = rStr + "IMAGE_IMG_FILE_NAME=" + imageFileNameFieldName + "&";
	rStr = rStr + "UPLOAD_PATH=" + upLoadPath + "&";
	rStr = rStr + "IMAGE_IMG_LOCAL_FILE_NAME=" + imageLocalFileNameFieldName + "&";
	rStr = rStr + "SVR_FILE_NAME=Document_" + d.getUTCDate() + 
			+ d.getUTCMonth() + d.getUTCFullYear() + 
			+ d.getUTCHours() + d.getUTCMinutes() +
			+ d.getUTCSeconds() + d.getUTCMilliseconds() + "&";
	rStr = rStr + "studentID=" + studentID + "&";
	rStr = rStr + "from=" + from + "&";
	rStr = rStr + "pageno=" + pageno + "&";
	rStr = rStr + "searchBy=" + searchby + "&";
	rStr = rStr + "searchFor=" + searchfor+ "&";
	rStr = rStr + "parentform=" + parentform;
	
	if (win != null) {
		win.close();
		win = null;
	}
	
	if (win == null) {
		win = window.open("uploadform.asp?" + rStr, 
					"upload", 
					"width=500px, height=350px, toolbar=0, scrollbars=0, menubar=0, resizable=0, status=0");
	}
	
	if (win != null) {
		x = (screen.availWidth - 500) / 2; 
		y = (screen.availHeight - 350) / 2;
		win.moveTo(x, y);
	}
		
}

////////////////////////////////////////////////////////////////////////////////////
// Function ShowDocumentViewWindow launches the document View Window
//
//
////////////////////////////////////////////////////////////////////////////////////
function showDocumentViewWindow(documentID, pageno, studentID) {
	var rStr;
	var d = new Date();
	rStr = "documentID=" + documentID + "&pageno=" + pageno + "&studentID=" + studentID;
	if (docViewWin != null) {
		docViewWin.close();
		docViewWin = null;
	}
	
	if (docViewWin == null) {
		docViewWin = window.open("DocumentManagerView.asp?" + rStr, 
					"dep", 
					"width=800, height=600, toolbar=0, scrollbars=1, menubar=0, resizable=1, status=0");
	}
	
	
	if (docViewWin != null) {
		//alert("here" + docViewWin.isOpen());
		x = (screen.availWidth - 800) / 2; 
		y = (screen.availHeight - 600) / 2;
		docViewWin.moveTo(x, y);
	}
		
}


function closeDep() {
  if (win && win.open && !win.closed) win.close();
  if (docViewWin && docViewWin.open && !docViewWin.closed) docViewWin.close();
  
  if (reportODAPFWins && reportODAPFWins.open && !reportODAPFWins.closed) reportODAPFWins.close();
  if (reportPTPFWins && reportPTPFWins.open && !reportPTPFWins.closed) reportPTPFWins.close();
  if (reportPSPFWins && reportPSPFWins.open && !reportPSPFWins.closed) reportPSPFWins.close();
  if (reportIMPFWins && reportIMPFWins.open && !reportIMPFWins.closed) reportIMPFWins.close();
  if (reportIAPFWins && reportIAPFWins.open && !reportIAPFWins.closed) reportIAPFWins.close();
}

function showReportWindow(reportType, spage, rStr) {
	if (reportType == 0) {
		cWin = reportODAPFWins;
	} else if(reportType == 1) {
		cWin = reportPTPFWins;
	} else if(reportType == 2) {
		cWin = reportPSPFWins;
	} else if(reportType == 3) {
		cWin = reportIMPFWins;
	} else if(reportType == 4) {
		cWin = reportIAPFWins;
	}
	
	//alert(":" + "r" + reportType);
	if (cWin != null) {
		cWin.close();
		cWin = null;
	}
	
	if (cWin == null) {
		cWin = window.open(spage + "?" + rStr, 
					"r" + reportType, 
					"width=800, height=600, toolbar=0, scrollbars=1, menubar=1, resizable=1, status=0");
	}
	
	if (reportType = 0) {
		reportODAPFWins = cWin;
	} else if(reportType = 1) {
		reportPTPFWins = cWin;
	} else if(reportType = 2) {
		reportPSPFWins = cWin;
	} else if(reportType = 3) {
		reportIMPFWins = cWin;
	} else if(reportType = 4) {
		reportIAPFWins = cWin;
	}
}

function popUpWindow(winURL, winAttributes) {

	if (winAttributes.length == 0)
		winAttributes = "width=500px, height=450px, toolbar=0, scrollbars=0, menubar=0, resizable=0, status=0";		
		
	window.open(winURL, 
							"", 
							winAttributes);
}

function expandCollapseContents(elementID, expandCollapseButton) 
{	
	tData = document.getElementById(elementID);
	if (tData.runtimeStyle.display == "none") 
	{
		document.getElementById(expandCollapseButton).src = "images/collapse.bmp";
		tData.runtimeStyle.display = ""
	} 
	else 
	{
		document.getElementById(expandCollapseButton).src = "images/expand.bmp";
		tData.runtimeStyle.display = "none"
	}
}

function expandCollapseContentsAll(elementID, rowCount, expandCollapseButton) 
{	
 
 if (document.getElementById(expandCollapseButton).src.indexOf("images/expand.bmp") > 0) 
 {
  document.getElementById(expandCollapseButton).src = "images/collapse.bmp";
 } 
 else 
 {
  document.getElementById(expandCollapseButton).src = "images/expand.bmp";
 }
	
	
	for (i=0; i<rowCount; i++)
	{
	 tData = document.getElementById(elementID + i)
	 btnElement = document.getElementById("expandCollapseRecords" + i);
	 if (tData != null) 
	 {
   if (document.getElementById(expandCollapseButton).src.indexOf("images/expand.bmp") < 0) 
   {
	   tData.runtimeStyle.display = "";
	   document.getElementById("expandCollapseRecords" + i).src = "images/collapse.bmp";
   } 
   else 
   {
	   tData.runtimeStyle.display = "none";
	   document.getElementById("expandCollapseRecords" + i).src = "images/expand.bmp";
   }
	 }
	}	
}


function changeCursorStyle(elementID) {

	if (document.getElementById(elementID).className == "expandCollapseOver") {
		document.getElementById(elementID).className = "expandCollapseOut";

	} else {
		document.getElementById(elementID).className = "expandCollapseOver";	

	}
	
}
function DivFunc(){

alert("here");

		
		
}