	function scroll(goLeft)
	{
		var offset = (goLeft)?-2:2;
		var flowCut = document.getElementById("flowcut");
		flowCut.scrollTop += offset;
    //alert(flowCut.scrollTop);
		//addBox(goLeft);
	}

	function addBox(goLeft)
	{
		content = document.getElementById("flowcut");
		if((document.getElementById("flowcut").scrollTop % 110)== 0 && !goLeft)
		{
			if (arrBox[i])
			{
					tmpContent = (content.innerHTML).toString();
					box = arrBox[i].innerHTML.toString();
					tmpContent.replace(box, "");
					content.innerHTML = tmpContent + box;
					i++;
			}
			else
				i = 0;
		}
		else if ((document.getElementById("flowcut").scrollTop / 110) < 3 && goLeft)
		{

			if (arrBox[(arrBox.length - i)])
			{
				tmpContent = (content.innerHTML).toString();
				box = arrBox[(arrBox.length - i)].innerHTML.toString();
				tmpContent.replace(box, "");

				content.innerHTML =box + tmpContent;
				i--;
			}
			else
				i = (arrBox.length - 1);
			document.getElementById("flowcut").scrollTop = 110*10;
		}
	}
	
	function initScrol()
	{
		strFunction1 = "scroll(true)";
		strFunction2 = "scroll(false)";
		strFunction3 = "scroll(true)";
		strFunction4 = "scroll(false)";

		document.getElementById("scroll0").style.cursor="pointer";
		document.getElementById("scroll1").style.cursor="pointer";

scrollDirection = setInterval(strFunction2, 50);
document.getElementById("flowcut").onmouseover = function(){ clearInterval(scrollDirection); };
document.getElementById("flowcut").onmouseout = function(){scrollDirection = setInterval(strFunction2, 50); };

//alert(document.getElementById("flowcut").style.height);


		document.getElementById("scroll0").onmouseover = function(){
    clearInterval(scrollDirection);
    scrollDirection2 = setInterval(strFunction3, 15); 
    };
		document.getElementById("scroll1").onmouseover = function(){
    clearInterval(scrollDirection);
    scrollDirection2 = setInterval(strFunction4, 15); 
    };

		document.getElementById("scroll0").onmouseout = function(){ 
    clearInterval(scrollDirection2); 
    scrollDirection = setInterval(strFunction2, 50);
    };
		document.getElementById("scroll1").onmouseout = function(){ 
    clearInterval(scrollDirection2); 
    scrollDirection = setInterval(strFunction2, 50);    
    };

		var i = 0;


		while(document.getElementById("box" + i))
		{
			arrBox[i] = document.getElementById("box" + i);

			i++;
		}
	}

function NewWindow(mypage,myname,w,h,scroll){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
var settings ='height='+h+',';
settings +='width='+w+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars='+scroll+',';
settings +='resizable=yes';
win=window.open(mypage,myname,settings);
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function PopUp2(nId, nWidth, nHeight)
{
    if(typeof WindowPopUp != "undefined")
            WindowPopUp.close();
    
    WindowPopUp = window.open("popup_image.php?id="+nId, "image", "left="+((screen.width-nWidth)/2)+", top="+((screen.height-nHeight)/2)+", width="+nWidth+", height="+nHeight+", scrollbars=yes");
    WindowPopUp.focus();
    }

function PopUp(strFile, nWidth, nHeight)
{
    if((typeof WindowPopUp != "undefined") && (WindowPopUp != null))
        WindowPopUp.close();

    WindowPopUp = window.open("popup.php?file="+strFile, "popup", "left="+((screen.width-nWidth)/2)+", top="+((screen.height-nHeight)/2)+", width="+nWidth+", height="+nHeight);
    if(WindowPopUp != null)
        WindowPopUp.focus();
}

	function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}
