// JavaScript Document

function checksize(thisform) {
if (thisform.os0.value == "Please Select") {
alert ("You did not select a size or option for this item.");return false;
}
}


function checkLength(thisform) {
if (thisform.quantity.value < 12) {
alert ("Minimum length is 12 inches");
thisform.quantity.value = 12 ;return false;
}
}



function populate() {
// Old URL parser for subscriptions

url=location.href;
qmark = 1 + url.indexOf("?");
dmark = 1 + url.indexOf("%");
if (qmark == 0) {
emailaddress="Please Enter Address";
validation="Please Enter Code";
}

else {
validation=url.slice(dmark);
emailaddress=url.slice(qmark);
dmark = emailaddress.indexOf("%");
emailaddress=emailaddress.slice(0,dmark);
};

document.subscribe.emailad.value = emailaddress;
document.subscribe.vcode.value = validation;
}


function subscriptionurl() {
url=location.href;
qmark = 1 + url.indexOf("?");
dmark = 1 + url.indexOf("&");
if (qmark == 0) {
emailaddress="Please Enter Address";
validation="Please Enter Code";
}

else {
validation=url.slice(dmark);
emailaddress=url.slice(qmark);
dmark = emailaddress.indexOf("&");
emailaddress=emailaddress.slice(0,dmark);
};

document.subscribe.emailad.value = emailaddress;
document.subscribe.vcode.value = validation;
}


function prefilladdtocart() {
url=location.href;
qmark = 1 + url.indexOf("?");
dmark = 1 + url.indexOf("&");
if (qmark == 0) {
itemname="Please Enter Item Name";
itemamount="Please Enter Amount";
}

else {
itemamount=url.slice(dmark);
itemname=url.slice(qmark);
dmark = itemname.indexOf("&");
itemname=itemname.slice(0,dmark);
};

document.paypal.item_name.value = itemname;
document.paypal.amount.value = itemamount;
}


// Image Swapping


function MM_preloadgraphics() { //v3.0
  var d=document; if(d.graphics){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadgraphics.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



// Drop Down Menus

function mmLoadMenus() {
  if (window.mm_menu_0019110135_5) return;
  window.blues = new Menu("root",120,16,"Verdana, Arial, Helvetica, sans-serif",10,"#ffcc00","#990000","#990000","#ffcc00","left","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  blues.addMenuItem("Blues Blouses","location='/blues.html'");
  blues.addMenuItem("Blues Trousers","location='/trousers.html'");
  blues.addMenuItem("Blues Covers","location='/dressbluescovers.html'");
  blues.addMenuItem("Blues Accessories","location='/accessories.html'");
    blues.addMenuItem("Children&#146;s Blues","location='/special/childrensdressblues.html'");
  blues.addMenuItem("Red Gold Patches","location='/redgold.html'");
  blues.addMenuItem("Medals&nbsp;&amp;&nbsp;Ribbons","location='/medalsribbons.html'");
    blues.addMenuItem("Badges","location='/badges.html'");
  blues.addMenuItem("Swords&nbsp;&amp;&nbsp;Accessories","location='/special/sx1096_swords.html'");
   blues.addMenuItem("Corframs","location='/corframs.html'");
  blues.addMenuItem("Graphic Menu","location='/dressblues.html'");
   blues.hideOnMouseOut=true;
   blues.menuBorder=1;
   blues.menuLiteBgColor='#666666';
   blues.menuBorderBgColor='#000000';
   blues.bgColor='#000000';


  window.service = new Menu("root",120,16,"Verdana, Arial, Helvetica, sans-serif",10,"#ffcc00","#990000","#990000","#ffcc00","left","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  service.addMenuItem("Service Blouses","location='/alphas.html'");
  service.addMenuItem("Service Trousers","location='/greentrousers.html'");
  service.addMenuItem("Khaki Shirts - Long","location='/khakishirts-long.html'");
  service.addMenuItem("Khaki Shirts - Short","location='/khakishirts-short.html'");
  service.addMenuItem("Service Covers","location='/servicecovers.html'");
  service.addMenuItem("Service Accessories","location='/serviceaccessories.html'");
  service.addMenuItem("Red Green Patches","location='/redgreen.html'");
  service.addMenuItem("Khaki Green Patches","location='/tangreen.html'");
  service.addMenuItem("Badges","location='/badges.html'");
  service.addMenuItem("Graphic Menu","location='/service.html'");
   service.hideOnMouseOut=true;
   service.menuBorder=1;
   service.menuLiteBgColor='#666666';
   service.menuBorderBgColor='#000000';
   service.bgColor='#000000';
   
   
     window.ptgear = new Menu("root",120,16,"Verdana, Arial, Helvetica, sans-serif",10,"#ffcc00","#990000","#990000","#ffcc00","left","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  ptgear.addMenuItem("Shorts","location='/ptgear.html'");
  ptgear.addMenuItem("Fleece Gear","location='/usmcfleece.html'");
  ptgear.addMenuItem("Plain Shirts","location='/shirts.html'");
  ptgear.addMenuItem("Used Gear","location='/usedptgear.html'");
  ptgear.addMenuItem("Graphic Menu","location='/marineptgear.html'");
   ptgear.hideOnMouseOut=true;
   ptgear.menuBorder=1;
   ptgear.menuLiteBgColor='#666666';
   ptgear.menuBorderBgColor='#000000';
   ptgear.bgColor='#000000';


  window.covers = new Menu("root",120,16,"Verdana, Arial, Helvetica, sans-serif",10,"#ffcc00","#990000","#990000","#ffcc00","left","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  covers.addMenuItem("Dress Blues Covers","location='/dressbluescovers.html'");
  covers.addMenuItem("Utility Covers","location='/covers.html'");
  covers.addMenuItem("Service Covers","location='/servicecovers.html'");
  covers.addMenuItem("Misc Covers","location='/misccovers.html'");
  covers.addMenuItem("Graphic Menu","location='/usmccovers.html'");
   covers.hideOnMouseOut=true;
   covers.menuBorder=1;
   covers.menuLiteBgColor='#666666';
   covers.menuBorderBgColor='#000000';
   covers.bgColor='#000000';

  window.ranks = new Menu("root",120,16,"Verdana, Arial, Helvetica, sans-serif",10,"#ffcc00","#990000","#990000","#ffcc00","left","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  ranks.addMenuItem("Red Gold Patches","location='/redgold.html'");
  ranks.addMenuItem("Red Green Patches","location='/redgreen.html'");
  ranks.addMenuItem("Khaki Green Patches","location='/tangreen.html'");
  ranks.addMenuItem("Officer Collar","location='/collarrank-marineofficer.html'");
 ranks.addMenuItem("Officer Coat","location='/shoulderrank-marineofficer.html'");
  ranks.addMenuItem("Officer Subdued","location='/fieldinsignia.html'");
  ranks.addMenuItem("Enlisted Black","location='/collarrank-usmcenlisted.html'");
  ranks.addMenuItem("Enlisted Gold","location='/collarrank-enlistedgold.html'");
  ranks.addMenuItem("Badges","location='/badges.html'");
    ranks.addMenuItem("Rank Sickers","location='/marinestickers.html'");
  ranks.addMenuItem("Graphic Menu","location='/insignia.html'");
   ranks.hideOnMouseOut=true;
   ranks.menuBorder=1;
   ranks.menuLiteBgColor='#666666';
   ranks.menuBorderBgColor='#000000';
   ranks.bgColor='#000000';


  window.medals = new Menu("root",120,16,"Verdana, Arial, Helvetica, sans-serif",10,"#ffcc00","#990000","#990000","#ffcc00","left","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  medals.addMenuItem("Medals","location='/medals.html'");
  medals.addMenuItem("Ribbons","location='/ribbons.html'");
  medals.addMenuItem("Ribbon Bars &amp; Stars","location='/ribbonaccessories.html'");
  medals.addMenuItem("Badges","location='/badges.html'");
  medals.addMenuItem("Graphic Menu","location='/medalsribbons.html'");
   medals.hideOnMouseOut=true;
   medals.menuBorder=1;
   medals.menuLiteBgColor='#666666';
   medals.menuBorderBgColor='#000000';
   medals.bgColor='#000000';

  window.shirts = new Menu("root",120,16,"Verdana, Arial, Helvetica, sans-serif",10,"#ffcc00","#990000","#990000","#ffcc00","left","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  shirts.addMenuItem("Plain&nbsp;Shirts","location='/shirts.html'");
  shirts.addMenuItem("Printed&nbsp;Shirts","location='/usmcshirts.html'");
    shirts.addMenuItem("Second&nbsp;Hand&nbsp;T-Shirts","location='/usmcshirtsused.html'");
  shirts.addMenuItem("Khaki Shirts - Long","location='/khakishirts-long.html'");
  shirts.addMenuItem("Khaki Shirts - Short","location='/khakishirts-short.html'");
  shirts.addMenuItem("Graphic Menu","location='/marinecorpsshirts.html'");
   shirts.hideOnMouseOut=true;
   shirts.menuBorder=1;
   shirts.menuLiteBgColor='#666666';
   shirts.menuBorderBgColor='#000000';
   shirts.bgColor='#000000';
   
   
      window.footgear = new Menu("root",120,16,"Verdana, Arial, Helvetica, sans-serif",10,"#ffcc00","#990000","#990000","#ffcc00","left","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  footgear.addMenuItem("Boots","location='/boots.html'");
  footgear.addMenuItem("Corframs","location='/corframs.html'");
  footgear.addMenuItem("Socks,&nbsp;Laces,&nbsp;Etc.","location='/socks.html'");
  footgear.addMenuItem("Graphic Menu","location='/usmcfootgear.html'");
   footgear.hideOnMouseOut=true;
   footgear.menuBorder=1;
   footgear.menuLiteBgColor='#666666';
   footgear.menuBorderBgColor='#000000';
   footgear.bgColor='#000000';

  window.patches = new Menu("root",120,16,"Verdana, Arial, Helvetica, sans-serif",10,"#ffcc00","#990000","#990000","#ffcc00","left","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  patches.addMenuItem("Patches","location='/usmcpatches.html'");
  patches.addMenuItem("Rank Patches","location='/insignia.html'");
  patches.addMenuItem("Stickers","location='/marinestickers.html'");
  patches.addMenuItem("Graphic Menu","location='/patches.html'");
   patches.hideOnMouseOut=true;
   patches.menuBorder=1;
   patches.menuLiteBgColor='#666666';
   patches.menuBorderBgColor='#000000';
   patches.bgColor='#000000';
   
  patches.writeMenus();
} // mmLoadMenus()
//-->
