// JavaScript Document

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 validate() {     

    if(document.request.name.value == "")
     { alert('You must enter your name to continue'); return false;}  
    if(document.request.email.value == "")
     { alert('You must enter your email address to continue'); return false;}
   }
   
function validate2() {     

    if(document.request.name.value == "")
     { alert('You must enter your name to continue'); return false;}  
    if(document.request.company.value == "")
     { alert('You must enter your company name to continue'); return false;}
	if(document.request.address.value == "")
     { alert('You must enter your address to continue'); return false;}
	if(document.request.phone.value == "")
     { alert('You must enter your phone number to continue'); return false;}  
    if(document.request.email.value == "")
     { alert('You must enter your email address to continue'); return false;}
	
   }
   
   function validate3() {     

    if(document.request.officename.value == "")
     { alert('You must enter your office name to continue'); return false;}  
    if(document.request.officeid.value == "")
     { alert('You must enter your office ID to continue'); return false;}
	if(document.request.brokername.value == "")
     { alert('You must enter the brokers name to continue'); return false;}  
    if(document.request.brokerid.value == "")
     { alert('You must enter your broker ID number to continue'); return false;}
	if(document.request.email.value == "")
     { alert('You must enter the brokers email address to continue'); return false;}
	if(document.request.address.value == "")
     { alert('You must enter your address to continue'); return false;}
	if(document.request.city.value == "")
     { alert('You must enter your city to continue'); return false;}  
    if(document.request.state.value == "")
     { alert('You must enter your state to continue'); return false;}
	if(document.request.zip.value == "")
     { alert('You must enter your zip to continue'); return false;}
	if(document.request.quantity.value == "")
     { alert('You must enter the quantity to continue'); return false;}
	if(document.request.checkbox.value == "")
     { alert('Please check the billing acknowledgement to continue'); return false;}
	
	
   }


function shawsWindow()
{
	shawsWin = window.open("/GetCopy/ShawsLocations.asp","shaws","width=541,height=450"); 
}

function stopshopWindow()
{
	stopshopWin = window.open("/GetCopy/StopShopLocations.asp","stopshop","width=541,height=650"); 
}

function cvsWindow()
{
	cvsWin = window.open("/GetCopy/cvsLocations.asp","cvs","width=541,height=750,scrollbars"); 
}

function deadlinesWindow()
{
	deadlinesWin = window.open("/Advertise/PublicationDeadlines.asp","deadlines","width=541,height=650"); 
}

function printPage() { print(document); }



/***********************************************
* Show Hint script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
		
var horizontal_offset="9px" //horizontal offset of hint box from anchor link

/////No further editting needed

var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
var ie=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
}
else{
var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
}
return edgeoffset
}

function showhint(menucontents, obj, e, tipwidth){
if (menucontents != ""){
	if ((ie||ns6) && document.getElementById("hintbox")){
	dropmenuobj=document.getElementById("hintbox")
	dropmenuobj.innerHTML=menucontents
	dropmenuobj.style.left=dropmenuobj.style.top=-500
	if (tipwidth!=""){
	dropmenuobj.widthobj=dropmenuobj.style
	dropmenuobj.widthobj.width=tipwidth
	}
	dropmenuobj.x=getposOffset(obj, "left")
	dropmenuobj.y=getposOffset(obj, "top")
	dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
	dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
	dropmenuobj.style.visibility="visible"
	obj.onmouseout=hidetip
	}
}
}

function hidetip(e){
dropmenuobj.style.visibility="hidden"
dropmenuobj.style.left="-500px"
}

function createhintbox(){
var divblock=document.createElement("div")
divblock.setAttribute("id", "hintbox")
document.body.appendChild(divblock)
}
function disableEnterKey(){
if (window.event.keyCode == 13){
	event.returnValue=false;
	event.cancel = true;
	}
}

if (window.addEventListener)
window.addEventListener("load", createhintbox, false)
else if (window.attachEvent)
window.attachEvent("onload", createhintbox)
else if (document.getElementById)
window.onload=createhintbox
