subt = 0; 
addtax = 0;
addtaxtot = 0;  
tot = 0; 
vattot = 0; 
var aQuant = new Array();
var aPrice = new Array();
var aDescr = new Array();
var aTax = new Array();
var timeOutId = 0;

//-------------------------------------
function AddDecimal(number)
{
  var withdecimal = "";
  var num = "" + number;
  if (num.length == 0)
  {
      withdecimal += "0";
  }
  else if (num.length == 1)
  {
      withdecimal += "0.0" + num;
  }
  else if (num.length == 2)
  {
      withdecimal += "0." + num;
  }
  else
  {
	  withdecimal += num.substring(0, num.length - 2);
	  withdecimal += "."
	  withdecimal += num.substring(num.length - 2, num.length);
  }
  return withdecimal;
}

//-------------------------------------
function AddTaxDecimal(number)
{
  var withdecimal = "";
  var num = "" + number;
  if (num.length == 0)
  {
      withdecimal += "0";
  }
  else if (num.length == 1)
  {
      withdecimal += "0";
  }
  else if (num.length == 2)
  {
      withdecimal += "0";
  }
  else if (num.length == 3)
  {
	  withdecimal += "0.0";
	  withdecimal += num.substring(num.length - 3, num.length - 2);
  }
  else if (num.length == 4)
  {
	  withdecimal += "0.";
	  withdecimal += num.substring(num.length - 4, num.length - 2);

  }
  else
  {
	  withdecimal += num.substring(0, num.length - 4);
	  withdecimal += "."
	  withdecimal += num.substring(num.length - 4, num.length - 2);
  }
  return withdecimal;
}
//-------------------------------------
function updateLeft()
{
	shipi = top.frames[1].document.forms[0].elements[0].selectedIndex;
	ship = top.frames[1].document.forms[0].elements[0].options[shipi].value; 
	addtax = Math.round(addtax);
	tot = (eval(subt) + eval(ship));
	vattot = (eval(subt) + eval(ship) + eval(addtax));
	p = aQuant.length * 0.5;
	top.frames[1].document.forms[0].subtotal.value = AddDecimal(subt);
	top.frames[1].document.forms[0].shipping.value = AddDecimal(ship);
	top.frames[1].document.forms[0].addedtax.value = AddDecimal(addtax);
	top.frames[1].document.forms[0].num_order_hidden.value = p;
	if (top.frames[1].document.forms[0].subtotal.value == 0.00)
	{
		tot = 0;
	  	top.frames[1].document.forms[0].total.value ="0.00";
		vattot = 0;
	  	top.frames[1].document.forms[0].vattotal.value ="0.00";
	}
	else
        {
		top.frames[1].document.forms[0].total.value = AddDecimal(tot);
		top.frames[1].document.forms[0].vattotal.value = AddDecimal(vattot);
 	}	

	if (top.frames[1].document.forms[0].shipping.value == 45.00)
	{
		top.frames[1].document.forms[0].shipping_type_hidden.value = "FedEx Priority Service";
	}
	else if (top.frames[1].document.forms[0].shipping.value == 25.00)
	{
		top.frames[1].document.forms[0].shipping_type_hidden.value = "TPG International Priority Plus Mail";
	}
	else if (top.frames[1].document.forms[0].shipping.value == 20.00)
	{
		top.frames[1].document.forms[0].shipping_type_hidden.value = "TPG International Priority Mail";
	}
        else if (top.frames[1].document.forms[0].shipping.value == 10.00) 
	{
		top.frames[1].document.forms[0].shipping_type_hidden.value = "TPG International Economy Mail";
 	}	
}
//-------------------------------------
function updatefieldLeft()
{
	titlei = top.frames[2].document.forms[0].title.selectedIndex;
	title = top.frames[2].document.forms[0].title.options[titlei].value;
	first_name = top.frames[2].document.forms[0].first_name.value;
	last_name = top.frames[2].document.forms[0].last_name.value;
	company = top.frames[2].document.forms[0].company.value;
	Email = top.frames[2].document.forms[0].Email.value;
	phone = top.frames[2].document.forms[0].phone.value;
	address1 = top.frames[2].document.forms[0].address1.value;
	address2 = top.frames[2].document.forms[0].address2.value;
	city = top.frames[2].document.forms[0].city.value;
	state = top.frames[2].document.forms[0].state.value;
	zipcode = top.frames[2].document.forms[0].zipcode.value;
	countryi = top.frames[2].document.forms[0].country.selectedIndex;
	country = top.frames[2].document.forms[0].country.options[countryi].value;
	navigationi = top.frames[2].document.forms[0].navigation.checked;
	gifti = top.frames[2].document.forms[0].gift.checked;

	top.frames[1].document.forms[0].title_hidden.value = title;
	top.frames[1].document.forms[0].first_name_hidden.value = first_name;
	top.frames[1].document.forms[0].last_name_hidden.value = last_name;
	top.frames[1].document.forms[0].company_hidden.value = company;
	top.frames[1].document.forms[0].Email_hidden.value = Email;
	top.frames[1].document.forms[0].phone_hidden.value = phone;
	top.frames[1].document.forms[0].address1_hidden.value = address1;
	top.frames[1].document.forms[0].address2_hidden.value = address2;
	top.frames[1].document.forms[0].city_hidden.value = city;
	top.frames[1].document.forms[0].state_hidden.value = state;
	top.frames[1].document.forms[0].zipcode_hidden.value = zipcode;
	top.frames[1].document.forms[0].country_hidden.value = country;

	if(navigationi == 1)
	{
	top.frames[1].document.forms[0].navigation_hidden.value = "regular";
	}
	else
	{
	top.frames[1].document.forms[0].navigation_hidden.value = "";
	}

	if(gifti == 1)
	{
	top.frames[1].document.forms[0].gift_hidden.value = "gift";
	}
	else
	{
	top.frames[1].document.forms[0].gift_hidden.value = "";
	}
	if((top.frames[1].document.forms[0].country_hidden.value == "Austria") || (top.frames[1].document.forms[0].country_hidden.value == "Belgium") || 
(top.frames[1].document.forms[0].country_hidden.value == "Cyprus") || 
(top.frames[1].document.forms[0].country_hidden.value == "Czech Republic") || 
(top.frames[1].document.forms[0].country_hidden.value == "Denmark") || (top.frames[1].document.forms[0].country_hidden.value == "England") || (top.frames[1].document.forms[0].country_hidden.value == "Espana") || 
(top.frames[1].document.forms[0].country_hidden.value == "Estonia") || (top.frames[1].document.forms[0].country_hidden.value == "Finland") || (top.frames[1].document.forms[0].country_hidden.value == "France") || (top.frames[1].document.forms[0].country_hidden.value == "Germany") || (top.frames[1].document.forms[0].country_hidden.value == "Great Britain") || (top.frames[1].document.forms[0].country_hidden.value == "Greece") || 
(top.frames[1].document.forms[0].country_hidden.value == "Hungary") || 
(top.frames[1].document.forms[0].country_hidden.value == "Ireland") || (top.frames[1].document.forms[0].country_hidden.value == "Italy") || 
(top.frames[1].document.forms[0].country_hidden.value == "Latvia") || (top.frames[1].document.forms[0].country_hidden.value == "Lithuania") || 
(top.frames[1].document.forms[0].country_hidden.value == "Luxembourg") || 
(top.frames[1].document.forms[0].country_hidden.value == "Malta") || (top.frames[1].document.forms[0].country_hidden.value == "Netherlands") || (top.frames[1].document.forms[0].country_hidden.value == "Poland") || 
(top.frames[1].document.forms[0].country_hidden.value == "Portugal") ||
(top.frames[1].document.forms[0].country_hidden.value == "Scotland") || 
(top.frames[1].document.forms[0].country_hidden.value == "Slovakia") || 
(top.frames[1].document.forms[0].country_hidden.value == "Slovenia") ||
(top.frames[1].document.forms[0].country_hidden.value == "Spain") || (top.frames[1].document.forms[0].country_hidden.value == "Sweden") || (top.frames[1].document.forms[0].country_hidden.value == "United Kingdom") || (top.frames[1].document.forms[0].country_hidden.value == "Wales"))
	{
	top.frames[1].document.forms[0].eu_hidden.value = "eu";
	}
	else
	{
	top.frames[1].document.forms[0].eu_hidden.value = "";
	}
}
//-------------------------------------
function updatefieldLeftGift()
{
	gift_titlei = top.frames[2].document.forms[0].gift_title.selectedIndex;
	gift_title = top.frames[2].document.forms[0].gift_title.options[gift_titlei].value;
	gift_name = top.frames[2].document.forms[0].gift_name.value;
	gift_address1 = top.frames[2].document.forms[0].gift_address1.value;
	gift_address2 = top.frames[2].document.forms[0].gift_address2.value;
	gift_city = top.frames[2].document.forms[0].gift_city.value;
	gift_state = top.frames[2].document.forms[0].gift_state.value;
	gift_zipcode = top.frames[2].document.forms[0].gift_zipcode.value;
	gift_countryi = top.frames[2].document.forms[0].gift_country.selectedIndex;
	gift_country = top.frames[2].document.forms[0].gift_country.options[gift_countryi].value;
	giftwrapi = top.frames[2].document.forms[0].giftwrap.checked;

	top.frames[1].document.forms[0].gift_title_hidden.value = gift_title;
	top.frames[1].document.forms[0].gift_name_hidden.value = gift_name;
	top.frames[1].document.forms[0].gift_address1_hidden.value = gift_address1;
	top.frames[1].document.forms[0].gift_address2_hidden.value = gift_address2;
	top.frames[1].document.forms[0].gift_city_hidden.value = gift_city;
	top.frames[1].document.forms[0].gift_state_hidden.value = gift_state;
	top.frames[1].document.forms[0].gift_zipcode_hidden.value = gift_zipcode;
	top.frames[1].document.forms[0].gift_country_hidden.value = gift_country;

	if(giftwrapi == 1)
	{
	top.frames[1].document.forms[0].giftwrap_hidden.value = "yes";
	}
	else
	{
	top.frames[1].document.forms[0].giftwrap_hidden.value = "no";
	}
}
//-------------------------------------
function updatefieldLeftPay()
{
	PhoneNumberPrivate = top.frames[2].document.forms[0].PhoneNumberPrivate.value;
	callbacki = top.frames[2].document.forms[0].callback.selectedIndex;
	callback = top.frames[2].document.forms[0].callback.options[callbacki].value;
	PhoneNumberBusiness = top.frames[2].document.forms[0].PhoneNumberBusiness.value;
	callback1i = top.frames[2].document.forms[0].callback1.selectedIndex;
	callback1 = top.frames[2].document.forms[0].callback1.options[callback1i].value;
	top.frames[1].document.forms[0].PhoneNumberPrivate_hidden.value = PhoneNumberPrivate;
	top.frames[1].document.forms[0].callback_hidden.value = callback;
	top.frames[1].document.forms[0].PhoneNumberBusiness_hidden.value = PhoneNumberBusiness;
	top.frames[1].document.forms[0].callback1_hidden.value = callback1;
}
//-------------------------------------
function refreshCheckout()
{
	if(top.frames[2].document.title == "CheckOut")
	{
	top.frames[2].document.location="checkout.htm";
	}
	else if(top.frames[2].document.title == "CheckOut_cc")
	{
	top.frames[2].document.location="checkout_cc.htm";
	}
	else if(top.frames[2].document.title == "CheckOut_fax")
	{
	top.frames[2].document.location="checkout_fax.htm";
	}
	else if(top.frames[2].document.title == "CheckOut_callback")
	{
	top.frames[2].document.location="checkout_callback.htm";
	}
}
//-------------------------------------
function compute(list_index,price,descr,tax)
{
  sindex = top.frames[2].document.forms[0].elements[list_index].value;
  aQuant.length = aQuant.length + 1;

  if (sindex == 0)
  {
	  alert("Please enter the quantity and add the item once again.");
	  top.frames[2].document.forms[0].elements[list_index].focus();
  }
  else
  {
	  m = aQuant.length - 1;
	  n = m + 1; 
	  aQuant[n] = sindex;
	  aPrice[n] = price;
	  aDescr[n] = descr;
	  aTax[n] = tax;
	  subt = (eval(subt) + (eval(price) * eval(sindex)));
	  addtax = (eval(addtax) + (eval(price) * eval(sindex) * eval(tax) * 0.01));
	  updateLeft();	
  }
}
//-------------------------------------
function uncompute2(quant,price,descr,tax)
{	
	  var undescr = unescape(descr); 

	  if((subt != 0)&&(confirm("Remove " + quant + " " + undescr + " from your shopping cart?")))
	  {
          subt = (eval(subt) - (eval(price) * eval(quant)));
	  addtax = (eval(addtax) - (eval(price) * eval(sindex) * eval(tax) * 0.01));		
			//-------------------------------------
			for(i=0; i < aQuant.length; i++)
			{
				if((aDescr[i]== undescr)&&(aQuant[i]==quant))
				{
					aQuant[i]=0;
					break;
				}
			}
			timeOutId = setTimeout("updateLeft()",100); 
			timeOutId = setTimeout("showCart()",100); 			  		
	    }else{
	   			 return;
			 }				
}	
//--------------------------------------------------------------------- 
function checkOutCart()
{
	if(top.frames[0].subt <= 3499)
	{
		alert("The subtotal must be at least EUR 35.00. Please add additional items.");
	}
	else
	{
		top.frames[2].document.forms[0].submit();
	}
}
//--------------------------------------------------------------------- 
function checkOutInfo()
{
	if(top.frames[2].document.forms[0].Email.value == "")
	{
		alert("Please enter your email address.");
		top.frames[2].document.forms[0].Email.focus();
		top.frames[2].document.forms[0].Email.select();
	}
	else if(top.frames[2].document.forms[0].Email.value.indexOf('@') == -1)
	{
		alert("Please correct your email address. It should look like you@domain.com");
		top.frames[2].document.forms[0].Email.focus();
		top.frames[2].document.forms[0].Email.select();
	}
	else if(top.frames[2].document.forms[0].address1.value == "")
	{
		alert("Please enter your shipping address.");
		top.frames[2].document.forms[0].address1.focus();
		top.frames[2].document.forms[0].address1.select();
	}
	else if(top.frames[2].document.forms[0].city.value == "")
	{
		alert("Please enter the city.");
		top.frames[2].document.forms[0].city.focus();
		top.frames[2].document.forms[0].city.select();
	}
	else if(top.frames[2].document.forms[0].zipcode.value == "")
	{
		alert("Please enter the zip or postal code.");
		top.frames[2].document.forms[0].zipcode.focus();
		top.frames[2].document.forms[0].zipcode.select();
	}
	else
	{
		if(top.frames[2].document.forms[0].gift.checked == 1)
		{
		top.frames[2].document.location="gift_info.htm";
		}
		else if((top.frames[2].document.forms[0].gift.checked == 0) && (top.frames[2].document.forms[0].navigation.checked == 1))
		{
		top.frames[2].document.location="checkout.htm";
		}
		else
		{
		top.frames[2].document.forms[0].submit();
		}
	}
}
//--------------------------------------------------------------------- 
function checkOutInfoGift()
{
	if(top.frames[2].document.forms[0].gift_address1.value == "")
	{
		alert("Please enter the billing address.");
		top.frames[2].document.forms[0].gift_address1.focus();
		top.frames[2].document.forms[0].gift_address1.select();
	}
	else if(top.frames[2].document.forms[0].gift_city.value == "")
	{
		alert("Please enter the city.");
		top.frames[2].document.forms[0].gift_city.focus();
		top.frames[2].document.forms[0].gift_city.select();
	}
	else if(top.frames[2].document.forms[0].gift_zipcode.value == "")
	{
		alert("Please enter the zip or postal code.");
		top.frames[2].document.forms[0].gift_zipcode.focus();
		top.frames[2].document.forms[0].gift_zipcode.select();
	}
	else
	{
		if(top.frames[1].document.forms[0].navigation_hidden.value == "regular")
		{
		top.frames[2].document.location="checkout.htm";
		}
		else
		{
		top.frames[2].document.forms[0].submit();
		}
	}
}
//-------------------------------------
function showCart()
{
  var doc = top.frames[2].window.document;
  doc.clear();
  doc.write("<title>Shopping cart</title>");
  doc.write("<link REL='stylesheet' HREF='style/style.css' TYPE='text/css'>");
  doc.write("<base target='_self'>");
  doc.write("<body topmargin=0 leftmargin=0>");

  doc.write("<form action='info.htm' target=bottom>");

  doc.write("<table width=600 border=0 cellspacing=20 cellpadding=0>");
  doc.write("<tr><td width=100%>");
  doc.write("<table width=95% border=0 cellpadding=3 cellspacing=1>");
  doc.write("<tr><td colspan=5 align=right><img src='images/header_your_shopping_cart.gif' border=0 width=227 height=32></td></tr></table>");

  doc.write("<table width=95% border=0 cellpadding=3 cellspacing=1 bgcolor=#FFFFFF>");
   doc.write("<tr bgcolor=#FF8000><td width=46% class=orange><b>Item</b></td><td width=14% align=right class=orange><b>Unit price</b></td><td align=center width=11% class=orange><b>Quantity</b></td><td align=right width=17% class=orange><b>Total (EUR)</b></td><td align=center width=12% class=orange><b>Remove</b></td></tr>");
  //-------------------------------------
  m = aQuant.length - 1;
  n = m + 1; 
  if(subt == 0)
  {
  	tot = 0;
  }	
  //-------------------------------------
  for (i=0 ; i < n; i++)
  {
	  	if((aQuant[i] != null)&&(aQuant[i] != 0))
		{
		cost = eval(aPrice[i])*eval(aQuant[i]);
		var description = escape(aDescr[i]);
		x = (i+1) * 0.5;
		p = aQuant.length * 0.5;
		doc.write("<tr bgcolor=#FF8000>");
  		doc.write("<td class=orange>" + aDescr[i] + "</td><td align=right class=orange>" + AddDecimal(aPrice[i]) + "</td><td align=center class=orange>" +  aQuant[i] + "</td><td align=right class=orange>" + AddDecimal(cost) + "</td>");
		doc.write("<td align=center class=orange><A HREF=javascript:top.frames[0].uncompute2(" + aQuant[i] + "," + aPrice[i] + ",'" + description + "'," + aTax[i] + ")><img src='images/remove_cart_white.gif' border=0 width=16 height=15 alt='remove from shopping cart'></A></td>");
		doc.write("</tr>");
		}	
  }	
  //-------------------------------------
  doc.write("<tr bgcolor=#FF8000><td colspan=3 class=orange><b>Your subtotal is: </b></td><td align=right class=orange><b>EUR " +  AddDecimal(subt) + "</b></td><td class=orange>&nbsp;</td></tr></table>")
  //-------------------------------------
  doc.write("<table width=95% border=0 cellpadding=3 cellspacing=1>");
  doc.write("<tr><td colspan=5 class=footer>--<a href='javascript:top.frames[1].refresh();' class=menu>empty cart</a>--</td></tr>")
  doc.write("<tr><td align=right colspan=5><a href='javascript:top.frames[0].checkOutCart();'><img src='images/order_white.gif' border=0 width=21 height=21></a></td></tr>")
  //-------------------------------------
        doc.write("<tr><td colspan=5><br>")
        doc.write("<table border=0 width=100% cellpadding=0 cellspacing=0>")
doc.write("<tr><td><a href=javascript:history.go(-1) class=page><< Continue shopping</a></td></tr>")
	doc.write("</table>")
	doc.write("</td></tr>")

  doc.write("<tr><td colspan=5 align=right><br>")
	doc.write("<table border=0 width=80% cellpadding=0 cellspacing=1 bgcolor=#282828>")
	doc.write("<tr><td width=20% bgcolor=#282828><img src='images/trans.gif' width=1 height=5></td><td width=20% bgcolor=#FFFFFF></td><td width=20% bgcolor=#FFFFFF></td><td width=20% bgcolor=#FFFFFF></td><td width=20% bgcolor=#FFFFFF></td></tr>")
	doc.write("</table>")
	doc.write("<table border=0 width=80% cellpadding=0 cellspacing=1>")
	doc.write("<tr><td width=20% align=center class=footer>Shopping Cart</td><td width=20% align=center class=footer>Address</td><td width=20% align=center class=footer>[Gift]</td><td width=20% align=center class=footer>Payment</td><td width=20% align=center class=footer>Checkout</td></tr>")
	doc.write("</table>")
	doc.write("</td></tr>")

  doc.write("</table>")
  doc.write("</form>")
  doc.write("<br>")
  doc.write("</body>");
  doc.close();
}
//-------------------------------------
function showCheckout()
{
  var doc = top.frames[2].window.document;
var ref= new Date();
month = ref.getMonth() + 1;
ref = ref.getYear()+"."+month+"."+ref.getDate()+"."+ref.getHours()+"."+ref.getMinutes();
  doc.clear();
  doc.write("<table width=95% border=0 cellpadding=3 cellspacing=1>");
  doc.write("<tr><td colspan=4 align=right><img src='images/header_checkout.gif' border=0 width=104 height=28></td></tr></table>");
  doc.write("<table><tr><td class=orange>Reference: " + ref +"</td></tr></table>");
  doc.write("<table width=95% border=0 cellpadding=3 cellspacing=1 bgcolor=#FFFFFF>");
   doc.write("<tr bgcolor=#FF8000><td width=50% class=orange><b>Item</b></td><td width=15% align=right class=orange><b>Unit price</b></td><td align=center width=15% class=orange><b>Quantity</b></td><td align=right width=20% class=orange><b>Total (EUR)</b></td></tr>");
  //-------------------------------------
  m = aQuant.length - 1;
  n = m + 1; 
  if(subt == 0)
  {
  	tot = 0;
  }
  updateLeft();	
  //-------------------------------------
  for (i=0 ; i < n; i++)
  {
	  	if((aQuant[i] != null)&&(aQuant[i] != 0))
		{
		cost = eval(aPrice[i])*eval(aQuant[i]);
		var description = escape(aDescr[i]);
		x = (i+1) * 0.5;
		p = aQuant.length * 0.5;
		doc.write("<tr bgcolor=#FF8000>");
  		doc.write("<td class=orange>" + aDescr[i] + "</td><td align=right class=orange>" + AddDecimal(aPrice[i]) + "</td><td align=center class=orange>" +  aQuant[i] + "</td><td align=right class=orange>" + AddDecimal(cost) + "</td>");
		doc.write("</tr>");
		}	
  }	
  //-------------------------------------
if(top.frames[1].document.forms[0].eu_hidden.value == "eu")
{
  doc.write("<tr bgcolor=#FF8000><td colspan=3 class=orange><b>Your subtotal is: </b></td><td align=right class=orange><b>EUR " +  AddDecimal(subt) + "</b></td></tr>");
  doc.write("<tr bgcolor=#FF8000><td colspan=3 class=orange><b>Shipping: </b></td><td align=right class=orange><b>EUR " +  AddDecimal(ship) + "</b></td></tr>");
  doc.write("<tr bgcolor=#FF8000><td colspan=3 class=orange><b>Total (excl. VAT): </b></td><td align=right class=orange><b>EUR " +  AddDecimal(tot) + "</b></td></tr>");
  doc.write("<tr bgcolor=#FF8000><td colspan=3 class=orange><b>VAT (EU residents): </b></td><td align=right class=orange><b>EUR " +  AddDecimal(addtax) + "</b></td></tr>");
  doc.write("<tr bgcolor=#FF8000><td colspan=3 class=orange><b>Grand total (incl. VAT): </b></td><td align=right class=orange><b>EUR " +  AddDecimal(vattot) + "</b></td></tr></table>")
}
else
{
  doc.write("<tr bgcolor=#FF8000><td colspan=3 class=orange><b>Your subtotal is: </b></td><td align=right class=orange><b>EUR " +  AddDecimal(subt) + "</b></td></tr>");
  doc.write("<tr bgcolor=#FF8000><td colspan=3 class=orange><b>Shipping: </b></td><td align=right class=orange><b>EUR " +  AddDecimal(ship) + "</b></td></tr>");
  doc.write("<tr bgcolor=#FF8000><td colspan=3 class=orange><b>Grand total: </b></td><td align=right class=orange><b>EUR " +  AddDecimal(tot) + "</b></td></table>")
}
  //-------------------------------------
  for (i=0 ; i < n; i++)
  {
	  	if((aQuant[i] != null)&&(aQuant[i] != 0))
		{
		var description = escape(aDescr[i]);

		x = (i+1) * 0.5;
		p = aQuant.length * 0.5;
		doc.write("<input type=hidden name='quant" + (x) + "' value=" + aQuant[i] + ">");
		doc.write("<input type=hidden name='descr" + (x) + "' value=" + description + ">");
		doc.write("<input type=hidden name='price" + (x) + "' value=" + AddDecimal(aPrice[i]) + ">");
		}
  }
if (top.frames[1].document.forms[0].eu_hidden.value == "eu")
{
  doc.write("<input type=hidden name='valuta' value=EUR>");
  doc.write("<input type=hidden name='subt' value=" + AddDecimal(subt) + ">");
  doc.write("<input type=hidden name='addtax' value=" + AddDecimal(addtax) + ">");
  doc.write("<input type=hidden name='ship' value=" + AddDecimal(ship) + ">");
  doc.write("<input type=hidden name='tot' value=" + AddDecimal(vattot) + ">");
}
else
{
  doc.write("<input type=hidden name='valuta' value=EUR>");
  doc.write("<input type=hidden name='subt' value=" + AddDecimal(subt) + ">");
  doc.write("<input type=hidden name='addtax' value=0.00>");
  doc.write("<input type=hidden name='ship' value=" + AddDecimal(ship) + ">");
  doc.write("<input type=hidden name='tot' value=" + AddDecimal(tot) + ">");
}

var orderdate= new Date();
month = orderdate.getMonth() + 1;
orderdate = orderdate.getDate()+"-"+month+"-"+orderdate.getYear();

  var shipping_type = escape(top.frames[1].document.forms[0].shipping_type_hidden.value);
  doc.write("<input type=hidden name='num_order' value=" + top.frames[1].document.forms[0].num_order_hidden.value + ">");
  doc.write("<input type=hidden name='ref' value=" + ref + ">");
  doc.write("<input type=hidden name='orderdate' value=" + orderdate + ">");
  doc.write("<input type=hidden name='shipping_type' value=" + shipping_type + ">");
  doc.write("<input type=hidden name='gift_hidden' value=" + top.frames[1].document.forms[0].gift_hidden.value + ">");

doc.close();
} 
//-------------------------------------
function showInfo()
{
  var doc = top.frames[2].window.document;
  doc.clear();
	doc.write("<table width=95% border=0 cellpadding=3 cellspacing=1>")
if(top.frames[1].document.forms[0].gift_hidden.value == "gift")
{
	doc.write("<tr><td colspan=2 class=orangeBig><i>Gift from</i></td></tr>");
}
	doc.write("<tr><td colspan=2 class=orange><b>Personal information</b></td></tr>")

	doc.write("<tr>")
	doc.write("<td width=30% class=footer>Full name</td>")
if (top.frames[1].document.forms[0].last_name_hidden.value == "")
	{
	doc.write("<td width=70% class=footer>&nbsp;</td>");
	}
else
	{
	doc.write("<td width=70% class=footer>&nbsp;" + top.frames[1].document.forms[0].title_hidden.value + " " + top.frames[1].document.forms[0].last_name_hidden.value + "</td>");
	}
	doc.write("</tr>")
	doc.write("<tr>")
	doc.write("<td width=30% class=footer>Email address</td>")
	doc.write("<td width=70% class=footer>&nbsp;" + top.frames[1].document.forms[0].Email_hidden.value + "</td>")
	doc.write("</tr>")
	doc.write("<tr>")
	doc.write("<td width=30% class=footer>Phone number</td>")
	doc.write("<td width=70% class=footer>&nbsp;" + top.frames[1].document.forms[0].phone_hidden.value + "</td>")
	doc.write("</tr>")
	doc.write("<tr height=10><td colspan=2></td></tr>")
	doc.write("<tr>")
	doc.write("<td colspan=2 class=orange>Invoice address</td>")
	doc.write("</tr>")
	doc.write("<tr>")
	doc.write("<td width=30% class=footer>Company name</td>")
	doc.write("<td width=70% class=footer>&nbsp;" + top.frames[1].document.forms[0].company_hidden.value + "</td>")
	doc.write("</tr>")
	doc.write("<tr>")
	doc.write("<td width=30% class=footer>Address line 1</td>")
	doc.write("<td width=70% class=footer>&nbsp;" + top.frames[1].document.forms[0].address1_hidden.value + "</td>")
	doc.write("</tr>")
	doc.write("<tr>")
	doc.write("<td width=30% class=footer>Address line 2</td>")
	doc.write("<td width=70% class=footer>&nbsp;" + top.frames[1].document.forms[0].address2_hidden.value + "</td>")
	doc.write("</tr>")
	doc.write("<tr>")
	doc.write("<td width=30% class=footer>City</td>")
	doc.write("<td width=70% class=footer>&nbsp;" + top.frames[1].document.forms[0].city_hidden.value + "</td>")
	doc.write("</tr>")
	doc.write("<tr>")
	doc.write("<td width=30% class=footer>State/Province/Region</td>")
	doc.write("<td width=70% class=footer>&nbsp;" + top.frames[1].document.forms[0].state_hidden.value + "</td>")
	doc.write("</tr>")
	doc.write("<tr>")
	doc.write("<td width=30% class=footer>Zip/Postal Code</td>")
	doc.write("<td width=70% class=footer>&nbsp;" + top.frames[1].document.forms[0].zipcode_hidden.value + "</td>")
	doc.write("</tr>")
	doc.write("<tr>")
	doc.write("<td width=30% class=footer>Country</td>")
	doc.write("<td width=70% class=footer>&nbsp;" + top.frames[1].document.forms[0].country_hidden.value + "</td>")
	doc.write("</tr>")

if(top.frames[1].document.forms[0].gift_hidden.value == "gift")
{
	doc.write("<tr><td colspan=2 class=orangeBig><i>Gift for</i></td></tr>");
	doc.write("<tr><td colspan=2 class=orange><b>Personal information</b></td></tr>")

	doc.write("<tr>")
	doc.write("<td width=30% class=footer>Full name</td>")
	doc.write("<td width=70% class=footer>&nbsp;" + top.frames[1].document.forms[0].gift_title_hidden.value + " " + top.frames[1].document.forms[0].gift_name_hidden.value + "</td>");
	doc.write("</tr>")
	doc.write("<tr height=10><td colspan=2></td></tr>")
	doc.write("<tr>")
	doc.write("<td colspan=2 class=orange>Shipping address</td>")
	doc.write("</tr>")
	doc.write("<tr>")
	doc.write("<td width=30% class=footer>Address line 1</td>")
	doc.write("<td width=70% class=footer>&nbsp;" + top.frames[1].document.forms[0].gift_address1_hidden.value + "</td>")
	doc.write("</tr>")
	doc.write("<tr>")
	doc.write("<td width=30% class=footer>Address line 2</td>")
	doc.write("<td width=70% class=footer>&nbsp;" + top.frames[1].document.forms[0].gift_address2_hidden.value + "</td>")
	doc.write("</tr>")
	doc.write("<tr>")
	doc.write("<td width=30% class=footer>City</td>")
	doc.write("<td width=70% class=footer>&nbsp;" + top.frames[1].document.forms[0].gift_city_hidden.value + "</td>")
	doc.write("</tr>")
	doc.write("<tr>")
	doc.write("<td width=30% class=footer>State/Province/Region</td>")
	doc.write("<td width=70% class=footer>&nbsp;" + top.frames[1].document.forms[0].gift_state_hidden.value + "</td>")
	doc.write("</tr>")
	doc.write("<tr>")
	doc.write("<td width=30% class=footer>Zip/Postal Code</td>")
	doc.write("<td width=70% class=footer>&nbsp;" + top.frames[1].document.forms[0].gift_zipcode_hidden.value + "</td>")
	doc.write("</tr>")
	doc.write("<tr>")
	doc.write("<td width=30% class=footer>Country</td>")
	doc.write("<td width=70% class=footer>&nbsp;" + top.frames[1].document.forms[0].gift_country_hidden.value + "</td>")
	doc.write("</tr>")
}
if (top.frames[1].document.forms[0].giftwrap_hidden.value == "yes")
	{
	doc.write("<tr height=10><td colspan=2></td></tr>")
	doc.write("<tr>")
	doc.write("<td colspan=2 class=orange><b>Wrapping</b></td>")
	doc.write("</tr>")
	doc.write("<tr>")
	doc.write("<td colspan=2 class=footer>Your present(s) will be wrapped.</td>")
	doc.write("</tr>")
	doc.write("<tr>")
	doc.write("<td class=footer width=30% valign=top>Personal message</td>")
	doc.write("<td width=70%><textarea rows=5 name=gift_message cols=40>Type your personal message here...</textarea></td>")
	doc.write("</tr>")
	doc.write("</table>");
	}
	else 
	{
	doc.write("</table>");
	}
doc.close();
}
//-------------------------------------
function updateOutputInfo()
{  
	var doc = top.frames[2].window.document;
	doc.clear();

name = top.frames[1].document.forms[0].last_name_hidden.value;
title = top.frames[1].document.forms[0].title_hidden.value;
aanhef = (title) + ' ' + (name);
var fullname = escape(aanhef);
var fulllast_name = escape(name);
var fullfirst_name = escape(first_name);

	if(top.frames[1].document.forms[0].last_name_hidden.value == "")
	{
	doc.write("<input type=hidden name='fullaanhef' value=Customer>");
	}
	else
	{
	doc.write("<input type=hidden name='fullaanhef' value=" + fullname + ">");
	}
doc.write("<input type=hidden name='last_name_hidden' value=" + fulllast_name + ">");
doc.write("<input type=hidden name='first_name_hidden' value=" + fullfirst_name + ">");
doc.write("<input type=hidden name='title_hidden' value=" + top.frames[1].document.forms[0].title_hidden.value + ">");

phone = top.frames[1].document.forms[0].phone_hidden.value;
company = top.frames[1].document.forms[0].company_hidden.value;
address1 = top.frames[1].document.forms[0].address1_hidden.value;
address2 = top.frames[1].document.forms[0].address2_hidden.value;
city = top.frames[1].document.forms[0].city_hidden.value;
state = top.frames[1].document.forms[0].state_hidden.value;
zipcode = top.frames[1].document.forms[0].zipcode_hidden.value;
country = top.frames[1].document.forms[0].country_hidden.value;

var fullphone = escape(phone);
var fullcompany = escape(company);
var fulladdress1 = escape(address1);
var fulladdress2 = escape(address2);
var fullcity = escape(city);
var fullstate = escape(state);
var fullzipcode = escape(zipcode);
var fullcountry = escape(country);

doc.write("<input type=hidden name='Email' value=" + top.frames[1].document.forms[0].Email_hidden.value + ">");
doc.write("<input type=hidden name='phone_hidden' value=" + fullphone + ">");
doc.write("<input type=hidden name='company_hidden' value=" + fullcompany + ">");
doc.write("<input type=hidden name='address1_hidden' value=" + fulladdress1 + ">");
doc.write("<input type=hidden name='address2_hidden' value=" + fulladdress2 + ">");
doc.write("<input type=hidden name='city_hidden' value=" + fullcity + ">");
doc.write("<input type=hidden name='state_hidden' value=" + fullstate + ">");
doc.write("<input type=hidden name='zipcode_hidden' value=" + fullzipcode + ">");
doc.write("<input type=hidden name='country_hidden' value=" + fullcountry + ">");
doc.write("<input type=hidden name='http_user_agent' value=$http_user_agent>");
doc.write("<input type=hidden name='http_referer' value=$http_referer>");

gift_name = top.frames[1].document.forms[0].gift_name_hidden.value;
gift_title = top.frames[1].document.forms[0].gift_title_hidden.value;
gift_aanhef = (gift_title) + ' ' + (gift_name);
var gift_fullname = escape(gift_aanhef);
doc.write("<input type=hidden name='gift_fullaanhef' value=" + gift_fullname + ">");
doc.write("<input type=hidden name='gift' value='yes'>");

gift_address1 = top.frames[1].document.forms[0].gift_address1_hidden.value;
gift_address2 = top.frames[1].document.forms[0].gift_address2_hidden.value;
gift_city = top.frames[1].document.forms[0].gift_city_hidden.value;
gift_state = top.frames[1].document.forms[0].gift_state_hidden.value;
gift_zipcode = top.frames[1].document.forms[0].gift_zipcode_hidden.value;
gift_country = top.frames[1].document.forms[0].gift_country_hidden.value;

var gift_fulladdress1 = escape(gift_address1);
var gift_fulladdress2 = escape(gift_address2);
var gift_fullcity = escape(gift_city);
var gift_fullstate = escape(gift_state);
var gift_fullzipcode = escape(gift_zipcode);
var gift_fullcountry = escape(gift_country);

doc.write("<input type=hidden name='gift_address1_hidden' value=" + gift_fulladdress1 + ">");
doc.write("<input type=hidden name='gift_address2_hidden' value=" + gift_fulladdress2 + ">");
doc.write("<input type=hidden name='gift_city_hidden' value=" + gift_fullcity + ">");
doc.write("<input type=hidden name='gift_state_hidden' value=" + gift_fullstate + ">");
doc.write("<input type=hidden name='gift_zipcode_hidden' value=" + gift_fullzipcode + ">");
doc.write("<input type=hidden name='gift_country_hidden' value=" + gift_fullcountry + ">");
doc.write("<input type=hidden name='giftwrap' value=" + top.frames[1].document.forms[0].giftwrap_hidden.value + ">");

doc.close();
}
//-------------------------------------
function showPayment()
{
  var doc = top.frames[2].window.document;
  doc.clear();
  doc.write("<table width=95% border=0 cellpadding=3 cellspacing=1>");
  doc.write("<tr><td colspan=2 class=orangeBig>Payment details</td></tr>");
  doc.write("<tr><td colspan=2 class=orange><b>Creditcard payment</b></td></tr>");

  doc.write("<tr>");
  doc.write("<td width=30% class=footer>Creditcard number<br></td>");
  doc.write("<td width=70% class=footer><i>on file</i></td>");
  doc.write("</tr>");

  doc.write("</table>");

  doc.write("<input type=hidden name='paymentselected' value='regular'>");
doc.close();
}
//-------------------------------------
function showPayment_cc()
{
  var doc = top.frames[2].window.document;
  doc.clear();
  doc.write("<table width=95% border=0 cellpadding=3 cellspacing=1>");
  doc.write("<tr><td colspan=2 class=orangeBig>Payment details</td></tr>");
  doc.write("<tr><td colspan=2 class=orange><b>Creditcard payment</b></td></tr>");

  doc.write("<tr><td colspan=2 class=orange>You can enter your creditcard details as soon as you press the Checkout button below. All creditcards are encrypted and transfered via a secure connection (SSL <img src='http://www.europebymail.com/images/lock.gif' width=12 height=15>).</td></tr>");
  doc.write("</table>");

  doc.write("<input type=hidden name='paymentselected' value='cc'>");
doc.close();
}
//-------------------------------------
function showPayment_fax()
{
  var doc = top.frames[2].window.document;
  doc.clear();
	doc.write("<table width=95% border=0 cellpadding=3 cellspacing=1>");
	doc.write("<tr><td colspan=2 class=orangeBig>Payment details</td></tr>");
	doc.write("<tr><td colspan=2 class=orange><b>Payment service via fax</b></td></tr>");
	doc.write("<tr>");
	doc.write("<td width=30% class=footer>Fax number<br></td>");
	doc.write("<td width=70% class=footer>+31 (0)71 - 576 3174</td>");
	doc.write("</tr>");
	doc.write("<tr>");
	doc.write("<td colspan=2 class=orange>Use the pre-formatted faxform to create and print your fax. The link to the faxform appears in the next step.</td>");
	doc.write("</tr>");
  doc.write("</table>");
  doc.write("<input type=hidden name='paymentselected' value='fax'>");
doc.close();
}
//-------------------------------------
function showPayment_callback()
{
  var doc = top.frames[2].window.document;
  doc.clear();
	doc.write("<table width=95% border=0 cellpadding=3 cellspacing=1>");
	doc.write("<tr><td colspan=2 class=orangeBig>Payment details</td></tr>");
	doc.write("<tr><td colspan=2 class=orange><b>Details for Call-back Payment service</b></td></tr>");
	doc.write("<tr>");
	doc.write("<td width=30% class=footer>Phone number<br><small>(privat)</small></td>");
	doc.write("<td width=70% class=footer>" + top.frames[1].document.forms[0].PhoneNumberPrivate_hidden.value + "</td>");
	doc.write("</tr>");
	doc.write("<tr>");
	doc.write("<td width=30% class=footer>Preferred call-back time</td>");

	if(top.frames[1].document.forms[0].PhoneNumberPrivate_hidden.value == "")
	{
	doc.write("<td width=70% class=footer>&nbsp;</td>");
	}
	else
	{
	doc.write("<td width=70% class=footer>" + top.frames[1].document.forms[0].callback_hidden.value + "</td>");
	}
	doc.write("</tr>");

	doc.write("<tr>");
	doc.write("<td width=30% class=footer>Phone number<br><small>(business)</small></td>");
	doc.write("<td width=70% class=footer>" + top.frames[1].document.forms[0].PhoneNumberBusiness_hidden.value + "</td>");
	doc.write("</tr>");

	doc.write("<tr>");
	doc.write("<td width=30% class=footer>Preferred call-back time</td>");

	if(top.frames[1].document.forms[0].PhoneNumberBusiness_hidden.value == "")
	{
	doc.write("<td width=70% class=footer>&nbsp;</td>");
	}
	else
	{
	doc.write("<td width=70% class=footer>" + top.frames[1].document.forms[0].callback1_hidden.value + "</td>");
	}
	doc.write("</tr>");
	doc.write("</table>");
doc.close();
}
//-------------------------------------
function updateOutputCallback()
{  
	var doc = top.frames[2].window.document;
	doc.clear();

PhoneNumberPrivate = top.frames[1].document.forms[0].PhoneNumberPrivate_hidden.value;
var fullPhoneNumberPrivate = escape(PhoneNumberPrivate);


doc.write("<input type=hidden name='paymentselected' value='callback'>");
doc.write("<input type=hidden name='PhoneNumberPrivate_hidden' value=" + fullPhoneNumberPrivate + ">");

	if(top.frames[1].document.forms[0].PhoneNumberPrivate_hidden.value == "")
	{
	doc.write("<input type=hidden name='callback_hidden' value=''>");
	}
	else
	{
	doc.write("<input type=hidden name='callback_hidden' value=" + top.frames[1].document.forms[0].callback_hidden.value + ">");
	}

PhoneNumberBusiness = top.frames[1].document.forms[0].PhoneNumberBusiness_hidden.value;
var fullPhoneNumberBusiness = escape(PhoneNumberBusiness);

doc.write("<input type=hidden name='PhoneNumberBusiness_hidden' value=" + fullPhoneNumberBusiness + ">");

	if(top.frames[1].document.forms[0].PhoneNumberBusiness_hidden.value == "")
	{
	doc.write("<input type=hidden name='callback1_hidden' value=''>");
	}
	else
	{
	doc.write("<input type=hidden name='callback1_hidden' value=" + top.frames[1].document.forms[0].callback1_hidden.value + ">");
	}
doc.close();
}
// -->