 
/* include CSS for given screen resolution */
if (screen.width <= 800) {
   var head=document.getElementById('head');
   document.write('<link href="/styles/lgs/styles/w800.css" rel="stylesheet" type="text/css"/>');
}


function showTab(obj) {
		var curr, newClass, contentId, contentObj;
		for(var i=0; i < obj.parentNode.childNodes.length; i++) {
			curr=obj.parentNode.childNodes[i];
			if (curr.nodeType != 1) continue;

			newClass=(curr.id == obj.id ? 'activeYes' : 'activeNo');
			
			// Tab
			curr.className=curr.className.replace(/active(Yes|No)/, newClass);
			if (!document.all) curr.setAttribute('class', curr.getAttribute('class').replace(/active(Yes|No)/, newClass));

			// Content
			contentId=curr.id.replace(/tab/, 'content');
			contentObj=document.getElementById(contentId);
			contentObj.className=contentObj.className.replace(/active(Yes|No)/, newClass);
			if (!document.all) contentObj.setAttribute('class', contentObj.getAttribute('class').replace(/active(Yes|No)/, newClass));
		}
	}



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>';
}


function newWindow(theURL,winName,features) { //v2.0
picWin = window.open(theURL,winName,features);
picWin.focus();
}



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 LoadVendorInfo(id) {
    ShowVendorInfo(id, '<div id="Vendor-Loading"></div>');
    loadXMLDoc('/.ajax/?f=lgs-vendor-info&id='+id+'&cb=ShowVendorInfo');
}

function ShowVendorInfo(id, data) {
    var infoBox = document.getElementById('VendorInfoBox');
    var dataLayer = document.getElementById('VIB-middle');
    var parentLayer = document.getElementById('Vendor-'+id);
    if (!infoBox) return;
    if (!dataLayer) return;
    if (!parentLayer) return;
    if (data) {
	dataLayer.innerHTML = data;
	infoBox.style.top = getposOffset(parentLayer, "top");
	if (document.all) {
    	    infoBox.style.left = parentLayer.offsetLeft + 300;/*getposOffset(parentLayer, "left")+300;*/
	} else {
	    infoBox.style.left = getposOffset(parentLayer, "left")+300;
	}
	
	infoBox.style.display = "block";
	/*updateVendorInfoPos();*/
    }
}

function HideVendorInfoBox() {
    var infoBox = document.getElementById('VendorInfoBox');
    if (infoBox) {
	infoBox.style.display = "none";
    }
}

function updateVendorInfoPos() {
    var infoBox = document.getElementById('VendorInfoBox');
    if (infoBox) {
	iebody = (document.compatMode=="CSS1Compat")?document.documentElement : document.body;
	if (document.all) {
	    infoBox.style.top = iebody.scrollTop +72 + 'px';
	} else {
	    infoBox.style.top = pageYOffset + 72 + 'px';
	}
    }
}

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++){
    Prepare(links[i]);
    }
}

function Prepare(el){
var tooltip,t,b,s,l;
t=el.getAttribute("title");
if(t==null || t.length==0) t="link:";
el.removeAttribute("title");
tooltip=CreateEl("span","tooltip");
s=CreateEl("span","top");
s.appendChild(document.createTextNode(t));
tooltip.appendChild(s);
b=CreateEl("b","bottom");
l=el.getAttribute("name");
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-20)+"px";
}