




/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.menucontent{display: none;}\n')
document.write('</style>\n')
}

var newClass = 'menutitleactive';
var oldClass = 'menutitle';
var prevQ = 'q0';
var activeQ = 'q0';

function SwitchMenu(obj,obj2,obj3){
	prevQ = activeQ;
	activeQ = obj2;
		
	if(document.getElementById){
	
	var thetitle = document.getElementById(obj3);
	var oldtitle = document.getElementById(prevQ);
	
	var el = document.getElementById(obj);
	var ar = document.getElementById("dynamicbox").getElementsByTagName("span"); //DynamicDrive.com change
	thetitle.className=newClass;
	oldtitle.className=oldClass;
	
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="menucontent") //DynamicDrive.com change
				ar[i].style.display = "none";
				
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
		if (activeQ != prevQ) 
		{
		prevQ = activeQ;
		}
				
	}
}






// standard eb-functions

function eClick(page,type,id)	{
	mypage = '/e.cfm?page='+page+'&type='+type+'&id='+ id ;
	NewWindow(mypage,'ebox',640,515,'no');
//	toggleBox('e',status); 
//	document.forms.editform.snippet.value=id;
//	toggleBox('editbglayer',status); 
//	toggleBox('editlayer',status);
} 


function popitup(url,w,h)
	{
		newwindow=window.open(url,'name','height='+h+',width='+w+'');
		if (window.focus) {newwindow.focus()}
		return false;
	}

	var win = null;
	function NewWindow(mypage,myname,w,h,scroll){
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=yes'
		win = window.open(mypage,myname,settings)
	}
 	


// toggle view mode of divs
function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
	if(document.layers)	   //NN4+
	    {document.layers[szDivID].visibility = iState ? "show" : "hide";}
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {   
		var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
	    {document.all[szDivID].style.visibility = iState ? "visible" : "hidden";}
}


/* 	hides all work divs and shows the one passed (if any..) */
function resetDivs(div)	{
	for (var i in subdivlist) {toggleBox(subdivlist[i],0);}  
	if (div)	{toggleBox(div,1)}
}
