var isDHTML = 0;
var isLayers = 0;
var isAll = 0;
var isID = 0;
 
if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
    if (document.all) {isAll = 1; isDHTML = 1;}
    else {
        browserVersion = parseInt(navigator.appVersion);
    if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}
}}
 
function findDOM(objectID,withStyle) {
    if (isID) { return (document.getElementById(objectID)) ; }
    else {
      if (isAll) { return (document.all[objectID]); }
    else {
      if (isLayers) { return (document.layers[objectID]); }
    }
  }
} 

function windowopener(url,winName,width,height,isScroll){
	var screenW = 0;
	var screenH = 0;
	var scroll = 'scrollbars = yes';
	if(screen.width){
		screenW = screen.width;
		screenH = screen.height;
	}else{
		screenW = 800;
		screenH = 600;
	}
	if(isScroll){
	}else{
		scroll = 'scrollbars = no';
	}
	var boxWidth = width;
	var boxHeight = height;
	// 12 and 52 values are for the bars on the newwindow
	// note: only ie has constant bars, netscape 4+ adds as necc
	var windowLeft = ((screenW - boxWidth)/2-10);
	var windowTop = ((screenH - boxHeight)/2-52);
	window.open(url,winName,'' + scroll + ',resizable=yes,status=no,width=' + width + ',height=' + height + ',left=' + windowLeft + ',top=' + windowTop);
}

function changeimage(sMainImageRef,sImageSrc){
	var sImageDirRoot="/images/"
	var oRef=""
	// if there is a length then its a string otherwise an object
	if(sMainImageRef.length){
		oRef=findDOM(sMainImageRef)
	}else{
		oRef=sMainImageRef
	}
	oRef.src=sImageDirRoot + sImageSrc
}

function changebg(oRef,sColor){
	oRef.style.backgroundColor=sColor
}

function confirm(stMessage){
	var agree=confirm(stMessage);
	if (agree)
		return true;
	else
		return false;
}