﻿// JScript File

/* Open window in center of screen */

function winOpen(filename,winwidth,winheight){
     winleft = (screen.width / 2) - (winwidth / 2);
     wintop = (screen.height / 2) - (winheight / 2);
     window.open(filename, 'a', 'top=' + wintop + ',left=' + winleft + ',height=' + winheight + ',width=' + winwidth +',resizable=1,toolbars=no,scrollbars=yes');
}

/* show hode box start here */
var imageArray=new Array();
var numImages = 0;
 
imageArray[0]= new Image();
imageArray[0].src="/images/plus.gif";
imageArray[1]= new Image();
imageArray[1].src="/images/minus.gif";
 
function swapImage(imgName, divid)
{
   for (x=0; x < imageArray.length; x++){   
     if (imageArray[x].src == document.images[imgName].src)
     {
        if ((x+2) % 2 == 0)
            document.images[imgName].src=imageArray[x+1].src;
        else
            document.images[imgName].src=imageArray[x-1].src;
       switchDIV(divid);
       break; 
     }
   }
} 

function switchDIV(divid){
	
	current = (document.all[divid].style.display == 'none') ? 'block' : 'none';
		document.all[divid].style.display = current;	
}
/* show hode box ends here */

/* tab control starts */
var initialtab=[1, "sc1"]

////////Stop editting////////////////

var previoustab=""

function expandcontent(cid, aobject){
    if (document.getElementById){
        highlighttab(aobject)
        if (previoustab!="")
        document.getElementById(previoustab).style.display="none"
        document.getElementById(cid).style.display="block"
        previoustab=cid
        if (aobject.blur)
        aobject.blur()
        return false
    }
    else{
    alert("JI")
    return true}
}

function highlighttab(aobject){
    if (typeof tabobjlinks=="undefined")
    collecttablinks()
    for (i=0; i<tabobjlinks.length; i++)
    tabobjlinks[i].className="tabss";
    aobject.className="tabSelected";
}

function collecttablinks(){
    var tabobj=document.getElementById("tablist")
    tabobjlinks=tabobj.getElementsByTagName("li")
}


function do_onload(){
    collecttablinks();
    expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1]);
}
if (window.addEventListener) 
window.addEventListener('load', do_onload, false); 
else if (window.attachEvent) 
window.attachEvent('onload', do_onload); 
else if (document.getElementById)

window.onload=do_onload
/* tab control ends */