function popUpHelp(theURL,theWidth,theHeight,theScroll,theResize) {
var theProperties = 'width=' + theWidth +',height=' + theHeight + ',scrollbars=' + theScroll + ',resizable=' + theResize+',top=0,left=0';
// if (document.cookie.indexOf('scomp') < 1) {
  popUpWindow = window.open(theURL,'',theProperties)
//  document.cookie='ringwayscomp=1';
// }
}



function popUpHelp(theURL,theWidth,theHeight,theScroll,theResize) {
var theProperties = 'width=' + theWidth +',height=' + theHeight + ',scrollbars=' + theScroll + ',resizable=' + theResize+',top=0,left=0';
// if (document.cookie.indexOf('scomp') < 1) {
  popUpWindow = window.open(theURL,'',theProperties)
//  document.cookie='ringwayscomp=1';
// }
}


// changes right hand menu div height 	
	function changeDivHeight (){
		
				// get height of text box and set height of menu box
			var contentColourHeight = document.getElementById('contentColour').offsetHeight+27;
			var contentTextHeight = document.getElementById('contentText').offsetHeight+27;
			
			if (contentTextHeight<contentColourHeight){
			document.getElementById('rightMenu').style.height=document.getElementById('contentColour').offsetHeight+27;		
				
			} else {
				
			document.getElementById('rightMenu').style.height=document.getElementById('contentText').offsetHeight+32;	
			}
		
	}
// expandable layers


dom = (document.getElementById) ? true : false;
ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
ns4 = (document.layers && !dom) ? true : false;
ie4 = (document.all && !dom) ? true : false;
nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;

var curLyr='expandText0';
function expandLyr(pg) {
	

	var oldLyr = curLyr;
	collapsetheLyr(oldLyr);
  	curLyr = pg;
	expandtheLyr(pg);
}

function expandtheLyr(lyr) {
	

	var theLyr = (ns4)? document.mainContentRight.document.layers[lyr] : (ie4)? document.all[lyr].style : (ie5||ns5)? document.getElementById(lyr).style: null;
	if (!theLyr) return;
	theLyr.display = "block";
changeDivHeight ()
} 

function collapsetheLyr(lyr) {
	var theLyr = (ns4)? document.mainContentRight.document.layers[lyr] : (ie4)? document.all[lyr].style : (ie5||ns5)? document.getElementById(lyr).style: null;
	if (!theLyr) return;
	
	theLyr.display = "none";
changeDivHeight ()
}



/*
Preload images script
By JavaScript Kit (http://javascriptkit.com)
Over 400+ free scripts here!
*/

var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}


function backToTop() {
    var x1 = x2 = x3 = 0;
    var y1 = y2 = y3 = 0;

    if (document.documentElement) {
        x1 = document.documentElement.scrollLeft || 0;
        y1 = document.documentElement.scrollTop || 0;
    }

    if (document.body) {
        x2 = document.body.scrollLeft || 0;
        y2 = document.body.scrollTop || 0;
    }

    x3 = window.scrollX || 0;
    y3 = window.scrollY || 0;

    var x = Math.max(x1, Math.max(x2, x3));
    var y = Math.max(y1, Math.max(y2, y3));

    window.scrollTo(Math.floor(x / 2), Math.floor(y / 2));

    if (x > 0 || y > 0) {
        window.setTimeout("backToTop()", 25);
    }
}



