function truebody(){
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

function iebody(){
	try
	{
		if (document.documentElement.clientHeight) return document.documentElement;
	}
	catch(e) {};
	
	return document.body;
}

function findeFlash (flash) {
    if (document.all) {
      if (document.all[flash]) {
        return document.all[flash];
      }
      if (window.opera) {
        var movie = eval(window.document + flash);
        if (movie.SetVariable) {
          return movie;
        }
      }
      return;
    }
    if(document.layers) {
      if(document.embeds[flash]) {
        var movie = document.embeds[flash];
        if (movie.SetVariable) {
          return movie;
        }
      }
      return;
    }
    if (!document.getElementById) {
      return;
    }
    var movie = document.getElementById(flash);
    if (movie.SetVariable) {
      return movie;
    }
    var movies = movie.getElementsByTagName('embed');
    if (!movies || !movies.length) {
      return;
    }
    movie = movies[0];
    if (movie.SetVariable) {
      return movie;
    }
    return;
  }

function hoverFlashNavi(){
	try{
		findeFlash('fNavi').mouseOver();
	}catch(e){}
}
function unhoverFlashNavi(){
	try{
		findeFlash('fNavi').mouseOut();
	}catch(e){}
}

function getFlashObjectEmbed(id){
	cont = document.getElementById(id);
	o = cont.getElementsByTagName('object');
	e = cont.getElementsByTagName('embed');
	return (o.length) ? o[0] : e[0];
}
function onBodyResize(){
	height = window.innerHeight;
	if (!height) height = iebody().clientHeight;
	
	try{
		getFlashObjectEmbed("flashFilm").height = getMaxHeight();
	}catch(e){}
}
function getMaxHeight(){
	try{ch = document.getElementById('container').offsetHeight;} catch(e){ch = 0;}
	try{h1 = self.innerHeight;} catch(e){h1 = 0;}
	try{h2 = document.body.clientHeight;} catch(e){h2 = 0;}
	try{h3 = iebody().clientHeight;} catch(e){h3 = 0;}
	
	if (!ch) ch = 0;
	if (!h1) h1 = 0;
	if (!h2) h2 = 0;
	if (!h3) h3 = 0;
	
	//document.getElementById('logo').innerHTML = ch+" &lt; "+h1+" &lt; "+h2+" &lt; "+h3;
	
	return Math.max(ch, Math.max(h3, Math.max(h1, h2)));
}


var ns6=document.getElementById&&!document.all?1:0
agent = navigator.userAgent;
var safari=(agent.search(/safari/i) != -1) ? true : false;

if (document.layers || ns6 || safari)		//KOMPATIBLE FIREFOX VERSION
{
	var followmouse = function (e){
		try{
			maxWidth = document.getElementsByTagName('body')[0].offsetWidth;
			x = (document.layers || ns6) ? e.pageX : document.body.scrollLeft+event.clientX;
			
			frame = Math.ceil(x / maxWidth * 201);
			findeFlash("back").getX(frame);
		}
		catch(e){}
	}
}else{
	var followmouse = function (e){
		try{
			maxWidth = document.getElementsByTagName('body')[0].offsetWidth;
			x=truebody().scrollLeft+event.clientX;
			
			frame = Math.ceil(x / maxWidth * 201);
			findeFlash("back").getX(frame);
		}
		catch(e){}
	}
}
document.onmousemove=followmouse;
window.onresize = onBodyResize;
