function movecontent(){
	var winH;

if (parseInt(navigator.appVersion)>3) {
 if (navigator.appName=="Netscape") {
    winH = window.innerHeight;
 }
 if (navigator.appName.indexOf("Microsoft")!=-1) {
    winH = document.body.offsetHeight;
 }
 	var x = document.getElementById('content');
	var y = 620;
	
	if (winH > y)
		x.style.marginTop = (winH - y)/3 + 'px';
 
}
}

function toggledir(a){
	var x = document.getElementById('directors');
	y = x.offsetHeight;

	if (a==y)
		res = setInterval("resizedir(0)",100);		
	else
		res = setInterval("resizedir("+a+")",100);		
}
function resizedir(b){
	var x = document.getElementById('directors');
	y = x.offsetHeight;
	if (b==0){
		if (y>0)
			x.style.height = (y-2) + 'px';
		else 	
			clearInterval ( res );
	}
	else{
		if (y<b)
			x.style.height = (y+5) + 'px';
		else 	
			clearInterval ( res );
	}
}

function opacity(id, opacStart, opacEnd, millisec) {
	//speed for each frame
	var speed = Math.round(millisec / 100);
	var timer = 0;

	//determine the direction for the blending, if start and end are the same nothing happens
	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++)
			{
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}

//change the opacity for different browsers
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 shiftOpacity(id, millisec) {
	//if an element is invisible, make it visible, else make it ivisible
	if(document.getElementById(id).style.opacity == 0) {
		opacity(id, 0, 100, millisec);
	} else {
		opacity(id, 100, 0, millisec);
	}
}
function delayed(id,img){
	document.getElementById(id).src = img;
	}
function blendimage(divid, imageid, imagefile, millisec) {
	var speed = Math.round(millisec / 100);
	var timer = 0;
	
	//set the current image as background
	document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";	
	
	//make image transparent
	changeOpac(0, imageid);
	
	//make new image
	setTimeout("delayed('"+imageid+"','"+imagefile+"')",100);
	
	//fade in image
	for(i = 0; i <= 100; i++) {
		setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
		timer++;
	}
	

		
}

function currentOpac(id, opacEnd, millisec) {
	//standard opacity is 100
	var currentOpac = 100;
	
	//if the element has an opacity set, get it
	if(document.getElementById(id).style.opacity < 100) {
		currentOpac = document.getElementById(id).style.opacity * 100;
	}

	//call for the function that changes the opacity
	opacity(id, currentOpac, opacEnd, millisec)
}

//scrolling

function hookEvent(element, eventName, callback)
{
  if(typeof(element) == "string")
    element = document.getElementById(element);
  if(element == null)
    return;
  if(element.addEventListener)
  {
    if(eventName == 'mousewheel')
    {
      element.addEventListener('DOMMouseScroll',
        callback, false); 
    }
    element.addEventListener(eventName, callback, false);
  }
  else if(element.attachEvent)
    element.attachEvent("on" + eventName, callback);
}
function cancelEvent(e)
{
  e = e ? e : window.event;
  if(e.stopPropagation)
    e.stopPropagation();
  if(e.preventDefault)
    e.preventDefault();
  e.cancelBubble = true;
  e.cancel = true;
  e.returnValue = false;
  return false;
}

function printInfo(e)
{
  e = e ? e : window.event;
  var raw = e.detail ? e.detail : e.wheelDelta;
  var normal = e.detail ? e.detail * -1 : e.wheelDelta / 40;
  var mask = document.getElementById("mask");
  y2 = mask.style.top.substring(0, mask.style.top.length - 2) * 1;
  y4 = y2 + mask.offsetHeight;
    
  var content = document.getElementById("slide");
  y1 = content.style.top.substring(0, content.style.top.length - 2) * 1;
  y3 = content.offsetHeight + y1;
  normal = normal*2;
  if ((y1 + normal)<=y2 && (y3 + normal)>y4)
  content.style.top = (y1 + normal) + "px";
 
  cancelEvent(e);
}

function changetitle(title) {
document.getElementById("name").innerHTML = title;
}
	var start = 0;
	var scrollDir = 0;
	var speed = 3;
	function scrollDiv () {
		var mask = document.getElementById("mask");
		var content = document.getElementById("slide");
		switch (scrollDir) {
			case 1: {
				if ((content.style.top.substring(0, content.style.top.length - 2) * 1) + speed < 0) 
					content.style.top = ((content.style.top.substring(0, content.style.top.length - 2) * 1) + speed) + "px";
				else content.style.top = "0px";
			} break;
			case 2: {
				if ((content.style.top.substring(0, content.style.top.length - 2) * 1) - speed > (-content.offsetHeight + mask.offsetHeight)) 
					content.style.top = ((content.style.top.substring(0, content.style.top.length - 2) * 1) - speed) + "px";
				else content.style.top = (-content.offsetHeight + mask.offsetHeight) + "px";
			} break;
		}
		setTimeout("scrollDiv()", 20);
	}