
function myopen(url,w,h) 
{
   w = (typeof w == 'undefined') ? 400 : w;
   h = (typeof h == 'undefined') ? 300 : h;
	feat ="resizable=yes,toolbar=no,location=no,scrollbars=no,status=no,menubar=no,width=" + w + ",height=" + h + ",left=10,top=10";
	popupWindow=window.open(url,'SoupInfo',feat);
	popupWindow.focus();
}

/* =====================================================
Script: Emulate Button  
Author: D Savage dsavage@websiteapps.com
Copyright 2006,2007,2008
Website: www.websiteapps.com
Instructions:
	Use style sheets to format the buttons and text links for the appearance you want.
	The class names are not important, so it can be used for more then one type of 
	button on a page or site.
@PARAM emuButton([div element],[0/1 (0=up,1=down)],[use images (0/1/2)],[border style (default=inset)])
	Use Images: 
		0 = no background image
		1 = use images defined in vars buttonImgUp & buttonImgDwn with no border
		2 = use images defined in vars buttonImgUp & buttonImgDwn with border
	example:
	 <div class'navButton' onmouseup='emuButton(this,"u",0)' onmousedown='emuButton(this,"d",0)' 
		onClick='location.assign("url")><a href='url'>Text for link</a></div>
Requirements:
	<div> ,<span>, or table cell<td> is required for the click effect.
	Div must have at least 1px css padding on two parrallel sides 
	(left/right or top/bottom) for text affect. 4 sides provides full effect.
	Will work in browsers supporting currentStyle || getComputedStyle
	The <a href> link around the text supports all browsers
Licence: 
	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU Affero General Public License as
	published by the Free Software Foundation, either version 3 of the
	License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Affero General Public License for more details.

	You should have received a copy of the GNU Affero General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.

======================================================= */
// urls to images to use as up and down button backgrounds (optional)
var buttonUp = new Image();
buttonUp.src = "";
var buttonDown = new Image();
//buttonDown.src =  "/soupandstockmarket/images/buttonDown.gif";
buttonDown.src =  "";

// var to hold up style - do not change
var buttonBdr = "";
function emuButton(el,down,useImg,bStyle) 
{		
	if (el.currentStyle || window.getComputedStyle)
	{
	  useImg = (typeof useImg == 'undefined') ? 0 : useImg;
	  bStyle = (typeof bStyle == 'undefined') ? "inset" : bStyle;
		if (buttonBdr =="") {
			buttonBdr = (el.currentStyle) ? el.currentStyle["borderStyle"] : 
			document.defaultView.getComputedStyle(el,null).getPropertyValue("border-style");
		}
		var top;
		var bottom;
		var left;
		var right;
		if (el.currentStyle)
		{
			top = parseInt(el.currentStyle["paddingTop"]);
			bottom = parseInt(el.currentStyle["paddingBottom"]);
			left = parseInt(el.currentStyle["paddingLeft"]);
			right = parseInt(el.currentStyle["paddingRight"]);
		} else 
		{
			top = parseInt(document.defaultView.getComputedStyle(el,null).getPropertyValue("padding-top"));
			bottom = parseInt(document.defaultView.getComputedStyle(el,null).getPropertyValue("padding-bottom"));
			left = parseInt(document.defaultView.getComputedStyle(el,null).getPropertyValue("padding-left"));
			right = parseInt(document.defaultView.getComputedStyle(el,null).getPropertyValue("padding-right"));
		} 
		if (down) 
		{
			if (top>0 && bottom>0) { top++; bottom--; }
			if (left>0 && right>0) { left++; right--; }
			if (useImg==0 || useImg==2) 	
				el.style.borderStyle= bStyle; 
			if (useImg && buttonDown.src) 
				el.style.backgroundImage = eval("'url("+buttonDown.src+")'"); 	
		} else
		{	
			if (top>0 && bottom>0) { top--; bottom++; } 
			if (left>0 && right>0) { left--; right++; }
			if (useImg==0 || useImg==2) 	
				el.style.borderStyle= buttonBdr; 
			if (useImg && buttonUp.src) 			
				el.style.backgroundImage = eval("'url("+buttonUp.src+")'"); 	
		}
		el.style.paddingTop = top.toString() + "px";
		el.style.paddingBottom = bottom.toString() + "px"; 
		el.style.paddingLeft = left.toString() + "px";
		el.style.paddingRight = right.toString() + "px"; 
	}
}