// Javascript By Jeff@flash-db.com

var folderOpenImg = new Image();
	folderOpenImg.src = "http://www.flash-db.com/Tutorials/images/openFolder.gif";
	
var folderImg = new Image();
	folderImg.src = "http://www.flash-db.com/Tutorials/images/folder.gif";
	
var downImg = new Image();
	downImg.src = "http://www.flash-db.com/remoting/images/arrowDown.gif";
	
var rightImg = new Image();
	rightImg.src = "http://www.flash-db.com/remoting/images/arrowRight.gif";

// changes color of main category selection plus adds hand pointer.
function changeBG(who,what) {
	if (what == "on") {
		document.getElementById(who).style.backgroundColor 	= "#003399";
		try {
		
			if (document.all) {
				document.getElementById(who).style.cursor = "hand";
			} else {
				document.getElementById(who).style.cursor = "pointer";
			}
		} catch(e) {}
	} else {
		document.getElementById(who).style.backgroundColor = "#003366";
	}
}

// Hides and displays Category Items - also swaps folder images.
function hideShow(who) {

	var tObj = document.getElementById(who+'Img');
	var eObj = document.getElementById(who+'Bot');
	
	if (tObj.src == "http://www.flash-db.com/Tutorials/images/folder.gif") {
	
		tObj.src = folderOpenImg.src;
		eObj.style.display = "block"; // dynamic display does not work in opera 5 and 6.
		
	} else {
	
		tObj.src = folderImg.src;
		eObj.style.display = "none";
	}
}

// Resize's Left side Navigation - when you click on the minimize area.
function resizeAll() {
	var side = document.getElementById("tutSide");
	var menu = document.getElementById("tutContent");
	var img  = document.getElementById("resizeImg");
	
	if (img.style.left == "10px") {
		img.style.left = "165px";
		side.style.display = "block";
		menu.style.left = "185px";
		menu.style.width = "740px";
	} else {
		img.style.left = "10px";
		side.style.display = "none";
		menu.style.left = "10px";
		menu.style.width = "915px";	
	}
}

// changes bg of individual item for tutorial area.

function changeBG3(who,what) 
{
	if (what == "on") 
      {
		document.getElementById(who).style.backgroundColor 	= "#FFBA4D";

		try 
            {
			if (document.all) {
				document.getElementById(who).style.cursor = "hand";
			} else {
				document.getElementById(who).style.cursor = "pointer";
			}

		} catch(e) { }
		
		document.getElementById(who).style.color 			= "#ffffff";
		document.getElementById(who).style.border 		= "2px inset #FFBA4D";
												
	} else {
		document.getElementById(who).style.backgroundColor 	= "#ffffff";		
		document.getElementById(who).style.color 			= "#003366";
		document.getElementById(who).style.border 		= "2px solid white";
	}
}

// changes bg of individual item for features area.
function changeBG2(who,what) {
	if (what == "on") {
		document.getElementById(who).style.backgroundColor 	= "#003399";
		try {
			if (document.all) {
				document.getElementById(who).style.cursor = "hand";
			} else {
				document.getElementById(who).style.cursor = "pointer";
			}
		} catch(e) { }
		
		document.getElementById(who).style.color 			= "#ffffff";
		document.getElementById(who).style.border 		= "2px inset #000099";
												
	} else {
		document.getElementById(who).style.backgroundColor 	= "#ccccff";		
		document.getElementById(who).style.color 			= "#003366";
		document.getElementById(who).style.border 			= "2px solid #003366";
	}
}

function openArea(what) {
	var areaObj = document.getElementById("con"+what).style;
	var imgObj = document.getElementById("img"+what);
	
		//imgObj.width = "10";
		//imgObj.height = "10";	
	
	if (areaObj.display == "block") {
		//imgObj.src = rightImg.src;	
		areaObj.display = "none";
	} else {
		//imgObj.src = downImg.src;	
		areaObj.display = "block";
	}
}

// goes to a specific article or tutorial file.
function gotoURL(where) {
		window.location.href = "http://"+where;
}

// old window open code.
function NewWindow(URL, xsize, ysize, winName) {
	Name = winName
	winprops = 'width='+xsize+',height='+ysize+',scrollbars=auto,resizable=yes,status=no,menubar=no'
	win = window.open(URL, Name, winprops)
}
