var alwaysOnImg = ""
function setMenu(onImg) {
	image_on(onImg);
	alwaysOnImg = onImg;
}

function compressString(strData) {
	strCompData = strData.replace(/\s/g,'');
}

function splitString(strCompData, delimiter) {
	aEmail = strCompData.split(delimiter);
}

//Image on
function image_on(imgName) {		
	if (navigator.appName == "Netscape") {			
		ActiveImage = eval(imgName + "_active.src");
		document[imgName].src = ActiveImage;		
	}
	else{
		if(document.readyState == "complete"){	
			ActiveImage = eval(imgName + "_active.src");
			document[imgName].src = ActiveImage;		
		}
	}
}
	
//Image off
function image_off(imgName) {
	if(imgName != alwaysOnImg) {
		if (navigator.appName == "Netscape") {	
			DefaultImage = eval(imgName + "_default.src");		
			document[imgName].src =DefaultImage;
		}
			else{
				if(document.readyState == "complete"){	
					DefaultImage = eval(imgName + "_default.src");		
					document[imgName].src =DefaultImage;
				}			
			}	
	}
}

function changeTab(tabToShow) {
	for (i=0; i<aTabs.length; i++) {
		imgName = "img" + aTabs[i];
		image_off(imgName);
		setElementProperty(aTabs[i], 'display', 'none')
	}
	imgName = "img" + tabToShow;
	image_on(imgName);
	setElementProperty(tabToShow, 'display', 'block');
}

function setElementProperty(elm, property, value){
	var thisElm = null;
	if(typeof(elm) == "object"){
		thisElm = elm;
	} else {
		thisElm = document.getElementById(elm);
	}
	if((thisElm != null) && (thisElm.style != null)){
		thisElm = thisElm.style;
		thisElm[property] = value;
	}
}

// Popup Window
function popWin(url,wn,wd,ht,scroll) {
	useScroll = 1;
	width = 600;
	height = 520;
	winName = "newWin";
	if (scroll == 0)	{
		useScroll = 0;
	}
	if(ht != null) {
		height = ht;
	}
	if(wd != null) {
		width = wd;
	}
	if(wn != null) {
		winName = wn;
	}
	thisURL = url;
	popupWin=window.open(thisURL,winName,"width=" + width + ",height=" + height + ", scrollbars=" + useScroll + ",resizable")
}

//getting a single querystring value
var args = new Object();
function getQueryString() {
	var query = location.search.substring(1);
	if(query != "") {
		var pairs = query.split("&");
		for (i=0; i<pairs.length; i++) {
			var pos = pairs[i].indexOf('=');
			if(pos == -1) continue;
			var argname = pairs[i].substring(0,pos);
			var value = pairs[i].substring(pos+1);
			args[argname] = unescape(value);
		}
	}
	return args;
}

function chkTab() {
	getQueryString();
	if(args['tab'] >= 0) {
		setTab = aTabs[args['tab']];
	} else {
		setTab = aTabs[0];
	}
	changeTab(setTab);
}

function goToAnc() {
	getQueryString();
	if(args['anc'] != null) {
		changeLocation("#" + args['anc']);
	}
}

function changeLocation(url){
	window.location=url
}

function setProductOption(strProdOpt) {
	//alert(strProdOpt);
	if(document.ctl00){	
		intOptCount = document.ctl00.LookupForm1$ProductDropDownList.length;
		for (i=0; i<intOptCount; i++) {
			//alert(document.ctl00.LookupForm1$ProductDropDownList.options[i].value);
			if(document.ctl00.LookupForm1$ProductDropDownList.options[i].value == strProdOpt) {
				document.ctl00.LookupForm1$ProductDropDownList.options[i].selected = true;
			}
		}
	//	alert(document.ctl00.LookupForm1$ProductDropDownList.selectedIndex);
	}
}

function autotab(current,to){
	if (current.getAttribute && current.value.length==current.getAttribute("maxlength")) {
		to.focus() 
	}
}
