  function show_color(xid,xprod) {
    window.location = 'index.php?action=lab&idproduct=' + xprod + '&idcolor=' + xid;
  }
  function show_color_quote(xid,xprod) {
	url = 'index.php?action=quote_calculator&idproduct=' + xprod + '&idcolor=' + xid;
	load_dinamic(url,"contentdiv");
  }
  function show_more_images(xid) {
    window.open('index.php?action=show_more_images&id=' + xid, 'help', 'width=600,height=450,scrollbars=yes,toolbar=no,menubar=no,location=no,resizable=no')
  }
    function open_quote() {
    window.open('index.php?action=quote', 'help', 'width=400,height=600,scrollbars=yes,toolbar=no,menubar=no,location=no,resizable=yes')
  }

  function show_full_catalog(){
    window.open('../','full','width=800,height=600,scrollbars=yes,toolbar=no,menubar=no,location=no,resizable=yes');
  }
  function view_sizes_chart(xid) {
    window.open('index.php?action=view_sizes_chart&id=' + xid, 'help', 'width=600,height=560,scrollbars=yes,toolbar=no,menubar=no,location=no,resizable=no')
  }
  function exit_lab(act){
/*	var x = confirm("Are you sure you want to leave the Design Lab? \n You will lose any unsaved data if you proceed.");
		if (x)*/
			window.location = act;

  }
  function buyIt(){
	var a1 = document.getElementById('first_name');
	var a2 = document.getElementById('last_name');
	var a3 = document.getElementById('address_1');
//	var a4 = document.getElementById('address_2');
	var a5 = document.getElementById('city');
	var a6 = document.getElementById('state');
	var a7 = document.getElementById('zip_code');
	var a8 = document.getElementById('country');
	var a9 = document.getElementById('phone');
	var a10 = document.getElementById('email');
	var a11 = document.getElementById('credit_card');
	var a12 = document.getElementById('expiration_date_mm');
	var a13 = document.getElementById('SameShip');
	var a14 = document.getElementById('ship_address');
	var a15 = document.getElementById('ship_city');
	var a16 = document.getElementById('ship_state');
	var a17 = document.getElementById('ship_zip_code');
	var a18 = document.getElementById('ship_country');
	
	// alert(document.buy_It.ship_same.checked ? 'true' : 'false');
	// alert(a13.checked);
	
	var error = 0;
	
	if (a1.value == '' || a2.value == '' || a3.value == '' || a5.value == '' || a6.value == '' || a7.value == '' || a8.value == '' || a9.value == '' || a10.value == '' || a11.value == '' || a12.value == ''){
		error = true;
		alert('Error');
	}
	

	if (!error && !a13.checked)
	{
		if (a14.value == '' || a15.value == '' || a16.value == '' || a17.value == '' || a18.value == '')
			error = true;
	}


	if (error)
		alert('Please fill in all the fields');
	else
		// alert('submit');
		document.getElementById('buy_It').submit();
}
