<!--
self.onerror=function() { return true; }

function popup(theURL,winName,features) {
	// Open a popup window to edit section details
  	window.open(theURL,winName,features);
}

function setFrRate(mvspeed,frrate){//!!!!!!!!!THIS MUST BE CALLED BEFORE TRYING TO USE MoveDivs()!!!!!!!!!!!!!
	movespeed = mvspeed;//the higher the slower, try between 5 and 30 (ish)
	framerate = frrate;//I usually set 20 frames per second (slow tv!)
	milliframe = 1000/framerate;
	timeout = new Array();//make the array to hold the timeout variables returned from a timeout call
}

//example call moveDivs('layername|target x|target y|boolean visibility','layername2|target x|target y|boolean visibility')
//e.g moveDivs('bluelayer|500|200|true','redlayer|120|80|set','redlayer|120|80|false','redlayer|120|80');
function moveDivs(){
//alert("start movedivs");
	object = null;//refresh the object for the latest loop(could be in a set up somewhere?).
	object = new Array();
	//set up the 'object' database
	for(i=0;i<arguments.length;i++){//split up the call strings passed from the arguments array
		var argsplitstr = String(arguments[i]);
		argsplit = argsplitstr.split("|");//e.g. of argsplitstr: 'bluelayer|200|150'
		object[i] = new Array();
		object[i][0] = String(argsplit[0]);//layer name string
		object[i][1] = parseInt(argsplit[1]);//target x position
		object[i][2] = parseInt(argsplit[2]);//target y position
		if(argsplit.length == 3 || argsplit[3] == "trans"){
			object[i][3] = "trans";//show only while moving
		}else if(argsplit[3] == "set"){
			object[i][3] = "set";//used for set up, keep them hidden, just position for future
		}else{
			object[i][3] = eval(argsplit[3]);//boolean visibility
		}
	}

	if (IE){//---------------------------------------------------------------------------------------------------------
		stylestr = ".style";

		for(i=0;i<=object.length-1;i++){//loop through database of arguments

			var tmp = eval(object[i][0]+stylestr);//set up reference to div in question

			if(object[i][3] == true && tmp.visibility == "hidden" && object[i][3] != "set"){
				tmp.visibility = "visible";//last argument of each is type of visibility, this is true(show whilst moving and stationary)
			}else if(!object[i][3] && tmp.visibility == "visible"){
				tmp.visibility = "hidden";//this is last argument of false(hide whilst moving, then show)
			}else if(object[i][3] == "trans" && tmp.visibility == "hidden"){
				tmp.visibility = "visible";//this is last argument missed off or set to 'trans'(show whilst moving, then hide)
			}else if(object[i][3] == "set" && tmp.visibility == "visible"){
				tmp.visibility = "hidden";//last argument of 'set' used for set up positioning (hide whilst moving, then hide)
			}
			var xtarget = object[i][1];//+xx;
			var dx = xtarget - tmp.pixelLeft;//current distance from target x position
			var ytarget = object[i][2];//+yy;
			var dy = ytarget - tmp.pixelTop;//current ditance from target y position
			if(dx > 3){//not almost there from the left
				var xshift = (dx+movespeed)/movespeed;//remember to remove the top: property of the divs style position settings.
			}else if(dx < -3){//not almost there from the right
				var xshift = (dx-movespeed)/movespeed;
			}else{//almost there
				xshift = 0;
			    tmp.pixelLeft = xtarget;//place on target x position
			}
			if(dy > 3){//not almost there from top
				var yshift = (dy+movespeed)/movespeed;//remember to remove the left: property of the divs style position settings.
			}else if(dy < -3){//not almost there from bottom
				var yshift = (dy-movespeed)/movespeed;
			}else{//almost there
				yshift = 0;
			    tmp.pixelTop = ytarget;//place on target y position
			}
			tmp.pixelLeft += xshift;//move layer horizontally
			tmp.pixelTop += yshift;//move layer vertically
			if(xshift == 0 && yshift == 0){//layer has been positioned on end point
				if(object[i][3] == "trans" && tmp.visibility == "visible"){//last argument: 'trans' the move is over so now hide the layer
					tmp.visibility = "hidden";
				}else if(object[i][3] == false){//last argument: false the move is over so now show the layer
					tmp.visibility = "visible";
				}
				clearTimeout(timeout[object[i][0]]);//passing the layer name as the array index. leave it!!
				// splice not present in IE5.0
				//object.splice(i,1);//get rid of the layer and move from the pseudo database
			}else{
				clearTimeout(timeout[object[i][0]]);//clean up timeouts
				var argstr = object[i].join("|");//put the argument string back together
				var timecall= "moveDivs(\""+argstr+"\")";//make the appropriate call string
				timeout[object[i][0]] = setTimeout(timecall,milliframe);//set up timeout object for this call; milliframe is milliseconds according to the frame rate set
			}
		}
		
	}else{//Netscape code (see comments from IE script above) -------------------------------------------------------
		
		for(i=0;i<object.length;i++){
			var tmp = document[object[i][0]];
			if(object[i][3] && tmp.visibility == "hide" && object[i][3] != "set"){
				tmp.visibility = "show";
			}else if(!object[i][3] && tmp.visibility == "show"){
				tmp.visibility = "hide";
			}else if(object[i][3] == "trans" && tmp.visibility == "hide"){
				tmp.visibility = "show";
			}else if(object[i][3] == "set" && tmp.visibility == "show"){
				tmp.visibility = "hide";
			}
			var xtarget = object[i][1];
			var dx = xtarget - tmp.left;
			var ytarget = object[i][2];
			var dy = ytarget - tmp.top;
			if(dx > 3){
				var xshift = (dx+movespeed)/movespeed;
			}else if(dx < -3){
				var xshift = (dx-movespeed)/movespeed;
			}else{
				xshift = 0;
			    tmp.pixelLeft = xtarget;
			}
			if(dy > 1){
				var yshift = (dy+movespeed)/movespeed;
			}else if(dy < -1){
				var yshift = (dy-movespeed)/movespeed;
			}else{
				yshift = 0;
			    tmp.pixelTop = ytarget;
			}			
			tmp.left += xshift;
			tmp.top += yshift;
			if(xshift == 0 && yshift == 0){
				if(object[i][3] == "trans" && tmp.visibility == "show"){
					tmp.visibility = "hide";
				}else if(object[i][3] == false){
					tmp.visibility = "show";
				}
				clearTimeout(timeout[object[i][0]]);
				object.splice(i,1);
			}else{
				clearTimeout(timeout[object[i][0]]);
				var argstr = object[i].join("|");
				var timecall= "moveDivs(\""+argstr+"\")";
				timeout[object[i][0]] = setTimeout(timecall,milliframe);
			}
		}
	}
//alert("end movedivs");
}
//-->
