function $() {
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string')
			element = document.getElementById(element);
		if (arguments.length == 1)
			return element;
		elements.push(element);
	}
	return elements;
}


function flash(strFile, strId, strClass, intWidth, intHeight) {
	document.write("<object class=\"" + strClass + "\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" name=\"" + strId + "\" width=\"" + intWidth + "\" height=\"" + intHeight + "\" id=\"" + strId + "\">");
    document.write("<param name=\"movie\" value=\"_swf/" + strFile + "\" />");
    document.write("<param name=\"quality\" value=\"high\" />");
	document.write("<param name=\"wmode\" value=\"transparent\">");
	document.write("<param name=\"SCALE\" value=\"noborder\">");
	document.write("<param name=\"menu\" value=\"false\">");
	document.write("<embed class=\"" + strClass + "\" src=\"_swf/" + strFile + "\" width=\"" + intWidth + "\" height=\"" + intHeight + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" scale=\"noborder\" menu=\"false\" name=\"" + strId + "\"></embed></object>");
}

function navShow() {
   var arrayLayers = document.getElementsByTagName("div");
   var arraySelects = document.getElementsByTagName("select");
	for (i = 0; i < arrayLayers.length; i++) {
		if (arrayLayers[i].id.substr(0,8) == "rolldown") {
			arrayLayers[i].style.display = "none";
		}
	}
	if (navigator.appName.indexOf("Explorer") != -1) {
		for (j = 0; j < arraySelects.length; j++) {
			arraySelects[j].style.visibility = "visible";
		}
	}
	for (k = 0; k < arguments.length; k++) {
		if (document.getElementById(arguments[k])) {
			document.getElementById(arguments[k]).style.display = "block";

			if (navigator.appName.indexOf("Explorer") != -1) {
				for (l = 0; l < arraySelects.length; l++) {
					arraySelects[l].style.visibility = "hidden";
				}
			}
		}
	}
}


function getElementsByClass(node,searchClass,tag) {
var classElements = new Array();
var els = node.getElementsByTagName(tag); // use "*" for all elements
var elsLen = els.length;
var pattern = new RegExp("\\b"+searchClass+"\\b");
for (i = 0, j = 0; i < elsLen; i++) {
 if ( pattern.test(els[i].className) ) {
 classElements[j] = els[i];
 j++;
 }
}
return classElements;
}

function init() {

	var arrRolldownStyling = getElementsByClass(document,'rolldown','td');
	for (var i=0; i < arrRolldownStyling.length; i++) {
		//arrRolldownStyling[i].onmouseover = rolldownStylingOver;
		//arrRolldownStyling[i].onmouseout = rolldownStylingOut;
		arrRolldownStyling[i].onclick = rolldownClick;
	}
}

function rollover(obj) {
	obj.style.background = "#666666 url(_gfx/09/bg_rolldownOn.gif) no-repeat";
}

function rollout(obj) {
	obj.style.background = "#343434 url(_gfx/09/bg_rolldown.gif) no-repeat";
}

function rolldownClick() {
	document.location = this.firstChild;
}


function get_cities(sType, sLang ) {
	if (sType != "") {
		self.location.href = "retailers.asp?lang=" + sLang + "&type=" + sType;
		return true;
	} else {
		return false;
	}
}

function get_city(sCity, sLang ) {
	if (sCity != "") {
		var oType = $("type");
		self.location.href = "retailers.asp?lang=" + sLang + "&strCity=" + sCity + "&type=" + oType.options[oType.selectedIndex].value;
		return true;
	} else {
		return false;
	}
}

function get_prod(sProd, sLang ) {
	if (sProd != "") {
		self.location.href = "product.asp?prod_id=" + sProd + "&lang=" + sLang;
		return true;
	} else {
		return false;
	}
}

function get_service(sCountry, sLang ) {
	if (sCountry != "") {
		self.location.href = "service.asp?country_id=" + sCountry + "&lang=" + sLang;
		return true;
	} else {
		return false;
	}
}

window.onload = init;
document.onclick = navShow;
