function addF (title) { if (window.sidebar) { window.sidebar.addPanel(title, window.location,""); } else if( window.external ) { window.external.AddFavorite( window.location, title); }
else if(window.opera && window.print) { return true; } }

function destroyWin2 (where,name) { 
	document.getElementById(where).style.overflow = ''; 
	if (document.getElementById(name)) { document.getElementById(where).removeChild(document.getElementById(name)); }
if (document.getElementById('opacityDiv')) { document.getElementById(where).removeChild(document.getElementById('opacityDiv')); } 

}

function destroyWin (where) { document.getElementById(where).style.overflow = ''; 
	if (document.getElementById('qDiv')) { document.getElementById(where).removeChild(document.getElementById('qDiv')); }
	
	if (document.getElementById('opacityDiv')) { document.getElementById(where).removeChild(document.getElementById('opacityDiv')); } }

function f_scrollLeft() { return f_filterResults ( window.pageXOffset ? window.pageXOffset : 0, document.documentElement ? document.documentElement.scrollLeft : 0, document.body ? document.body.scrollLeft : 0 ); }

function getScrollXY() { var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; }
return [ scrOfX, scrOfY ]; }

function createWin (where,height,width,url) { document.getElementById(where).style.overflow = 'hidden'; var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; }
var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = document.body.scrollWidth; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight){ xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; }
var windowWidth, windowHeight; if (self.innerHeight) { windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; }
if(yScroll < windowHeight){ pageHeight = windowHeight; } else { pageHeight = yScroll; }
if(xScroll < windowWidth){ pageWidth = windowWidth; } else { pageWidth = xScroll; }
var newOLayer = document.createElement("div"); newOLayer.setAttribute('id','opacityDiv'); newOLayer.style.position = 'absolute'; newOLayer.style.top = '-10px'; newOLayer.style.left = '-10px'; newOLayer.style.width = (pageWidth + 10); newOLayer.style.height = (pageHeight + 10); newOLayer.style.background = 'black'; newOLayer.style.border = 'solid 1px #000000'; newOLayer.style.zIndex = '100'; newOLayer.style.filter = 'filter: alpha(opacity=50)'; newOLayer.style.opacity = '0.5'; document.getElementById(where).appendChild(newOLayer); newOLayer.onclick = function () {destroyWin(where); return false;}
var newQdiv = document.createElement("div"); newQdiv.setAttribute('id','qDiv'); newQdiv.style.position = 'absolute'; newQdiv.style.background = 'white'; newQdiv.style.zIndex = '101'; newQdiv.style.top = (((windowHeight / 2) + scrOfY) - (height / 2)); newQdiv.style.left = (((windowWidth / 2) + scrOfX) - (width / 2)); newQdiv.style.border = 'solid 1px #444444'; newQdiv.innerHTML = '<table cellspacing=3 cellpadding=3><tr><td><img src=\"http://www.hbd101.com/is/animated_loading.gif\"> Loading...</td></tr></table>'; document.getElementById(where).appendChild(newQdiv); var xmlhttp; xmlhttp = false; if (!xmlhttp) { if (navigator.appName == "Microsoft Internet Explorer") { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } else { xmlhttp = new XMLHttpRequest(); } }
xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState==4) { newQdiv.innerHTML = (xmlhttp.responseText); xmlhttp = false; } }; xmlhttp.open("GET",url); xmlhttp.send(null); }

function ix_call(action,target){ 

if (target != 'null') { 
//document.getElementById(target).innerHTML = '<img src="http://www.hbd101.com/is/animated_loading.gif"> Loading...'; 
}
var xmlhttp; xmlhttp = false; if (!xmlhttp) { if (navigator.appName == "Microsoft Internet Explorer") { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } else { xmlhttp = new XMLHttpRequest(); } }
xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState==4) { if (target != 'null') { if (document.getElementById(target)) { document.getElementById(target).innerHTML = (xmlhttp.responseText); } }
xmlhttp = false; } }; xmlhttp.open("GET",action); xmlhttp.send(null); }

function createWin2 (name,where,height,width,url,showLoader) {   if (document.getElementById(name)) { return ''; }
var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; }
var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = document.body.scrollWidth; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight){ xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; }
var windowWidth, windowHeight; if (self.innerHeight) { windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; }
if(yScroll < windowHeight){ pageHeight = windowHeight; } else { pageHeight = yScroll; }
if(xScroll < windowWidth){ pageWidth = windowWidth; } else { pageWidth = xScroll; }              
var newQdiv = document.createElement("div"); 
newQdiv.setAttribute('id',name); 
newQdiv.style.position = 'absolute'; 
newQdiv.style.background = 'transparent'; 
newQdiv.style.zIndex = '101'; 
newQdiv.style.top = (((windowHeight / 2) + scrOfY) - (height / 2)); 
newQdiv.style.left = (((windowWidth / 2) + scrOfX) - (width / 2)); 
newQdiv.style.border = 'solid 0px #444444'; 
document.getElementById(where).appendChild(newQdiv) 
if ((i = navigator.userAgent.indexOf("MSIE")) >= 0) {  } else {  }
var unique_date = new Date().getTime(); 

if (showLoader) { content = "<table width=\"230\" cellspacing=\"12\" cellpadding=\"12\"><tr> <td align=\"center\" id=\"progressDiv\">Loading, please wait...<br><br><img src=\"http://www.hbd101.com/is/scd_msn_loader.gif\" onLoad=\"get_url_to_field(url,'progressDiv', '0')\"></td> </tr> </table>"; } else { content = "&nbsp;"; }
newQdiv.innerHTML = get_round_corners(unique_date,'10',content); ix_call(url,unique_date); }
function get_round_corners(cntId,width,content) { return "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse;\"><tr><td valign=\"top\"><img style=\"filter:alpha(opacity=50);-moz-opacity:.6;\" src=\"http://www.hbd101.com/is/lb_tl.gif\" width=\""+width+"\" height=\""+width+"\"></td><td style=\"background-image: url('http://www.hbd101.com/is/lb_bg.gif');filter:alpha(opacity=50);-moz-opacity:.6;\"></td><td valign=\"top\"><img style=\"filter:alpha(opacity=50);-moz-opacity:.6;\" src=\"http://www.hbd101.com/is/lb_tr.gif\" width=\""+width+"\" height=\""+width+"\"></td></tr><tr><td style=\"background-image: url('http://www.hbd101.com/is/lb_bg.gif');filter:alpha(opacity=50);-moz-opacity:.6;\"></td><td style=\"background-color: #FFFFFF\" id=\""+cntId+"\">"+content+"</td><td style=\"background-image: url('http://www.hbd101.com/is/lb_bg.gif');filter:alpha(opacity=50);-moz-opacity:.6;\"></td></tr><tr><td valign=\"bottom\"><img style=\"filter:alpha(opacity=50);-moz-opacity:.6;\" src=\"http://www.hbd101.com/is/lb_bl.gif\" width=\""+width+"\" height=\""+width+"\"></td><td style=\"background-image: url('http://www.hbd101.com/is/lb_bg.gif');filter:alpha(opacity=50);-moz-opacity:.6;\"></td><td valign=\"bottom\"><img style=\"filter:alpha(opacity=50);-moz-opacity:.6;\" src=\"http://www.hbd101.com/is/lb_br.gif\" width=\""+width+"\" height=\""+width+"\"></td></tr></table>"; }
function hideThumb (productID) { document.getElementById(productID).style.display = 'none'; }
function hideEmailProduct (productID) { document.getElementById(productID).style.display = 'none'; }
function showEmailProduct (productID) { document.getElementById(productID).style.display = ''; document.getElementById(productID).innerHTML = '<table bgcolor="#EDF0FF" border=0 style="border-style: solid; border-color: #444444;border-width: 1px;position:absolute;top: 160;left: -100;"><tr><td>To Email:</td><td><input type=text name=toEmail style="width: 120px;"></td></tr><tr><td>Comment:</td><td><textarea style="width: 120px;" name=emailComment></textarea></td></tr><td></td><td align=right><a href="javascript:;" onClick="javascript:(this.div.style.display=\'none\');">Cancel</a>  &nbsp;&nbsp; <a href="javascript:;">Send</a></td></tr></table>'; document.getElementById(productID).style.top = event.clientY + document.body.scrollTop - 175; document.getElementById(productID).style.left = (event.clientX + document.body.scrollLeft) - 10; document.getElementById(productID).style.position = 'absolute'; document.getElementById(productID).style.zIndex = 100; }

function pause(ms) { date = new Date(); var curDate = null; do { var curDate = new Date(); }
while(curDate-date < ms); }

function showThumb (event,thumbImage,productID) { image1 = new Image(); image1.src = 'http://images5.hbd101.com/' + thumbImage; var toolTipImage = ''; document.getElementById(productID).style.display = ''; document.getElementById(productID).style.height = '350'; document.getElementById(productID).style.width = '400'; if (((event.clientY + document.body.scrollTop) - document.body.scrollTop) > 250) { toolTipImage = 'http://www.hbd101.com/is/tooltip.png'; } else { toolTipImage = 'http://www.hbd101.com/is/tooltip2.png'; }
document.getElementById(productID).style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src='+toolTipImage+', sizingMethod="scale");'; document.getElementById(productID).style.position = 'absolute'; var tempX = event.clientX + document.body.scrollLeft - 480; if (((event.clientY + document.body.scrollTop) - document.body.scrollTop) > 250) { var tempY = event.clientY + document.body.scrollTop - 340; } else { var tempY = event.clientY + document.body.scrollTop - 130; }
document.getElementById(productID).style.top = tempY; document.getElementById(productID).style.left = (event.clientX + document.body.scrollLeft) + 2; if (((event.clientY + document.body.scrollTop) - document.body.scrollTop) > 250) { if ((i = navigator.userAgent.indexOf("MSIE")) >= 0) { document.getElementById(productID).innerHTML = '<img alt="Thumb" src="http://images5.hbd101.com/' + thumbImage + '" style="position:absolute;top: 127;left: 15;">'; } else { document.getElementById(productID).innerHTML = '<img alt="Thumb" src="'+toolTipImage+'"><img alt="Thumb" src="http://images5.hbd101.com/' + thumbImage + '" style="position:absolute;top: 130;left: 18;">'; } } else { if ((i = navigator.userAgent.indexOf("MSIE")) >= 0) { document.getElementById(productID).innerHTML = '<img src="http://images5.hbd101.com/' + thumbImage + '" style="position:absolute;top: 160;left: 15;">'; } else { document.getElementById(productID).innerHTML = '<img src="'+toolTipImage+'"><img src="http://images5.hbd101.com/' + thumbImage + '" style="position:absolute;top: 163;left: 18;">'; } }
document.getElementById(productID).style.zIndex = 100; }
