//  validate that a size was selected
function Size_Validator(theForm)
{

  if (theForm.os0.selectedIndex == 0)
  {
    alert("Please select a size.");
    theForm.os0.focus();
    return (false);
  }
  return (true);
}
function cartpop(Item,Portrait)
{
  if (Portrait)
    var pop=window.open('','name','height=650,width=300');
  else
    var pop=window.open('','name','height=400,width=600');
//alert("Item=["+Item+"]");
pop.document.write('<html><head><title>MP-'+Item+'</title>');
pop.document.write('</head><body><center>');
pop.document.write('<br><img src="images/mp/'+Item+'.jpg" >');
pop.document.write('<p><a href="javascript:self.close()">Close</a></p>');
pop.document.write('</center></body></html>');
pop.document.close();
}

function cartpopA(Item)
{
    var pop=window.open('','name','height=450,width=725');
//alert("Item=["+Item+"]");
pop.document.write('<html><head><title>MP-'+Item+'</title>');
pop.document.write('</head><body><center>');

pop.document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
  pop.document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,42,0" id="fishmovie2" width="672" height="354">');
  pop.document.write('<param name="movie" value="mp'+Item+'.swf">');
  pop.document.write('<param name="quality" value="high">');
  pop.document.write('<param name="bgcolor" value="#FFFFFF">');
    pop.document.write('<embed name="mp'+Item+'" src="mp'+Item+'.swf" quality="high" bgcolor="#FFFFFF" swLiveConnect="true" width="672" height="354"');
    pop.document.write('type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>');

pop.document.write('<p><br><a href="javascript:self.close()">Close</a></p>');
pop.document.write('</center></body></html>');
pop.document.close();
}

function CartBut(Item, Desc, Small, Med, Large, XL, XXL, Portrait)
{
      if (Portrait=='A')
         document.write('<a href="javascript:cartpopA(\''+Item+'\');"><img src="images/mp/'+Item+'_tn.jpg" width="275" height="150"></a>');
      else if (Portrait)
         document.write('<a href="javascript:cartpop(\''+Item+'\',1);"> <img src="images/mp/'+Item+'_tn.jpg" width="150" height="275"></a>');
      else
         document.write('<a href="javascript:cartpop(\''+Item+'\');"><img src="images/mp/'+Item+'_tn.jpg" width="275" height="150"></a>');
      document.write('<br>'+Desc+' MP-'+Item);
      document.write('<!-- Begin add to cart -->');
/*      document.write('<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="return Size_Validator(this)" language="JavaScript" name="mp">');
*/
      document.write('<form target="paypal" action="#" method="post" onsubmit="return Size_Validator(this)" language="JavaScript" name="mp">');
      document.write('<input type="hidden" name="cmd" value="_cart">');
      document.write('<input type="hidden" name="business" value="jmpbooks@jmcutlery.com">');
      document.write('<input type="hidden" name="lc" value="US">');
      document.write('<input type="hidden" name="item_name" value="'+Desc+' MP-'+Item+'">');
      document.write('<input type="hidden" name="item_number" value="MP-'+Item+'">');
      document.write('<input type="hidden" name="button_subtype" value="products">');
      document.write('<input type="hidden" name="cn" value="Add special instructions to the seller">');
      document.write('<input type="hidden" name="no_shipping" value="2">');
      document.write('<input type="hidden" name="rm" value="1">');
      document.write('<input type="hidden" name="return" value="http://www.jmcutlery.com/thankyou.htm">');
      document.write('<input type="hidden" name="cancel_return" value="http://www.jmcutlery.com/cancel.htm">');
      document.write('<input type="hidden" name="currency_code" value="USD">');
      document.write('<input type="hidden" name="weight_unit" value="lbs">');
      document.write('<input type="hidden" name="add" value="1">');
      document.write('<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted">');
      document.write('<table>');
        document.write('<tr>');
            document.write('<td>');
              document.write('<input type="hidden" name="on0" value="Size">'); 
            document.write('</td>');
       document.write('</tr>');
       document.write('<tr>');
            document.write('<td>');
              document.write('<select name="os0">');
	            document.write('<option value="Go Back Select Size">Select Size');
                              if (Small)
	                document.write('<option value="Small  18 X 12">Small  18 X 12 $34.99');
                              if (Med)
	                document.write('<option value="Medium 26 X 18">Medium 26 X 18 $54.99');
                              if (Large)
	               document.write('<option value="Large 39 X 19">Large 39 X 19 $74.99');
                              if (XL)
	               document.write('<option value="Extra Large 46 X 29">Extra Large 46 X 29 $199.99');
              document.write('</select>');
           document.write('</td>');
        document.write('</tr>');
      document.write('</table>');
      document.write('<input type="hidden" name="currency_code" value="USD">');
      document.write('<input type="hidden" name="option_select5" value="Go Back Select Size">');
      document.write('<input type="hidden" name="option_amount5" value="0.00">');
      document.write('<input type="hidden" name="option_select0" value="Small  18 X 12">');
      document.write('<input type="hidden" name="option_amount0" value="34.99">');
      document.write('<input type="hidden" name="option_select1" value="Medium 26 X 18">');
      document.write('<input type="hidden" name="option_amount1" value="54.99">');
      document.write('<input type="hidden" name="option_select2" value="Large 39 X 19">');
      document.write('<input type="hidden" name="option_amount2" value="74.99">');
      document.write('<input type="hidden" name="option_select3" value="Extra Large 46 X 29">');
      document.write('<input type="hidden" name="option_amount3" value="199.99">');
      document.write('<input type="hidden" name="option_index" value="0">');
/*      document.write('<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">');
      document.write('<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">');
*/
      document.write('</form>');
      document.write('<!-- End of add to cart -->');
}

