/* GLOBAL FILE ================================*/
/* THIS CODE PROPAGATES THE Click VARIABLE FROM THE ENTRY PAGE */
/* DEPENDS ON ANALYTICS MODULE */
var affRefPattern=/analytics_entryPage=[^;]+Click%3D([0-9]+)/;
var affClickId=document.cookie.match(affRefPattern) && document.cookie.match(affRefPattern)[1];
if (document.cookie.match(/analytics_originalReferer=[^;]+\.radioreference\.com/)) { // hardcoded affid for radioreference.com
    affClickId=20907;
} else if (document.cookie.match(/analytics_originalReferer=[^;]+\.butel\.nl/)) { // hardcoded affid for radioreference.com
    affClickId=41054;
}


if (affClickId) { 
  function affRewrite() {
    for(var c=0; c < document.links.length; c++) {
      if (document.links[c].hostname=="www.scannermaster.com") {
          document.links[c].href+=(document.links[c].search ? '&' : '?') + 'Click=' + affClickId;
      }
    } 
  }
  if (window.attachEvent) {
    window.attachEvent("onload", affRewrite);
  } else if (document.addEventListener) {
    window.addEventListener("load", affRewrite, true);
  }
}
/* Click VAR SUPPORT END */

	 function findTable(table) { // For faster usage
	   while((table.localName || table.tagName).toLowerCase() != 'table') {
              table=table.parentNode;
           }
	   return table;
	 }
	 
	 function setClassHoverTable(node) {
			 if (!node.table) node.table=findTable(node);
			 var cellIndex=node.cellIndex;

			 setClassHover(node, 'hoverCell');
			 setClassHover(node.parentNode, 'hoverRow');			 
			 for(var row=0; row < node.table.rows.length; row++) {
					 setClassHover(node.table.rows[row].cells[cellIndex], 'hoverCol');
			 }
	 }

	 function unsetClassHoverTable(node) {
			 if (!node.table) node.table=findTable(node);
			 var cellIndex=node.cellIndex;

			 unsetClassHover(node, 'hoverCell');
			 unsetClassHover(node.parentNode, 'hoverRow');
			 for(var row=0; row < node.table.rows.length; row++) {
					 unsetClassHover(node.table.rows[row].cells[cellIndex], 'hoverCol');
			 }
	 }


 	 function setClassHover(node, sClass) {
           if (!node) return;
	   node.className=(node.className || node.getAttribute('class')) + ' '+sClass;
	   node.setAttribute('class', node.className);
	 }

	 function unsetClassHover(node, sClass) {
           if (!node) return;
	   node.className=(node.className || node.getAttribute('class')).replace(new RegExp(" "+sClass), '');
	   node.setAttribute('class', node.className);	 
	 }


function LoadFlash(elementId, url, w, h, bgcolor, wmode) {
	var e = document.getElementById(elementId);
	e.innerHTML = 
	'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+w+'" height="'+h+'" align="middle">'+
	'<param name="allowScriptAccess" value="sameDomain" />'+
	'<param name="movie" value="'+url+'" />'+
	'<param name="quality" value="high" />'+
	'<param name="bgcolor" value="'+bgcolor+'" />'+
	'<param name="wmode" value="'+wmode+'" />'+
	'<embed src="'+url+'" quality="high" bgcolor="'+bgcolor+'" width="'+w+'" height="'+h+'" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
	'</object>';
}



/* LOCAL FILE ================================ */
var isPopup=1;

//if (document.all) {
//    var wtt = null;
//    window.onscroll = function () {clearTimeout(wtt); wtt = setTimeout('updateVendorInfoPos()', 500);};
//}


function enableTooltips(id){
var links,i,h;
if(!document.getElementById || !document.getElementsByTagName) return;
AddCss();
h=document.createElement("span");
h.id="btc";
h.setAttribute("id","btc");
h.style.position="absolute";
document.getElementsByTagName("body")[0].appendChild(h);
if(id==null) links=document.getElementsByTagName("a");
else links=document.getElementById(id).getElementsByTagName("a");
for(i=0;i<links.length;i++){
    if (links[i].className=='paramTip') {Prepare(links[i]);}
    }
}

function Prepare(el){
var tooltip,t,b,s,l;
t=el.getAttribute("title");
el.removeAttribute("title");
tooltip=CreateEl("span","tooltip");
s=CreateEl("span","top");
s.appendChild(document.createTextNode(t));
tooltip.appendChild(s);
b=CreateEl("b","bottom");

//if(l.length>28) l=l.substr(0,25)+"...";
//b.appendChild(document.createTextNode(l));
tooltip.appendChild(b);
setOpacity(tooltip);
el.tooltip=tooltip;
el.onmouseover=showTooltip;
el.onmouseout=hideTooltip;
el.onmousemove=Locate;
}

function showTooltip(e){
document.getElementById("btc").appendChild(this.tooltip);
Locate(e);
}

function hideTooltip(e){
var d=document.getElementById("btc");
if(d.childNodes.length>0) d.removeChild(d.firstChild);
}

function setOpacity(el){
el.style.filter="alpha(opacity:95)";
el.style.KHTMLOpacity="0.95";
el.style.MozOpacity="0.95";
el.style.opacity="0.95";
}

function CreateEl(t,c){
var x=document.createElement(t);
x.className=c;
x.style.display="block";
return(x);
}

function AddCss(){
var l=CreateEl("link");
l.setAttribute("type","text/css");
l.setAttribute("rel","stylesheet");
l.setAttribute("href","bt.css");
l.setAttribute("media","screen");
document.getElementsByTagName("head")[0].appendChild(l);
}

function Locate(e){
var posx=0,posy=0;
if(e==null) e=window.event;
if(e.pageX || e.pageY){
    posx=e.pageX; posy=e.pageY;
    }
else if(e.clientX || e.clientY){
    if(document.documentElement.scrollTop){
        posx=e.clientX+document.documentElement.scrollLeft;
        posy=e.clientY+document.documentElement.scrollTop;
        }
    else{
        posx=e.clientX+document.body.scrollLeft;
        posy=e.clientY+document.body.scrollTop;
        }
    }
document.getElementById("btc").style.top=(posy-10)+"px";
document.getElementById("btc").style.left=(posx+5)+"px";
}

function printWindow(){
browserVersion = parseInt(navigator.appVersion)
if (browserVersion >= 4) window.print()
}
