isLoaded=0;
var divCount = '';
var entInterval;
var activeToolTip = '';
var activeTab = new Array();

function doDrawer (which) {
	drawersArray = new Array ('nbdl_body1','nbdl_body2','nbdl_body3');
	for (i=0; i<drawersArray.length;i++) {
		document.getElementById(drawersArray[i]).style.display = "none";
	}
	document.getElementById("nbdl_body"+which).style.display = "block";
	document.getElementById("nbdl_drawer"+which).style.backgroundColor = "#A8B11C";
}

var activeDrawer = 0;
var mo_colors = new Array(0,"#000000","#000000","#000000");
var n_colors = new Array(0,"#713B02","#9F5302","#CC6A03");

function drawer_handleMouseOver(id) {
	if(activeDrawer == id) return;
	document.getElementById("nbdl_drawer" + id).style.backgroundColor = mo_colors[id];
}

function drawer_handleMouseOut(id) {
	if(activeDrawer == id) return;
	document.getElementById("nbdl_drawer" + id).style.backgroundColor = n_colors[id];
	
}

function drawer_handleClick(id) {
	if(activeDrawer) document.getElementById("nbdl_drawer" + activeDrawer).style.backgroundColor = n_colors[activeDrawer];
	activeDrawer = id;
	document.getElementById("nbdl_drawer" + id).style.backgroundColor = "#A8B11C";
	drawersArray = new Array ('nbdl_body1','nbdl_body2','nbdl_body3');
	for (i=0; i<drawersArray.length;i++) {
		document.getElementById(drawersArray[i]).style.display = "none";
	}
	document.getElementById("nbdl_body"+id).style.display = "block";
	
}

function tabs_handleMouseOver(id,color,instance) {
	if(activeTab[instance] == id) return;
	if (color == "ntrl"){
		eval('document.images.img_'+instance+'_' + id + '.src = tabs_on_ntrl_'+instance+'['+id+']');
	}else{
		eval('document.images.img_'+instance+'_' + id + '.src = tabs_on_'+instance+'['+id+']');
	}
}

function tabs_handleMouseOut(id,instance) {
	if(activeTab[instance] == id) return;
	eval('document.images.img_'+instance+'_' + id + '.src = tabs_off_'+instance+'['+id+']');	
}

function tabs_handleClick(id,color,instance) {
	
	if(activeTab[instance] != id) {
		if (color == "ntrl") {
			eval('document.images.img_'+instance+'_' + id + '.src=tabs_on_ntrl_'+instance+'['+id+']');
		}else{
			eval('document.images.img_'+instance+'_' + id + '.src=tabs_on_'+instance+'['+id+']');
		}
		eval('document.images.img_'+instance+'_' + activeTab[instance] + '.src=tabs_off_'+instance+'[activeTab[instance]]');
	}
	activeTab[instance] = id;
	/* listTableArray = new Array (0,'listtable1_'+instance,'listtable2_'+instance,'listtable3_'+instance,'listtable4_'+instance);
	for (i=1; i<listTableArray.length;i++) {
		if (document.getElementById(listTableArray[i])) document.getElementById(listTableArray[i]).style.display = "none";
	}
	document.getElementById("listtable" + id + '_' + instance).style.display = "block";
	*/
}

function returnScrollDimensions(which) {
	if(which) {
		if(document.body.scrollTop != 0)return document.body.scrollTop;
		if(document.documentElement.scrollTop != 0)return document.documentElement.scrollTop;
	} else {
		if(document.body.scrollLeft != 0)return document.body.scrollLeft;
		if(document.documentElement.scrollLeft != 0)return document.documentElement.scrollLeft;
	}
return 0;
}

var x,y,zInterval;
document.onmousemove = setMouseCoords;

function setMouseCoords(e) {
	if(!isLoaded)return;
	if(document.all) {
		x = window.event.clientX + returnScrollDimensions(0);
		y = window.event.clientY + returnScrollDimensions(1);
	} else {
		x = e.pageX;
		y = e.pageY;
	}
}

function showToolTip(divID) {
	showToolTip2(divID, -140,-10);
}

function showToolTipRight(divID) {
	showToolTip2(divID, 10,-10);
}

function showToolTip2(divID, dx, dy) {
if(activeToolTip==divID) {hideToolTip();}
	else if(activeToolTip!=divID) {
		document.getElementById("toolTip").style.top = (y+dy) + "px";
		document.getElementById("toolTip").style.left = (x+dx) + "px";
		document.getElementById("toolTip").innerHTML = document.getElementById("toolTip_"+divID).innerHTML;
		document.getElementById("toolTip").style.display = "block";
		activeToolTip = divID;
	}
	clearInterval(zInterval);
}

function timeOutToolTip(){
	zInterval = setTimeout("hideToolTip()",100);
}

function hideToolTip() {
	document.getElementById("toolTip").style.display = "none";
	document.getElementById("toolTip").innerHTML = "";
	clearInterval(zInterval);
	activeToolTip = "";
}

function showEntGuide () {
if (document.getElementById("ent_guide")){
clearInterval(entInterval);
document.getElementById("ent_guide").style.display = "block";
}
}

function hideEntGuide () {
	entInterval = setTimeout("document.getElementById(\"ent_guide\").style.display=\"none\"",100);
}

function openlink(url){
   window.open(url, '_dlplayer');
}
