// preload and rolls

userAgent = window.navigator.userAgent;
browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function findElement(n,ly) {
	if (browserVers < 4)		return document[n];
	var curDoc = ly ? ly.document : document;
	var elem = curDoc[n];
	if (!elem) {
		for (var i=0;i<curDoc.layers.length;i++) {
			elem = findElement(n,curDoc.layers[i]);
			if (elem) return elem;
		}
	}
	return elem;
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		var img;
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			img = null;
			if (document.layers) {
				img = findElement(changeImages.arguments[i],0);
			}
			else {
				img = document.images[changeImages.arguments[i]];
			}
			if (img) {
				img.src = changeImages.arguments[i+1];
			}
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		/* menu_film_over = newImage("images/menu-film-over.jpg");
		menu_film_down = newImage("images/menu-film-down.jpg");
		menu_insight_over = newImage("images/menu-insight-over.jpg");
		menu_insight_down = newImage("images/menu-insight-down.jpg");
		menu_contact_over = newImage("images/menu-contact-over.jpg");
		menu_contact_down = newImage("images/menu-contact-down.jpg");
		menu_blog_over = newImage("images/menu-blog-over.jpg");
		menu_blog__down = newImage("images/menu-blog-down.jpg");
			menu_home_over = newImage("images/menu-home-over.gif");
		menu_home_down = newImage("images/menu-home-down.gif"); */
		
		submenurollz = newImage("images/submenus/recentmenuroll1.gif");
		submenurollz = newImage("images/submenus/recentmenuroll2.gif");
		submenurollz = newImage("images/submenus/recentmenuroll3.gif");
		submenurollz = newImage("images/submenus/recentmenuroll4.gif");
		submenurollz = newImage("images/submenus/recentmenuroll5.gif");
		submenurollz = newImage("images/submenus/filmmenuroll1.gif");
		submenurollz = newImage("images/submenus/filmmenuroll2.gif");
		submenurollz = newImage("images/submenus/filmmenuroll3.gif");
		submenurollz = newImage("images/submenus/filmmenuroll4.gif");
		submenurollz = newImage("images/submenus/filmmenuroll5.gif");
		submenurollz = newImage("images/submenus/filmmenuroll6.gif");
		submenurollz = newImage("images/submenus/filmmenuroll7.gif");
		submenuroll = newImage("images/submenus/insightrollnull.gif");
		submenuroll = newImage("images/submenus/insighttitleroll1.gif");
		submenuroll = newImage("images/submenus/insighttitleroll2.gif");
		submenuroll = newImage("images/submenus/insightroll1.gif");
		submenuroll = newImage("images/submenus/insightroll2.gif");
		submenuroll = newImage("images/submenus/insightroll3.gif");
		submenuroll = newImage("images/submenus/insightroll4.gif");
		submenuroll = newImage("images/submenus/insightroll5.gif");
		submenuroll = newImage("images/submenus/insightroll6.gif");
		submenuroll = newImage("images/submenus/insightroll7.gif");
		submenuroll = newImage("images/submenus/insightroll8.gif");
		submenuroll = newImage("images/submenus/insightroll9.gif");
		preloadFlag = true;
	}
}

// End Preload Script


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


var movieName = "testcommand";

function thisMovie(movieName) {
  // IE and Netscape refer to the movie object differently.
  // This function returns the appropriate syntax depending on the browser.
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
    return window[movieName]
  }	else {
    return document[movieName]
  }
}

// Checks if movie is completely loaded.
// Returns true if yes, false if no.
function movieIsLoaded (theMovie) {
  if (typeof(theMovie) != "undefined") {
    return theMovie.PercentLoaded() == 100;
  } else {
    return false;
  }
}


function playmovie() {
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).Play();
  }
}

function stopmovie() {
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).StopPlay();
  }
}


function go(theFrame) {
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).GotoFrame(theFrame);
  }
}
function golabel0() {
reveal('zero');
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).TGotoLabel("_level0/","film0");
    
  }
}

function golabel1() {
reveal('first');
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).TGotoLabel("_level0/","film1");
    
  }
}

function golabel2() {
reveal('second');
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).TGotoLabel("_level0/","film2");
  }
}

function golabel3() {
reveal('third');
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).TGotoLabel("_level0/","film3");
  }
}

function golabel4() {
reveal('fourth');
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).TGotoLabel("_level0/","film4");
  }
}

function golabel5() {
reveal('fifth');
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).TGotoLabel("_level0/","film5");
  }
}

function golabel6() {
reveal('sixth');
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).TGotoLabel("_level0/","film6");
  }
}

function golabel7() {
reveal('seventh');
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).TGotoLabel("_level0/","film7");
  }
}

function golabel8() {
reveal('eighth');
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).TGotoLabel("_level0/","film8");
  }
}

function golabel9() {
reveal('nineth');
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).TGotoLabel("_level0/","film9");
  }
}

function golabel10() {
reveal('tenth');
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).TGotoLabel("_level0/","film10");
  }
}


function golabel11() {
reveal('eleventh');
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).TGotoLabel("_level0/","film11");
  }
}

// TEXT SWAP
if(document.getElementById)
document.write('<style type="text/css">.detail {float:left;display:none;}#zero {display:block;}<\/style>');
function reveal(det){
if(!document.getElementById) return;
if (!document.getElementsByClassName){
document.getElementsByClassName = function(cn){
cn = cn.replace(/ +/g, ' ').split(' ');
var ar = [], testname = function(n){
for (var re, i = cn.length - 1; i > -1; --i){
re = new RegExp('(^|\W)' + cn[i] + '(\W|$)');
if(!re.test(n)) return false;
}
return true;
}
for(var d = document.all || document.getElementsByTagName('*'), i = 0; i < d.length; ++i)
if(testname(d[i].className))
ar[ar.length] = d[i];
return ar;
};
document.getElementsByClassName.spoof = true;
}
for (var d = document.getElementsByClassName('detail'), i = d.length - 1; i > -1; --i)
d[i].style.display = 'none';
document.getElementById(det).style.display = 'block';
if (document.getElementsByClassName.spoof)
document.getElementsByClassName.spoof = document.getElementsByClassName = null;
}

