function showSubMenu(obj, mode) {
	var els = obj.getElementsByTagName("UL");
	if (els.length > 0) {
		if (mode == true) {
			els[0].style.display = "block";
		} else {
			els[0].style.display = "";
		}
	}
}

function changeTab(obj, mode) {
	
	//hide all tabs
	var tabs = document.getElementById("tabs");
	var divs = tabs.getElementsByTagName("DIV");
	var header = divs[0];
	var links = header.getElementsByTagName("A");
	var i = 0;
	for (i=0; i<links.length; i++) {
		if (i == links.length-1) {
			links[i].className = "tab last";
		} else {
			links[i].className = "tab";
		}
	}
	
	//show specific tab
	obj.className = "tab sel";
	
	//hide all info
	var tabContent = document.getElementById("tab1");
	tabContent.style.display = "none";
	var tabContent = document.getElementById("tab2");
	tabContent.style.display = "none";
	var tabContent = document.getElementById("tab3");
	tabContent.style.display = "none";
	var tabContent = document.getElementById("tab4");
	tabContent.style.display = "none";
	var tabContent = document.getElementById("tab5");
	tabContent.style.display = "none";
	
	//show specific info
	var tabContent = document.getElementById("tab" + mode);
	tabContent.style.display = "block";
	
	return false;
}

function checkBox(obj, num) {
	var w = document.getElementById("vwquantity" + num);
	if (obj.checked == true) {
		w.value = "1";
	} else {
		w.value = "0";
	}
}

function mailpage()
{
	mail_str = "mailto:?subject=Check out the " + escape(document.title);
	mail_str += "&body=I thought you might be interested in the " + escape(document.title);
	mail_str += ". You can view it at, " + escape(location.href);
	location.href = mail_str;
	return false;
}

function gup(name)
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}
