<!--
function init()
{
	flyerspecial();
	//leftbottom();
	productimage();
}

function productimage()
{
images = new Array();
images[0] = "<img src='images/1FreebieFriday.jpg' border='0' alt='Freebie Friday Feb 24th!' /></a>";

//index = Math.floor(Math.random() * images.length);
document.getElementById('productspecial').innerHTML = images[0];
}

function flyerspecial()
{
images = new Array(23);

images[0] = "<a href = 'http://monarch.basics.com/product.htm?Product=04019-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/04019.jpg' alt='Flyer Special: Washable School Glue' border='0'></a>";
images[1] = "<a href = 'http://monarch.basics.com/product.htm?Product=06060-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/06060.jpg' alt='Flyer Special: Blueline Miraclebind Notebooks' border='0'></a>";
images[2] = "<a href = 'http://monarch.basics.com/product.htm?Product=06782-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/06782.jpg' alt='Flyer Special: Hilroy Steno Notebook' border='0'></a>";
images[3] = "<a href = 'http://monarch.basics.com/product.htm?Product=10496-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/10496.jpg' alt='Flyer Special: HP Inkjet Cartridges' border='0'></a>";
images[4] = "<a href = 'http://monarch.basics.com/product.htm?Product=10516-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/10516.jpg' alt='Flyer Special: Epson Inkjet Cartridges' border='0'></a>";
images[5] = "<a href = 'http://monarch.basics.com/product.htm?Product=10522-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/10522.jpg' alt='Flyer Special: Xerox Solid Ink Sticks' border='0'></a>";
images[6] = "<a href = 'http://monarch.basics.com/product.htm?Product=10848-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/10848.jpg' alt='Flyer Special: Ko-Rec Type Brother Inkjet' border='0'></a>";
images[7] = "<a href = 'http://monarch.basics.com/product.htm?Product=13016-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/13016.jpg' alt='Flyer Special: Artistic Logo Deskpad' border='0'></a>";
images[8] = "<a href = 'http://monarch.basics.com/product.htm?Product=13222-01&Source=Ad' target='_blank'><img src='images/ads/flyerT1/13222.jpg' alt='Flyer Special: Stackable Storage Cubes' border='0'></a>";
images[9] = "<a href = 'http://monarch.basics.com/product.htm?Product=13256-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/13256.jpg' alt='Flyer Special: Olfaź CL Heavy Duty Cutter' border='0'></a>";
images[10] = "<a href = 'http://monarch.basics.com/product.htm?Product=13410-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/13410.jpg' alt='Flyer Special: Rubbermaid Extra Capacity Drawer Organizer' border='0'></a>";
images[11] = "<a href = 'http://monarch.basics.com/product.htm?Product=14017-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/14017.jpg' alt='Flyer Special: Winnable Mesh Desk Accessories' border='0'></a>";
images[12] = "<a href = 'http://monarch.basics.com/product.htm?Product=17201-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/17201.jpg' alt='Flyer Special: V-Flap Business Envelopes' border='0'></a>";
images[13] = "<a href = 'http://monarch.basics.com/product.htm?Product=23052-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/23052.jpg' alt='Flyer Special: Storex Utility Tote' border='0'></a>";
images[14] = "<a href = 'http://monarch.basics.com/product.htm?Product=23089-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/23089.jpg' alt='Flyer Special: Aluminum Side-Hinged Sheet Holders' border='0'></a>";
images[15] = "<a href = 'http://monarch.basics.com/product.htm?Product=24161-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/24161.jpg' alt='Flyer Special: Laminated Folders' border='0'></a>";
images[16] = "<a href = 'http://monarch.basics.com/product.htm?Product=27027-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/27027.jpg' alt='Flyer Special: Beta Posture Task Chair' border='0'></a>";
images[17] = "<a href = 'http://monarch.basics.com/product.htm?Product=28080-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/28080.jpg' alt='Flyer Special: Kriya Chairs' border='0'></a>";
images[18] = "<a href = 'http://monarch.basics.com/product.htm?Product=31265-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/31265.jpg' alt='Flyer Special: Trueblock White Mailing Labels' border='0'></a>";
images[19] = "<a href = 'http://monarch.basics.com/product.htm?Product=31432-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/31432.jpg' alt='Flyer Special: Gemex Fold-Over Name Tag Kit Pin Holder 2-1/4x3-1/2' border='0'></a>";
images[20] = "<a href = 'http://monarch.basics.com/product.htm?Product=35150-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/35150.jpg' alt='Flyer Special: Acco D-Ring Binders' border='0'></a>";
images[21] = "<a href = 'http://monarch.basics.com/product.htm?Product=22028-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/22028.gif' alt='Flyer Special: Winnable Portable File Pockets' border='0'></a>";
images[22] = "<a href = 'http://monarch.basics.com/product.htm?Product=74380-00&Source=Ad' target='_blank'><img src='images/ads/flyerT1/74380.gif' alt='Flyer Special: Slimline CD Jewel Cases' border='0'></a>";

index = Math.floor(Math.random() * images.length);
document.getElementById('flyerspecial').innerHTML = images[index];
//document.getElementById('flyerspecial').innerHTML = "<a href = 'http://www.basics.com'><img src='images/greenoffice.png' alt='Green Your Office and Win Contest!' border='0'></a>";
}

function leftbottom()
{
images = new Array(4);

images[0] = "<a href='ordercat.html'><img src='images/catorder.jpg' border='0' alt='2011 Catalogue Order'/></a>";
images[1] = "<a href='feedback.html'><img src='images/feedback.png' border='0' alt='Monarch Basics Feedback'/></a>";
images[2] = "<a href='http://director.flyerservices.com/basics/PublicationSelector.aspx?OrganizationId=b0beef16-f005-4ea8-8382-58c6e9336af7&amp;BannerId=72f7780e-92f6-4f7f-9ec2-e3f5cd551df7&amp;BannerName=bsc&amp;Language=en&amp;dealer_id=20&amp;PostalCode=N8W5V7&amp;SessionId=hyrcjsudna1kytmrowhkrm55' target='_blank'><img src='images/OnlineFlyer.png' border='0' alt='Monarch Basics Online Flyers'/></a>";
images[3] = "<iframe src='https://www.google.com/calendar/embed?showNav=0&amp;showDate=0&amp;showPrint=0&amp;showTabs=0&amp;showCalendars=0&amp;showTz=0&amp;mode=AGENDA&amp;height=100&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=monarchbasics.com_ht41kikqt6s9k4f3d5ppa5toe4%40group.calendar.google.com&amp;color=%23856508&amp;ctz=America%2FToronto' style='border-width:1' width='215' height='150' frameborder='0' scrolling='no'></iframe>";

index = Math.floor(Math.random() * images.length);
document.getElementById('leftbottom').innerHTML = images[index];
}

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_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_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];}
}

function emailvalidation(field, alertbox) {
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.sex)|(\.biz)|(\.aero)|(\.coop)|(\.museum)|(\.name)|(\.pro)|(\..{2,2}))$)\b/gi);
apos=field.value.indexOf("@");
dotpos=field.value.lastIndexOf(".");
lastpos=field.value.length-1;
var badEmail = (apos<1 || dotpos-apos<2 || lastpos-dotpos<2)
if (goodEmail && !badEmail) {
	return true;
}
else {
	alert(alertbox);
	field.focus();
	field.select();
	return false;
   }
}

function emptyvalidation(entered, alertbox)
{
	with (entered)
	{
		if (value==null || value=="")
		{if (alertbox!="") {alert(alertbox);} return false;}
		else {return true;}
	}
}

function formvalidation(thisform)
{
	with (thisform)
	{

	if (emptyvalidation(name,"Please enter your name")==false) {name.focus(); return false;};
	if (emptyvalidation(lastname,"Please enter your last name")==false) {lastname.focus(); return false;};
	if (emailvalidation(email,"Please enter your valid email address")==false) {email.focus(); return false;};
	if (emptyvalidation(company,"Please enter your company name")==false) {subcompany.focus(); return false;};
	}
}

function catvalidation(thisform)
{
	with (thisform)
	{

	if (emptyvalidation(cname,"Please enter your name")==false) {cname.focus(); return false;};
	if (emailvalidation(cemail,"Please enter your e-mail")==false) {cemail.focus(); return false;};
	if (emptyvalidation(addr,"Please enter your address")==false) {addr.focus(); return false;};
	if (emptyvalidation(phnum,"Please enter your phone number")==false) {phnum.focus(); return false;};
	if (emptyvalidation(city,"Please enter your city")==false) {city.focus(); return false;};
	if (emptyvalidation(postalcode,"Please enter your postal code")==false) {postalcode.focus(); return false;};
	}
}

function creditformvalidation(thisform)
{
	with (thisform)
	{

	if (emptyvalidation(billname,"Please enter your billing name")==false) {billname.focus(); return false;};
	if (emptyvalidation(billaddress,"Please enter your billing address")==false) {billaddress.focus(); return false;};
	if (emptyvalidation(billcity,"Please enter your billing city")==false) {billcity.focus(); return false;};
	if (emptyvalidation(billpostal,"Please enter your billing postal code")==false) {billpostal.focus(); return false;};
	if (emptyvalidation(billphone,"Please enter your billing phone number")==false) {billphone.focus(); return false;};
	if (emptyvalidation(billfax,"Please enter your billing fax number")==false) {billfax.focus(); return false;};

	//Check for type of Business
	if(biztype[0].checked==false && biztype[1].checked==false && biztype[2].checked==false && biztype[3].checked==false) { alert("Please choose a business type"); biztype[0].focus(); return false;};
	if((biztype[3].checked==true) && emptyvalidation(biztypeother,"Please specify the business type")==false) {biztypeother.focus(); return false;};

	if (emptyvalidation(bizemp,"Please specify the number of office employees")==false) {bizemp.focus(); return false;};
	if (emptyvalidation(biznature,"Please enter your business nature")==false) {biznature.focus(); return false;};
	if (emptyvalidation(yrsbiz,"Please enter years in business")==false) {yrsbiz.focus(); return false;};
	if (emptyvalidation(bizemp,"Please specify the number of office employees")==false) {bizemp.focus(); return false;};
	if (emptyvalidation(bizowner,"Please enter the name of the business owner")==false) {bizowner.focus(); return false;};
	//Check if PO is required
	if(bizporeq[0].checked==false && bizporeq[1].checked==false){ alert("Please select if a PO is required"); bizporeq[0].focus(); return false;};
	
	if (emptyvalidation(bizbuyer,"Please enter the name of the business buyer")==false) {bizbuyer.focus(); return false;};
	if (emptyvalidation(bizapcontact,"Please enter the name of the accounts payable")==false) {bizapcontact.focus(); return false;};
	if (emptyvalidation(bizbuyeremail,"Please enter the buyers email")==false) {bizbuyeremail.focus(); return false;};
	if (emptyvalidation(bizapemail,"Please enter accounts payable email")==false) {bizapemail.focus(); return false;};
	//Check if Catalogue is required
	if(bizreqcat[0].checked==false && bizreqcat[1].checked==false){ alert("Please select if your business requires a catalogue"); bizreqcat[0].focus(); return false;};
	if (emptyvalidation(bizestpurch,"Please enter estimated purchase amount")==false) {bizestpurch.focus(); return false;};
	//Check if location method is selected
	if(purtype[0].checked==false && purtype[1].checked==false && purtype[2].checked==false){ alert("Please select how you will purchase products and services"); purtype[0].focus(); return false;};
	//Check which products are selected
	if(prodpurch1.checked==false && prodpurch2.checked==false && prodpurch3.checked==false && prodpurch4.checked==false && prodpurch5.checked==false) { alert("Please select the types of products you will purchase"); prodpurch1.focus(); return false;};
	
	if (emptyvalidation(bankname,"Please enter your bank name")==false) {bankname.focus(); return false;};
	if (emptyvalidation(bankaddress,"Please enter your bank branch address")==false) {bankaddress.focus(); return false;};
	if (emptyvalidation(bankphone,"Please enter your bank's phone number")==false) {bankphone.focus(); return false;};
	if (emptyvalidation(bankacct,"Please enter your bank account number")==false) {bankacct.focus(); return false;};
	if (emptyvalidation(bizrefname1,"Please enter your business reference name")==false) {bizrefname1.focus(); return false;};
	if (emptyvalidation(bizrefaddress1,"Please enter your business reference address")==false) {bizrefaddress1.focus(); return false;};
	if (emptyvalidation(bizreftele1,"Please enter your business reference telephone")==false) {bizreftele1.focus(); return false;};
	if (emptyvalidation(bizrefname2,"Please enter your business reference name")==false) {bizrefname2.focus(); return false;};
	if (emptyvalidation(bizrefaddress2,"Please enter your business reference address")==false) {bizrefaddress2.focus(); return false;};
	if (emptyvalidation(bizreftele2,"Please enter your business reference telephone")==false) {bizreftele2.focus(); return false;};
	
	if (emptyvalidation(applicantname,"Please enter your name")==false) {applicantname.focus(); return false;};
	if (emptyvalidation(applicanttitle,"Please enter your title/position")==false) {applicanttitle.focus(); return false;};
	//Check if customer agrees with the terms and conditions and have read the privacy agreement
	if(i_agree[0].checked==false){ alert("You must read and understand the privacy policy"); i_agree[0].focus(); return false;};
	if(i_agree[1].checked==false){ alert("You must agree to the terms and conditions above"); i_agree[1].focus(); return false;};
	}
}

function eflyervalidation(thisform)
{
	with (thisform)
	{

	if (emptyvalidation(name,"Please enter your name")==false) {name.focus(); return false;};
	if (emptyvalidation(lastname,"Please enter your last name")==false) {lastname.focus(); return false;};
	if (emailvalidation(email,"Please enter your valid email address")==false) {email.focus(); return false;};
	if (emptyvalidation(company,"Please enter your company name")==false) {company.focus(); return false;};
	//Check if location method is selected
	if(document.subform.purtype[0].checked==false && document.subform.purtype[1].checked==false && document.subform.purtype[2].checked==false){ alert("Please select how you will purchase products and services"); purtype[0].focus(); return false;};
	//Check which products are selected
	if(document.subform.prodpurch1.checked==false && document.subform.prodpurch2.checked==false && document.subform.prodpurch3.checked==false && document.subform.prodpurch4.checked==false && document.subform.prodpurch5.checked==false) { alert("Please select the types of products you will purchase"); prodpurch1.focus(); return false;};
	
	}
}

function checkall()
{
	document.subform.prodpurch1.checked=true;
	document.subform.prodpurch2.checked=true;
	document.subform.prodpurch3.checked=true;
	document.subform.prodpurch4.checked=true;
	document.subform.prodpurch5.checked=true;
}

function clearText(field){

    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;

}

function toggleMenu(objID) {
if (!document.getElementById) return;
var ob = document.getElementById(objID).style;
ob.display = (ob.display == 'block')?'none': 'block';
}

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-19758954-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);
})();

//-->

