<!--

function AddListener(obj, type, expression, bubbling) {
	bubbling = bubbling || false;
	element = document.getElementById(obj);
	if (window.addEventListener) { // Standard
		element.addEventListener(type, expression, bubbling);
		return true;
	} else if (window.attachEvent) { // IE
		element.attachEvent('on' + type, expression);
		return true;
	} else return false;
}
var W3CDOM = (document.createElement && document.getElementsByTagName);

function FindPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
	while (obj = obj.offsetParent);
		var objPos = new Object();
		objPos.x = curleft;
		objPos.y = curtop;
		return objPos;
	}
}
function correctPNG() {
	for(var i=0; i<document.images.length; i++) {
		var img = document.images[i]
		var imgName = img.src.toUpperCase()
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {
			var imgID = (img.id) ? "id='" + img.id + "' " : ""
			var imgClass = (img.className) ? "class='" + img.className + "' " : ""
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
			var imgStyle = "display:inline-block;" + img.style.cssText 
			if (img.align == "left") imgStyle = "float:left;" + imgStyle
			if (img.align == "right") imgStyle = "float:right;" + imgStyle
	 		if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
	 		var strNewHTML = "<span " + imgID + imgClass + imgTitle
	 		+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
			+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
			img.outerHTML = strNewHTML
			i = i-1
		}
	}
}
function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") &&
			anchor.getAttribute("rel") == "external")
			anchor.target = "_blank";
	}
}
function initFileUploads() {
	if (!W3CDOM) return;
	var fakeFileUpload = document.createElement('div');
	fakeFileUpload.className = 'newinput';
	fakeFileUpload.appendChild(document.createElement('input'));
	var x = document.getElementsByTagName('input');
	for (var i=0;i<x.length;i++) {
		if (x[i].type != 'file') continue;
		if (x[i].parentNode.className != 'attach') continue;
		var clone = fakeFileUpload.cloneNode(true);
		x[i].parentNode.appendChild(clone);
		x[i].relatedElement = clone.getElementsByTagName('input')[0];
		x[i].onchange = x[i].onmouseout = function () {
			this.relatedElement.value = this.value;
		}
	}
}
function showHide(layerName){
	if (document.getElementById){
		var fred = document.getElementById(layerName);
		var display = fred.style.display ? '' : 'none';
		fred.style.display = display;
		return;
	}
}
function openChatWindow() {
	window.open('http://server.iad.liveperson.net/hc/48343607/?cmd=file&amp;file=visitorWantsToChat&amp;site=48343607&amp;imageUrl=http://images.liveperson.com/lp/48343607&amp;referrer='+escape(document.location),'chat48343607','width=472,height=320');
	return false;
}
function setPox() {
	var allDivs = document.getElementsByTagName("div");
	for (a=0;a<allDivs.length;a++) {
		if (allDivs[a].className == "pox") {
			for (c=0;c<allDivs[a].childNodes.length;c++) {
				if (allDivs[a].childNodes[c].nodeName == "H3") {
					for (p=0;p<allDivs[a].childNodes[c].childNodes.length;p++) {
						if (allDivs[a].childNodes[c].childNodes[p].nodeName == "A") {
							allDivs[a].hdr = allDivs[a].childNodes[c].childNodes[p];
						}
					}
				}
				if (allDivs[a].childNodes[c].nodeName == "P") {
					allDivs[a].hdr.par = allDivs[a].childNodes[c];
				}
			}
			if ((allDivs[a].hdr)&&(allDivs[a].hdr.par)) {
				allDivs[a].hdr.onclick = function() {
					var classy = (this.par.className == "on") ? 'off' : 'on'; 
					this.par.className = classy;
					this.className = classy;
					return false;
				}
			}
			//showHide(allDivs[a].par.id);
			//alert(allDivs[a].par);
		}
	}
}
function setMethodInfo() {
	var via = document.getElementById("contactvia");
	var meth = document.getElementById("method");
	meth.innerHTML = via.options[via.selectedIndex].value;
}
function showOthersize() {
	var size = document.getElementById("size");
	var sbox = document.getElementById("sizebox");
	if (size.selectedIndex+1 == size.options.length) { sbox.style.display = ""; } else { sbox.style.display = "none"; }
}
addDOMLoadEvent = (function(){
	var load_events = [],
        load_timer,
        script,
        done,
        exec,
        old_onload,
        init = function () {
            done = true;
			clearInterval(load_timer);
            while (exec = load_events.shift())
                exec();
            if (script) script.onreadystatechange = '';
        };
    return function (func) {
        if (done) return func();
        if (!load_events[0]) {
            if (document.addEventListener)
                document.addEventListener("DOMContentLoaded", init, false);
            /*@cc_on @*/
            /*@if (@_win32)
                document.write("<script id=__ie_onload defer src=//0><\/scr"+"ipt>");
                script = document.getElementById("__ie_onload");
                script.onreadystatechange = function() {
                    if (this.readyState == "complete")
                        init(); // call the onload handler
                };
            /*@end @*/
            if (/WebKit/i.test(navigator.userAgent)) { // sniff
                load_timer = setInterval(function() {
                    if (/loaded|complete/.test(document.readyState))
                        init();
                }, 10);
            }
            old_onload = window.onload;
            window.onload = function() {
                init();
                if (old_onload) old_onload();
            };
        }
        load_events.push(func);
    }
})();

addDOMLoadEvent(function() {
	//add stuff here
	if (document.getElementById("ChatButton")) { AddListener("ChatButton","click",openChatWindow,true); }
	if (document.getElementById("logoPanel")) { initFileUploads(); }
	if (document.getElementById("products")) { setPox(); }
	//if (document.getElementById("method")) { AddListener("contactvia","change",setMethodInfo,true); }
	if (document.getElementById("size")) { AddListener("size","change",showOthersize,true); }
	if (!window.XMLHttpRequest) { correctPNG(); }
	externalLinks();
});

//-->