/*header change*/
var el="header";
var bgimg=new Array("img/header1.png", "img/header2.png", "img/header3.png", "img/header4.png", "img/header5.png", "img/header6.png", "img/header7.png");
var random=Math.round((bgimg.length-1)*Math.random());
var cssStr="#"+el+" { background: url("+bgimg[random]+") no-repeat} ";
var style=document.createElement("style");style.setAttribute("type","text/css");
if(style.styleSheet){style.styleSheet.cssText=cssStr;}
else{var cssText=document.createTextNode(cssStr);style.appendChild(cssText);}document.getElementsByTagName("head")[0].appendChild(style);


/*scrolling*/
var Timer;
function animate() {
  document.getElementById("prod").scrollTop = 0;
  clearInterval(Timer);
  Timer = setInterval("scrollbottom()", 80);
}
function scrollbottom() {
  document.getElementById("prod").scrollTop += 1;
  if (document.getElementById("prod").scrollTop == 1316 ){
    document.getElementById("prod").scrollTop = 0;
  }
}
function pausescroll() {
		clearInterval(Timer);
}
function startscroll() {
		Timer = setInterval("scrollbottom()", 80);
}

/*lightbox*/
var curr_lb_div;
var is_modal = false;

function showbox(lb_div, isModal)
{
	document.getElementById(lb_div).style.display='block';
	document.getElementById('fade').style.display='block';
	curr_lb_div = lb_div;
	if (isModal)
			is_modal = true;
	else is_modal = false;
}

function hidebox()
{
    if (document.getElementById(curr_lb_div))
    {
         document.getElementById(curr_lb_div).style.display='none';
         document.getElementById('fade').style.display='none';
         curr_lb_div = '';
    }
}

