<br />
<b>Warning</b>:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'metroframe_com'@'192.168.252.221' (using password: YES) in <b>/nfs/home/m/metroframe.com/public_html/include/db_conn.inc.php</b> on line <b>9</b><br />
<br />
<b>Warning</b>:  mysql_select_db(): supplied argument is not a valid MySQL-Link resource in <b>/nfs/home/m/metroframe.com/public_html/include/db_conn.inc.php</b> on line <b>12</b><br />

// global defs

<br />
<b>Warning</b>:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>11</b><br />
<br />
<b>Warning</b>:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>11</b><br />
gRadiusPPF =  ;
<br />
<b>Warning</b>:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>11</b><br />
<br />
<b>Warning</b>:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>11</b><br />
gBlackIntPPF = ;
// defalult drill from back as false except for these three profiles
<br />
<b>Warning</b>:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>11</b><br />
<br />
<b>Warning</b>:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>11</b><br />
gBlackIntBPPF =   ;
<br />
<b>Warning</b>:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>11</b><br />
<br />
<b>Warning</b>:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>11</b><br />
gDrillPPF =  ;

<br />
<b>Warning</b>:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>11</b><br />
<br />
<b>Warning</b>:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>11</b><br />
JOINprc =  ;
<br />
<b>Warning</b>:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>11</b><br />
<br />
<b>Warning</b>:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>11</b><br />
WEDGEprc =  ;
<br />
<b>Warning</b>:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>11</b><br />
<br />
<b>Warning</b>:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>11</b><br />
SPLINESprc =  ;



	Profile[myFrame.pnum] = new ProfileOb();

<br />
<b>Warning</b>:  mysql_query(): supplied argument is not a valid MySQL-Link resource in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>146</b><br />

/*	ERROR! 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)	*/
	
	with (Profile[myFrame.pnum]) {
		i = 0 ;
	<br />
<b>Notice</b>:  Undefined variable:  rows in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>213</b><br />
		// end php loop ----------
		//pop.length = woodcode.length = options.length = price.length = cutprice.length = i ;
		woodcode.length = i;
	
	
		fin = new Array();
		
		{
		//i = 0 ;
			// end php loop1 ----------
	
		fin.length = i ;
		}
	}

function CheckThis(num) {
	if (num == '') {
		selectLeftTab('Profile');
		makeRequest('ThisProfileTab.php?Number='+num, 'Left');
		return false;
	} else {
		switchProfile(num);
		return false;
	}
}

// Spacers Stuff

<br />
<b>Warning</b>:  mysql_query(): supplied argument is not a valid MySQL-Link resource in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>281</b><br />
n/* ERROR! 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)	*/

Spacer = new Array();
	{
	i = 0 ;
<br />
<b>Notice</b>:  Undefined variable:  code in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>323</b><br />
		// end php loop
		Spacer.length = i;
	}


// Strainers Stuff

gLenPrice = 1.62;
gCutPrice = 2.03;

gDrillFromSidePrice = 7;
gDrillFromBackPrice = 7;
gDrillFromSideWInsPrice = 25;

gJoinStrainer = 8;
gWedgeStrainer = 3;

StrainCut = new StrainOb();
if (myFrame.isUltraThin()) {
	StrainCut.drill = new buildArray("No Drilling", "From Side", "From Side w/Insert");
	StrainCut.img = new buildArray("strainer.gif", "strainer.side.gif", "strainer.insert.gif");
} else {
	StrainCut.drill = new buildArray("No Drilling", "From Side", "From Side w/Insert", "From Behind");
	StrainCut.img = new buildArray("strainer.gif", "strainer.side.gif", "strainer.insert.gif", "strain.behind.gif");
}

StrainUnCut = new StrainOb();
StrainUnCut.drill = new buildArray("No Drilling");
StrainUnCut.img = new buildArray("strainer.gif");


//Udate Language with joining
JoinCut = new Object();
//JoinCut.pop = new buildArray("No Joining", "Wedge Joining", "Standard Joining");
JoinCut.pop = new buildArray("Cut to Size", "Cut to Size with Wedges", "Standard Joining");
JoinCut.prc = new buildArray(0, gWedgeStrainer, gJoinStrainer);

JoinUnCut = new Object();
//JoinUnCut.pop = new buildArray("No Joining");
//JoinUnCut.pop = new buildArray("Cut to Size");
JoinUnCut.pop = new buildArray("Lengths");
JoinUnCut.prc = new buildArray(0);


// Matboard Stuff

NoBoard = new Object();
NoBoard.plypop = new buildArray("N/A");
NoBoard.ply = new Object();
	
	NoBoard.ply[0] = new PlyOb();
	with (NoBoard.ply[0]) {
		colpop = new buildArray("N/A");
		colnos = new buildArray("");
	}

Cresc = new Object();
Cresc.plypop = new Array();
Cresc.ply = new Array();
<br />
<b>Warning</b>:  mysql_query(): supplied argument is not a valid MySQL-Link resource in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>403</b><br />
n/* ERROR! 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)	*/

Mat = new Object();

gAcrylic = new Object();
gAcrylic.pop = new Array("None");
gAcrylic.price = new Array(0);
// gAcrylic.cutcharge = new Array(0);


<br />
<b>Warning</b>:  mysql_query(): supplied argument is not a valid MySQL-Link resource in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>440</b><br />
n/* ERROR! 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)	*/

gFoam = new Object();
gFoam.pop = new Array();//"None");
gFoam.price = new Array();//0);
// gFoam.cutcharge = new Array(0);
gFoam.item = new Array();//0);

<br />
<b>Warning</b>:  mysql_query(): supplied argument is not a valid MySQL-Link resource in <b>/nfs/home/m/metroframe.com/public_html/include/frame-js.php</b> on line <b>457</b><br />
n/* ERROR! 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)	*/


Style = new Object();
Style.img = new buildArray("window_mat.gif", "overmount_mat.GIF", "mat_whspace.gif");
Style.name = new buildArray("Custom Cut Mats", "Custom Cut Sized Boards", "Custom Cut Mats & Sized Boards");



function SizeIt() {
	if (myFrame.isFloater() && myFrame.isCut) {
		myFrame.setFloatSize(parseFloat(selectedValueById("FloatPop")));
		var h = parseInt(valueById("Hor")) + parseFloat(selectedValueById("HorPop"))
		var v = parseInt(valueById("Ver")) + parseFloat(selectedValueById("VerPop"))
		setValueById(h + (2 * myFrame.floatSize), "SizeH");
		setValueById(v + (2 * myFrame.floatSize), "SizeV");
	}
	PriceEst();
}

function FloatAlert() {
	if (myFrame.isFloater() && myFrame.isCut && myFrame.pnum == 125 && myFrame.floatSize > 0.03125) {
		alert('On pictures that are square we normally allow 1/32 inch float which means the panels will fit snugly in the frame. Larger floats are used to acccommodate panels that are out of square.');
	}
}

function HorFunky() {
	var h = parseFloat(valueById("Hor")) + parseFloat(selectedValueById("HorPop"));
	if (h != myFrame.horizontal) {
		myFrame.setHorizontal(h);
		if (selectedTab == 'Frame') {
			PriceEst();
		} else if (selectedTab == 'Acrylic') {
			AcrPriceEst();
			if (!myFrame.hasAcrylic) {
				updateRightSide();
			}
		} else if (selectedTab == 'Foam') {
			FoamPriceEst();
			if (!myFrame.hasFoam) {
				updatRightSide();
			}
		}
	}
}

function VerFunky() {
	var v = parseFloat(valueById("Ver")) + parseFloat(selectedValueById("VerPop"));
	if (v != myFrame.vertical) {
		myFrame.setVertical(v);
		if (selectedTab == 'Frame') {
			PriceEst();
		} else if (selectedTab == 'Acrylic') {
			AcrPriceEst();
		} else if (selectedTab == 'Foam') {
			FoamPriceEst();
		}
	}
}

function QtyFunky() {
	var q = parseInt(valueById("Qty"));
	if (q != myFrame.qty()) {
		if (myFrame.isCut) {
			myFrame.setQuantity(q);
		} else { // lengths
			myFrame.setFeetNeeded(q);
			setValueById(q, "Feet");
			Feeter();
		}
		if (selectedTab == 'Spacers') {
			SpacersPriceEst();
			if (!myFrame.hasSpacer) {
				updateRightSide();
			}
		} else if (selectedTab == 'Strainers') {
			StrainersPriceEst();
			if (!myFrame.hasStrainer) {
				updateRightSide();
			}
		} else if (selectedTab == 'Mat') {
			MatPriceEst();
			if (!myFrame.hasMat) {
				updateRightSide();
			}
		} else if (selectedTab == 'Acrylic') {
			AcrPriceEst();
			if (!myFrame.hasAcrylic) {
				updateRightSide();
			}
		} else if (selectedTab == 'Foam') {
			FoamPriceEst();
			if (!myFrame.hasFoam) {
				updateRightSide();
			}
		} else {
			PriceEst();
		}
	}
}

function LengthFunky() {
	var q = parseInt(valueById("Feet"));
	if (!myFrame.isCut && q != myFrame.feetNeeded) {
		myFrame.setFeetNeeded(q);
		setValueById(q, "Qty");
		Feeter();
		PriceEst();
	}
}

function PriceEst() {
	if (myFrame.isCut) {
		// the non-floater hor/ver are now handled by their own funkys
		if (myFrame.isFloater()) {
			myFrame.setHorizontal(parseFloat(valueById("SizeH")));
			myFrame.setVertical(parseFloat(valueById("SizeV")))
		}
	} else {
		var ft = parseInt(valueById("Feet"));
		if (ft != myFrame.feetNeeded) {
			myFrame.setFeetNeeded(ft);
			setValueById(ft, "Qty");
		}
	}

	var prc = myFrame.frameSubtotal();
	setValueById("$" + CashFormat(myFrame.subTotal(prc)), "Price");
	updateRightSide();
}

function SelectFrame(isIt) {
	myFrame.setHasFrame(isIt);
	if (elem = myGetElementById("FrameSelect")) {
		if (isIt) {
			elem.className = "selected";
			elem.value = "Remove Frame";
		} else {
			elem.className = "none";
			elem.value = "Add Frame";
		}
	}
	updateRightSide();
}

function updateLeftTabs() {
	//alert ("updateLeftTabs()");
	var html = '<table border="0" cellpadding="0" cellspacing="0" align="center">\n' +
	'<tr><td id="Others" nowrap>';
	if (myFrame.isMetal) {
		html += "<a href=\"Metal.php\" onclick=\"selectLeftTab('Others')\">Metal Frames</a>";
	} else {
		html += "<a href=\"#Others\" onclick=\"selectLeftTab('Others');makeRequest('" + myFrame.frameType() + "Tab.php', 'Left'); return true;\">" + myFrame.frameType() + " Frames</a>";
	}
	html += "</td>" +
	"<td id=\"Profile\" nowrap><a href=\"#Profile\" onclick=\"selectLeftTab('Profile');makeRequest('ThisProfileTab.php?" + (myFrame.isMetal ? "Metal=" : "Number=") + myFrame.pnum + "', 'Left'); return true;\">Profile " + myFrame.pnum + "</a></td>" +
	"</tr></table>";
	setInnerHTMLById(html, "lefttabs");
	selectLeftTab('Profile');
}

function updateRightTabs() {
	var html = '<table border="0" cellspacing="0" cellpadding="0" align="center">\n' +
	"<tr><td id=\"ThisOrder\"><a href=\"#This\" onclick=\"selectThisOrder()\">" + myFrame.desc() + '</a></td>\n' +
	"<td id=\"EntireOrder\"><a href=\"#EntireOrder\" onclick=\"selectEntireOrder()\">Your Order</a></td></tr>\n" +
	'</table>';
	setInnerHTMLById(html, "componentstabs");
	selectRightTab('ThisOrder');
}

function updateRightSide() {
	updateRightTabs();
	alternate = true;
	var prc = 0;
	var html = "<table border=0 cellpadding=0 cellspacing=0 style=\"width:98%\">" +
	"<tr" + rightSideBkgd() + "><th align=\"left\">Item#</th><th align=\"left\">Description</th><th align=\"center\">Price</th>";
	if (!myFrame.isCut || myFrame.quantity > 1) {
		html += "<th align=\"center\" nowrap>x " + (myFrame.isCut ? myFrame.quantity : myFrame.feetNeeded) + "</th>";
	}
	html += "</tr>";
	if (myFrame.hasFrame) {
		html += "<tr onclick=\"return selectFrame()\"" + rightSideBkgd('Frame') + "><td>" + myFrame.itemNo() + "</td><td>" + myFrame.frameDesc() + "</td><td align=\"right\">" + CashFormat(myFrame.framePrice()) + "</td>";
		if (!myFrame.isCut || myFrame.quantity > 1) {
			html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.framePrice())) + "</td>";
		}
		html += "</tr>";
		prc += myFrame.framePrice();
		if (myFrame.isOverSize()) {
			html += "<tr onclick=\"return selectFrame()\"" + rightSideBkgd('Frame') + "><td>" + myFrame.overSizeItemNo() + "</td><td>" + myFrame.overSizeDesc() + "</td><td align=\"right\">" + CashFormat(myFrame.overSizePrice()) + "</td>";
			if (!myFrame.isCut || myFrame.quantity > 1) {
				html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.overSizePrice())) + "</td>";
			}
			html += "</tr>";
			prc += myFrame.overSizePrice();
		}
		if (!myFrame.isMetal && myFrame.finishNumber() != "00") {
			html += "<tr onclick=\"return selectFrame()\"" + rightSideBkgd('Frame') + "><td>" + myFrame.finItemNo() + "</td><td>" + myFrame.finDesc() + "</td><td align=\"right\">" + CashFormat(myFrame.finPrice()) + "</td>";
			if (!myFrame.isCut || myFrame.quantity > 1) {
				html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.finPrice())) + "</td>";
			}
			html += "</tr>";
			prc += myFrame.finPrice();
		}
		if (!myFrame.isMetal && myFrame.isCut && myFrame.joinPrice > 0) {
			html += "<tr onclick=\"return selectFrame()\"" + rightSideBkgd('Frame') + "><td>" + myFrame.joinItem + "</td><td>" + myFrame.joining + "</td><td align=\"right\">" + CashFormat(myFrame.joinPrice) + "</td>";
			if (myFrame.quantity > 1) {
				html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.joinPrice)) + "</td>";
			}
			html += "</tr>";
			prc += myFrame.joinPrice;
		}
		if (myFrame.isMetal) {
			html += "<tr " + rightSideBkgd('Frame') + "><td>" + myFrame.metalHardwareItem + "</td><td>" + myFrame.metalHardwareDescription + "</td><td align=\"right\">" + CashFormat(myFrame.metalHardwarePrice) + "</td>";
			if (myFrame.quantity > 1) {
				html += "<td align=\"right\">" + CashFormat(myFrame.metalHardwarePrice) + "</td>";
			}
			html += "</tr>";
			prc += myFrame.metalHardwarePrice;
		}
		if (myFrame.canRadiusTop() && myFrame.radiusTop) {
			html += "<tr onclick=\"return selectFrame()\"" + rightSideBkgd('Frame') + "><td>" + myFrame.radiusItemNo() + "</td><td>" + myFrame.radiusDesc() + "</td><td align=\"right\">" + CashFormat(myFrame.radiusPrice()) + "</td>";
			if (!myFrame.isCut || myFrame.quantity > 1) {
				html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.radiusPrice())) + "</td>";
			}
			html += "</tr>";
			prc += myFrame.radiusPrice();
		}
		if (!myFrame.isMetal && myFrame.blackInterior) {
			html += "<tr onclick=\"return selectFrame()\"" + rightSideBkgd('Frame') + "><td>" + myFrame.blackIntItemNo() + "</td><td>" + myFrame.blackIntDesc() + "</td><td align=\"right\">" + CashFormat(myFrame.blackInteriorPrice()) + "</td>";
			if (!myFrame.isCut || myFrame.quantity > 1) {
				html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.blackInteriorPrice())) + "</td>";
			}
			html += "</tr>";
			prc += myFrame.blackInteriorPrice();
		}
		if (!myFrame.isMetal && myFrame.isCut && myFrame.drillFromBack) {
			html += "<tr onclick=\"return selectFrame()\"" + rightSideBkgd('Frame') + "><td>" + myFrame.drillFromBackItemNo() + "</td><td>" + myFrame.drillFromBackDesc() + "</td><td align=\"right\">" + CashFormat(myFrame.drillFromBackPrice) + "</td>";
			if (!myFrame.isCut || myFrame.quantity > 1) {
				html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.drillFromBackPrice)) + "</td>";
			}
			html += "</tr>";
			prc += myFrame.drillFromBackPrice;
		}
	}
	if (myFrame.doesHaveSpacer()) {
		html += "<tr onclick=\"return selectSpacers()\"" + rightSideBkgd('Spacers') + "><td>" + myFrame.spItemNo() + "</td><td>" + myFrame.spDesc() + "</td><td align=\"right\">" + CashFormat(myFrame.spPrice()) + "</td>";
		if (!myFrame.isCut || myFrame.quantity > 1) {
			html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.spPrice())) + "</td>";
		}
		html += "</tr>";
		prc += myFrame.spPrice();
		if (myFrame.isOverSize()) {
			html += "<tr onclick=\"return selectSpacers()\"" + rightSideBkgd('Spacers') + "><td>" + myFrame.overSizeSpItemNo() + "</td><td>" + myFrame.overSizeSpDesc() + "</td><td align=\"right\">" + CashFormat(myFrame.overSizeSpPrice()) + "</td>";
			if (!myFrame.isCut || myFrame.quantity > 1) {
				html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.overSizeSpPrice())) + "</td>";
			}
			html += "</tr>";
			prc += myFrame.overSizeSpPrice();
		}
		if (myFrame.spFinishNumber() != "00") {
			html += "<tr onclick=\"return selectSpacers()\"" + rightSideBkgd('Spacers') + "><td>" + myFrame.spFinItemNo() + "</td><td>" + myFrame.spFinDesc() + "</td><td align=\"right\">" + CashFormat(myFrame.spFinPrice()) + "</td>";
			if (!myFrame.isCut || myFrame.quantity > 1) {
				html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.spFinPrice())) + "</td>";
			}
			html += "</tr>";
			prc += myFrame.spFinPrice();
		}
	}
	if (myFrame.doesHaveStrainer()) {
		html += "<tr onclick=\"return selectStrainers()\"" + rightSideBkgd('Strainers') + "><td>" + myFrame.stItemNo() + "</td><td>" + myFrame.stDesc() + "</td><td align=\"right\">" + CashFormat(myFrame.stPrice()) + "</td>";
		if (!myFrame.isCut || myFrame.quantity > 1) {
			html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.stPrice())) + "</td>";
		}
		html += "</tr>";
		prc += myFrame.stPrice();
		if (myFrame.isOverSize()) {
			html += "<tr onclick=\"return selectStrainers()\"" + rightSideBkgd('Strainers') + "><td>" + myFrame.overSizeStItemNo() + "</td><td>" + myFrame.overSizeStDesc() + "</td><td align=\"right\">" + CashFormat(myFrame.overSizeStPrice()) + "</td>";
			if (!myFrame.isCut || myFrame.quantity > 1) {
				html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.overSizeStPrice())) + "</td>";
			}
			html += "</tr>";
			prc += myFrame.overSizeStPrice();
		}
		if (myFrame.isCut && myFrame.stDrillPrice > 0) {
			html += "<tr onclick=\"return selectStrainers()\"" + rightSideBkgd('Strainers') + "><td>" + myFrame.stDrillItem + "</td><td>" + myFrame.stDrillDesc() + "</td><td align=\"right\">" + CashFormat(myFrame.stDrillPrice) + "</td>";
			if (!myFrame.isCut || myFrame.quantity > 1) {
				html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.stDrillPrice)) + "</td>";
			}
			html += "</tr>";
			prc += myFrame.stDrillPrice;
		}
		if (myFrame.isCut && myFrame.stJoinPrice > 0) {
			html += "<tr onclick=\"return selectStrainers()\"" + rightSideBkgd('Strainers') + "><td>" + myFrame.stJoinItem + "</td><td>" + myFrame.stJoinDesc() + "</td><td align=\"right\">" + CashFormat(myFrame.stJoinPrice) + "</td>";
			if (!myFrame.isCut || myFrame.quantity > 1) {
				html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.stJoinPrice)) + "</td>";
			}
			html += "</tr>";
			prc += myFrame.stJoinPrice;
		}
	}
	if (myFrame.hasMat && myFrame.isCut && !myFrame.isFloater()) {
		if ((myFrame.matStyle == 0 || myFrame.matStyle == 2) && myFrame.matPrice() > 0) {
			html += "<tr onclick=\"return selectMat()\"" + rightSideBkgd('Mat') + "><td>" + myFrame.matItemNo() + "</td><td>" + myFrame.matDesc() + "</td><td align=\"right\">" + CashFormat(myFrame.matPrice()) + "</td>";
			if (myFrame.quantity > 1) {
				html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.matPrice())) + "</td>";
			}
			html += "</tr>";
			prc += myFrame.matPrice();
		}
		if ((myFrame.matStyle == 1 || myFrame.matStyle == 2) && myFrame.boardPrice() > 0) {
			html += "<tr onclick=\"return selectMat()\"" + rightSideBkgd('Mat') + "><td>" + myFrame.boardItemNo() + "</td><td>" + myFrame.boardDesc() + "</td><td align=\"right\">" + CashFormat(myFrame.boardPrice()) + "</td>";
			if (myFrame.quantity > 1) {
				html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.boardPrice())) + "</td>";
			}
			html += "</tr>";
			prc += myFrame.boardPrice();
		}
	}
	if (myFrame.hasAcrylic && myFrame.isCut && !myFrame.isFloater()) {
		if (myFrame.acrylicPrice() > 0) {
			html += "<tr onclick=\"return selectAcrylic()\"" + rightSideBkgd('Acrylic') + "><td>" + myFrame.acrItemNo() + "</td><td>" + myFrame.acrDesc() + "</td><td align=\"right\">" + CashFormat(myFrame.acrylicPrice()) + "</td>";
			if (myFrame.quantity > 1) {
				html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.acrylicPrice())) + "</td>";
			}
			html += "</tr>";
			prc += myFrame.acrylicPrice();
		}
	}
	if (myFrame.hasFoam && myFrame.isCut && !myFrame.isFloater()) {
		if (myFrame.foamboardPrice() > 0) {
			html += "<tr onclick=\"return selectFoam()\"" + rightSideBkgd('Foam') + "><td>" + myFrame.foamItemNo() + "</td><td>" + myFrame.foamDesc() + "</td><td align=\"right\">" + CashFormat(myFrame.foamboardPrice()) + "</td>";
			if (myFrame.quantity > 1) {
				html += "<td align=\"right\">" + CashFormat(myFrame.subTotal(myFrame.foamboardPrice())) + "</td>";
			}
			html += "</tr>";
			prc += myFrame.foamboardPrice();
		}
	}
	html += "<tr" + rightSideBkgd() + "><th colspan=\"2\" align=\"right\">Total:</th><th align=\"right\">$" + CashFormat(RoundToCent(prc)) + "</th>";
	if (!myFrame.isCut || myFrame.quantity > 1) {
		html += "<th align=\"right\">$" + CashFormat(RoundToCent(myFrame.subTotal(prc))) + "</th>";
	}
	html += "</tr></table>";
	html += "<p align=\"center\">";
	if (myOrder.containsFrame(myFrame.id)) {
		html += "This frame is in your order. <!--When you've finished your changes, make sure you click &quot;update order&quot;:--></p><p align=\"center\">";
		html += '<input type="button" name="addnew" id="addnew" value="Begin New" onclick="startNew()" /> ';
		html += '<input type="button" name="remove" id="remove" value="Remove" onclick="removeIt()" /> ';
		html += '<input type="button" name="order" id="order" value="Update"  onclick="OrderIt()" /><!--</p>';
		html += '<p align="center">If you want to start fresh on a new frame, click &quot;start new&quot;:</p>-->';
	} else if (prc > 0) {
		html += '<input type="button" name="addnew" id="addnew" value="Clear" onclick="startNew()" /> ';
		html += '<input type="button" name="order" id="order" value="Add to Order"  onclick="OrderIt()" />';
	}
	html += '</p>';
	setInnerHTMLById(html, "ordertable");
	SetCookie("CurrentOrderItem", myFrame.toJSONString());

	if (elem = myGetElementById("OrderText")) {
		elem.style.visibility = "hidden";
		elem.style.display = "none";
	}
	if (elem = myGetElementById("EmptyOrderText")) {
		elem.style.visibility = "hidden";
		elem.style.display = "none";
	}
}

function SelectWhatever() {
	if (selectedTab == "Frame") {
		SelectFrame(myFrame.hasFrame);
	} else if (selectedTab == "Spacers") {
		SelectSpacer(myFrame.hasSpacer);
	} else if (selectedTab == "Strainers") {
		SelectStrainer(myFrame.hasStrainer);
	} else if (selectedTab == "Mat") {
		SelectMat(myFrame.hasMat);
	} else if (selectedTab == "Acrylic") {
		SelectAcrylic(myFrame.hasAcrylic);
	} else if (selectedTab == "Foam") {
		SelectFoam(myFrame.hasFoam);
	}
}

function startNew() {
	myFrame.startNew();
	SelectWhatever();
	updateRightSide();
}

function removeIt() {
	if (myOrder.containsFrame(myFrame.id)) {
		selectEntireOrder();
		removeFromOrder(myFrame.id);
		SetCookie("AllOrders", myOrder.toJSONString());
	}
}

function Hardware(link) {
	if (myFrame != null && myFrame.isMetal) {
		link.href = "/Products/Other_products/Hardware.php";
	} else {
		link.href = "/Products/Other_products/Strap_Steel.php";
	}
	return true;
}

function OrderIt() {
	if (!CookiesAreEnabled()) {
		alert ("Cookies are not enabled in your browser! This sites ordering functions require cookies to be enabled. Please turn them on in your browser's preferences. Call 1-800-626-3139 if you have any questions. ");
		return;
	}
	for (i=0; i<myOrder.frameCnt; i++) {
		frames[myOrder.frames[i]].collapsed = true;
	}
	if (myFrame.allSubtotal() == 0) {
		removeIt();
	} else {
		if (!myOrder.containsFrame(myFrame.id)) {
			myOrder.addFrame(myFrame.id);
		}
		myFrame.collapsed = false;
		var json = myFrame.toJSONString();
		SetCookie("CurrentOrderItem", json);
		if (frames[myFrame.id] == null) {
			frames[myFrame.id] = new Frame(myFrame.isMetal, myFrame.pnum, myFrame.isCut);
		}
		frames[myFrame.id].loadJSONString(json);
		
		// this is an ugly hack, but it works really well, so what the hell.
		// it loads a php script into an image that's inside a hidden div. 
		// just moves the CurrentOrderItem cookie into the PHP session. 
		setInnerHTMLById("<img src=\"" + noCacheUrl("addtoOrder.php") + "\" />", "hiddenthang");
	
		SetCookie("AllOrders", myOrder.toJSONString());
	}
	//scrollDownRight();

	// give the current frame a clean slate
	myFrame.startNew();
	SelectWhatever();

	selectEntireOrder();
}

function scrollDownRight() {
	var hor = window.pageXOffset;
	var ver = window.pageYOffset;
//	if (confirm("hor: " + hor + ", ver: " + ver)) {
		window.scrollBy(5, 5);
		if (hor != window.pageXOffset || ver != window.pageYOffset) {
			setTimeout("scrollDownRight()", 20);
		}
//	}
//	window.scrollTo(window.innerWidth, window.innerHeight);
}

function scrollDown() {
	var ver = window.pageYOffset;
	window.scrollBy(0, 5);
	if (ver != window.pageYOffset) {
		setTimeout("scrollDown()", 20);
	}
}

function scrollRight() {
	var hor = window.pageXOffset;
	window.scrollBy(5, 0);
	if (hor != window.pageXOffset) {
		setTimeout("scrollRight()", 20);
	}
}

function scrollLeft() {
	var hor = window.pageXOffset;
	window.scrollBy(-5, 0);
	if (hor != window.pageXOffset) {
		setTimeout("scrollLeft()", 20);
	}
}

function DrillFunky() {
	if (!myFrame.isCut && checkedById("DrillFromBack")) {
		alert("Drilling from back is for frames that are cut to size only.");
		setCheckedById(false, "DrillFromBack");
	}
	myFrame.setDrillFromBack(checkedById("DrillFromBack"));
	myFrame.setDrillFromBackPrice(myFrame.drillFromBack ? gDrillPPF : 0);
	PriceEst();
}

function WoodFunky() {
	var woodidx = selectedIndexById("WoodPop");
	var oldWoodCode = myFrame.woodCode;
 	myFrame.setWood(selectedTextById("WoodPop"));
 	myFrame.setWoodCode(selectedValueById("WoodPop"));
	myFrame.setFrameLengthPrice(RoundToCent(Profile[myFrame.pnum].price[woodidx]));
	myFrame.setFrameCutPrice(RoundToCent(Profile[myFrame.pnum].cutprice[woodidx]));
	
	if (myFrame.hasSpacer) { // gotta move the wood selection to the spacer. 
		// but only if something's actually changed
		if (myFrame.woodCode != oldWoodCode) {
			myFrame.setSpWood(myFrame.wood);
			myFrame.setSpWoodCode(myFrame.woodCode);
			for (i=0; i<Spacer.length; i++) {
				if (Spacer[i].woodcode == myFrame.spWoodCode) {
					myFrame.setSpCutPrice(Spacer[i].cutprice);
					myFrame.setSpLengthPrice(Spacer[i].price);

					// also need to clear out spacer finish info so that it will
					// be handled by the other functions properly
					myFrame.setSpFinish("")
					myFrame.setSpFinCutPrice(0);
					myFrame.setSpFinLengthPrice(0);

					break;
				}
			}
		}
	}
	
	buildPop(myGetElementById("FinishPop"), Profile[myFrame.pnum].fin[woodidx].pop, myFrame.finish);
	ImgReplace(document.images['WoodImg'], "options/" + 
		Profile[myFrame.pnum].fin[woodidx].imgsrc[0]);
	FinishFunky();
}

function FinishFunky() {
	var oldFinish = myFrame.finish;
	var fin = selectedIndexById("FinishPop");
	myFrame.setFinish(selectedTextById("FinishPop"));
	if (myFrame.isMetal) {
		ImgReplace(document.images['FinishImg'], "Metal/Finishes/" + Profile[myFrame.pnum].gifsrc[fin]);
		myFrame.setFrameLengthPrice(RoundToCent(Profile[myFrame.pnum].lprice[fin]));
		myFrame.setFrameCutPrice(RoundToCent(Profile[myFrame.pnum].cprice[fin]));
		PriceEst();
	} else {
		var w = selectedIndexById("WoodPop");
		if (myFrame.mustHaveBlackInterior() && !myFrame.blackInterior) {
			setCheckedById(true, "BlackIntCheck");
		}
		ImgReplace(document.images['FinishImg'], "options/" + Profile[myFrame.pnum].fin[w].imgsrc[fin]);
		myFrame.setFinLengthPrice(RoundToCent(Profile[myFrame.pnum].fin[w].price[fin]));
		myFrame.setFinCutPrice(RoundToCent(Profile[myFrame.pnum].fin[w].cutprice[fin]));
		
		if (myFrame.hasSpacer && myFrame.woodCode == myFrame.spWoodCode) {
			// If the personally deliberatly changes the spacer finish, don't hammer it just
			// 'cause this function is called. Make sure that something's actually changed.
			// Also, verify that the wood is in sync before we update the finish. 
			if (myFrame.finish != oldFinish) {
				myFrame.setSpFinish(myFrame.finish);
				// find the pricing for this bloody spacer thing
				for (i=0; i<Spacer.length; i++) {
					if (Spacer[i].woodcode == myFrame.spWoodCode) {
						for (j=0; j<Spacer[i].pop.length; j++) {
							if (Spacer[i].pop[j].substring(0, myFrame.spFinishNumber().length) == myFrame.spFinishNumber()) {
								myFrame.setSpFinCutPrice(Spacer[w].cutspacer[j]);
								myFrame.setSpFinLengthPrice(Spacer[w].spacer[j]);
								break;
							}
						}
						break;
					}
				}
			}
		}
		
		if (myFrame.isCut) {
			fno = myFrame.finishNumber();
			if ((fno == "13") || (fno == "15")) {
				Join = JoinOpaque;
			} else if (fno == "00") {
				Join = NormJoin;
			} else {
				Join = JoinFinish;
			}
			buildJoinMenu();
//			buildPop(myGetElementById("JoinPop"), Join.pop, myFrame.joining);
//			JoinFunky();
		}
		BlackIntFunky(); // always call this, because it sets the black int price dependent on finishes
	}
}

function JoinFunky() {
	var j = selectedIndexById("JoinPop");
	if (myFrame.isCut) { // only need to save the joining option when dealing with cut
		myFrame.setJoining(selectedTextById("JoinPop"));
		myFrame.setJoinItem(Join.item[j]);
		myFrame.setJoinPrice(Join.price[j]);
	} else {
		myFrame.setJoinPrice(0);
	}
	ImgReplace(document.images['JoinImg'], "options/" + Join.img[j]);
	PriceEst();
}

function HorVerFunky() {
	if (!checkedById("cut2size")) {
		setCheckedById(false, "lengths");
		setCheckedById(true, "cut2size");
		CutFunky();
	}
}

function FeetFunky() {
	if (!checkedById("lengths")) {
		setCheckedById(false, "cut2size");
		setCheckedById(true, "lengths");
		UnCutFunky();
	}
}

function Feeter() {
	if (myFrame.isMetal) {
		var i = parseInt(myFrame.feetNeeded);
		var q = Math.round(i/10)*10;
		if (q != i) {
			alert("Lengths must be in increments of 10 feet.");
			setValueById(q, "Feet");
			setValueById(q, "Qty");
			myFrame.setFeetNeeded(q);
		}
	} else {
		//alert("Lengths vary from approximately 8 to 12 feet. We will come as close to footage as possible");
	}
}

function CutFunky() {
	myFrame.setIsCut(true);
	setInnerHTMLById(tabsHTML(), "bottomtabs");
	setVisibilityById(false, "lengthsarea");
	setValueById("", "Feet");
	
	//if (valueById("Qty") != myFrame.quantity) {
		setValueById(myFrame.quantity, "Qty");
		setInnerHTMLById("Qty", "QtyLabel");
	//}
	setHor(myFrame.horizontal);
	setVer(myFrame.vertical);

	if (myFrame.isFloater()) {
		setSelectedValueById(myFrame.floatSize, "FloatPop");
	}
	if (myFrame.canDrillFromBack()) {
		setCheckedById(myFrame.drillFromBack, "DrillFromBack");
	}
	if (!myFrame.isMetal) {
		var fno = myFrame.finishNumber();
		if ((fno == "13") || (fno == "15")) {
			Join = JoinOpaque;
		} else if (fno == "00") {
			Join = NormJoin;
		} else {
			Join = JoinFinish;
		}
		buildJoinMenu();
// 		buildPop(myGetElementById("JoinPop"), Join.pop, myFrame.joining);
// 		JoinFunky();
	} else {
		PriceEst();
	}
	setVisibilityById(true, "cut2sizearea");
}

function UnCutFunky() {
	myFrame.setIsCut(false);
	setInnerHTMLById(tabsHTML(), "bottomtabs");
	setVisibilityById(false, "cut2sizearea");

	//if (valueById("Feet") == "") {
		setValueById(myFrame.feetNeeded, "Feet");
		setValueById(myFrame.feetNeeded, "Qty");
		setInnerHTMLById("Lengths", "QtyLabel");
	//}
	//setValueById("", "Qty");
	setValueById("", "Hor");
	setSelectedIndexById(0, "HorPop");
	setValueById("", "Ver");
	setSelectedIndexById(0, "VerPop");

	if (myFrame.isFloater()) {
		setValueById("", "SizeH");
		setValueById("", "SizeV");
	}
	if (myFrame.canDrillFromBack()) {
		setCheckedById(false, "DrillFromBack");
	}
	if (!myFrame.isMetal) {
		Join = NoJoin;
		buildJoinMenu();
// 		buildPop(myGetElementById("JoinPop"), Join.pop);
// 		JoinFunky();
	} else {
		PriceEst();
	}
	setVisibilityById(true, "lengthsarea");
}


function setVisibilityById(isIt, id) {
	if (elem = myGetElementById(id)) {
		elem.style.visibility = (isIt ? "visible" : "hidden");
		elem.style.display = (isIt ? "block" : "none");
	}
}

function RadiFunky() {
	myFrame.setRadiusTop(checkedById("RadiusCheck"));
	myFrame.setRadiusTopPrice(myFrame.radiusTop ? gRadiusPPF : 0);
	PriceEst();
}

function BlackIntFunky() {
	if (!myFrame.isMetal) {
		//Added by dustin (8-5-05 to make sure you don't deselect the blackness
		if (myFrame.mustHaveBlackInterior() && !checkedById("BlackIntCheck")) {
			alert("You must select Black Interior with this Wood and Finish");
			setCheckedById(true, "BlackIntCheck");
		}
		myFrame.setBlackInterior(checkedById("BlackIntCheck"));
		var fno = myFrame.finishNumber();
		var ppf = 0;
		if (myFrame.blackInterior) {
			if (fno == "04" || fno == "05" || fno == "15") {
				ppf = gBlackIntBPPF;
			} else if (fno != "13A"){
				ppf = gBlackIntPPF;
			}
		}
		myFrame.setBlackIntPrice(ppf);
		PriceEst();
	}
}

NormJoin = new JoinOb();
with (NormJoin) {

//New code added by Dustin 3-18-05
	if (myFrame.isUltraThin()) {
		pop = new buildArray("Cut to Size", "Spline - Matching", "Spline - Contrasting");
		img = new buildArray("stdCutToSize.gif", "spline.con.JPG", "spline.mat.JPG");
		price = new buildArray(0, SPLINESprc, SPLINESprc);
		item = new buildArray("", "SPLINES", "SPLINES");
	} else {
		//pop = new buildArray("No Joining", "Wedge Joining", "Standard Joining", "Spline - Matching", "Spline - Contrasting");
		//img = new buildArray("trans.gif", "wedge.JPG", "joined.JPG", "spline.con.JPG", "spline.mat.JPG");
		//price = new buildArray(0, WEDGEprc, JOINprc, SPLINESprc, SPLINESprc);
		//item = new buildArray("", "WEDGE", "JOIN", "SPLINES", "SPLINES");
		pop = new buildArray("Cut to Size", "Cut to Size with Wedges", "Standard Joining", "Spline - Matching", "Spline - Contrasting");
	//	img = new buildArray("qswedgesNo.jpg", "qswedges.JPG", "joined.JPG", "spline.con.JPG", "spline.mat.JPG");
		if (myFrame.isFloater()) {
			img = new buildArray("floaterCutToSize.gif", "floaterWedges.gif", "joined.JPG", "spline.con.JPG", "spline.mat.JPG");
		} else {
			img = new buildArray("stdCutToSize.gif", "stdCutToSizeWedges.gif", "joined.JPG", "spline.con.JPG", "spline.mat.JPG");
		}
		price = new buildArray(0, WEDGEprc, JOINprc, SPLINESprc, SPLINESprc);
		item = new buildArray("", "WEDGE", "JOIN", "SPLINES", "SPLINES");
		
	}
	
	
	
}
// Added this function 3-12-04
JoinOpaque = new JoinOb();
with (JoinOpaque) {
	/*Need the cut and wedge option for these as well....
	pop = new buildArray("Spline - Matching");
	img = new buildArray("spline.con.JPG");
	price = new buildArray(SPLINESprc);
	item = new buildArray("SPLINES");
	*/
	if (myFrame.isUltraThin()) {
		pop = new buildArray("Cut to Size", "Spline - Matching");
		img = new buildArray("stdCutToSize.gif", "spline.con.JPG");
		price = new buildArray(0, SPLINESprc);
		item = new buildArray("", "SPLINES");
	} else {
		pop = new buildArray("Cut to Size", "Cut to Size with Wedges", "Standard Joining", "Spline - Matching");
		if (myFrame.isFloater()) {
			img = new buildArray("floaterCutToSize.gif", "floaterWedges.gif", "joined.JPG", "spline.con.JPG");
		} else {
			img = new buildArray("stdCutToSize.gif", "stdCutToSizeWedges.gif", "joined.JPG", "spline.con.JPG");
		}
		price = new buildArray(0, WEDGEprc, JOINprc, SPLINESprc);
		item = new buildArray("", "WEDGE", "JOIN", "SPLINES");
	}
}
// Down to here
NoJoin = new JoinOb();
with (NoJoin) {
	/*Don't know if this one needs to be changed, but what the hell....
	pop = new buildArray("No Joining");
	img = new buildArray("trans.gif");
	price = new buildArray(0);
	item = new buildArray("");
	*/
	pop = new buildArray("Length Moulding");
//	img = new buildArray("qswedgesNo.jpg");
	if (myFrame.isFloater()) {
		img = new buildArray("floaterCutToSize.gif");
	} else {
		img = new buildArray("stdCutToSize.gif");
	}
	price = new buildArray(0);
	item = new buildArray("");
}

JoinFinish = new JoinOb();
with (JoinFinish) {
	//Let's try commenting this out as well....
	if (myFrame.isUltraThin()) {
		pop = new buildArray("Cut to Size", "Spline - Matching", "Spline - Contrasting");
		img = new buildArray("stdCutToSize.gif", "spline.con.JPG", "spline.mat.JPG");
		price = new buildArray(0, SPLINESprc, SPLINESprc);
		item = new buildArray("", "SPLINES", "SPLINES");
	} else {
		//pop = new buildArray("Standard Joining", "Spline - Matching", "Spline - Contrasting");
		//img = new buildArray("joined.JPG", "spline.con.JPG", "spline.mat.JPG");
		//price = new buildArray(JOINprc, SPLINESprc, SPLINESprc);
		//item = new buildArray("JOIN", "SPLINES", "SPLINES");
	
		pop = new buildArray("Cut to Size", "Cut to Size with Wedges", "Standard Joining", "Spline - Matching", "Spline - Contrasting");
	//	img = new buildArray("qswedgesNo.jpg", "qswedges.JPG", "joined.JPG", "spline.con.JPG", "spline.mat.JPG");
		if (myFrame.isFloater()) {
			img = new buildArray("floaterCutToSize.gif", "floaterWedges.gif", "joined.JPG", "spline.con.JPG", "spline.mat.JPG");
		} else {
			img = new buildArray("stdCutToSize.gif", "stdCutToSizeWedges.gif", "joined.JPG", "spline.con.JPG", "spline.mat.JPG");
		}
		price = new buildArray(0, WEDGEprc, JOINprc, SPLINESprc, SPLINESprc);
		item = new buildArray("", "WEDGE", "JOIN", "SPLINES", "SPLINES");
	}
	/*
	//New code added by Dustin 3-18-05
	pop = new buildArray("Cut to Size", "Cut to Size with Wedges", "Standard Joining", "Spline - Matching", "Spline - Contrasting");
//	img = new buildArray("qswedgesNo.jpg", "qswedges.jpg", "joined.JPG", "spline.con.JPG", "spline.mat.JPG");
	if (myFrame.isFloater()) {
		img = new buildArray("floaterCutToSize.gif", "floaterWedges.gif", "joined.JPG", "spline.con.JPG", "spline.mat.JPG");
	} else {
		img = new buildArray("stdCutToSize.gif", "stdCutToSizeWedges.gif", "joined.JPG", "spline.con.JPG", "spline.mat.JPG");
	}
	price = new buildArray(0, WEDGEprc, JOINprc, SPLINESprc, SPLINESprc);
	item = new buildArray("", "WEDGE", "JOIN", "SPLINES", "SPLINES");*/
}

Join = NormJoin;


function setHor(hor) {
	//alert ("setHor(" + hor + ")");
	if (myFrame.isFloater() && selectedTab == 'Frame') {
		setValueById(hor, "SizeH");
		hor -= (parseFloat(selectedValueById("FloatPop")) * 2);
	}
	var h = Math.floor(hor);
	setValueById(h, "Hor");
	setSelectedValueById(hor - h, "HorPop");
}

function setVer(ver) {
	//alert ("setVer(" + ver + ")");
	if (myFrame.isFloater() && selectedTab == 'Frame') {
		setValueById(ver, "SizeV");
		ver -= (parseFloat(selectedValueById("FloatPop")) * 2);
	}
	var v = Math.floor(ver);
	setValueById(v, "Ver");
	setSelectedValueById(ver - v, "VerPop");
}

function exhibitionStartUp() {
	// start at an increment of 10 for lengths
	if (myFrame.isMetal) {
		var q = Math.round(myFrame.feetNeeded/10)*10;
		if (q != myFrame.feetNeeded) {
			myFrame.setFeetNeeded(q);
		}
	}
	if (myFrame.isCut) {
		if (myFrame.isFloater()) {
			setSelectedValueById(myFrame.floatSize, "FloatPop");
		}
		setCheckedById(false, "lengths");
		setCheckedById(true, "cut2size");
		setValueById("", "Feet");
		setHor(myFrame.horizontal);
		setVer(myFrame.vertical);
		setValueById(myFrame.quantity, "Qty");
		setInnerHTMLById("Qty", "QtyLabel");
		if (myFrame.canDrillFromBack()) {
			setCheckedById(myFrame.drillFromBack, "DrillFromBack");
			DrillFunky();
		}
	} else { // lengths
		setCheckedById(false, "cut2size");
		setCheckedById(true, "lengths");
		setValueById("", "Hor");
		setSelectedIndexById(0, "HorPop");
		setValueById("", "Ver");
		setSelectedIndexById(0, "VerPop");
		//setValueById("", "Qty");
		if (myFrame.isFloater()) {
			setValueById("", "SizeH");
			setValueById("", "SizeV");
			setCheckedById(false, "DrillFromBack");
		}
		setInnerHTMLById("Lengths", "QtyLabel");
		setValueById(myFrame.feetNeeded, "Feet");
		setValueById(myFrame.feetNeeded, "Qty");
	}
	if (myFrame.canHaveBlackInterior()) {
		setCheckedById(myFrame.blackInterior, "BlackIntCheck");
	}
	if (myFrame.canRadiusTop()) {
		setCheckedById(myFrame.radiusTop, "RadiusCheck");
	} //both metal and wood frames next
	if (Profile[myFrame.pnum] != null) {
		if (myFrame.isMetal) {
			foundit = false;
			html = "";
			for (i=0; i < Profile[myFrame.pnum].code.length; i++) {
				code = Profile[myFrame.pnum].code[i];
				foundit = (foundit || code == myFrame.finishNumber());
				//html += '<a href="#" id="' + code + '" onclick="return selectTheFinish(\'' + Profile[myFrame.pnum].pop[code] + '\')" class="woodblock" style="float: left; color: ' + (isDarkFinish(code) ? '#fff' : '#000') + '; background-image:url(/Products/Metal/Finishes/' + Profile[myFrame.pnum].gifsrc[code].replace(/gif/,"jpg") + ')"><span style="background-color: ' + bkgdColor(code) + '">' + breakFinString(Profile[myFrame.pnum].pop[code]) + '</span></a>';
				html += '<a href="#" id="' + code + '" onclick="return selectTheFinish(\'' + Profile[myFrame.pnum].pop[code] + '\')" class="metalFinishBlock" style="float: left;"><div id="sel' + code + '" style="display: none; position: absolute; top: -2px; left: -1px; width: 80px; height: 31px; background-image: url(/Products/border-dropshadow-metal.png); border: none; padding: 0px; margin: 0px;"><img src="/Products/Metal/Finishes/' + Profile[myFrame.pnum].gifsrc[code].replace(/gif/,"jpg") + '" style="padding-top: 2px; padding-left: 2px; border: none; margin: 0px;"></div><div class="metalFinishImage" style="background-image:url(/Products/Metal/Finishes/' + Profile[myFrame.pnum].gifsrc[code].replace(/gif/,"jpg") + ')">&nbsp;</div><div class="metalFinishNumberPart">' +  breakMetalFinString(Profile[myFrame.pnum].pop[code],"number") + '</div><div class="metalFinishTextPart">' + breakFinString(breakMetalFinString(Profile[myFrame.pnum].pop[code],"text")) + '</div></a>';
			}
			setInnerHTMLById(html, "finish_menu");
			if (!foundit && Profile[myFrame.pnum].code[0]) {
				selectTheFinish(Profile[myFrame.pnum].pop[Profile[myFrame.pnum].code[0]]);
			} else {
				selectTheFinish(myFrame.finish);
			}
		} else {
			foundit = false;
			html = "";
			for (i=0; i < Profile[myFrame.pnum].woodcode.length; i++) {
				code = Profile[myFrame.pnum].woodcode[i];
				foundit = (foundit || code == myFrame.woodCode);
				html += '<a href="#" id="' + code + '" onclick="return selectTheWood(\'' + code + '\');" class="woodblock" style="float: left; "><div id="sel' + code + '" style="display: none; position: absolute; top: -2px; left: -2px; width: 80px; height: 51px; background-image: url(/Products/border-dropshadow.png); border: none; padding: 0px; margin: 0px;"><img src="/Products/options/' + Profile[myFrame.pnum].fin[code].imgsrc[0] + '" style="padding-top: 2px; padding-left: 2px; border: none; margin: 0px;"></div><img class="menuImage" src="/Products/options/' + Profile[myFrame.pnum].fin[code].imgsrc[0] + '"><div class="woodMenuTextPart">' + Profile[myFrame.pnum].pop[code] + '</div></a>';
			}
			setInnerHTMLById(html, "wood_menu");
			if (!foundit && Profile[myFrame.pnum].woodcode[0]) {
				selectTheWood(Profile[myFrame.pnum].woodcode[0]);
			} else {
				selectTheWood(myFrame.woodCode);
			}
			if (!myFrame.isCut) { // the cut will already be taken care of
				Join = NoJoin;
				buildJoinMenu();
// 				buildPop(myGetElementById("JoinPop"), Join.pop, myFrame.joining);
// 				JoinFunky();
			}
		}
		if (myFrame.isCut) {
			CutFunky();
		} else {
			UnCutFunky();
		}
	} else {
		// not sure why
		selectedTab = ''; // clear this out to force reload
		setTimeout("selectFrame()", 800);
	}
	SelectFrame(myFrame.hasFrame);
}

var woodTimer;

function inactivateWoodMenu() {
	if (link = myGetElementById("wood_menu_link")) {
		link.className = "";
	}
	if (menu = myGetElementById("wood_menu")) {
		menu.style.visibility = "hidden";
	}	
}

function activateWoodMenu() {
	if (link = myGetElementById("wood_menu_link")) {
		if (menu = myGetElementById("wood_menu")) {
			var lft = link.offsetLeft;
			var top = (link.offsetTop + link.offsetHeight);
			var parent = link;
			while (parent = parent.offsetParent) {
				lft += parent.offsetLeft;
				top += parent.offsetTop;
			}
			// ie mac doesn't figure the padding Ð adjust for it here
			if (BrowserDetect.OS == "Mac" && BrowserDetect.browser == "Explorer") {
			//	lft -= 38;
			}
			lft -= 1;
			top -= 1;
			menu.style.left = lft + "px";
			menu.style.top = top + "px";
			var wdth = 160;//link.offsetWidth;// + 40; // add a little
			menu.style.width = wdth + "px";
			if (link.className == "current") {
				link.className = "";
				menu.style.visibility = "hidden";
			} else {
				link.className = "current";
				menu.style.visibility = "visible";
			}
		}
	}
	return false;
}

function moutWood() {
	if (link = myGetElementById("wood_menu_link")) {
		if (link.className == "current") {
			woodTimer = setTimeout("inactivateWoodMenu()", 700);
		}
	}
}

function moverWood() {
	clearTimeout(woodTimer);
}

function markWoodSelected() {
	code = myFrame.woodCode;
	//alert(code);
	if (element = myGetElementById("sel" + code)) {
		//element.style.border = "1px solid #FF0000";
		element.style.display = "block";
	}
}

function selectTheWood(code) {
	myFrame.setWoodCode(code);
	myFrame.setWood(Profile[myFrame.pnum].pop[myFrame.woodCode])

	myFrame.setFrameLengthPrice(RoundToCent(Profile[myFrame.pnum].price[myFrame.woodCode]));
	myFrame.setFrameCutPrice(RoundToCent(Profile[myFrame.pnum].cutprice[myFrame.woodCode]));

	//clearWoodSelected();
	
	//if (Profile[myFrame.pnum].woodcode.length == 1) {
	//	elem = myGetElementById("woodMenuText");
	//	elem.style.visibility = "hidden";
	//} else {
	//	elem = myGetElementById("woodMenuText");
	//	elem.style.visibility = "visible";
	//}
	
	for (i=0; i < Profile[myFrame.pnum].woodcode.length; i++) {
		myCode = Profile[myFrame.pnum].woodcode[i];
		element = myGetElementById("sel" + myCode);
		//element.style.border = "1px solid #808080";
		element.style.display = "none";
	}
	
	e = myGetElementById("sel" + code);
	//e.style.border = "1px solid #FF0000";
	//e.style.border = "2px dotted #FF0000";
	e.style.display = "inline-block";
	
	// No longer needed while using expanded wood menu 2009-07-18 EJA
	//setInnerHTMLById(myFrame.wood, "woody");
	//if (elem = myGetElementById("woody")) {
	//	elem.style.backgroundImage = "url(/Products/options/" + Profile[myFrame.pnum].fin[myFrame.woodCode].imgsrc[0] + ")";
	//}
	//inactivateWoodMenu();

	// poplulate the finish menu based on our wood selection	
	html = "";
	html2 = "";
	foundit = false;
	for (i=0; i < Profile[myFrame.pnum].fin[code].pop.length; i++) {
		finish = Profile[myFrame.pnum].fin[code].pop[i];
		foundit = (foundit || myFrame.finish == finish);
		var p = finish.indexOf(" ");
		if (p >= 0) {
			num = finish.substring(0, p);	// ID of finish
			html += '<a href="#" onclick="return selectTheFinish(\'' + finish + '\')" class="woodblock" style="width: 70px; height: 40px; float: left; color: ' + (isDarkFinish(num) ? '#fff' : '#000') + '; background-image:url(/Products/options/' + Profile[myFrame.pnum].fin[code].imgsrc[i] + ')"><span style="background-color: ' + bkgdColor(num) + '">' + breakFinString(finish) + '</span></a>';
			//html2 += '<a href="#" id="' + num + '" onclick="return selectTheFinish(\'' + finish + '\')" class="woodblock" style="float: left; color: ' + (isDarkFinish(num) ? '#fff' : '#000') + '; background-image:url(/Products/options/' + Profile[myFrame.pnum].fin[code].imgsrc[i] + ')"><div id="sel' + num + '" style="display: none; position: absolute; top: -2px; left: -1px; width: 80px; height: 51px; background-image: url(/Products/border-dropshadow.png); border: none; padding: 0px; margin: 0px;"><img src="/Products/options/' + Profile[myFrame.pnum].fin[code].imgsrc[i] + '" style="padding-top: 2px; padding-left: 2px; border: none; margin: 0px;"></div><div class="woodMenuTextPart" style="background-color: ' + bkgdColor(num) + '">' + breakFinString(finish) + '</div></a>';
			html2 += '<a href="#" id="' + num + '" onclick="return selectTheFinish(\'' + finish + '\')" class="woodFinishBlock" style="float: left;"><div class="woodFinishImage" style="background-image:url(/Products/options/' + Profile[myFrame.pnum].fin[code].imgsrc[i] + ')">&nbsp;</div><div id="sel' + num + '" style="display: none; position: absolute; top: -2px; left: -2px; width: 80px; height: 51px; background-image: url(/Products/border-dropshadow.png); border: none; padding: 0px; margin: 0px;"><img src="/Products/options/' + Profile[myFrame.pnum].fin[code].imgsrc[i] + '" style="padding-top: 2px; padding-left: 2px; border: none; margin: 0px;"></div><div class="woodFinishNumberPart">' + breakMetalFinString(finish,"number") + '</div><div class="woodFinishTextPart">' + breakFinString(breakMetalFinString(finish,"text")) + '</div></a>';

		}
	}
	setInnerHTMLById(html, "finish_menu");
	setInnerHTMLById(html2, "finish_menu2");
	//alert (Profile[myFrame.pnum].woodcode[0]);
	if (!foundit && Profile[myFrame.pnum].fin[code].pop[0]) {
		selectTheFinish(Profile[myFrame.pnum].fin[code].pop[0]);
	} else {
		selectTheFinish(myFrame.finish);
	}
	element = myGetElementById(code);
	element.blur();
	return false;
}

function breakFinString(fin) {
	ret = stringReplace(fin, ' ', '<br/>');
	ret = stringReplace(ret, '<br/>', '<br />');
	ret = stringReplace(ret, 'Gallery<br />Pic', 'Gal Pic'); // hack
	return ret;
}

function breakMetalFinString(fin, finPart) {
	if (finPart == "number") {
		ret = fin.substring(0,2);
	} else {
		if (fin.substring(0,3) == "13A") {
			ret = fin.substring(4,fin.length);
		} else {
			ret = fin.substring(3,fin.length);
		}
	}
	return ret;
}

function breakJoinString(jo) {
	ret = stringReplace(jo, 'Size with', 'Size<br />w/');
	ret = stringReplace(ret, 'dard Join', 'dard<br />Join');
	ret = stringReplace(ret, 'ength Mould', 'ength<br />Mould');
	ret = stringReplace(ret, ' - ', '<br />');
	if (ret == "Cut to Size") {
		ret = "Cut to Size<br />&nbsp;";
	}
	return ret;
}

var finishTimer;

function inactivateFinishMenu() {
	if (link = myGetElementById("finish_menu_link")) {
		link.className = "";
	}
	if (menu = myGetElementById("finish_menu")) {
		menu.style.visibility = "hidden";
		if (selectedTab == 'Spacers' || myFrame.pnum == 15) {
			restoreSelect();
		}
	}	
}

function activateFinishMenu() {
	if (link = myGetElementById("finish_menu_link")) {
		if (menu = myGetElementById("finish_menu")) {
			if (link.className != "current" && (selectedTab == 'Spacers' || myFrame.pnum == 15)) {
				hideSelect(); // do this hack before figuring the positions, because it can move stuff slightly
			}
			var lft = link.offsetLeft;
			var top = (link.offsetTop + link.offsetHeight);
			var parent = link;
			while (parent = parent.offsetParent) {
				lft += parent.offsetLeft;
				top += parent.offsetTop;
			}
			// ie mac doesn't figure the padding Ð adjust for it here
			if (BrowserDetect.OS == "Mac" && BrowserDetect.browser == "Explorer") {
			//	lft -= 38;
			}
			lft -= 1;
			top -= 1;
			menu.style.left = lft + "px";
			menu.style.top = top + "px";
			var wdth = (myFrame.isMetal ? 300 : 160);		//link.offsetWidth;// + 40; // add a little
			menu.style.width = wdth + "px";
			if (link.className == "current") {
				link.className = "";
				if (selectedTab == 'Spacers' || myFrame.pnum == 15) {
					restoreSelect();
				}
				menu.style.visibility = "hidden";
			} else {
				link.className = "current";
				menu.style.visibility = "visible";
			}
		}
	}
	return false;
}

function moutFinish() {
	if (link = myGetElementById("finish_menu_link")) {
		if (link.className == "current") {
			finishTimer = setTimeout("inactivateFinishMenu()", 700);
		}
	}
}

function moverFinish() {
	clearTimeout(finishTimer);
}

function selectTheFinish(fin) {
	myFrame.setFinish(fin);
		setInnerHTMLById('<span style="background-color: ' + bkgdColor(myFrame.finishNumber()) + '">' + breakFinString(myFrame.finish) + '</span>', "selected_finish");
	if (elem = myGetElementById("selected_finish")) {
	 	if (isDarkFinish(myFrame.finishNumber())) {
	 		elem.style.color = "#fff";
	 	} else {
	 		elem.style.color = "#000";
	 	}
	 	if (myFrame.isMetal) {
	 		i = myFrame.finishNumber();
			myFrame.setFrameLengthPrice(RoundToCent(Profile[myFrame.pnum].lprice[i]));
			myFrame.setFrameCutPrice(RoundToCent(Profile[myFrame.pnum].cprice[i]));
			elem.style.backgroundImage = "url(/Products/Metal/Finishes/" + Profile[myFrame.pnum].gifsrc[i] + ")";
			PriceEst();
			var p = myFrame.finish.indexOf(" ");
			if (p >= 0) {
				e = myGetElementById("sel" + myFrame.finish.substring(0,p));
				//e.style.border = "1px solid #ff0000";
				e.style.display = "block";
			}
	 	} else {
			for (i=0; i<Profile[myFrame.pnum].fin[myFrame.woodCode].pop.length; i++ ) {
				//alert (Profile[myFrame.pnum].fin[myFrame.woodCode].pop[i]);
				if (Profile[myFrame.pnum].fin[myFrame.woodCode].pop[i] == myFrame.finish) {
					if (myFrame.mustHaveBlackInterior() && !myFrame.blackInterior) {
						setCheckedById(true, "BlackIntCheck");
					}
					myFrame.setFinLengthPrice(RoundToCent(Profile[myFrame.pnum].fin[myFrame.woodCode].price[i]));
					myFrame.setFinCutPrice(RoundToCent(Profile[myFrame.pnum].fin[myFrame.woodCode].cutprice[i]));
					url = "url(/Products/options/" + Profile[myFrame.pnum].fin[myFrame.woodCode].imgsrc[i] + ")";
					elem.style.backgroundImage = url;
					//alert myFrame.finish;
					var p = myFrame.finish.indexOf(" ");
					if (p >= 0) {
						e = myGetElementById("sel" + myFrame.finish.substring(0,p));
						//e.style.border = "1px solid #FF0000";
						e.style.display = "block";
					}
					//alert (url);
					if (myFrame.isCut) {
						fno = myFrame.finishNumber();
						if ((fno == "13") || (fno == "15")) {
							Join = JoinOpaque;
						} else if (fno == "00") {
							Join = NormJoin;
						} else {
							Join = JoinFinish;
						}
						buildJoinMenu();
					}
					BlackIntFunky(); // always call this, because it sets the black int price dependent on finishes
					break;
				}
			}
		}
	}
	//inactivateFinishMenu();
	if (!(myFrame.isMetal)) {
//		if (Profile[myFrame.pnum].fin[myFrame.woodCode].pop.length == 1) {
//			element = myGetElementById("finishMenuText");
//			element.style.visibility = "hidden";
//		} else {
//			element = myGetElementById("finishMenuText");
//			element.style.visibility= "visible";
//		}
		for (j=0; j<Profile[myFrame.pnum].fin[myFrame.woodCode].pop.length; j++ ) {
			if (!(Profile[myFrame.pnum].fin[myFrame.woodCode].pop[j] == myFrame.finish)) {
				var p = Profile[myFrame.pnum].fin[myFrame.woodCode].pop[j].indexOf(" ");
				if (p >= 0) { 
					element = myGetElementById("sel" + Profile[myFrame.pnum].fin[myFrame.woodCode].pop[j].substring(0,p));
					//element.style.border = "1px solid #808080";
					element.style.display = "none";
				}
			}
		}
	} else {
//		if (Profile[myFrame.pnum].code.length == 1) {
//			element = myGetElementById("finishMenuText");
//			element.style.visibility = "hidden";
//		} else {
//			element = myGetElementById("finishMenuText");
//			element.style.visibility= "visible";
//		}
		for (i=0; i < Profile[myFrame.pnum].code.length; i++) {
			e = "";
			code = Profile[myFrame.pnum].code[i];
			var p = myFrame.finish.indexOf(" ");
			if (p >= 0) {
				e = myFrame.finish.substring(0,p);
			}
			if (!(code == e)) {
				//alert(code + " - " + e);
				element = myGetElementById("sel" + code);
				//element.style.border = "1px solid #777777";
				element.style.display = "none";
			}
		}
	}
	g = fin.indexOf(" ");
	if (g >= 0) {
		myNum = fin.substring(0,p);
	}
	if (element = myGetElementById(myNum)) {
		element.blur();
	}

	return false;
}

function buildJoinMenu() {
	html = "";
	foundit = false;
	for (i=0; i<Join.pop.length; i++) {
		html += '<a href="#" id="' + Join.pop[i].replace(/ /g,"") + '" onclick="return selectTheJoin(\'' + Join.pop[i] + '\')"' + ' class="joinblock" style="float:left; /*height:23px;*/ background-image:url(options/' + Join.img[i] + ')"><div id="sel' + Join.pop[i].replace(/ /g,"") + '" style="display: none; position: absolute; top: -2px; left: -1px; width: 80px; height: 80px; background-image: url(/Products/options/frameJoinDropShadow.png); border: none; padding: 0px; margin: 0px;"><img src="options/' + Join.img[i] + '" style="padding-top: 2px; padding-left: 2px; border: none; margin: 0px;"></div><div class="frameJoinTextPart">' + breakJoinString(Join.pop[i]) + '</div></a>';
		foundit = (foundit || Join.pop[i] == myFrame.joining);
	}
	if (!foundit && Join.pop[0]) {
		selectTheJoin(Join.pop[0]);
	} else {
		selectTheJoin(myFrame.joining);
	}
	setInnerHTMLById(html, "join_menu");
}

var joinTimer;

function inactivateJoinMenu() {
	if (link = myGetElementById("join_menu_link")) {
		link.className = "";
	}
	if (menu = myGetElementById("join_menu")) {
		menu.style.visibility = "hidden";
	}	
}

function activateJoinMenu() {
	if (link = myGetElementById("join_menu_link")) {
		if (menu = myGetElementById("join_menu")) {
			var lft = link.offsetLeft;
			var top = (link.offsetTop + link.offsetHeight);
			var parent = link;
			while (parent = parent.offsetParent) {
				lft += parent.offsetLeft;
				top += parent.offsetTop;
			}
			// ie mac doesn't figure the padding Ð adjust for it here
			if (BrowserDetect.OS == "Mac" && BrowserDetect.browser == "Explorer") {
			//	lft -= 38;
			}
			lft -= 1;
			top -= 1;
			menu.style.left = lft + "px";
			menu.style.top = top + "px";
			if (link.className == "current") {
				link.className = "";
				menu.style.visibility = "hidden";
			} else {
				link.className = "current";
				menu.style.visibility = "visible";
			}
		}
	}
	return false;
}

function moutJoin() {
	if (link = myGetElementById("join_menu_link")) {
		if (link.className == "current") {
			joinTimer = setTimeout("inactivateJoinMenu()", 700);
		}
	}
}

function moverJoin() {
	clearTimeout(joinTimer);
}

function markJoinSelected() {
	if (element = myGetElementById("sel" + myFrame.joining.replace(/ /g,""))) {
		//element.style.border = "1px solid #FF0000";
		element.style.display = "block";
	}
}

function selectTheJoin(jo) {
	if (elem = myGetElementById("selected_joining")) {
		for (i=0 ; i < Join.pop.length; i++) {
			if (Join.pop[i] == jo) {
				elem.style.backgroundImage = "url(options/" + Join.img[i] +")";
				setInnerHTMLById(breakJoinString(jo), "selected_joining");
				if (element = myGetElementById("sel" + jo.replace(/ /g,""))) {
					//element.style.border = "solid 1px #FF0000";
					element.style.display = "block";
					}
				if (myFrame.isCut) { // only need to save the joining option when dealing with cut
					myFrame.setJoining(jo);
					myFrame.setJoinItem(Join.item[i]);
					myFrame.setJoinPrice(Join.price[i]);
				} else {
					myFrame.setJoinPrice(0);
				}
				PriceEst();
				break;
			}
		}
	}
	inactivateJoinMenu();
	for (j=0; j < Join.pop.length; j++) {
		if (!(Join.pop[j] == jo)) {
			if (element = myGetElementById("sel" + Join.pop[j].replace(/ /g,""))) {
				//element.style.border = "1px solid #808080";
				element.style.display = "none";
			}
		}
	}
	if (element = myGetElementById(jo.replace(/ /g,""))) {
		element.blur();
	}
	return false;
}

function isDarkFinish(num) {
	if (myFrame.isMetal) {
		return (num == 50 || num == 18 || num == 19 || num == 20 || num == 21 || num == 01 || num == 03 || num == 13 || num == 14);
	} else {
		return (num == 11 || num == 10 || num == 33 || num == 34 || num == 2 || num == 3 || /*num == 6 ||*/ num == "13A" || num == 9  || num == 14 || num == 19 || num == 36 );
	}
}

function bkgdColor(num) {
	if (myFrame.isMetal) {
		if (num == 1 || num ==2 || num == 14) {
			return "#eee";
		}
		if (num == 1 || num == 2 || (num > 9 && num < 15)) {
			return "#ccc";
		}
		if (num == 3) {
			return "#ffe7c6";
		}
		if (num == 18) {
			return "#5a3929";//"#ffefde";
		}
		if (num == 19) {
			return "#413939";
		}
		if (num == 20) {
			return "#000";
		}
		if (num == 22) {
			return "#c6845a";
		}
		if (num == 30) {
			return "#ad8c84";
		}
	} else {
		if (num == 6) {
			return "#ce8431";
		}
	}
	return "none";
}
