var isID = 0;
var isAll = 0;
var isLayers = 0;

// browser identification
if (document.getElementById){isID=1;}
if (document.layers){isLayers=1;}
if (document.all){isAll=1;}


////////////////////////////////////////////////////////////////////
// Menu object constructors and methods
////////////////////////////////////////////////////////////////////

function menuCollection(descStr){		// menuCollection object constructor

		this.description = descStr;		// description string, not currently used
		this.menuCount = 0;				// counter to aid iteration through menus
		this.addMenu = addMenuFunc;		// method linked to additional function

}

function menuObj(shortTextStr,textStr,menuHref){		// menu object constructor

		this.ref = shortTextStr;			// shorten version of text (without spaces) to be used as reference
		this.text = textStr;			// text shown at top of menu
		this.href = menuHref;			// href for text
		this.itemCount = 0;				// counter to aid iteration through menu items
		this.addItem = addMenuItemFunc;	// method linked to additional function

}

function menuItemObj(textStr,itemHref,isHr){	// menuItem object constructor

		this.text = textStr;			// text shown in menu
		this.href = itemHref;			// href for text
		this.hrFollows = isHr;			// whether menu item is followed by <hr> spacer
		this.subMenuExists = 0;			// does menu item have a submenu
		this.addSubMenu = addSubMenuFunc;	// method linked to additional function
		this.subRef = "";				// reference name for sub menu

}

function addMenuFunc(shortTextStr,textStr,menuHref){			// constructor method

		this.menuCount++;				// increase menuCount
		this["menu" + this.menuCount] = new menuObj(shortTextStr,textStr,menuHref);	// create menu object using menuCount to create iterative name

}

function addMenuItemFunc(textStr,itemHref,isHr){	// constructor method

		this.itemCount++;				// increase itemCount
		this["menuItem" + this.itemCount] = new menuItemObj(textStr,itemHref,isHr);	// create menuitem object using itemCount to create iterative name

}

function addSubMenuFunc(subRef){				// constructor method

		this.subMenuExists = 1;			// set that there is a sub menu for a particular menuItem
		this.subRef = subRef;
		this.subMenu = new menuObj("",""); // create menu object below a particular menuItem

}




////////////////////////////////////////////////////////////////////
// Functions to draw menus dynamically from configuration file
////////////////////////////////////////////////////////////////////

function drawMainMenu(){		// function iterates through menu Collection


	htmlStr = "";

	htmlStr += "<div id=\"menu\">\n";
	htmlStr += "<table cellspacing=\"0\" border=\"0\" cellpadding=\"2\">\n";
	htmlStr += "<tr>\n";
	htmlStr += "<td width=\"10\" align=\"center\">&nbsp;</td>\n";

		for (i=1; i <= topMenu.menuCount; i++){

			thisMenu = topMenu['menu' + i];

			if (!isLayers){

			htmlStr += "<td ";

			htmlStr += "onmouseover=\"showMenu('" + thisMenu.ref + "Menu','main')\" ";
			if (i==1) {
				htmlStr += "onmouseout=\"menuTimer()\"><a style=\"cursor:default;\"class=\"menuTitle\" href=http://www.rsi-uk.com  >" + thisMenu.text + "</a></td>\n";
			} else {
				htmlStr += "onmouseout=\"menuTimer()\"><span style=\"cursor:default;\"class=\"menuTitle\">" + thisMenu.text + "</span></td>\n";
				}

			//htmlStr += "<a class=\"menuTitle\" href=\"" + thisMenu.href + "\" "
			//htmlStr += "<a class=\"menuTitle\" href=\"\" "



			} else {

			htmlStr += "<td>";
			//htmlStr += "<a class=\"menuTitle\" href=\"" + thisMenu.href + "\" "
			htmlStr += "<a class=\"menuTitle\" href=\"\" ";
			htmlStr += "onmouseover=\"showMenu('" + thisMenu.ref + "Menu','main')\" ";
			htmlStr += "onmouseout=\"menuTimer()\">" + thisMenu.text + "</a></td>\n";

			}


			if (i < topMenu.menuCount){
				htmlStr += "<td width=\"30\" align=center>|</td>\n";
			}

		}

	//htmlStr += "<td width=\"25\" align=center>&nbsp;</td>\n"
	htmlStr += "</tr></table></div>";

	document.write (htmlStr);

}


function drawDropDowns(){		// function iterates through menu and then menu items

	var htmlStr = "";
	var subHtmlStr = "";

	for (i=1; i <= topMenu.menuCount; i++){

		thisMenu = topMenu['menu' + i];

		htmlStr += "\n<div id=\"" + thisMenu.ref + "Menu\">\n";
		htmlStr += "<table border=\"0\" bgcolor=\"#000000\" cellpadding=\"1\" cellspacing=\"0\"><tr><td>\n";
		htmlStr += "<table border=\"0\" bgcolor=\"#cecedc\" cellpadding=\"2\" cellspacing=\"0\">\n";


		for (j=1; j <= thisMenu.itemCount; j++){

			thisItem = thisMenu['menuItem' +j];

			htmlStr += "<tr>\n";

			if (!isLayers){

				if (thisItem.subMenuExists){
					htmlStr += "<td width=\"100\" onmouseout=\"menuOut();subTimer()";
				}
				else{
					htmlStr += "<td colspan=\"2\" width=\"110\" onmouseout=\"menuOut();";
				}


				htmlStr += "\" onmouseover=\"menuOver();";

				if (thisItem.subMenuExists){
					htmlStr += "showMenu('" + thisItem.subRef + "','sub')";
				}

				htmlStr += "\"><a class=\"menuItem\" href=\"" + thisItem.href + "\">&nbsp;";
				htmlStr += thisItem.text + "&nbsp;</a>";
				htmlStr += "</td>\n";

				if (thisItem.subMenuExists){
					htmlStr += "<td width=\"10\" align=\"right\"><img src=\"images/bullet-tri-menu.gif\"></td>";
				}



			} else {	// different version for Netscape 4 which doesn't support events in td
				htmlStr += "<td width=\"110\"><a class=\"menuItem\" href=\"" + thisItem.href + "\" onmouseout=\"menuOut();";

				if (thisItem.subMenuExists){
					htmlStr += "subTimer()";
				}

				htmlStr += "\" onmouseover=\"menuOver();";

				if (thisItem.subMenuExists){
					htmlStr += "showMenu('" + thisItem.subRef + "','sub')";
				}

				htmlStr += "\">&nbsp;";
				htmlStr += thisItem.text + "&nbsp;</a>";
				htmlStr += "</td>\n";
			}

			htmlStr += "</tr>\n";


			if(thisItem.subMenuExists){		// if menuItem has submenu call function and return code to temp string

				subHtmlStr += drawSubMenu(thisItem);

			}

			if (thisItem.hrFollows){		// add horizontal line in menu, if configured

				htmlStr += "<tr><td align=\"center\"><img src=\"/images/structure/borderline_bk.gif\" width=\"105\" height=\"1\" border=\"0\"></td></tr>";

			}

		}

		htmlStr += "</table>\n";
		htmlStr += "</td></tr></table>\n";
		htmlStr += "</table>\n";
		htmlStr += "</div>\n\n";
	}

	document.write(htmlStr);		// output the menu html
	document.write(subHtmlStr);	// output the submenu html

}

function drawSubMenu(menuItemObj){	// iterates through submenu items

	var tempStr = "";

	tempStr += "<div id=\"" + menuItemObj.subRef + "\">\n";
	tempStr += "<table border=\"0\" bgcolor=\"#000000\" cellpadding=\"1\" cellspacing=\"0\"><tr><td>\n";
	tempStr += "<table border=\"0\" bgcolor=\"#cecedc\" cellpadding=\"2\" cellspacing=\"0\">\n";

	subMenu = menuItemObj.subMenu;

	for (k=1; k <= subMenu.itemCount; k++){

		subItem = subMenu['menuItem' + k];

		tempStr += "<tr>\n";

		if (!isLayers){		// different version for Netscape 4 which doesn't support events in td

			tempStr += "<td  onmouseout=\"subOut()\" onmouseover=\"subOver()\">";
			tempStr += "<a class=\"menuItem\" href=\"" + subItem.href + "\">&nbsp;";
			tempStr += subItem.text + "&nbsp;</a>";
			if (subItem.hrFollows){
				tempStr += "<hr>";
			}
			tempStr += "</td>\n";

		} else {

			tempStr += "<td>";
			tempStr += "<a class=\"menuItem\" href=\"" + subItem.href + "\"";
			tempStr += " onmouseout=\"subOut()\" onmouseover=\"subOver()\">&nbsp;";
			tempStr += subItem.text + "&nbsp;</a>";
			if (subItem.hrFollows){
				tempStr += "<hr>";
			}
			tempStr += "</td>\n";

		}

		tempStr += "</tr>\n";

	}

	tempStr += "</table>\n";
	tempStr += "</td></tr></table>\n";
	tempStr += "</div>\n\n";

return tempStr;

}


function drawTopCorner(){	// draw the topCorner2 i.e. curve, picture and small menu

	document.write ("<div id=\"topCorner\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">");
	document.write ("<tr><td rowspan=\"2\">");
	document.write ("<img src=\"images/topcorner1.gif\" alt=\"\" width=\"116\" height=\"115\" border=\"0\">");
	document.write ("</td>");
	document.write ("<td>");
	document.write ("<img src=\"images/topcorner2.gif\" alt=\"\" width=\"64\" height=\"89\" border=\"0\">");
	document.write ("</td>");
	document.write ("<td>");
	document.write ("<img src=\"images/topcorner3.jpg\" alt=\"\" width=\"180\" height=\"89\" border=\"0\">");
	document.write ("</td>");
	document.write ("</tr>");

	document.write ("<tr>");
	document.write ("<td height=\"26\" colspan=\"2\" align=\"right\">");
	document.write ("<table cellpadding=\"3\" cellspacing=\"0\" border=\"0\"><tr>");

	if (lb == 1 || lb == 4){
		document.write ("<td><a href=\"javascript:showLogin();\">" + logoutName + "</a></td>");
		document.write ("<td>|</td>");
		document.write ("<td><a href=\"" + profileUrl + "\">" + profileName + "</a></td>");
	}
	else {
		document.write ("<td><a href=\"private/private.htm\">" + loginName + "</a></td>");
		//document.write ("<td>|</td>");
		//document.write ("<td><a href=\"" + registerUrl + "\">" + registerName + "</a></td>");
	}


	//document.write ("<td>|</td>");
	//document.write ("<td><a href=\"/contactus\">Contact Us</a></td>");
	//document.write ("<td>|</td>");
	//document.write ("<td><a href=\"/search\">Search</a></td>");
	document.write ("</table></td></tr>");
	document.write ("</tr>");
	document.write ("</table></div>");

}



function drawTopBar(hasBackground){		// master function to draw topbar, calling other functions to draw key parts


	document.write ("<div id=\"topBar\"><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">");
	document.write ("<tr>");
	document.write ("<td bgcolor=\"#133878\">");
	document.write ("<a href=\"http://www.rsi-uk.com\">");
	document.write ("<img src=\"images/RSILOGO.gif\" width=\"134\" height=\"50\" border=\"0\" alt=\"RSI Home Page\" vspace=\"15\" hspace=\"15\" >");
	document.write ("</a></td>");
	document.write ("<td rowspan=\"2\" width=\"360\" bgcolor=\"#133878\">");
			drawTopCorner();
	document.write ("</td></tr>");
	document.write ("<tr>");

		if (isAll || isLayers){
			document.write ("<td bgcolor=\"#314c8e\" height=\"24\">");
		} else {
			document.write ("<td bgcolor=\"#314c8e\" height=\"26\">");
		}

		drawMainMenu();
	document.write ("</td></tr>");
	document.write ("<tr><td bgcolor=\"#9999cc\" colspan=\"2\">");
	document.write ("<img src=\"/images/structure/transparent.gif\" alt=\"\" width=\"1\" height=\"2\" border=\"0\">");
	document.write ("</td>");
	document.write ("</tr>");
	document.write ("</table>");

	document.write ("</div>");


		drawDropDowns();
		//drawRegion();

		if (hasBackground){
			drawBackgroundLine();
		}

		switch (lb) {
			case 1:
				drawLogin("logout","");
				break;
			case 2:
				drawLogin("login","none");
				break;
			case 3:
				drawLogin("login","many");
				break;
			case 4:
				drawLogin("logout","");
				break;
			default:
				drawLogin("login","");
				break;
		}


		if (lb == 2 || lb == 3){
			setVisibility('loginBox','visible');
		}

		var queryString = location.search.substring(1);		// QueryString section of URL
		if (queryString.indexOf('prt=1') != -1){			// if print window then
			printStyle();									// call printStyle function
		}
}


function drawBackgroundLine(){

	document.write("<style type=\"text/css\">");
	document.write("body {background-image: url(/images/structure/background2.gif);}");
	document.write("#main {width:775px;margin: 10px;");
	document.write("</style>");

}

function footer(){

		if (window.name != "printWindow"){
			document.write("<div id=\"footer\"><table width=\"95%\" align=\"center\" style=\"clear:both;\">");
			document.write("<tr><td>");
			document.write("<p align=\"center\">");
			document.write("<br>");
			document.write("<img src=\"/images/structure/borderline.gif\" width=\"750\" height=\"2\" border=\"0\">");
			document.write("</p>");
			document.write("</td></tr>");
				var today = new Date();
			document.write("<tr>");
			document.write("<td colspan=\"3\" align=center>");
			document.write("<span class=\"smallText\">Copyright &copy; " + today.getFullYear() + " Radio Systems Information Ltd. All rights reserved.</span> ");
			document.write("</td>");
			document.write("</tr>");
			document.write("</table></div>");
		} else
		{
			document.write("<hr><p align=\"center\" class=\"normalTitle\">Contact: <a href=\"mailto:sales&#64rsi-uk.com\">sales&#64rsi-uk.com</a></p><br/>");
		}

}

////////////////////////////////////////////////////////////////////
// Functions to control dynamic menus
////////////////////////////////////////////////////////////////////


var menuActive = 0;
var subActive = 0;
var onMenu;
var onSub;
var timeOn = null;
var timeSub = null;



// SHOW MENU
function showMenu(menuName,menuType){

	// Reset menu timeouts
	if (menuType=="sub"){
		if (timeSub != null) {
			clearTimeout(timeSub);
			hideSub(onSub);
		}

	}
	else{
		if (timeOn != null) {
			clearTimeout(timeOn);
			hideMenu(onMenu);
		}
	}

	// Change menu style to visible
	setVisibility(menuName,'visible');

	// Change current menu string
	if (menuType=="sub"){
		onSub = menuName;
	} else {
		onMenu = menuName;
	}
}


// TIMER FOR BUTTON MOUSE OUT
function menuTimer() {
 timeOn = setTimeout("btnOut()",600);
}

// BUTTON MOUSE OUT
function btnOut() {
	if (menuActive == 0) {
		hideMenu(onMenu);
	}
}

// SET MENU VISIBILITY STATE
function setVisibility(menuName,state){

	if (isID){
		document.getElementById(menuName).style.visibility = state;
	}
	else if (isLayers){
		document.layers[menuName].visibility = state;
	}
	else {
		document.all[menuName].style.visibility = state;
	}
}


 // HIDE MENU
function hideMenu(menuName){
 	if (menuActive == 0) {
		setVisibility(menuName,'hidden');
		if (onSub){
			hideSub(onSub);
		}
 	}
}


// HIDE SUB MENU
function hideSub(menuName){
 	if (subActive == 0) {
		setVisibility(menuName,'hidden');
 	}
}


// MENU MOUSE OVER
function menuOver() {
		if (timeSub != null) {
			clearTimeout(timeSub);
			hideSub(onSub);
		}
		clearTimeout(timeOn);
		menuActive = 1;
}

// SUB MOUSE OVER
function subOver() {
		subActive = 1;
		clearTimeout(timeSub);
		clearTimeout(timeOn);
		menuActive = 0;
}

// MENU MOUSE OUT
function menuOut() {
		menuActive = 0;
		timeOn = setTimeout("hideMenu(onMenu)", 600);
}

// SUB MOUSE OUT
function subOut() {
		subActive = 0;
		timeSub = setTimeout("hideSub(onSub)", 400);
		timeOn = setTimeout("hideMenu(onMenu)", 400);
}

// TIMER FOR SUB MENU OUT
function subTimer(){
	timeSub = setTimeout("menuItemOut()",400);
}


// MENU ITEM OUT
function menuItemOut(){
	if (subActive == 0) {
		hideSub(onSub);
	}
}

// returns dom.style object
function domStyle(objName){

	if (isID){
		return document.getElementById(objName).style;
	}
	else if (isLayers){
		return document.layers[objName];
	}
	else {
		return document.all[objName].style;
	}

}

// Shows or hides login box
function showLogin(){
	dom = domStyle('loginBox');


	if (dom.visibility == 'hidden' || dom.visibility == 'hide' || dom.visibility == ''){

		setVisibility('loginBox','visible');
		if (!isLayers && lb != 1){
				document.loginForm.email.focus();
		}

	} else {

		setVisibility('loginBox','hidden');

		if (isID && navigator.appName.indexOf('Microsoft') != -1){	// IE5+ doesn't return focus to window
			window.blur();
			window.focus();
		}

	}

}


// Draws hidden login box for login/logout and for error messages
function drawLogin(contentType,errorType) {

	document.write ("<div id=\"loginBox\">");
	document.write ("<form action=\"/config/login.asp\" method=\"post\" name=\"loginForm\">");
	document.write ("<table width=\"100%\" align=\"right\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >");
	document.write ("<tr><td>&nbsp;</td>");
	document.write ("<td width=\"235\">");
	document.write ("<table width=\"235\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\" bgcolor=\"#000000\">");
	document.write ("<tr><td>");
	document.write ("<table bgcolor=\"#cecedc\" width=\"235\" cellspacing=\"0\" border=\"0\" cellpadding=\"10\">");
	document.write ("<tr><td>");
	document.write ("<table width=\"235\" cellspacing=\"0\" cellpadding=\"3\">");


	if (contentType == "login") {

		if (errorType == "none"){

			document.write ("<tr><td colspan=\"2\" align=\"center\">");
			document.write ("Invalid e-mail or password.<br /> Please try again");
			document.write ("</td></tr>");

		}else if (errorType == "many"){

			document.write ("<tr><td colspan=\"2\" align=\"center\">");
			document.write ("There has been a problem with your details. Please re-enter your details and try again.");
			document.write ("<br />If this problem persists please contact web&#64rsi-uk.com");
			document.write ("</td></tr>");

		}

		document.write ("<tr><td>E-mail:</td>");
		document.write ("<td><input type=\"Text\" name=\"email\" size=\"20\" maxlength=\"50\">");
		document.write ("</td></tr>");
		document.write ("<tr><td>Password:</td>");
		document.write ("<td><input type=\"Password\" name=\"password\" size=\"20\" maxlength=\"20\">");
		document.write ("</td></tr>");
		document.write ("<tr><td colspan=\"2\" align=\"center\">");
		document.write ("<input type=\"Submit\" value=\"Login\"> &nbsp;");
		document.write ("<input type=\"Button\" value=\"Cancel\" onmouseup=\"showLogin();\" >");
		document.write ("</td></tr>");
		document.write ("<tr><td colspan=\"2\" align=\"center\">");
		document.write ("<span class=\"smallText\"><a href=\"/user/resend.asp\">Forgotten password?</a></span>");
		document.write ("</td></tr>");

	}
	else if (contentType == "logout") {

		document.write ("<tr><td align=\"center\">Please confirm that you wish to logout.</td></tr>");
		document.write ("<tr><td align=\"center\">");
		document.write ("<input type=\"Hidden\" name=\"email\" value=\"logout\">");
		document.write ("<input type=\"Submit\" value=\"Logout\"> &nbsp;");
		document.write ("<input type=\"Button\" value=\"Cancel\" onmouseup=\"showLogin();\" >");
		document.write ("</td></tr>");
	}


	document.write ("</table>");
	document.write ("</td></tr></table>");
	document.write ("</td></tr></table>");
	document.write ("</td><td width=\"10\">&nbsp;</td></tr>");
	document.write ("</table>");
	document.write ("</form>");
	document.write ("</div>	");


}


function drawRegion(){
	document.write("<div id=\"region\">");
	document.write("<table width=\"300\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\">");
	document.write("<tr><td bgcolor=\"#000080\">Region</td></tr></table>");
	document.write("</div>");
}


function sideBarTitle(theText){

	document.write ("<table cellpadding=\"10\" cellspacing=\"0\" border=\"0\" width=\"200\">");
	document.write ("<tr><th colspan=\"3\">");
	document.write (theText);
	document.write ("</th></tr>");
	document.write ("</table>");

}

function regionSideBar(){

	document.write ("<table cellpadding=\"10\" cellspacing=\"0\" border=\"0\" width=\"200\">");
	document.write ("<tr><th colspan=\"3\">");
	document.write ("Region/Language");
	document.write ("</th></tr>");
	document.write ("</table>");
	sideBarContentStart();
	document.write ("North America/English");
	sideBarContentFinish();
}


function sideBarContentStart(){

	document.write ("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"200\">");
	document.write ("<tr>");
	document.write ("<td width=\"2\" bgcolor=\"#dee9f5\"><img src=\"/images/structure/transparent.gif\" width=\"2\" height=\"1\" border=\"0\"></td>");
	document.write ("<td>");
	document.write ("<table cellpadding=\"10\" cellspacing=\"0\" border=\"0\">");
	document.write ("<tr><td>");

}


function sideBarContentFinish(){

	document.write ("</td></tr></table>");
	document.write ("</td>");
	document.write ("<td width=\"2\" bgcolor=\"#dee9f5\"><img src=\"/images/structure/transparent.gif\" width=\"2\" height=\"1\" border=\"0\"></td>");
	document.write ("</tr>");
	document.write ("<tr>");
	document.write ("<td colspan=\"3\" bgcolor=\"#dee9f5\"><img src=\"/images/structure/transparent.gif\" width=\"2\" height=\"2\" border=\"0\"></td>");
	document.write ("</tr></table>");

}

function printStyle(){

	document.write ("<style type=\"text/css\">");
	document.write ("body {background-image:none;}");
	document.write ("#sideBar {display:none;}");
	document.write ("#topCorner {display:none;}");
	document.write ("#topBar {display:none;}");
	document.write ("#menu {display:none;}");
	//document.write ("#footer {display:none;}");
	document.write ("#main {width:100%;}");
	document.write ("</style>");

}

function printWin(){
	var printWindow;
	var pageUrl = window.location.href;

	if (pageUrl.indexOf("?") == -1){
		pageUrl = pageUrl + "?prt=1";
	}
	else {
		pageUrl = pageUrl + "&prt=1";
	}

		 printWindow =  window.open(pageUrl,"printWindow","resizable,width=795,height=500,top=100,left=100,scrollbars,toolbar,menubar");
		printWindow.focus();

}

function printOption(){

	if (window.name != "printWindow"){
		document.write("<a href=\"javascript:printWin();\"><img src=\"/images/icons/print_16.gif\" alt=\"Printer Friendly Version\" width=\"16\" height=\"16\" border=\"0\" align=\"absmiddle\"> <span class=\"smallText\">Printer Friendly Version</span></a>");
	}
	else {

	document.write("<img src=\"/images/structure/print_logo.gif\" alt=\"RSI\" width=\"300\" height=\"68\" border=\"0\"><hr>");

	}

}

function customerList(){
	var customerWin;
	customerWin =  window.open("/products/infoworks/customers.html","printWindow","resizable,width=250,height=180,top=200,left=200");
	customerWin.focus();
}



function drawRegionBar(){

	document.write("<tr><td><table cellpadding=\"1\" cellspacing=\"0\"><tr><td bgcolor=\"#133878\">");
	document.write("<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\"><tr><td bgcolor=\"#cecedc\" valign=\"top\">");
	document.write("&nbsp; <a href=\"\" class=\"menuItem\">Region: North America (English)</a> &nbsp;");
	document.write("</td><td bgcolor=\"cecedc\"><img src=\"/images/structure/small_down_arrow.gif\"  border=\"0\">");
	document.write("</td></tr></table>");
	document.write("</td></tr></table></td></tr>");

}


function screenshot(imageRef){
	var customerWin;
	screenWin =  window.open("/images/products2/"+imageRef,"screen_shot","resizable,width=625,height=475,top=100,left=100");
	screenWin.focus();
}

function pp(imageRef){
	var popWin;
	popWin =  window.open("/products/enlarge.asp?ref="+imageRef,"screen_shot","scrollbars=no,resizable,width=625,height=525,top=100,left=100");
	popWin.focus();
}


function imgBox(imageRef){

	refArray = imageRef.split(",");

	document.write ("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"80%\"><tr><td align=\"center\">");

	document.write ("<div align=\"center\" class=\"imgBox\">");
	document.write ("<a href=\"javascript:pp('" + refArray[0] + "')\"><img src=\"/images/products/thumbs/" + refArray[0] + ".jpg\" border=\"0\" alt=\"Enlarge\"></a> ");
	document.write ("<span class=\"smallText\"><a href=\"javascript:pp('" + refArray[0] + "')\">Enlarge</a></span> ");
	document.write ("<a href=\"javascript:pp('" + refArray[0] + "')\"><img src=\"/images/icons/magnify.gif\" alt=\"Enlarge\" align=\"middle\" border=\"0\"></a>");
	document.write ("</div>");

	// handle a possible second image at this point
	if (refArray.length > 1){

		document.write ("</td><td>");
		document.write ("<div align=\"center\" class=\"imgBox\">");
		document.write ("<a href=\"javascript:pp('" + refArray[1] + "')\"><img src=\"/images/products/thumbs/" + refArray[1] + ".jpg\" border=\"0\" alt=\"Enlarge\"></a> ");
		document.write ("<span class=\"smallText\"><a href=\"javascript:pp('" + refArray[1] + "')\">Enlarge</a></span> ");
		document.write ("<a href=\"javascript:pp('" + refArray[1] + "')\"><img src=\"/images/icons/magnify.gif\" alt=\"Enlarge\" align=\"middle\" border=\"0\"></a>");
		document.write ("</div>");

	}

	document.write ("</td></tr></table>");

}







