function goTo (where) {
	if (where != "") window.location.href = where;
}


function show(file, width, height)
{

width2 = width + 40;
height2 = height + 40;

  res=window.open("", "_blank", "width="+width2+", height="+height2+", toolbar=no, menubar=no, location=no, directories=no, resizeable=no, fullscreen=no");
  res.document.write("<html><body leftmargin=20 topmargin=20 rightmargin=20 bottommargin=20 marginwidth=20 marginheight=20><img src='"+file+"'></body></html>");
  res.document.close();
}

function _formatPrice( _price )
{			
		_price = String(_price);			   			
		_pointIndex = -1;	
		for( i=0; i< _price.length; i++ )
			if ( _price.charAt(i) == '.' )
			{
				_pointIndex = i;
				break;
			}

		if (  _pointIndex == -1 )
			_price = _price + ".00";
		else if (  _price.length-1 - _pointIndex == 1  )
			_price = _price + "0";

		_res = "";

		i=0;
		for( i=_price.length-1; i >= 0; i-- )
		{
			if ( _price.charAt(i) == '.' )
				break;
			else
				_res = _price.charAt(i) + _res;
		}

		_res = "." + _res;

		i--;
		_digitCounter = 0;
		for( ; i>=0; i-- )
		{
			_digitCounter ++;
			_res = _price.charAt(i) + _res;
			if ( _digitCounter == 3 && i != 0 )
			{
				_res = "," + _res;
				_digitCounter = 0;
			}
					
		}

		return _res;						
}

function change_atribut(ap, p_id)
{                       
 
 document.getElementById("s_price_"+p_id).innerHTML = _formatPrice(parseFloat(document.getElementById("price_"+p_id).value) + parseFloat(( ap.split(":") )[0]));
 
 if (document.getElementById("old_price_"+p_id).value)
 	document.getElementById("s_old_price_"+p_id).innerHTML = _formatPrice(parseFloat(document.getElementById("old_price_"+p_id).value) + parseFloat(( ap.split(":") )[0]));
 
}