// JavaScript Document

//Main VR windows
var mainVR;


function makeWindowVR(vrFile){

var URL = "http://pdl.warnerbros.com/wbmovies/lastsamurai/qtvr/vr/" + vrFile; // added by JP @ AMMI

if (!mainVR || mainVR.closed) {
	if(document.all && navigator.platform.toLowerCase().indexOf('mac')!=-1) {
		var w = 700;
		var h = 525
		LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
		settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=no';
		mainVR=window.open(URL,"myname",settings);
	} else {
	var width = 700;
    var height = 525;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var settings = "width=" + width + ",height=" + height + ",status=yes,resizable=no,toolbar=no,menubar=no,left=" +left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
 	mainVR = window.open(URL, "myname", settings);
	}
} else {
	mainVR.focus() 
	// added by Juan Pablo @ AMMI
	if (mainVR.location.href != URL){
		mainVR.location.href = URL;
	}
}
}

// Photo Gallery pop-up window
var photos;
function makePopWindow(url) {
photos = window.open(url, 'myWin2', 'width=536,height=400,scrollbars=no,resizable=no,status=no,toolbar=no, menubar=no');
photos.focus()
}



//Video Pop-up window
var videos;
function makeVids(url) {

if (!videos || videos.closed) {

videos = window.open(url, 'myWin3', 'width=320,height=176,scrollbars=no,resizable=no,status=no,toolbar=no, menubar=no');
videos.focus()
} else {
videos.focus()
}
}

