
// standard eb-functions

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";
    }
}
 
function updateContent(div,title,src,w,h)	{
	var contentBlock = '<h3>'+title+'</h3><iframe width="'+w+'" height="'+h+'" id="mediawindow" name="mediawindow" style="width: '+w+'px; height: '+h+'px;" src="./mediaplayer.cfm?media='+src+'&width='+w+'&height='+h+'" frameborder="0"></iframe><p><a href="javascript:closeBox(\''+div+'\');">close video</a></p>';
	document.getElementById(div).innerHTML = contentBlock;
} 

function	closeBox(div)	{
	document.getElementById(div).innerHTML = '';
}

var Ewindow = ''; 

function eClick(page,type,id)	{
	mypage = 'e.cfm?page='+page+'&amp;type='+type+'&amp;id='+ id ;
		
	if (!Ewindow.closed && Ewindow.location) {
		Ewindow.location.href = mypage;
	}
	else {
		Ewindow=window.open(mypage,'ebox','height=515,width=640');
		if (!Ewindow.opener) newwindow.opener = self;
	}
	if (window.focus) {Ewindow.focus()}
	// return false;
}


	

function popitup(url) {


//	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)
	}
 	

//Highlight form element- � Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and TOS,
//visit http://www.dynamicdrive.com

var highlightcolor="#C8CED8"
var highlightfontcolor="red"

var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
if (which.style&&intended.test(which.tagName)){
if (ns6&&eventobj.nodeType==3)
eventobj=eventobj.parentNode.parentNode
return true
}
else
return false
}

//Function to highlight form element
function highlight(e){
eventobj=ns6? e.target : event.srcElement
if (previous!=''){
if (checkel(previous))
previous.style.backgroundColor=''
previous.style.Color=''
previous=eventobj
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
eventobj.style.fontColor=highlightfontcolor
}
else{
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
eventobj.style.fontColor=highlightfontcolor
previous=eventobj
}
}



function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


/* 	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)}
}
