var contentArray = new Array(3);
var theCompany, theProduct, theTech, theContact;
var last = 0;
function changeItem(id)
{
	document.getElementById("contentArea").innerHTML = contentArray[id];
}
function setCompany()
{
	this.contentArr = new Array(3);
	this.contentArr[0] = new Array("logo.gif", "Intro", "Glory Charter Development Limited", "Glory Charter Development Limited is one of the world leading consumer-focused electronics manufacturers. Our factory is located in Shenzhen, China. We are a specialist in manufacturing of compressor and thermoelectric cooling units in Commercial and Domestic field. Moreover, our products represent the highest quality standard. If you are looking for manufacturer for your product, please kindly to give us a call.");
	this.contentArr[1] = new Array("", "Office", "Hong Kong Office", "Address: Room 10, 6/F, Wing Hing Industrial Building, 83-93 Chai Wan Kok Street, Tsuen Wan, Hong Kong", "Tel: (852)2492 0019, (852)2492 0037, (852)2498 0087", "Fax: (852)2498 1808, (852)2414 1369");
	this.contentArr[2] = new Array("factory.gif", "Factory", "Mainland Factory", "Address: The 2nd Ind. Area, Lisonglang, Gongming Town, Baoan District, Shenzhen, China");
}
function getCompany()
{
	theCompany = new setCompany();

	var theContent = "";
	theContent += "<table cellspacing='0' cellpadding='0' height='343' width='100%' background='img/com.gif'>";
	theContent += "<tr height='120'>";
	theContent += "<td></td>";
	theContent += "</tr>";
	theContent += "<tr>";
	theContent += "<td>";
	theContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
	for (var i=0; i<theCompany.contentArr.length; i++)
	{
		theContent += "<font class='menu' color='#6699FF' onClick='javascript:changeCompany(" + i + ");'><b>" + theCompany.contentArr[i][1] + "</b></font>";
		if (i != theCompany.contentArr.length-1)
		{
			theContent += "&nbsp;|&nbsp;";
		}
	}
	theContent += "";
	theContent += "</td>";
	theContent += "</tr>";

	theContent += "<tr>";
	theContent += "<td valign='top' align='center'>";

	theContent += "<div id='theCom'>";
	theContent += loadCompany(theCompany, 0);
	theContent += "</div>";

	theContent += "</td>";
	theContent += "</tr>";
	theContent += "</table>";
	return theContent;
}
function loadCompany(theCompany, i)
{
	var theContent = "";
	theContent += "<table border='0' cellspacing='0' cellpadding='0' width='90%'>";
	theContent += "<tr>";

	var theW = "1";
	var theImg = "";
	if (theCompany.contentArr[i][0] != "")
	{
		theW = "200";
		theImg += "<img src='img/" + theCompany.contentArr[i][0] + "' border='0'/>";
	}
	theContent += "<td align='center' width='" + theW + "'>";
	theContent += theImg;
	theContent += "</td>";
	theContent += "<td>";

	theContent += "<table border='0' cellspacing='0' cellpadding='0' width='90%'>";
	theContent += "<tr>";
	theContent += "<td valign='top'><b>" + theCompany.contentArr[i][2] + "</b></td>";
	theContent += "</tr>";
	theContent += "<tr>";
	theContent += "<td valign='top' height='20'></td>";
	theContent += "</tr>";
	for (var j=3; j<theCompany.contentArr[i].length; j++)
	{
		theContent += "<tr>";
		theContent += "<td valign='top'>" + theCompany.contentArr[i][j] + "</td>";
		theContent += "</tr>";
	}
	theContent += "</table>";

	theContent += "</td>";
	theContent += "</tr>";
	theContent += "</table>";
	return theContent;
}
function changeCompany(i)
{
	document.getElementById("theCom").innerHTML = loadCompany(theCompany, i);
}
function setProduct()
{	
}
function getProduct()
{
	theComm = new setComm();
	var theContent = "";
	theContent += "<table cellspacing='0' cellpadding='0'>";
	theContent += "<tr height='30'>";
	theContent += "<td></td>";
	theContent += "</tr>";

	theContent += "<tr>";
	theContent += "<td>";

	theContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
	for (var i=0; i<theComm.contentArr.length; i++)
	{
		theContent += "<font class='menu' color='#6699FF' onClick='javascript:changeComm(" + i + ");'><b>" + theComm.contentArr[i][0] + "</b></font>";
		if (i != theComm.contentArr.length-1)
		{
			theContent += "&nbsp;|&nbsp;";
		}
	}
	theContent += "";
	theContent += "</td>";
	theContent += "</tr>";

	theContent += "<tr>";
	theContent += "<td valign='top' align='center'>";

	theContent += "<br/>";
	theContent += "<div id='theComm'>";
	theContent += loadComm(theComm, 0);
	theContent += "</div>";

	theContent += "</td>";
	theContent += "</tr>";
	theContent += "</table>";
	return theContent;	
}


function setComm()
{
	this.contentArr = new Array(5);
	this.contentArr[0] = new Array(" All ","<center><img src=\"img/p1.jpg\"></center>");
	this.contentArr[1] = new Array(" Upright Cooler/Freezer ", "<u>Upright Cooler / Freezer</u>","<center><img src=\"img/p2.jpg\"></center>");
	this.contentArr[2] = new Array(" Countertop Cooler/Freezer ","<u>Countertop Cooler / Freezer</u>","<center><img src=\"img/p3.jpg\"></center>");
	this.contentArr[3] = new Array(" Chest Freezer / Can Cooler ", "<u>Chest Freezer / Can Cooler</u>","<center><img src=\"img/p4.jpg\"></center>");
	
	this.contentArr[4] = new Array(" &nbsp&nbsp&nbsp&nbsp&nbsp&nbspStainless Steel ", "<u>Stainless Steel Series</u>","<center><img src=\"img/p5.jpg\"></center>");
	this.contentArr[5] = new Array(" Specifications ", "<u>Specifications</u>","<center><img src=\"img/p6.jpg\"></center>");
}

function getComm()
{
	theComm = new setComm();
	var theContent = "";
	theContent += "<table cellspacing='0' cellpadding='0' height='343' width='100%' background='img/tech.gif'>";
	theContent += "<tr height='120'>";
	theContent += "<td></td>";
	theContent += "</tr>";

	theContent += "<tr>";
	theContent += "<td>";

	theContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
	for (var i=0; i<theComm.contentArr.length; i++)
	{
		theContent += "<font class='menu' color='#6699FF' onClick='javascript:changeTech(" + i + ");'><b>" + theComm.contentArr[i][0] + "</b></font>";
		if (i != theComm.contentArr.length-1)
		{
			theContent += "&nbsp;|&nbsp;";
		}
	}
	theContent += "";
	theContent += "</td>";
	theContent += "</tr>";

	theContent += "<tr>";
	theContent += "<td valign='top' align='center'>";

	theContent += "<br/>";
	theContent += "<div id='theComm'>";
	theContent += loadComm(theComm, 0);
	theContent += "</div>";

	theContent += "</td>";
	theContent += "</tr>";
	theContent += "</table>";
	return theContent;
}
function loadComm(theComm, i)
{
	var theContent = "";
	theContent += "<table border='0' cellspacing='0' cellpadding='0' width='90%'>";
	theContent += "<tr>";
	theContent += "<td>";

	theContent += "<table border='0' cellspacing='0' cellpadding='0' width='90%'>";
	theContent += "<tr>";
	theContent += "<td valign='top'><b>" + theComm.contentArr[i][1] + "</b></td>";
	theContent += "</tr>";
	theContent += "<tr>";
	theContent += "<td valign='top' height='20'></td>";
	theContent += "</tr>";
	for (var j=2; j<theComm.contentArr[i].length; j++)
	{
		theContent += "<tr>";
		theContent += "<td valign='top'>" + theComm.contentArr[i][j] + "<br/><br/></td>";
		theContent += "</tr>";
	}
	theContent += "</table>";

	theContent += "</td>";
	theContent += "</tr>";
	theContent += "</table>";
	return theContent;
}
function changeComm(i)
{
	document.getElementById("theComm").innerHTML = loadComm(theComm, i);
}



function setTech()
{
	this.contentArr = new Array(3);
	this.contentArr[0] = new Array("Understanding TEC", "Understanding Thermoelectric Cooling", "Thermoelectric coolers (TECs), also known as Peltier coolers, are solid-state heat pumps that utilize the Peltier effect to move heat.", "Passing a current though a TEC transfers heat from one side to the other, typically producing a heat differential of around 40¢XC-or as much as 70¢XC in high-end devices-that can be used to transfer heat from one place to another.", "<center><img src=\"img/tech01.gif\"></center>");

	this.contentArr[1] = new Array("The Peltier Effect", "The Peltier Effect", "The principle of thermoelectric cooling dates back to the discovery of the Peltier Effect by Jean Peltier in 1834.", "All electric current is accompanied by heat current (Joule heating). What Peltier observed was that when electric current passed across the junction of two dissimilar conductors (a \"thermocouple\") there was a heating effect that could not be explained by Joule heating alone. In fact, depending on the direction of the current, the overall effect could be either heating or cooling. This effect can be harnessed to transfer heat, creating a heater or a cooler.", "Peltier himself did not appreciate the potential of his discovery, and it was not efficiently exploited until the end of the 20th century.", "<u><b>How it Works</b></u>", "When two conductors are placed in electric contact, electrons flow out of the one in which the electrons are less bound, into the one where the electrons are more bound.", "The reason for this is a difference in the so-called Fermi level between the two conductors. The Fermi level represents the demarcation in energy within the conduction band of a metal, between the energy levels occupied by electrons and those that are unoccupied.", "When two conductors with different Fermi levels make contact, electrons flow from the conductor with the higher level, until the change in electrostatic potential brings the two Fermi levels to the same value. (This electrostatic potential is called the contact potential.)", "Current passing across the junction results in either a forward or reverse bias, resulting in a temperature gradient.", "If the temperature of the hotter junction (heat sink) is kept low by removing the generated heat, the temperature of the cold plate can be cooled by tens of degrees.", "<u><b>TEC Construction</b></u>", "TECs are constructed using two dissimilar semi-conductors, one n-type and the other p-type (they must be different because they need to have different electron densities in order for the effect to work). The two semiconductors are positioned thermally in parallel and joined at one end by a conducting cooling plate (typically of copper or aluminium).", "A voltage is applied to the free ends of two different conducting materials, resulting in a flow of electricity through the two semiconductors in series. The flow of DC current across the junction of the two semi-conductors creates a temperature difference. As a result of the temperature difference, Peltier cooling causes heat to be absorbed from the vicinity of the cooling plate, and to move to the other (heat sink) end of the device-see diagram.", "<center><img src=\"img/tech02.gif\"></center>", "The heat is carried through the cooler by electron transport and released on the opposite (\"hot\") side as the electrons move from a high to low energy state.", "When the two materials are connected to each other by an electrical conductor, a new equilibrium of free electrons is established. Potential migration creates an electrical field across each of the connections.", "When current is subsequently forced through the unit, the attempt to maintain the new equilibrium causes the electrons at one connection to absorb energy, while those at the other connection release energy.", "In practice many TEC pairs (or couples), such as described above, are connected side-by-side, and sandwiched between two ceramic plates, in a single TEC unit.", "<center><img src=\"img/tech03.gif\"></center>", "The heat pumping capacity of a cooler is proportional to the current and the number of pairs in the unit.");

	this.contentArr[2] = new Array("Benefits of TEC", "Benefits of TEC", "While refrigerators and air conditioners utilize compressors, condensers, and liquid refrigerants to lower temperature; solid-state cooling utilizes DC power, heat sinks, and semiconductors. This fundamental difference gives solid-state thermoelectric coolers the following advantages over compressors:", "<ul><li>No moving parts. Therefore they require little or no maintenance. Ideal for cooling parts that may be sensitive to mechanical vibration.</li><li>No refrigerants, such as potentially harmful CFCs. Therefore environmental and safety benefits.</li><li>Enables reduced, low-noise operation of cooling fans, while providing greater cooling power.</li><li>Suitable for manufacture in very small sizes. Therefore ideal for microelectronics.</li><li>Lightweight.</li><li>Long life. Exceeds 100,000 hrs MTBF (Mean Time Between Failures).</li><li>Controllable (by voltage / current).</li><li>Small size.</li><li>Fast, dynamic response.</li><li>Enhanced ration between heat sink and target element.</li><li>Can provide cooling below ambient temperature.</li></ul>");
}
function getTech()
{
	theTech = new setTech();
	var theContent = "";
	theContent += "<table cellspacing='0' cellpadding='0' height='343' width='100%' background='img/tech.gif'>";
	theContent += "<tr height='120'>";
	theContent += "<td></td>";
	theContent += "</tr>";

	theContent += "<tr>";
	theContent += "<td>";

	theContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
	for (var i=0; i<theTech.contentArr.length; i++)
	{
		theContent += "<font class='menu' color='#6699FF' onClick='javascript:changeTech(" + i + ");'><b>" + theTech.contentArr[i][0] + "</b></font>";
		if (i != theTech.contentArr.length-1)
		{
			theContent += "&nbsp;|&nbsp;";
		}
	}
	theContent += "";
	theContent += "</td>";
	theContent += "</tr>";

	theContent += "<tr>";
	theContent += "<td valign='top' align='center'>";

	theContent += "<br/>";
	theContent += "<div id='theTech'>";
	theContent += loadTech(theTech, 0);
	theContent += "</div>";

	theContent += "</td>";
	theContent += "</tr>";
	theContent += "</table>";
	return theContent;
}
function loadTech(theTech, i)
{
	var theContent = "";
	theContent += "<table border='0' cellspacing='0' cellpadding='0' width='90%'>";
	theContent += "<tr>";
	theContent += "<td>";

	theContent += "<table border='0' cellspacing='0' cellpadding='0' width='90%'>";
	theContent += "<tr>";
	theContent += "<td valign='top'><b>" + theTech.contentArr[i][1] + "</b></td>";
	theContent += "</tr>";
	theContent += "<tr>";
	theContent += "<td valign='top' height='20'></td>";
	theContent += "</tr>";
	for (var j=2; j<theTech.contentArr[i].length; j++)
	{
		theContent += "<tr>";
		theContent += "<td valign='top'>" + theTech.contentArr[i][j] + "<br/><br/></td>";
		theContent += "</tr>";
	}
	theContent += "</table>";

	theContent += "</td>";
	theContent += "</tr>";
	theContent += "</table>";
	return theContent;
}
function changeTech(i)
{
	document.getElementById("theTech").innerHTML = loadTech(theTech, i);
}
function setContact()
{
	this.contentArr = new Array(6);
	this.contentArr[0] = new Array("Office", "", "Room 10, 6/F, Wing Hing Industrial Building, 83-93 Chai Wan Kok Street, Tsuen Wan, Hong Kong", "");
	this.contentArr[1] = new Array("Factory", "", "The 2nd Ind. Area, Lisonglang, Gongming Town, Baoan District, Shenzhen, China", "");
	this.contentArr[2] = new Array("Sale Hotline", "", "(852)2492 0019, (852)2492 0037, (852)2498 0087", "");
	this.contentArr[3] = new Array("Fax", "", "(852)2498 1808, (852)2414 1369", "");
	this.contentArr[4] = new Array("Email", "<a href='mailto:sales@glory-group.com.hk'>", "sales@glory-group.com.hk", "</a>");
	this.contentArr[5] = new Array("Url", "", "http://www.glory-group.com.hk", "");
}
function getContact()
{
	theContact = new setContact();
	var theContent = "";
	theContent += "<table cellspacing='0' cellpadding='0' height='343' width='100%' background='img/contact.gif'>";
	theContent += "<tr height='100'>";
	theContent += "<td></td>";
	theContent += "</tr>";

	theContent += "<tr>";
	theContent += "<td>";

	theContent += "<table cellspacing='0' cellpadding='0' width='90%'>";
	for (var i=0; i<theContact.contentArr.length; i++)
	{
		theContent += "<tr>";
		theContent += "<th align='right' valign='top' width='150'>" + theContact.contentArr[i][0] + ":</th>";
		theContent += "<td width='20'/>";
		theContent += "<td>" + theContact.contentArr[i][1] + theContact.contentArr[i][2] + theContact.contentArr[i][3] + "</td>";
		theContent += "</tr>";
	}
	theContent += "</table>";

	theContent += "</td>";
	theContent += "</tr>";
	theContent += "</table>";
	return theContent;
}
function loadHeader()
{
	var theContent = "";
	theContent += "<font class='menu' onmouseover='javascript:this.color=\"#FFCC00\"' onmouseout='javascript:this.color=\"#FFFFFF\"' onClick='javascript:changeItem(0);'>COMPANY</font>&nbsp;|&nbsp;";
	theContent += "<font class='menu' onmouseover='javascript:this.color=\"#FFCC00\"' onmouseout='javascript:this.color=\"#FFFFFF\"' onClick='javascript:changeItem(1);'>PRODUCTS</font>&nbsp;|&nbsp;";
	theContent += "<font class='menu' onmouseover='javascript:this.color=\"#FFCC00\"' onmouseout='javascript:this.color=\"#FFFFFF\"' onClick='javascript:changeItem(2);'>TECHNOLOGY</font>&nbsp;|&nbsp;";
	theContent += "<font class='menu' onmouseover='javascript:this.color=\"#FFCC00\"' onmouseout='javascript:this.color=\"#FFFFFF\"' onClick='javascript:changeItem(3);'>CONTACT</font>&nbsp;&nbsp;";
	document.write(theContent);
}
function loadContent()
{
	var theContent = "";
	contentArray[0] = getCompany();
	contentArray[1] = getProduct();
	contentArray[2] = getTech();
	contentArray[3] = getContact();

	theContent += "<div id='contentArea'>";
	theContent += contentArray[1];
	theContent += "</div>";

	document.write(theContent);
}
function loadEnlargeImg(theImg)
{
	var theContent = "";
	theContent += "<br/><img src='img/" + theImg + "_Big.gif' border='0'/><br/><br/>";
	document.write(theContent);
}
function popUpEnlarge(imgFile)
{
	window.open("enlarge.htm?img=" + imgFile, "Enlarge", "width=800, height=600, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
}
