window.onload=init;

var moveup;
var movedown;
var Expand;
var Scroll;
var year;


function init() {

	Expand=document.getElementById("expanse");
	Scroll=document.getElementById("scroll");

	if (Expand)
		{
		Expand.style.top=0+"px";
		reset();
		}

}


function reset() {

	if (Scroll)
		{

		if (parseInt(Expand.offsetHeight, 10) >= 272)

			{
			Scroll.className="";
			}

		else

			{
			Scroll.className="inithidden";
			}

		}
}


function scrolldown(time, speed) {

	Expand=document.getElementById("expanse");

	if (parseInt(Expand.style.top, 10) >= (-(parseInt(Expand.offsetHeight, 10))+252+speed)) {

		Expand.style.top=parseInt(Expand.style.top, 10)-speed+"px";
		movedown=setTimeout("scrolldown("+time+","+speed+")",time);
	
	}
}	


function scrollup(time, speed) {

	Expand=document.getElementById("expanse");

	if (parseInt(Expand.style.top, 10) <= 0-speed) {
		Expand.style.top=parseInt(Expand.style.top, 10)+speed+"px";
		moveup=setTimeout("scrollup("+time+","+speed+")",time);
	
	}	

}


function off(updown) {

	var arrow=document.getElementById(updown);

	arrow.src="images/"+updown+"Arrow.gif";

}


function on(updown) {

	var arrow=document.getElementById(updown);

	arrow.src="images/"+updown+"ArrowOver.gif";

}


function clik(updown) {

	var arrow=document.getElementById(updown);

	arrow.src="images/"+updown+"ArrowClik.gif";

}


function blowup(image, capt) {

	var blowup=document.getElementById("blowup")
	blowup.innerHTML="<a onclick='blowaway()'><img src='"+image+"' /></a>";
	blowup.style.zIndex="10";

	var caption=document.getElementById("capt"+capt);
	caption.style.visibility="visible";

	var footext=document.getElementById("footext");
	if (footext)
		{
		footext.style.visibility="hidden";
		}

}


function blowaway() {

	var blowup=document.getElementById("blowup")
	blowup.innerHTML="";
	blowup.style.zIndex="-1";

	capthide();
	
}

function capthide() {

	for (x=1; x<15; x++)
		{
		var caption=document.getElementById("capt"+x);
		caption.style.visibility="hidden";
		}

	var footext=document.getElementById("footext");
	if (footext)
		{
		footext.style.visibility="visible";
		}

}


function mInsert() {

  	document.write("<a href='m&#97;ilto:info&#64;op&#101;nhydro&#46;com?subj&#101;ct=M&#97;il from W&#101;bsit&#101;'>info&#64;op&#101;nhydro&#46;com</a>");

}


function copyright() {

	var year = new Date().getFullYear();

	var Copy = document.getElementById("copyright");
	Copy.innerHTML = "&copy; OpenHydro Group Limited " + year + ". | Company Number 392378. | ";

}
