DOM = (document.getElementById) ? true : false;
NS4 = (document.layers) ? true : false;
IE = (document.all) ? true : false;
IE4 = IE && !DOM;
NS = (navigator.appName=="Netscape") ? true : false;
NS6 = NS && DOM;
MAC = (navigator.appVersion.indexOf("Mac") != -1);
 
function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj + 'On = new Image()')
		eval(imgObj + 'On.src = imgSrc + "roll.gif"')
		eval(imgObj + 'Off = new Image()')
		eval(imgObj + 'Off.src = imgSrc + ".gif"')
	}
}

function img_act(imgName) {
	if (document.images) {
		document[imgName].src = eval(imgName + "On.src");
	}
}

function img_inact(imgName) {
	if (document.images) {
		document[imgName].src = eval(imgName + "Off.src");
	}
}

function changeImages() {
	if (document.images) {
    	for (var i=0; i<changeImages.arguments.length; i+=2) {
      		document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
    		}
		}
}

function formHandler(formName, selectName){
var FUN = document[formName].elements[selectName];
var URL = FUN.options[FUN.selectedIndex].value;
if (URL != "") {
		window.location.href = "banddetails.php?bandid=" + URL;
	}
}

function openWindow(windowURL,windowName,windowWidth,windowHeight,scroll,center) {
	newWindow = window.open(windowURL,windowName,'width='+windowWidth+',height='+windowHeight+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollbars='+scroll+',resizable=0');
	newWindow.focus(); 
   if (center) {
      newWindow.moveTo((screen.width-windowWidth)/2,(screen.height-windowHeight)/2)
   }
}

function emailval(obj) {
   if (obj.email.value == "" || obj.email.value.indexOf('@') == -1 ||  obj.email.value.indexOf('.') == -1) {
      alert('Input valid email address.');
      obj.email.focus();
      return false;
   } else {
      return true;
   }
}

/*
if (parent.location.href == self.location.href){
    // change the url below to the url of the
    // frameset page...
    var url = self.location.href;
    var li = url.lastIndexOf("/") + 1;
    var page = url.substr(li);
    window.location.href = "index.php?p=" + page;
}
*/
