// Determine DOM support
if 	(document.getElementById)	var DOMS = 3	// Supports Web Standard
else if	(document.all)			var DOMS = 2	// Supports MS document.all
else if	(document.layers)		var DOMS = 1	// Supports NS layers
else					var DOMS = 0;	// Don't support crap

CBUT = new Object();
CBUT['1n'] = new Image(20,20) ; CBUT['1n'].src = 'images/circle/cbut1n.gif'
CBUT['1o'] = new Image(20,20) ; CBUT['1o'].src = 'images/circle/cbut1o.gif'
CBUT['1d'] = new Image(20,20) ; CBUT['1d'].src = 'images/circle/cbut1d.gif'
CBUT['2n'] = new Image(26,26) ; CBUT['2n'].src = 'images/circle/cbut2n.gif'
CBUT['2o'] = new Image(26,26) ; CBUT['2o'].src = 'images/circle/cbut2o.gif'
CBUT['2d'] = new Image(26,26) ; CBUT['2d'].src = 'images/circle/cbut2d.gif'
CBUT['3n'] = new Image(33,33) ; CBUT['3n'].src = 'images/circle/cbut3n.gif'
CBUT['3o'] = new Image(33,33) ; CBUT['3o'].src = 'images/circle/cbut3o.gif'
CBUT['3d'] = new Image(33,33) ; CBUT['3d'].src = 'images/circle/cbut3d.gif'

// Return DOM Handle for specified DOM object ID
function getObj(oid) {
  switch(DOMS) {					// Check for various browsers
    case 1: return(document[oid]);			// Supports Layers (NS4)
    case 2: return(document.all[oid]);			// Supports document.all (ie4)
    case 3: return( ((document.getElementById(oid))?document.getElementById(oid):'') );	// Supports getElementById
  }
}

// Hide specified dropdown menu
function hideIt(s) {
  switch(DOMS) {
    case 1: document.layers[s].visibility = 'hidden';			break;
    case 2: document.all[s].style.visibility='hidden';			break;
    case 3: document.getElementById(s).style.visibility='hidden';	break;
  }
}

// Show specified dropdown menu
function showIt(s) {
  switch(DOMS) {
    case 1: document.layers[s].visibility = 'visible';			break;
    case 2: document.all[s].style.visibility='visible';			break;
    case 3: document.getElementById(s).style.visibility='visible';	break;
  }
}

// Generate "Become a Merrchant" nav bar
function genPmenu(s) {
document.write('<table class="TABS" border="0" cellspacing="0" cellpadding="0" width="100%"><tr valign="middle">' +
  '<th nowrap><a class="' + ((s==0)  ?'TAB1':'TAB0') + '" href="newmerchant.php"	>Become a Merchant</a></th>' +
  '<th nowrap><a class="' + ((s==1)  ?'TAB1':'TAB0') + '" href="packages.php"		>Packages</a></th>' +
  '<th nowrap><a class="' + ((s==2)  ?'TAB1':'TAB0') + '" href="security.php"		>Security</a></th>' +
  '<th nowrap><a class="' + ((s==3)  ?'TAB1':'TAB0') + '" href="rts.php"		>Shipping</a></th>' +
  '<th nowrap><a class="' + ((s==4)  ?'TAB1':'TAB0') + '" href="features.php"		>Features</a></th>' +
  '<th nowrap><a class="' + ((s==5)  ?'TAB1':'TAB0') + '" href="ufi.php"		>Interface</a></th>' +
  '<th nowrap><a class="' + ((s==6)  ?'TAB1':'TAB0') + '" href="benefits.php"		>Benefits</a></th>' +
  '<th nowrap><a class="' + ((s==7)  ?'TAB1':'TAB0') + '" href="hosting.php"		>Hosting</a></th>' +
  '<th nowrap><a class="' + ((s==8)  ?'TAB1':'TAB0') + '" href="search_engine.php"	>Search Engine</a></th>' +
  '<th nowrap><a class="' + ((s==9)  ?'TAB1':'TAB0') + '" href="training.php"		>Training</a></th>' +
  '<th nowrap><a class="' + ((s==10) ?'TAB1':'TABr') + '" href="marketing.php"		>Marketing</a></th>' +
  '</tr><tr><td class="TBAS" colspan="11" height="4" style="font-size:2pt;"><br></td></tr></table>')
}

function swapImg(bid,b) { document.images[bid].src=CBUT[b].src }

// Swap display of blocks of content
function swapBlk(s,h,bid,b) {
  hideIt(h);
  showIt(s);
  swapImg(bid,b);
}

// Set DOM object visibility:  obj = DOM object handle;  s = visibility option
function setBor(obj,bs,bc) {
  switch(DOMS) {
//    case 0:  break;									// no DOM
//    case 1:  obj.borderColor = bc;		obj.borderStyle = bs;		break;	// layers
    default: obj.style.borderColor = bc;	obj.style.borderStyle = bs;	break;	// IE4+ and NS6+
  }
}

function molnk(s,oid) {
  obj = getObj(oid);
  switch(s) {
    case 1:  setBor(obj,'outset','#00f'); break;
    case 2:  setBor(obj,'inset', '#00f'); break;
    default: setBor(obj,'solid', '#fff'); break;
  }
}

function viewProductImages(storeid,itemid) { window.open('product_info.php?storeid='+storeid+'&itemid='+itemid,'product','height=700,width=700,scrollbars,resizable'); return false; }
