google.load("search", "1");

function OnLoad() {
	// Create a search control
	var searchControl = new google.search.SearchControl();

	// Create a Web Search
	var webSearch = new google.search.WebSearch()

	// Set the Search Control to get the most number of results
	searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);

	// Restrict our search to pages from Weld Engineering
	webSearch.setSiteRestriction('www.weldengineering.com');

	// web search, open, alternate root
	var options = new google.search.SearcherOptions();
	options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
	options.setRoot(document.getElementById("cse"));
	searchControl.addSearcher(webSearch, options);

	// Set No Result String
	options.setNoResultsString("<center>Your search query did not return any results.  Please check your spelling and try again.<\/br>You may also have to try removing quotes or other punctuation and operators.<\/center>")

	// Make Open On Same Page
	webSearch.setLinkTarget("_self")

	// Tell the searcher to draw itself and tell it where to attach
	searchControl.draw(document.getElementById("searchcontrol"));
}

google.setOnLoadCallback(OnLoad);


function show(elemnt) {

	var a = document.getElementById(elemnt);

	if(a.style.display == 'block')
		{a.style.display = 'none';}

	else
		{a.style.display = 'block';}
}

function printpic(elmnt1,elmnt2) {
	document.open();
	document.write('<html><head><title>Weld Engineering, Co. - ');
	document.write(elmnt1);
	document.write('<\/title><style type="text/css" media="screen">@import url( includes/printimg.css );<\/style><div id="printheader"><img src="images/header.png" alt="Weld Engineering Header"><\/div><h1 style="text-align:center;font-family:Arial;">');
	document.write(elmnt1);
	document.write('<\/h1><link href="includes/print.css" type="text/css" rel="stylesheet" media="print"><\/head><body><center><img src="images/');
	document.write(elmnt2);
	document.write('" style="position:relative;top:-10px;"><br><span class="noprint"><a href="');
	document.write(window.location.href);
	document.write('">BACK<\/a> | <a href="#" onclick="window.print();return false;">PRINT<\/a><\/span><\/center><\/body><\/html>');
	document.close();
}

function printpng(elmnt1,elmnt2) {
	document.open();
	document.write('<html><head><title>Weld Engineering, Co. - ');
	document.write(elmnt1);
	document.write('<\/title><style type="text/css" media="screen">@import url( printimg.css );<\/style><div id="printheader"><img src="images/header.png" alt="Weld Engineering Header"><\/div><h1 style="text-align:center;font-family:Arial;">');
	document.write(elmnt1);
	document.write('<\/h1><link href="print.css" type="text/css" rel="stylesheet" media="print"><\/head><body><center><img src="tb708/');
	document.write(elmnt2);
	document.write('" style="position:relative;top:-10px;"><br><span class="noprint"><a href="');
	document.write(window.location.href);
	document.write('">BACK<\/a> | <a href="#" onclick="window.print();return false;">PRINT<\/a><\/span><\/center><\/body><\/html>');
	document.close();
}

function high(elemnt) {
	var a = document.getElementById(elemnt);
	a.style.color = 'red';

}


function low(elemnt) {
	var a = document.getElementById(elemnt);
	a.style.color = 'blue';
}

	var cst=0
	var wld=0
	var mtl=0
	var flx=0
	var lbr=0

function calculate() {

	var ecost=document.CALCULATOR.equip.options[document.CALCULATOR.equip.selectedIndex].value

	if (ecost=="std")
		cst=1*3000

	else if (ecost=="hvy")
		cst=1*10500
	else if (ecost=="pipe")
		cst=1*45000

	var tweld=document.CALCULATOR.weld.options[document.CALCULATOR.weld.selectedIndex].value

	if (tweld=="sngl")
		wld=1*1

	else if (tweld=="twn")
		wld=1*2

	else if (tweld=="tndm")
		wld=1*2.5

	else if (tweld=="farc")
		wld=1*8.75

	var mtl=document.CALCULATOR.metal.value

	var flx=document.CALCULATOR.flux.value

	var lbr=document.CALCULATOR.labor.value

	if (document.all) {
		document.all["writeto"].innerHTML = Math.round(wld*mtl*50)+" Lbs. of Flux Saved per Year<br>$"+Math.round(wld*mtl*flx*50+lbr*5*50-cst)+" Saved in First Year<br>"+"$"+Math.round(wld*mtl*flx*50+lbr*5*50)+" Saved Each Year After";}

	else if (document.getElementById) {
		document.getElementById("writeto").innerHTML = Math.round(wld*mtl*50)+" Lbs. of Flux Saved per Year<br>$"+Math.round(wld*mtl*flx*50+lbr*5*50-cst)+" Saved in First Year<br>"+"$"+Math.round(wld*mtl*flx*50+lbr*5*50)+" Saved Each Year After";}

	else {
		alert(Math.round(wld*mtl*50) + ' Lbs. of Flux Saved per Year' + '\n' + '$' + Math.round(wld*mtl*flx*50+lbr*5*50-cst) + ' Saved in First Year' + '\n' + '$' + Math.round(wld*mtl*flx*50+lbr*5*50) + ' Saved Each Year After');}

}


function clear1() {

	if (document.all) {
		document.all["writeto"].innerHTML = "&nbsp;";}

	else if (document.getElementById) {
		document.getElementById("writeto").innerHTML = "&nbsp;";}

	else {
		alert("Please upgrade your browser to Firfox 3.0, Internet Explorer 8.0, Google Chrome, Safari, Opera 9, or to the latest current version of those.");}

}

var addthis_options = 'slashdot, technorati, delicious, diigo, twitter, digg, stumbleupon, reddit, linkedin, google, newsvine, facebook, more';
var addthis_exclude = 'print, email, favorites';

function boothpop() {
	window.open( "booth.png", "BoothPopUp", "status = 1, height = 670, width = 1182, resizable = 0" )
}