function gotoSweeps() {
	if (sweeps && sweeps.open) {
			sweeps.close();
			window.open('http://www.warnerbros.de/movies/butterflyeffect/sweeps/');
	}
}

function sweeps() {
	var url 	= 'media/sweeps/index.html';
	var name 	= 'sweeps';
	var width	= 304;
	var height	= 210;
	sweeps = window.open(url, name, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height=' + height);
}

function wallpapers() {
	var url 	= 'media/wallpaper/index.html';
	var name 	= 'downloads';
	var width	= 714;
	var height	= 250;
	name = window.open(url, name, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height=' + height);
}

function gallery() {
	var url 	= 'gallery/photos/index.html';
	var name 	= 'viewGallery';
	var width	= 550;
	var height	= 440;
	name = window.open(url, name, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height=' + height);
}

function gallery2() {
	var url 	= 'gallery/behindscene/source/img0007.htm';
	var name 	= 'viewGallery';
	var width	= 550;
	var height	= 440;
	name = window.open(url, name, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height=' + height);
}


function view( sPageName ) {
	var url 	= sPageName;
	var name 	= 'viewContent';
	var width	= 480;
	var height	= 500;
	name = window.open(url, name, 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width='+width+',height=' + height);
}


function trailer( ) {
	var url 	= 'http://wwws.warnerbros.de/movies/butterflyeffect/trailer.html?id=trailer&settings=true';
	var name 	= 'viewTrailer';
	var width	= 550;
	var height	= 470;
	name = window.open(url, name, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+width+',height=' + height);
}


function poster() {
	var url 	= 'media/onesheet/onesheet.jpg';
	var name 	= 'viewPoster';
	var width	= 460;
	var height	= 640;
	name = window.open(url, name, 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width='+width+',height=' + height);
}

function buddyIcons() {
	var url 	= 'media/buddyicons/index.html';
	var name 	= 'viewBuddyIcons';
	var width	= 460;
	var height	= 340;
	name = window.open(url, name, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height=' + height);
}

function screensaver() {
	var url 	= 'media/screensaver/index.html';
	var name 	= 'viewScreensaver';
	var width	= 410;
	var height	= 330;
	name = window.open(url, name, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height=' + height);
}

function checkPlugin() { //v4.0 
	// this is modified dreamweaver code to check for the flash pluggin
	// so that the function will return: true OR false
	// we will require it for intro page and site navigation

	var version	= getFlashVersion();
	var ok 		= false;
	var useVer	= 7;
	// returns true for the supported version of flash (and up)
	if(version >= useVer ) ok = true;
	return ok;
}

// Flash Version Detector  v1.2.1
// documentation: http://www.dithered.com/javascript/flash_detect/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)
// with VBScript code from Alastair Hamilton (now somewhat modified)

function isDefined(property) {
  return (typeof property != 'undefined');
}

var flashVersion = 0;
flashVersion_DONTKNOW = -1;

function getFlashVersion() {
	var latestFlashVersion = 8;
   var agent = navigator.userAgent.toLowerCase(); 
	
   // NS3 needs flashVersion to be a local variable
   if (agent.indexOf("mozilla/3") != -1 && agent.indexOf("msie") == -1) {
      flashVersion = 0;
   }
   
	// NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		var flashPlugin = navigator.plugins['Shockwave Flash'];
		if (typeof flashPlugin == 'object') { 
			for (var i = latestFlashVersion; i >= 3; i--) {
            if (flashPlugin.description.indexOf(i + '.') != -1) {
               flashVersion = i;
               break;
            }
         }
		}
	}

	// IE4+ Win32:  attempt to create an ActiveX object using VBScript
	else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
	   var doc = '<scr' + 'ipt language="VBScript"\> \n';
      doc += 'On Error Resume Next \n';
      doc += 'Dim obFlash \n';
      doc += 'For i = ' + latestFlashVersion + ' To 3 Step -1 \n';
      doc += '   Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';
      doc += '   If IsObject(obFlash) Then \n';
      doc += '      flashVersion = i \n';
      doc += '      Exit For \n';
      doc += '   End If \n';
      doc += 'Next \n';
      doc += '</scr' + 'ipt\> \n';
      document.write(doc);
   }
		
	// WebTV 2.5 supports flash 3
	else if (agent.indexOf("webtv/2.5") != -1) flashVersion = 3;

	// older WebTV supports flash 2
	else if (agent.indexOf("webtv") != -1) flashVersion = 2;

	// Can't detect in all other cases
	else {
		flashVersion = flashVersion_DONTKNOW;
	}

	return flashVersion;
}


