// This is to support the tabs on the main page
function DisplayTab(TabName){
      // Set all the tabs to the unselected state
      // (since nothing is keeping track of the current selection)
      // I would normally do these in a loop, or keep track of
      // what is selected, but for this
      // quick-n-dirty example I'm taking the easy way out
      document.getElementById("contact_cont").style.display = "none"
      document.getElementById("story_cont").style.display = "none"
      document.getElementById("luxury_cont").style.display = "none" 
      document.getElementById("product_cont").style.display = "none"
      document.getElementById("buy_cont").style.display = "none" 
      document.getElementById("splash_cont").style.display = "none" 
      document.getElementById("classic_cont").style.display = "none" 
      document.getElementById("set_cont").style.display = "none" 
      document.getElementById("bowl_cont").style.display = "none" 
      document.getElementById("gly_cont").style.display = "none" 
      document.getElementById("select_cont").style.display = "none" 
      document.getElementById("deluxe_cont").style.display = "none" 
      document.getElementById("dual_cont").style.display = "none" 
      document.getElementById("wdual_cont").style.display = "none" 
      document.getElementById("nBrush_cont").style.display = "none" 
      document.getElementById("dBrush_cont").style.display = "none" 
      document.getElementById("luxset_cont").style.display = "none" 
      document.getElementById("luxscent_cont").style.display = "none" 
      document.getElementById("luxunscent_cont").style.display = "none" 
      document.getElementById("luxbrush_cont").style.display = "none" 

      document.getElementById("contact_tab").className = ""
      document.getElementById("story_tab").className = ""
      document.getElementById("product_tab").className = ""
      document.getElementById("buy_tab").className = ""
      // document.getElementById("classic_tab").className = ""
      // document.getElementById("luxury_tab").className = ""

      // highlight the selected tabe
      document.getElementById(TabName+"_tab").className = "select"
      // make the content of the selected tab visible
      document.getElementById(TabName+"_cont").style.display = "block"
}

function newWindow(url){
	window.open(url);
}

function getDetail(seq_id){
	var url = "detail.php?seq_id=" + seq_id;
	window.open(url, "Description", "top=200, left=300, width=400, height=450, toolbar=no, menubar=no, scrollbars=no");
}

function getProductList(line){
	//document.getElementById("prod_detail").innerHTML = "Gathering data please wait...";
	var url = "prodDetail.php?prod=" + line;
	http.open("GET", url, true);
	http.onreadystatechange = updateHttpResponse;
	http.send(null);

}



function updateHttpResponse() {
	if (http.readyState == 4) {
		var strResponseArray;
		strResponseArray = http.responseText;
		//alert (strResponseArray);
		document.getElementById("prod_info").innerHTML = strResponseArray;
	}
}


// Creating a XMLRequest Object.
function getHTTPObject() {
	var xmlhttp = false;
	// Added this to hopefully fix the IE issue with the request
	//---------------------
	if (window.XMLHttpRequest){
		xmlhttp = new XMLHttpRequest();
	}else if (window.ActiveXObject) {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}	
	//--------------------
	/*@cc_on @if (@_jscript_version >= 5)
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (E) {
		xmlhttp = false;
	}
	}
	@else xmlhttp = false;
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp = false;
		}
	}
	return xmlhttp;
}
var http = getHTTPObject();

