<!--

/* Image Fading */
var imageArray = new Array();
imageArray[0] = "/elements/fade.1.jpg";
imageArray[1] = "/elements/fade.2.jpg";
imageArray[2] = "/elements/fade.3.jpg";
imageArray[3] = "/elements/fade.4.jpg";
imageArray[4] = "/elements/fade.5.jpg";
imageArray[5] = "/elements/fade.6.jpg";
imageArray[6] = "/elements/fade.0.jpg";
var currentImage = -1;
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}
function blendimage(divid, imageid, imagefile, millisec) {
    var speed = Math.round(millisec / 100);
    var timer = 0;
    document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
    changeOpac(0, imageid);
    document.getElementById(imageid).src = imagefile;
    for(i = 0; i <= 100; i++) {
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
        timer++;
    }
}
function fadeNext(){
	if(currentImage+1<imageArray.length){
		currentImage++;
	}else{
		currentImage=0;
	}
	blendimage('blenddiv','blendimage', imageArray[currentImage],1000);
	setTimeout('fadeNext();',5000);
}


/* Other */
var mxPos = 0;
var myPos = 0;	
var usragnt;
var logged;
var currheight;
var RevealI;
var move;
var ElementTargetHeight = new Array();
var saletmr;
var saleheight;

function captureMousePosition(e)
{	
	    var myPos=0;
        if (window.XMLHttpRequest)
	    {
                if (navigator.userAgent.indexOf("MSIE 7.0") == -1)
        	    {
	                    mxPos = e.pageX;
                        myPos = e.pageY;
                }
        	    else
	            {
                        mxPos = mouseX(event);
                	    myPos = mouseY(event);
        	    }
	    }
	    else if (window.ActiveXObject)
        {
	        mxPos = mouseX(event);
	        myPos = mouseY(event);
 	}
	    document.getElementById('hoverID').style.left = (mxPos-30) + "px";
        document.getElementById('hoverID').style.top = (myPos+10) + "px";
}

    function HoverOver(TipTxt)
    {
            if (document.getElementById('hoverID'))
            {
                    document.getElementById('hoverID').style.display= "block";
                    document.getElementById('hoverID').innerHTML=TipTxt;
            }
    }
    function HoverOut()
    {
            document.getElementById('hoverID').style.display= "none";
    }

function Reveal2(id)
{
	currheight=currheight+move;
	move=move*2;
	if (currheight>ElementTargetHeight[id]) 
	{ 
		document.getElementById(id).style.height="auto";
		window.clearInterval(RevealI); 
	}
	else
	{
		document.getElementById(id).style.height=currheight+"px";	
	}
}

function Reveal(id)
{
	document.getElementById("alertthisID").onmouseover = function() { return false }; 
	if (this.RevealI) 
	{ 
		exit; 
	}
	else
	{
		currheight=0;
		move=1;
		document.getElementById(id).style.height=currheight+"px";	
		document.getElementById(id).style.display="block";
		RevealI=window.setInterval("Reveal2('"+id+"')",20);
	}
}

function submit(frmid)
{
	document.getElementById(frmid).submit();
}

function submitas(what)
{
	    document.getElementById("whatID").value=what;
        document.lf.submit();
}

function LogThisRETURNFunc()
{
	// do nothing;
}

function LogThis(x,y)
{
	logged="YES";
	    if (window.XMLHttpRequest)
        {
                LogThisHTTPReq = new XMLHttpRequest();
	    }
        else if (window.ActiveXObject)
	    {
        	    LogThisHTTPReq = new ActiveXObject("Microsoft.XMLHTTP");
	    }
	    LogThisHTTPReq.abort();
        LogThisHTTPReq.onreadystatechange = LogThisRETURNFunc;
	    LogThisHTTPReq.open("POST", "/LogThis.php", true);
	LogThisHTTPReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	    LogThisHTTPReq.send("browser="+usragnt+"&x="+x+"&y="+y+"&xres="+window.screen.width+"&yres="+window.screen.height);
}

function Reflow()
    {
            var mnux=document.getElementById("navID").offsetWidth;
	var bdyx=document.getElementById("bodyID").offsetWidth;
            if ((usragnt=="IE6") || (usragnt=="IE7")) { var winx=document.documentElement.clientWidth; } else { var winx=window.innerWidth; }
	if (winx<890)
	{
		document.body.style.width="770px";			
		if (document.getElementById("contbox")) { document.getElementById("contbox").style.width="220px"; }
	}
	else
	{
		document.body.style.width="";
		if (document.getElementById("contbox")) { document.getElementById("contbox").style.width=(bdyx-560)+"px"; }
	}
    }

function init()
    {
	usragnt="NA";
            if (navigator.userAgent.indexOf("MSIE 7.0") != -1) { usragnt="IE7"; LogThis(document.body.clientWidth,document.body.clientHeight); }
            if (navigator.userAgent.indexOf("MSIE 6.0") != -1) { usragnt="IE6"; LogThis(document.documentElement.clientWidth,document.documentElement.clientHeight); }
            if (navigator.userAgent.indexOf("Firefox") != -1)  { usragnt="FF";  LogThis(window.innerWidth,window.innerHeight); }
            if (navigator.userAgent.indexOf("Safari") != -1) { usragnt="S"; LogThis(window.innerWidth,window.innerHeight); }
	if (logged != "YES") { LogThis(0,0); } 
	Reflow();
}

function popSale()
{
	if (document.getElementById("sale2ID"))
	{
		document.getElementById("sale2ID").style.display="block";
		saleheight=10;
		saletmr=window.setInterval(popSaleGrow,20);
	}
}

function popSaleGrow()
{
	saleheight=saleheight+(saleheight/4);
	document.getElementById("sale22ID").style.height=saleheight+"px";
	if (saleheight>130) { clearInterval(saletmr); }
}	

function hideSale()
{
	document.getElementById("sale2ID").style.display="none";
}

window.onload=init;
window.onresize=Reflow;

// -->