
//saveas button
function openPic(objurl) {
	var newWindow = window.open("", "SaveImage", "resizable,status=no,menubar=no,toolbar=no");
	newWindow.document.write("<html><body><p>To download the image below, right click on the image.  Then selete 'Save Picture As' or 'Save Image As' from the selete list, and the save diaglog box for the image will come up.</p><img src='" + objurl + "'>");
	newWindow.document.write("</body></html>");
	newWindow.document.close();
	return false;
}

//print the html
function printPage() {
	window.print();  
}

function emailfriend(stock_id,item_name) {
	var newWindow = window.open("", "SaveImage", "resizable,status=no,menubar=no,toolbar=no");
	newWindow.document.write("</body></html>");

	newWindow.document.write("<head>");
	newWindow.document.write("\<SCRIPT language='javascript'");
 	newWindow.document.write("\>");
	//newWindow.document.write("var initialsubj=\"Hay buddy, take a look at this\";");
	newWindow.document.write("var initialsubj=\"Take a look at this: " + item_name + " (" + stock_id + ") \";");
	//newWindow.document.write("var initialmsg=\"Hi:\\n You may want to check out this site: \"+window.location;");
	newWindow.document.write("var initialmsg=\"Hi, you may want to check out this item:\%0AItem No.: " + stock_id + "\%0AItem Name: " + item_name + "\%0ALink: " + " \"+window.location;");
	newWindow.document.write("var good;");
	newWindow.document.write("function checkEmailAddress(field) {");
	newWindow.document.write("var goodEmail = field.value.match(/\\b(^(\\S+@).+((\\.com)|(\\.net)|(\\.edu)|(\\.mil)|(\\.gov)|(\\.org)|(\\.info)|(\\.sex)|(\\.biz)|(\\.aero)|(\\.coop)|(\\.museum)|(\\.name)|(\\.pro)|(\\..{2,2}))$)\\b/gi);");
	newWindow.document.write("if (goodEmail) {");
	newWindow.document.write("good = true;");
	newWindow.document.write("} else {");
	newWindow.document.write("alert('Please enter a valid address.');");
	newWindow.document.write("field.focus();");
	newWindow.document.write("field.select();");
	newWindow.document.write("good = false;}}");
	newWindow.document.write("u = window.location;");
	newWindow.document.write("function mailThisUrl() {");
	newWindow.document.write("good = false;");
	newWindow.document.write("checkEmailAddress(document.eMailer.email);");
	newWindow.document.write("if (good) {");
	newWindow.document.write("window.location = \"mailto:\"+document.eMailer.email.value+\"?subject=\"+initialsubj+\"&body=\"+initialmsg;}");
	newWindow.document.write("window.close();}");
 	newWindow.document.write("\<");
	newWindow.document.write("\/");
	newWindow.document.write("SCRIPT");
	newWindow.document.write("\>");
	newWindow.document.write("</head>");
	newWindow.document.write("<html><body><form name='eMailer'>Enter Address Here:<input type='text' name='email' size='26' value=''><br>");
	newWindow.document.write("<input type='button' value='Send this URL' onClick='mailThisUrl();'></form></body></html>");
	newWindow.document.close();
	
}

//-->
