/*
Browsercheck DOM compatible
This script is used by other scripts that require browser detection
*/

	function api_browser_check(){
	this.name = navigator.appName;
	this.ver = navigator.appVersion;
	this.userAgent = navigator.userAgent;
	this.dom = document.getElementById?true:false;
	
	this.ie5 = (this.ver.indexOf("MSIE 5")>-1 && this.dom)?true:false;
	this.ie5_5 = (this.ver.indexOf("MSIE 5.5")>-1 && this.dom)?true:false;
	this.ie6 = (this.ver.indexOf("MSIE 6")>-1 && this.dom)?true:false;
	this.ie = (document.all && !this.dom)?true:false;
	
	this.ns = (document.layers && !this.dom)?true:false;
	this.ns6 = (this.userAgent.indexOf("Netscape6")>-1 && this.dom)?true:false;
	this.ns7 = (this.userAgent.indexOf("Netscape/7")>-1 && this.dom)?true:false;
	
	this.opera = (this.name.indexOf("Opera")>-1)?true:false;
	
	return this
	}
	
	this_browser = new api_browser_check();
	
	browserDOM = dom = this_browser.dom;
	browserUserAgent = this_browser.userAgent;
	
	browserIE5 = ie5 = this_browser.ie5;
	browserIE5_5 = ie5_5 = this_browser.ie5_5;
	browserIE6 = ie6 = this_browser.ie6;
	browserIE = ie = this_browser.ie;
	
	browserNS = ns = this_browser.ns;
	browserNS6 = ns6 = this_browser.ns6;
	browserNS7 = ns7 = this_browser.ns7;
	browserOpera = opera = this_browser.opera;

// standard image swap [name,image] ----------------------------------------------------------------------------------------------------------------------------
function img_swap() {
	for (m=0;m<arguments.length;m+=2){
		var obj=eval("document."+arguments[m])
		if (obj) {
			obj.src=arguments[m+1];
		}
	}
}

// preload images ----------------------------------------------------------------------------------------------------------------------------------
// aname: string name of image array | ipath: path to image folder | ilist: array of images
// eg: preload('menuimgs','../images/',['pic1_on.gif','pic2.gif']);
function preload(aname,ipath,ilist) {
	eval("var "+aname+"=new Array("+ilist.length+");");
	for (m=0;m< ilist.length;m++){
		eval(aname+"["+m+"]=new Image();");
		eval(aname+"["+m+"].src='"+ ipath + ilist[m] +"';");
	}
}

