// creates extra title code
//  a place to have common code that gets inserted below the title on every page
function ExtraTitle()
{
}
// validates e-mail and verifycode 
function Form1_Validator(theForm)
{
  var code = theForm.Verify_Code.value;
  var vcode = "25624";
 
  if (vcode  != code)
  {
    alert("Please enter verification code as shown.");
    theForm.Verify_Code.focus();
    return (false);
  }

  if (theForm.email.value.length > 50  ||  theForm.email.value.length < 7)
  {
    alert("Please enter a valid e-mail address.");
    theForm.email.focus();
    return (false);
  }
  return (true);
}

// this will build the guest book form
function GuestBook(id)
{
  var file_name = document.location.href;
  document.write('<table border="9" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="75%" bordercolor="#FF0000" height="340">');
    document.write('<tr>');
      document.write('<td width="100%" bgcolor="#FFFFCC" >');
      document.write('<center>');
        document.write('<p align="center">');
        document.write('<b>');
        document.write('<font color="#000080" size="4" face="arial">');
        document.write('<form action="/cgi-bin/cgiemail/contact/gb.txt" method="POST" name="Form1" onsubmit="return Form1_Validator(this)" language="JavaScript">');
        document.write('<input type="hidden" name="html_name" value="'+file_name+'">');
          document.write('<input type="hidden" name="success"  value="http://www.jmcutlery.com/confirm.html">');
          document.write('<font size="5" >');
          document.write('<br>Be the first to know about our  news and sales.<br>');
          document.write('Sign Our J. Mark Guest Register<br>');
          document.write('</font>');
          document.write('We never share your information or send you excessive email.<br>');
          document.write('<br>');
          document.write('<font color="#990000" size="4">');
          document.write('* Your email address<br>');
          document.write('<input type="text" size="50" name="email">');
          document.write('<br><br>Any Comments?...<br>');
          document.write('<textarea name="comment" rows="3" cols="35"></textarea>');
          document.write('<br><br>Enter Verification Code Shown In Image<br>');
          document.write('</font>');
          document.write('<img src="vcode.jpg" width="155" height="57">');
          document.write('<input type="text" size="10" name="Verify_Code"><br><br>');
          document.write('<input type="submit" value="send" name="'+id+'">');
          document.write('<input type="reset"  value="clear">');
        document.write('</form>');
        document.write('<br>Please Save this page in your favorites  and');
         document.write('<br>use your &quot;back&quot; arrow to return here after you click send.<br><br>');
        document.write('</font>');
        document.write('</b>');
        document.write('</p>');
      document.write('</center>');                          
      document.write('</td>');
    document.write('</tr>');
    document.write('</table>');

    setTimeout("window.scrollBy(0, -300);", 600);
       
}
// about your order table
function AboutOrder()
{
document.write('<table border="6" cellspacing="7" width="75%" bgcolor="#FFFF00" bordercolor="#FF0000" cellpadding="3" style="border-collapse: collapse" height="143">');
  document.write('<tr>');
    document.write('<td width="50%" bgcolor="#FFFFFF" height="17" style="color: #000000">');
      document.write('<p align="left" style="margin-left: 40; margin-right: 40"><b><strong><font size="4" color="#000000" face="arial">');
        document.write('<br>You should have your order within 17 business days (21 West of the Rockies)<br>');
        document.write('If not, Please e-mail us immediately. <br><br>');
        document.write('<font size="5">If you need to meet a deadline date, <br></font>');
        document.write('you need to <a href="mailto:custsvc@jmcutlery.com"><font color="#000000">e-mail us</font></a>');
        document.write(' before you order.<br>We try to answer within 1 business day. We need to know your address,');
        document.write('what product, how many. Be ready to order when we answer as our inventory changes.<br><br><br>');
      document.write('</font></strong></b></p>');
    document.write('</td>');
    document.write('<td width="50%" bgcolor="#FFFFFF" height="17" style="color: #000000"><b>');
      document.write('<p align="left" style="margin-left: 40; margin-right: 40"><b><font size="3" color="#000000" face="arial"><br>');
       document.write('<font size="6">About Your Order: </font><br><br>');
        document.write('You will receive an important J. Mark email soon after Pay Pal\'s notification. If you ');
        document.write('don\'t get it, click here to <a href="mailto:custsvc@jmcutlery.com"><font color="#000000">');
        document.write('email us </font></a>about it promptly.<br><br>');
        document.write('For problems click <a href="http://www.jmcutlery.com/policy.htm"><font color="#000000">www.OurHelp4U.com</font></a>');
        document.write(' It explains <span style="background-color: #FFFF00">sales tax </span>which is <span style="background-color: #FFFF00">not ');
        document.write('tax</span>, it is our means of adding a postage surcharge for excess weight and distance. It has ');
        document.write('our policy, and other information.<br><br>');
        document.write('<img border="0" src="http://www.jmcutlery.com/images/creditCards_169x21.gif" width="176" height="22"><br><br>');
        document.write('<span style="background-color: #FFFF00">You do not need a Pay Pal Account <br></span>');
        document.write('to buy securely online using our Add to Cart button. <br>');
        document.write('(If you encounter a Pay Pal problem, <strong>you can call them toll free at 1-888-221-1161. <br><br>');
        document.write('Do not ask them about orders or merchandise. <br>They are a bank and transfer funds online, only.</strong><br>');
        document.write('click here to <a href="mailto:custsvc@jmcutlery.com"><font color="#000000">email us</font> </a> any questions.<br><br>');
      document.write('</font></b></p>');
    document.write('</td>');
  document.write('</tr>');
  document.write('<tr>');
    document.write('<td width="50%" bgcolor="#FFFFFF" height="16" style="color: #000000">');
      document.write('<p align="left" style="margin-left: 40; margin-right: 40"><b><strong><font size="4" color="#FF0000" face="arial">');
        document.write('We do not ship Outside of the first 48 states continental USA Not to Canada, HI. AK, APO, AE, etc. <br>');
      document.write('</font></strong></b></p>');
    document.write('</td>');
    document.write('<td width="50%" bgcolor="#FFFFFF" height="16" style="color: #000000">');
      document.write('<p align="left" style="margin-left: 40; margin-right: 40"><b><br><font size="3" color="#000000" face="arial">');
        document.write('We do not offer catalogs. Click here for a list of ');
        document.write('<a href="http://www.jmcutlery.com/printourpages.htm"><font color="#000000">links to printable pages. </font></a>');
        document.write('<br><br>Please do not order unless you are certain you <br>');
        document.write('want the item and it is correct for your needs. <br>');
        document.write('Due to the fragility and the costly round-trip <br>');
        document.write('postage we do not accept returns.<br><br>');
      document.write('</font></b></p>');
    document.write('</td>');
  document.write('</tr>');
document.write('</table>');
}
// creates add to cart button
// example call   AddToCart( 'ceramic thingy', 'CE-6309', '24.99' );
function AddToCart(desc, item, price, nostock)
{
  if(nostock)
    document.write('<br><font color="#FF0000"> OUT OF STOCK </font>');
  else
  {
    document.write('<a name="L' + item + '"></a>');
    document.write('<br>  $' + price + '  ');
    document.write('<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_cart&business=jmpbooks%40jmcutlery.com&lc=US');
    document.write('&item_name='+desc+'&item_number='+item+'&amount='+price);
    document.write('&currency_code=USD&button_subtype=products&cn=Add%20special%20instructions%20to%20the%20seller');
    document.write('&no_shipping=2&rm=1&return=http%3a%2f%2fwww%2ejmcutlery%2ecom%2fthankyou%2ehtm');
    document.write('&cancel_return=http%3a%2f%2fwww%2ejmcutlery%2ecom%2fcancel%2ehtm&weight_unit=lbs&add=1');
    document.write('&bn=PP%2dShopCartBF%3abtn_cart_LG%2egif%3aNonHosted">' );
    document.write('<img src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" border="0"></a>');
  }
}
function ViewCart()
{
  document.write('<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_cart&display=1&business=jmpbooks%40jmcutlery.com"><img src="https://www.paypal.com/en_US/i/btn/view_cart.gif" border="0"></a>');
}

function PPSeal()
{
document.write('<b><a href="https://www.paypal.com/us/verified/pal=jmpbooks@bellsouth.net" target="_blank">');
document.write('<img src="http://www.paypal.com/en_US/i/icon/verification_seal.gif" border="0" alt="Official PayPal Seal" width="49" height="45" align="left"></a>');
document.write('<img border="0" src="http://www.jmcutlery.com/images/creditCards_169x21.gif" width="176" height="22" align="left">');
document.write('<font size="3" face="Arial" color="#000000">');
document.write('<br><br><br>Please use a <br>STREET ADDRESS<br>UPS does not deliver to a PO Box<br>');
document.write('<font color="#FFFFFF"><span style="background-color: #0000FF">WE SHIP TO USA ONLY</span></font><br></font></b>');
}
// example call   Add2Cart('CE', '6309', 'ceramic thingy', '24.99' );
function Add2Cart(type, item, desc, price, nostock) {
    document.write('<a name="' + type + '-' + item + '"></a>');
    if (type == "TCP")
        document.write('<a href="images/tcp/' + item + '.jpg"><img border="0" src="images/tcp/' + item + '_small.jpg" width="203" height="160" ></a>');
    else if (type == "TCU")
        document.write('<a href="images/tcu/' + item + '.jpg"><img border="0" src="images/tcu/' + item + '_small.jpg" width="150" height="125" ></a>');
    else if (type == "TLS")
        document.write('<a href="images/tls/' + item + '.jpg"><img border="0" src="images/tls/' + item + '_small.jpg" width="160" height="160" ></a>');
    else
        document.write('<a href="images/' + item + '.jpg"><img src="images/' + item + '.jpg" width="250" height="250" ></a>');
    document.write('<br>' + desc);
    if (nostock)
        document.write('<br><font color="#FF0000"> OUT OF STOCK </font>');
    else {
        document.write('<br>' + type + '-' + item + '  $' + price + '  ');
        document.write('<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_cart&business=jmpbooks%40jmcutlery.com&lc=US');
        document.write('&item_name=' + desc + '&item_number=' + type + '-' + item + '&amount=' + price);
        document.write('&currency_code=USD&button_subtype=products&cn=Add%20special%20instructions%20to%20the%20seller');
        document.write('&no_shipping=2&rm=1&return=http%3a%2f%2fwww%2ejmcutlery%2ecom%2fthankyou%2ehtm');
        document.write('&cancel_return=http%3a%2f%2fwww%2ejmcutlery%2ecom%2fcancel%2ehtm&weight_unit=lbs&add=1');
        document.write('&bn=PP%2dShopCartBF%3abtn_cart_LG%2egif%3aNonHosted">');
        document.write('<img src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" border="0"></a>');
    }
}
// for google analytics keep as last
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-681964-1']);
_gaq.push(['_trackPageview']);

(function () {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();


