<!--
var icon_pool;
var icon_selected;
var icon_num;
var icon_weight;

function disableIcon(i) {
	icon_pool[i].enabled=false;
	icon_weight-=icon_pool[i].weight;
}

function createIconPool() {
	var i,j;
	var rand;
	var curr;
	var free;
	var now=new Date();
	defineIcons();
	icon_weight=0;
	for (i=0;i<icon_pool.length;i++) {
		if (now<icon_pool[i].effective)
			icon_pool[i].enabled=false;
		if (now>icon_pool[i].expiry)
			icon_pool[i].enabled=false;
		if (icon_pool[i].enabled)
			icon_weight+=icon_pool[i].weight;
	}

	icon_selected=new Array();
	for (i=0;i<icon_num;i++)
		icon_selected[i]=-1;

	for (i=0;i<icon_pool.length;i++)
		if (icon_pool[i].enabled & icon_pool[i].pos>=0) {
			icon_selected[icon_pool[i].pos]=i;
			disableIcon(i);
		}

	free=new Array();
	j=0;
	for (i=0;i<icon_num;i++)
		if (icon_selected[i]<0)
			free[j++]=i;

	for (i=0;i<icon_pool.length & j>0;i++)
		if (icon_pool[i].enabled & icon_pool[i].force) {
			rand=Math.round(Math.random()*(j-1));
			curr=free[rand];
			icon_selected[curr]=i;
			disableIcon(i);
			//free[curr]=free[j-1];
			free[rand]=free[j-1];
			j--;
		}

	for (i=0;i<icon_num;i++) {
		if (icon_selected[i]<0) {
			curr=-1;
			rand=Math.random()*icon_weight;
			for (j=0;j<icon_pool.length & rand>0 & curr<0;j++)
				if (icon_pool[j].enabled) {
					if (rand < icon_pool[j].weight)
						curr=j;
					rand-=icon_pool[j].weight;
				}
			if (curr>=0) {
				disableIcon(curr);
				icon_selected[i]=curr;
			}
		}
	}
}

function getIcon(i) {
	var c=icon_selected[i];
	if (c>=0)
	{
		if (icon_pool[c].link != '')
			document.write('<a '+icon_pool[c].link+'><img src="'+icon_pool[c].pic+'" border="0"></a>');
		else
			document.write('<img src="'+icon_pool[c].pic+'" border="0">');
	}
}

function icon_popup(theURL) { //v2.0
	window.open(theURL,'','width=700,height=350,menubar=no,location=no,toolbar=no,scrollbars=yes,resizable=yes,top=10,left=10');
}

function createWelcomeBanner() {
/*	var i;
	var html='';
	defineWelcomeBanner();
      	if (welcome_banner_pool.length>0) {		
		html+='<table width="389" border="0" cellspacing="0" cellpadding="0">\n';
		html+='<tr>\n';
		for (i=0;i<welcome_banner_pool.length;i++) {	
			html+='<td><a ' + welcome_banner_pool[i].link + '>' + welcome_banner_pool[i].pic + '</a></td>\n';			
		}		
		html+='</tr>\n';
	      	html+='</table>\n';
		document.write(html);
	}
*/
createIconPool();
getIcon(0);
getIcon(1);
}

function createFeaturing() {
	var i;
	var now=new Date();	
	var html='';
	defineFeaturing();	

      	if (featuring_pool.length>0) {
		for (i=0;i<featuring_pool.length;i++) {
			if (now<featuring_pool[i].effective)
				featuring_pool[i].enabled=false;
			if (now>featuring_pool[i].expiry)
				featuring_pool[i].enabled=false;
		}	

		html+='<table width="360" border="0" align="center" cellpadding="4" cellspacing="0">\n';
		for (i=0;i<featuring_pool.length;i++) {
			if (featuring_pool[i].enabled) {
				html+='<tr>\n';
				html+='  <td width="20" height="19" align="center"><img src="./images/dot_feat.gif" width="13" height="13"></td>\n';
				html+='  <td width="360" class="content"><a ' + featuring_pool[i].link + '><font color="#333333">' + featuring_pool[i].text + '</font></a></td>\n';
				html+='</tr>\n';
			}
	      	}
	      	html+='</table>\n';
		document.write(html);
	}	
}

function createFeaturingMenu() { 
	var i;
	var html='';
	defineFeaturingMenu();	

      	if (featuring_menu_pool.length>0) {	
		html+='<div id="featuring" style="position:absolute; left:560px; top:280px; width:106px; height:91px; z-index:4; visibility: hidden" onMouseOver="MM_showHideLayers(\'featuring\',\'\',\'show\')" onMouseOut="MM_showHideLayers(\'featuring\',\'\',\'hide\')"> \n';
		html+='<table width="182" border="0" cellspacing="0" cellpadding="0">\n';
	  	html+='  <tr> \n';
	  	html+='    <td width="5"><img src="/hsb/com/spacer.gif" width="5" height="1" border="0"></td>\n';
	    	html+='    <td width="177" bgcolor="04487A">\n';
		html+='	     <table width="100%" border="0" cellspacing="1" cellpadding="3">\n';
		for (i=0;i<featuring_menu_pool.length;i++) {
			html+='        <tr>\n';
			html+='          <td bgcolor="B4D5EE" class="content" valign="middle">\n';
			html+='          <img src="/hsb/com/spacer.gif" width="8" height="8" border="0">\n';
			html+='          <a ' + featuring_menu_pool[i].link + ' class="subnav2"><b>' + featuring_menu_pool[i].text + '</b></a>\n';
			html+='          </td>\n';
			html+='        </tr>\n';
	      	}
		html+='	     </table>\n';
		html+='    </td>\n';
		html+='  </tr>\n';
		html+='</table>\n';
		html+='</div>\n';
		document.write(html);
	}
}

function createProductIcon() {
	var i,j;
	var html='';
	defineProductIcon();
      	if (product_icon_pool.length>0) {		
		html+='<table width="389" border="0" cellspacing="0" cellpadding="0">\n';
		for (i=0;i<product_icon_pool.length;i++) {
			if (i%3==0) {
				html+='<tr>\n';
				html+='<td width="129"><a ' + product_icon_pool[i].link + '>' + product_icon_pool[i].pic + '</a></td>\n';
			} else if (i%3==1) {
				html+='<td width="132"><a ' + product_icon_pool[i].link + '>' + product_icon_pool[i].pic + '</a></td>\n';
			} else if (i%3==2) {
				html+='<td width="128"><a ' + product_icon_pool[i].link + '>' + product_icon_pool[i].pic + '</a></td>\n';
				html+='</tr>\n';
				if (i!=product_icon_pool.length-1) {
					html+='<tr><td colspan="3"><img src="/hsb/com/spacer.gif" width="10" height="8"></td></tr>\n';
					html+='<tr bgcolor="#999999"><td colspan="3"><img src="/hsb/com/spacer.gif" width="1" height="1"></td></tr>\n';
					html+='<tr><td colspan="3"><img src="/hsb/com/spacer.gif" width="10" height="8"></td></tr>\n';			
				}
			}
	      	}
	      	j = 3-(i%3);
	      	if (j<2) {
	      		html+='<td colspan="' + j + '"><img src="/hsb/com/spacer.gif" width="10" height="8">\n';
	      		html+='</tr>\n';			
		}
	      	html+='</table>\n';
		document.write(html);
	}
}

function createAnalyses() {
	var i;
	var html='';
	defineAnalyses();	
      	if (analyses_pool.length>0) {	
		html+='<table width="360" border="0" align="center" cellpadding="4" cellspacing="0">\n';
		for (i=0;i<analyses_pool.length;i++) {
			html+='<tr>\n';
			html+='  <td width="16" height="19"><div align="center"><img src="./images/dot_anal_a.gif" width="15" height="11"></div></td>\n';
			html+='  <td width="352" class="content"><a ' + analyses_pool[i].link + '><font color="#333333">' + analyses_pool[i].text + '</font></a></td>\n';
			html+='</tr>\n';
	      	}
	      	html+='</table>\n';
		document.write(html);
	}
}

function createSrvIcon() {
	var i;
	var html='';
	defineSrvIcons();
      	if (srv_icon_pool.length>0) {		
	      	html+='<table width="192" border="0" cellspacing="0" cellpadding="0">\n';
		html+='<tr><td colspan="2"><IMG src="/hsb/com/spacer.gif" width="1" height="5"></td></tr>\n';
		for (i=0;i<srv_icon_pool.length;i++) {
	          	html+='<tr><td><a ' + srv_icon_pool[i].link + '>' + '<img src="' + srv_icon_pool[i].icon_pic_1 + '" width="22" height="21" border="0"><img src="' + srv_icon_pool[i].icon_pic_2 + '" width="170" height="21" border="0"></a></td></tr>\n';
			html+='<tr><td colspan="2"><IMG src="/hsb/com/spacer.gif" width="1" height="5"></td></tr>\n';
	      	}
	      	html+='</table>\n';        
		document.write(html);
	}
}

var invWin;
function eInvcPopUp() {
	var features = "toolbar=yes,scrollbars=yes,resizable=yes,top=0,left=0,width=700,height=550";
	var theURL = "";
	
	invWin = open(theURL,"eINVCWeb",features);
	if ((document.window != null) && (!invWin.opener)){
		invWin.opener = document.window;
	}
	invWin.focus();
	invWin = true;
}
//-->