
var layer  = null;
var ns = false;
var ie = false;
var moz = false;
var curr_num = null; 
var isLoaded = false;
var div,x,y;
var fx,fy;
var timeoutID = null;






function preLoadImages(){
	// required line, calls exhibeo init function to
	// initialise editing/saving constructs	
	// comment out when developing new templates when required.
	// "init" is a reserved exhibeo function name, do not use. 
	
	
	if(pageAction != "publish"){init()};
	
	if(document.layers)ns = true;
	if(document.getElementById && !document.all)moz = true;
	if(document.all)ie = true;
	
	isLoaded = true;
}

var isClicked = null;
var locked = false;


function swapImage(imgName, state) {
	if(isLoaded){
		//alert(document[imgName].src)
		document[imgName].src = eval(imgName + "_" + state + ".src");
		
	}	
	
}


/*
    Ned Collyer 03/11/2003 6:09PM
    Updated: remove win.moveTo(x,y) from open, openpopup, and openplainpopup as it did not work for external links
*/


function Open(url, h, w)
{
	var x = Number(screen.availWidth / 4);
	var y = Number(screen.availHeight / 4) - 100;

	if ((w == null) || (h == null))
	{
		// Popup to be 2/3 the size of an 800x600 screen.
		// J.M. (03/12/03).

		var intDefaultWidth = 800;
		var intDefaultHeight = 600;

		w = Math.round((intDefaultWidth / 3) * 2) + 25;
		h = Math.round((intDefaultHeight / 3) * 2)
	}

	var win = parent.window.open(url, "win", "height=" + h + ",width=" + w + ",resizable=1,location=1,menubar=0,status=0,toolbar=1,scrollbars=1");
	win.focus();
}


function openPopUp(url,w,h)
{
	var x = screen.availWidth - screen.availWidth;
	var y = screen.availHeight - screen.availHeight;

	var win = parent.window.open(url,"win","width=" + w + ",height=" + h + ",resizable=1,location=1,menubar=0,status=1,toolbar=0,scrollbars=1");
	win.focus();
}


function openPlainPopUp(url, w, h)
{
    var x = Number(screen.availWidth / 4);
    var y = Number(screen.availHeight / 4) - 100;

	// Added default size if width and height are not specified.
	// J.M.
    if ((w == null) || (h == null))
    {
		w = 600;
		h = 450;
    }
	
	var win = window.open(url, "win", "width=" + w + ",height=" + h + ",resizable=1,location=1,menubar=0,status=0,toolbar=1,scrollbars=1");
	
	win.focus();
}

function openPlainPopUp2(url, w, h)
{
    var x = Number(screen.availWidth / 4);
    var y = Number(screen.availHeight / 4) - 100;

	// Added default size if width and height are not specified.
	// J.M.
    if ((w == null) || (h == null))
    {
		w = 600;
		h = 450;
    }
	
	var win = window.open(url, "win", "width=" + w + ",height=" + h + ",resizable=0,location=0,menubar=0,status=0,toolbar=0,scrollbars=0");
	
	win.focus();
}


function chk(obj) {
	var  O = obj;
	var pI = "";
	for(var propertyName in O){
	 if(propertyName != "innerHTML" & propertyName != "innerText" & propertyName != "outerHTML" & propertyName != "outerText")
	 pI += propertyName + " = " + O[propertyName] + "  ,   ";
	 }
	alert(pI)
}






function openMgrWin(val){
var loc = "list-all.asp?id=" + val;


mgrwin = window.open(loc,"mgrwin","height=400,width=400,resizable=0,location=0,menubar=0,status=0,toolbar=0");
mgrwin.focus();
mgrwin.moveTo(10,10);
}



