// JavaScript Document

function getElementsByClassName(oElm, strTagName, strClassName){
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	strClassName = strClassName.replace(/\-/g, "\\-");
	var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
	var oElement;
	for(var i=0; i<arrElements.length; i++){
		oElement = arrElements[i];
		if(oRegExp.test(oElement.className)){
			arrReturnElements.push(oElement);
		}
	}
	return (arrReturnElements)
}

function cellHover()
		{
			//alert(this.parentNode.getElementsByTagName('tr'))
			mytd=this.parentNode.getElementsByTagName('td')
			
			for(i=0;i<mytd.length;i++)
				{
				
				if(mytd[i].style.backgroundColor!="#b3cde2")
					{
						mytd[i].style.backgroundColor="#ffffcc"	
					}
														
				}
			
		}
	
	function cellNone()
		{
			mytd=this.parentNode.getElementsByTagName('td')
			for(i=0;i<mytd.length;i++)
				{
				if(mytd[i].style.backgroundColor!="#b3cde2")
					{
						mytd[i].style.backgroundColor=""					
					}	
					
				}
		}
		
	function cellActive()
		{
			mytd=this.parentNode.getElementsByTagName('td')
			if(cellActive=true)
			{
				totTd=this.parentNode.parentNode.getElementsByTagName('td')
				for(i=0;i<totTd.length;i++)
					{
					totTd[i].style.backgroundColor=""
					totTd[i].style.color=""
					totTd[i].style.fontWeight=""
					}
			}
			
			for(i=0;i<mytd.length;i++)
				{
				mytd[i].style.backgroundColor="#b3cde2"
				mytd[i].style.color="#013d71"
				mytd[i].style.fontWeight="normal"
				}
			cellActive=true
		}
	
	function AddRowCol()
	{
		
	}

	function viewTable()
		{
		//active=""
		//AddRowCol()
		var mainContent=document.getElementById('mainContent')
		var targetTable=getElementsByClassName(mainContent, "*", "viewTable");		
		//alert(targetTable[0])
		if(targetTable[0]!=undefined){
		
		var table=targetTable[0].getElementsByTagName('table')
		
		//alert(table)		
		
		
		if(table[0]!=null){
			
			//var myTr=table[0].getElementsByTagName('tr');
//		for (i=0;i<myTr.length;i++)
//			{
//				if (i%2)
//					{
//						myTr[i].style.backgroundColor="#F4F4F4";
//						//alert(myTr[i])
//					}
//		}
		
		
		var td=table[0].getElementsByTagName('td')
		//
		//alert(td[1])
		for(i=0;i<td.length;i++)
			{
				td[i].onmouseover=cellHover
				td[i].onmouseout=cellNone
				td[i].onclick=cellActive
			}
		//for(j=0;j<table.length;j++){
			//alert(j)
			//}	
			}
		}
		}
		
	function openTog(id){
		document.getElementById(id).style.display="block"
		//t2 = new Tween(document.getElementById(id).style,'right',Tween.strongEaseOut,0,70,1,'px');
//t2.start();
		}
	
	function configTitleBar(){
	
//		document.getElementById('pageHeader').innerHTML=pageHeader	
		document.getElementById('nav').innerHTML="<a href='../home.aspx'>home</a>  <img src='../images/rightArrow.jpg' /> " + strFirstLink + " <img src='../images/rightArrow.jpg' /> " + "<b>"+strLastLink+"</b>"
		
		
		
	}
	
function PrintPage(){
		
			//alert("hi");
			
			var sOption="menubar=yes,scrollbars=yes,width=750,height=600,left=100,top=25,resizable=yes"; 

  			var sWinHTML = document.getElementById('viewTable').innerHTML; 
   
		   var winprint=window.open("","",sOption); 
			   winprint.document.open(); 
			   winprint.document.write('<html><head><link href=Style/print.css  rel=Stylesheet></head><body>'); 
			   winprint.document.write('<table width=100% cellspacing=0 cellpadding=0 border=0>');
			   winprint.document.write('<tr>')
			   winprint.document.write('<td width=60><img src=images/logoNew.jpg width=55 height=58></td>');
			   winprint.document.write('<td><strong>SCTE&VT <BR />TECHNICAL EDUCATION & VOCATIONAL TRAINING, ORISSA</strong></td>');
			   winprint.document.write('</tr>');
			   
			   winprint.document.write('<tr>');
			   winprint.document.write('<td colspan=2><hr></td>');
			   winprint.document.write('</tr>');
			   
			   winprint.document.write('</table>');
			   winprint.document.write(sWinHTML);          
			   winprint.document.write('</body></html>'); 
			   winprint.document.close(); 
			   winprint.focus(); 
		}
		
		
