// JavaScript Document

// JavaScript Document



var sPath = window.location.pathname;
//var sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);

var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
//alert(sPage)
switch(sPage)
{
	//case "about_us.html":
	//document.getElementById("td1").className = 'menuactive';
	//curmnu=1;
	//break;
	//case "activities.html":
	//document.getElementById("td8").className = 'normalon';
	//document.getElementById("mnu8").className = 'topmnuon';
	//curmnu=8;
	//break;
	//case "achievement.html":
	//document.getElementById("td9").className = 'normalon';
	//document.getElementById("mnu9").className = 'topmnuon';
	//curmnu=9;
	//break;
	//case "alumni.html":
	//document.getElementById("td10").className = 'normalon';
	//document.getElementById("mnu10").className = 'topmnuon';
	//curmnu=10;
	//break;
	//case "contactus.html":
	//document.getElementById("td11").className = 'normalon';
	//document.getElementById("mnu11").className = 'topmnuon';
	//curmnu=11;
	//break;
	

}

function lightOn(objLink, mnunum)
{
	if(curmnu == mnunum)
	{
		return true;
	}
	objLink.parentNode.className = "mnunact";
}

function lightOff(objLink, mnunum)
{
	if(curmnu == mnunum)
	{
		return true;
	}
	objLink.parentNode.className = "mnunorm";
}




//-----------------------------------------------

/*Open Popup Window*/
var popUpWin=0;
function popUpWindow(URLStr,mywidth,myheight,myleft,mytop,myscroll)
	{
	if(popUpWin)
		{
		if(!popUpWin.closed) 
			{popUpWin.close();}
		}
	popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + myscroll + ',resizable=no,copyhistory=yes,width='+mywidth+',height='+myheight+',left='+myleft+', top='+mytop+',screenX='+myleft+',screenY='+mytop+'');
	}

/*Open 2nd Popup Window*/
var popUpWin2=0;
function popUpWindow2(URLStr,mywidth,myheight,myleft,mytop,myscroll)
	{
	if(popUpWin2)
		{
		if(!popUpWin2.closed) 
			{popUpWin2.close();}
		}
	popUpWin2 = open(URLStr, 'popUpWin2', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + myscroll + ',resizable=no,copyhistory=yes,width='+mywidth+',height='+myheight+',left='+myleft+', top='+mytop+',screenX='+myleft+',screenY='+mytop+'');
	}


/*Check if single checkbox is selected*/
/*function isSingleSelected_bak(frm, chkname, recs)
	{
	if(recs == 0)
	  {
	  alert("no record");
	  return false;
	  }
	else
	  {
	  alert(eval("document." + frm.name + "." + chkname + "_" + 1));
	  alert("record found");
	  return false;
	  }
	
	var cboxes = eval("document." + frm.name + "." + chkname + "_" + 1);
	var cnt = 0;
	if(cboxes != null)
		{
		if(cboxes.length>0)
			{
			for(var m=0; m < cboxes.length; m++)
				{
				if(cboxes[m].checked == true)
					{cnt++;}
				}
			}
		else
			{
			if(cboxes.checked == true)
				{cnt++;}
			}
		}

	if(cnt == 1)
		{return true;}
	else
		{
		alert("Please select only a single row to proceed...");
		return false;
		}
	}
*/



function getPageName()
{
	var pgurl, pos, pgname;
	pgurl = window.location.href;
	//alert(pgurl);
	pos = pgurl.lastIndexOf("/");
	pgname = "";
	if(pos < pgurl.length-1)
	{
		pgname = pgurl.substring(pos+1,pgurl.length);
	}
	
	return(pgname);
}

function setBckgroundClass()
{
	var pageBkg = document.getElementById("headerinner");
	var clsName = "";
	var curPGName = getPageName();
	curPGName = curPGName.toLowerCase();
	switch(curPGName)
	{
		case "mission.html":
			//alert(clsName );
			clsName = "topbanner";
			break;
		case "facilities.html":
			clsName = "topbanner1";
			break;
		case "product_services.php":
			clsName = "topbanner2";
			break;
		case "quality.html":
			clsName = "topbanner3";
			break;
		case "career.php":
			clsName = "topbanner4";
			break;
		case "contact_us.html":
			clsName = "topbanner5";
			break;		
		default:
			clsName = "topbanner";
			//alert(clsName);
			break;
	}
	//return(clsName);
	//alert( clsName);
	pageBkg.className = clsName;
	
}

