﻿// JScript File


	var oldtab = document.all("oldTab");
//	var ids=new Array('content1','content2','content3');
		
//	if (window.attachEvent)
//        window.attachEvent("onload", ShowIt(document.all("oldTab"),1));
//    else (document.getElementById)
//        window.onload = ShowIt(document.all("oldTab"),1);
    
  
//	function Start()
//	{
//	    //alert("iiiiiiiiiii");
//	   ShowIt(document.all("no1"),1);
//	   //switchid(1);
//	}

    //document.all("oldTab").className = "current";
    
    function setCurrentTab(nn)
	{
	//alert(nn);
    	document.all("adminTab1").className = "common";  
    	document.all("adminTab2").className = "common";    	
	    document.all("adminTab2").className = "common";   
	    
   	    document.all("adminTab"+nn.toString()).className = "current";    

		hideallids();			
		showdiv("content"+nn.toString());	
		
		document.all("currentTab").innerHTML = nn.toString();
		
		alert(document.all("currentTab").innerHTML);	
	}

	function ShowIt(cur,nn)
	{
	
	//alert(cur.innerHTML);
		if(oldtab)
    	   oldtab.className = "common";
    	else
    	   document.all("oldTab").className = "common";    
 
		cur.className="current";

		oldtab = cur; 
		hideallids();			
		showdiv("content"+nn.toString());		
	}
		
    function switchid(id)
    {	
	    hideallids();
	    showdiv(id);
    }

    function hideallids()
    {//loop through the array and hide each element by id
	    for (var i=0;i<ids.length;i++)
	    {
	    //alert(ids[i]);
		    hidediv(ids[i]);
	    }		  
    }

    function hidediv(id) 
    {//safe function to hide an element with a specified id
	    if (document.getElementById) 
	    { // DOM3 = IE5, NS6
		    document.getElementById(id).style.display = 'none';
	    }
	    else 
	    {
		    if (document.layers) { // Netscape 4
			    document.id.display = 'none';
		    }
		    else { // IE 4
			document.all.id.style.display = 'none';
		    }
	    }
    }

    function showdiv(id) 
    {//safe function to show an element with a specified id
		  
	    if (document.getElementById) { // DOM3 = IE5, NS6
		    document.getElementById(id).style.display = 'block';
	    }
	    else {
		    if (document.layers) { // Netscape 4
			    document.id.display = 'block';
		    }
		    else { // IE 4
			    document.all.id.style.display = 'block';
		    }
	    }
    }