//For Top Menu
var menutexttag = "#F5F5DC";
var menutexttaghigh = "#CC3366";
var menucolortag = "#F5F5DC";
var menucolortaghigh  = "#F5F5DC";

function openSeta(){
	ItIs = window.open("http://196.4.89.14/cdas/BankSeta.asp", "", "_blank,menubar=no,resizable=no,height=600,width=800");
}

function openConference(){
	newWindow=window.open("../conference/default.htm","","width=610,height=610,resizable=no,scrollbars=no,dependent=no,toolbar=no,menubar=no,status=no");
}
function openads(){
	ItIs = window.open("images/2xads.jpg", "", "_blank,menubar=no,resizable=no,height=460,width=580");
}
function DoPopup(){
	ItIs=window.open("/popup.asp","Bankseta_Notice","width=600,height=743,resizable=no,scrollbars=no,dependent=no,toolbar=no,menubar=no,status=no");
}
function openKms(){
	ItIs = window.open("../kms/default.asp", "", "_blank,menubar=no,resizable=yes");
}
function userArray(){
	this.length=userArray.arguments.length;
	for (var a=0; a<this.length; a+=1){
		this[a]=userArray.arguments[a];
	}
}
var MySuperWidth;

function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else {
    if( document.documentElement &&
        ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      //IE 6+ in 'standards compliant mode'
      myWidth = document.documentElement.clientWidth;
      myHeight = document.documentElement.clientHeight;
    } else {
      if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
      }
    }
  }
  MySuperWidth =myWidth;
 // window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
}
function createAPopUp(theArray,theName){
	var theStr="";
		
	var thewidth ;
	var theLeft;
	var theTop;
	
	theTop= 268-3;
	thewidth = 200;
	//alert(document.documentelement);
	theLeft = 30; //MySuperWidth - thewidth;		
	//theLeft = 800;
	
	theStr='<div id="Pop_'+theName+'" style="position:absolute;top:'+theTop+';left:'+theLeft+';width:'+thewidth+';visibility:hidden;z-index:1000" onmouseover="MouseOn(\''+theName+'\')" onMouseOut="MouseOff(\''+theName+'\')">';
			
	theStr+='<table border=0 cellspacing=0 cellpadding=0 >';
	var totalRows=theArray.length;
	var k = 0 ;
	for (var i=0; i<totalRows-1; i+=2){
		extraSpace="";
		if (theArray[i].length<15){
			extraSpace=""; 
		}
		k += 1;
		theStr+="<tr><td colspan='3' height='1' class='MenuLine'><img  src=../images/bg_blank.gif height='1'></td></tr>";
		theStr+="<tr><td colspan='5' height='1' class='Line'><img  src=../images/bg_blank.gif height='1'></td></tr>";
		theStr+='<tr ><td width=1 class=Line><img  src=../images/bg_blank.gif width=1></td><td class="menuMain"   target="_parent" onclick=document.location="'  + theArray[i+1] +  '" onmouseover="changeMenuOn(this);" onmouseout="changeMenuOff(this);" >' +'&nbsp;'+ extraSpace + theArray[i] + extraSpace +'&nbsp;'+ '</td><td width=1 class=Line><img  src=../images/bg_blank.gif width=1></td></tr>';
		theStr+="<tr><td colspan='5' height='1' class='Line'><img  src=../images/bg_blank.gif height='1'></td></tr>";
	}
	theStr+='</table>';
	
	theStr+='</div>';
	var re = /[~]/;
	for ( var j = 0  ; j < (k * 8) ; j++){
		theStr = theStr.replace(re,"'")
	}
	document.write(theStr);
}

function changeMenuOn(obj){
	obj.style.color="#CC3366";
	obj.style.background=menucolortaghigh;
}
function changeMenuOff(obj){
	obj.style.color="#CC3366";
	obj.style.background=menucolortag;
}

function doReload() {
 	if (NETDom){
		history.go(0);
	 }
}

function MouseOn(imgName) {

	//if (document.images) {
	//	if (imgName.indexOf("a")!=0){
	//		document[imgName].src = eval(imgName + "on.src");
	//		showPop(imgName);
	//	}
	//}+
	Pop_menu.style.visibility = 'visible';
}

function MouseOff(imgName) {
	//if (document.images) {
	//	if (imgName.indexOf("a")!=0){
	//		document[imgName].src = eval(imgName + "off.src");
	//		hidePop(imgName);
	//	}
	//}
	Pop_menu.style.visibility = 'hidden';
}

function showPop(theName) {
	MouseOnA(theName);
	if (theName.indexOf("img")==0){
		if(NETDom&&document.layers["Pop_"+theName]){
			document.layers["Pop_"+theName].visibility="show";
		}
		if(D0MWerner){
			var elem = document.getElementById("Pop_"+theName);
			if (elem){
				ClientWidth=getInsideWindowWidth();
						
				elem.style.visibility="visible";
				
			}
		}
	}
}

function hidePop(theName) {
	MouseOffA(theName);
	if (theName.indexOf("img")==0){
		if(NETDom&&document.layers["Pop_"+theName]){
			document.layers["Pop_"+theName].visibility="hide";
		}
		if(D0MWerner){
			var elem = document.getElementById("Pop_"+theName);
			if (elem){
				elem.style.visibility="hidden";
			}
		}
	}
}

alertSize() ;

		var new01Array= new userArray(
		    "HOME","../default.asp",
			"ABOUT BANKSETA","../about/default.asp",
			"CAREERS @ BANKSETA","../careers/default.asp?thepage=careers.htm",
			"COMMUNICATIONS & MARKETING","../communication/default.asp",
			"BANKSETA RESEARCH PORTAL","javascript:openKms()",
			"ETQA","../etqa/default.asp",
			"LEARNING PROGRAMMES","../learnerships/default.asp",
			"CORPORATE SERVICES","../grants/default.asp",
			"HUMAN RESOURCES","../hr/default.asp",
			"DEVELOPMENT PROGRAMMES","../ssp/default.asp",
			"PROVINCIAL FOOTPRINT","../provincial/default.asp",
			"SKILLS DEVELOPMENT & RESEARCH","../skills/default.asp",
			"SMALL AND MICRO ENTERPRISES","../sme/default.asp",
			"STAKEHOLDER LOGIN","javascript:openSeta()",
			"MAKING A DIFFERENCE","../difference/default.asp",
			"SITE MAP","../search/default.asp?thepage=sitemap.asp",			
			"EVENTS CALENDAR","../communication/default.asp?thepage=events.asp",
			"TENDERS","../tenders/default.asp",
			"NEWSLETTER SUBSCRIPTION","../communication/default.asp?thepage=news/default.asp",
			"SETA RELATED ACRONYMS","../communication/default.asp?thepage=acronyms.asp")
			createAPopUp(new01Array,"menu");
