/*
	Copyright David Trewern Design         :: www.dtdesign.com ::
	Unauthorised modification / use is a criminal offence, and
	will be prosecuted to the fullest extent permitted by law.
	All Rights Reserved
*/

NAVarr = new Array("red", "default", "purple", "orange", "olive", "brown", "brown2", "green", "yellow", "richred","blue");
if (document.images) {
	for (var NAVitem in NAVarr) { 
		 for (var NAVicount=0; NAVicount < 2; NAVicount++) { 
				eval("b" + NAVarr[NAVitem] + NAVicount + " = new Image()");
				eval("b" + NAVarr[NAVitem] + NAVicount + ".src = 'assets/swap_" + NAVarr[NAVitem] + "_" + NAVicount + ".gif'");
		 } 
	} 
}

/* ALTERED TO SUIT THIS SITE */
function BturnOn(imageName, location) {
	if (document.images) {
		var imageNumber = "";
		if (arguments.length > 1) imageNumber = arguments[1];
		document [imageNumber].src = eval("b" + imageName + "1.src");
	}
}
function BturnOff(imageName) {
	if (document.images) {
		var imageNumber = "";
		if (arguments.length > 1) imageName = arguments[1];
		document [imageName].src = eval("bdefault0.src");
	}
}
 /*** ***/
 
 
function imgPopup(path) {
	if (path) {
		window.open("utils_imagepopup.aspx?path=" + path, "popup", "width=400, height=300, toolbar=no, status=no, scrollbars=yes, resizable=yes");
	}
}

function ddRedirect(dd) {
	if (dd.options[dd.selectedIndex].value != "") self.location = dd.options[dd.selectedIndex].value;
}


/* STYLESHEET SWITCHER */

function setStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") == title) {
      a.disabled = false;
    }
  }
}



window.onload = function(e) {
	
	var agt=navigator.userAgent.toLowerCase();
		
	if (agt.toLowerCase().indexOf("mac") != -1 && agt.toLowerCase().indexOf("ie") != -1) {
		setStyleSheet("mac_ie");
	}
	/*else if (agt.toLowerCase().indexOf("win") != -1 && agt.toLowerCase().indexOf("ie 5") != -1) {
		setStyleSheet("pc_ie_5");
	}*/
	//placeEvents();
	
}