<!--
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--;
        }
    }
}

isIE6 = /msie|MSIE 6/.test(navigator.userAgent);
if ( isIE6 ) window.attachEvent("onload", correctPNG);
//if ( window.attachEvent ) window.attachEvent("onload", correctPNG);

function changeClass(oThat,nOn,nOff)
{
	oThat.className = "on";
	
	for ( n = 1; n <= nOff; n++ )
	{
		sId = "l" + n;
		if ( n != nOn ) document.getElementById(sId).className = "";
	}
}

function slideWindow(nDir)
{
	if ( nDir > 0 ) void(new Effect.SlideDown(document.getElementById('popup'),{duration:.5, transition: Effect.Transitions.EaseTo}));
	else void(new Effect.SlideUp(document.getElementById('popup'),{duration:.5,transition:Effect.Transitions.EaseFrom}));
}

function openWindow(sUrl,sName,nWidth,nHeight,fClean)
{
	sOptions = "width=" + nWidth + ",height=" + nHeight;
	sOptions += fClean ? ",resizable=0,scrollbars=auto,menubar=0,statusbar=0,toolbar=0,locationbar=0" : "";
	return window.open(sUrl,sName,sOptions);
}

function openToolkit()
{
	return window.open('/toolkit/','toolkit','resizable=1,scrollbars=0,menubar=0,statusbar=0,toolbar=0,locationbar=0');
}

function download(sUrl)
{
	setTimeout("location.href='" + sUrl + "'", 3000);
}

function scrollUp()
{
	scroll(10);
}

function scrollDown()
{
	scroll(-10);
}

function scroll(nDir)
{
	sScrollY = Element.getStyle('scroll', 'top');
	nScrollY = ( sScrollY.replace("px", "") ) * 1;
	
	sHandleY = Element.getStyle('slider_handle', 'top');
	nHandleY = ( sHandleY.replace("px", "") ) * 1;
	
	sTrackH = Element.getStyle('slider_track', 'height');
	nTrackH = ( sTrackH.replace("px", "") ) * 1;
	
	sScrollH = Element.getStyle('scroll', 'height');
	nScrollH = ( sScrollH.replace("px", "") ) * 1;
	
	sScrollWindowH = Element.getStyle('scroll_window', 'height');
	nScrollWindowH = ( sScrollWindowH.replace("px", "") ) * 1;

	nScrollDelta = nScrollWindowH - nScrollH;
	nScrollFactor = nScrollDelta / nTrackH;
	nHandleY2 = Math.round(nScrollY / nScrollFactor);

	if ( ( nScrollY >= nScrollDelta ) && ( nScrollY <= 0 ) )
	{
		nScrollY = nScrollY + nDir;
		
		if ( nScrollY > 0 ) nScrollY = 0;
		if ( nScrollY < nScrollDelta ) nScrollY = nScrollDelta;
	}

	Element.setStyle('scroll', {top: nScrollY + "px"});
	Element.setStyle('slider_handle', {top: nHandleY2 + "px"});
}

function scrollTo(nDestination)
{
	nCurrentY = Element.getStyle('scroll', 'top').replace("px", "");
	nDestinationY = nDestination;
		
	if ( nDestinationY < nCurrentY )
	{
		hSlide = setInterval("slideDown()", 1)
	}
	else if ( nDestinationY > nCurrentY )
	{
		hSlide = setInterval("slideUp()", 1)
	}
	else
	{
		return;
	}
}

function slideDown()
{
	scroll(-10);
	nCurrentY = Element.getStyle('scroll', 'top').replace("px", "");
	
	if ( nDestinationY >= nCurrentY )
	{
		clearInterval(hSlide);
	}
}

function slideUp()
{
	scroll(10);
	nCurrentY = Element.getStyle('scroll', 'top').replace("px", "");
	
	if ( nDestinationY <= nCurrentY )
	{
		clearInterval(hSlide);
	}
}

function switchAudio(sAudioClip)
{
	sSwf = "/flash/audio-player.swf?sAudiofile=/flash/" + sAudioClip + ".mp3&fPlay=true";
	flashPageObject.setAttribute("swf",sSwf);
	flashPageObject.write("flash");
}

function switchVideo(sVideoClip)
{
	sSwf = "/flash/video-player.swf?sVideo=/flash/" + sVideoClip + "&fPlaying=true";
	flashPageObject.setAttribute("swf",sSwf);
	flashPageObject.write("flash");
}

function formatDollars(oElement,n)
{
	n = n.toString().replace(/[,.]/g, '');
    n = n.replace(/\d{2}$/, '.' + n.substr(n.length - 2, 2));
    var regex = new RegExp('(\\d+)(\\d{3})');
    
    while (regex.test(n))
    {
        n = n.replace(regex, '$1,$2');
    }

	oElement.value = n;
}

function toggleCcInfo()
{
	fVisible = ( ( document.getElementById("cc_info").style.visibility == "hidden" ) || ( document.getElementById("cc_info").style.visibility == "" ) ? true : false );
	document.getElementById("cc_info").style.visibility = fVisible ? "visible" : "hidden";
	document.forms[0].cc_name_first.value = "";
	document.forms[0].cc_name_last.value = "";
	document.forms[0].cc_zip.value = "";	
}

function cleanOrder(oElement)
{
	sName = oElement.name;
	
	if ( sName.substring(0,3) == "qty" )
	{
		sCheckboxName = sName.substring(4);
		sSelectName = sName;
		
		if ( document.getElementById(sSelectName).selectedIndex == 0 ) document.getElementById(sCheckboxName).checked = false;
		else document.getElementById(sCheckboxName).checked = true;
	}
	else
	{
		sCheckboxName = sName;
		sSelectName = "qty_" + sName;

		if ( !document.getElementById(sCheckboxName).checked ) document.getElementById(sSelectName).selectedIndex = 0;
	}
}

function maxWindow()
{
	return;

	window.moveTo(0,0);

	if ( document.all )
	{
		window.resizeTo(screen.availWidth,screen.availHeight);
	}
	else if ( document.layers || document.getElementById )
	{
		if ( ( window.outerHeight < screen.availHeight ) || ( window.outerWidth < screen.availWidth ) )
		{
			window.outerHeight = screen.availHeight;
			window.outerWidth = screen.availWidth;
		}
		else
		{
			
		}
	}
}
//-->