 var swfId = "startswf";
 var width = screen.width-6;
 var height= screen.height-35;
 var ff_height= screen.height;
 var ff_width= screen.width;

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
var isFF  = (navigator.userAgent.indexOf("Firefox") != -1) ? true : false;
var isSAF  = (navigator.userAgent.indexOf("Safari") != -1) ? true : false;

function openWindow(winUrl) {
    var winName = Math.round(9999*Math.random()) + new Date().getTime();
    var winNew;
    if(isFF){
    	winNew = window.open(winUrl,winName,"width="+ parseInt(width) +", height="+ parseInt(ff_height) +",status=0,toolbar=0,menubar=0,location=0,top=0,left=0");
    	winNew.resizeTo(ff_width,ff_height);
    }else{
    	winNew = window.open(winUrl,winName,"width="+ parseInt(width) +", height="+ parseInt(height) +",status=0,toolbar=0,menubar=0,location=0,top=0,left=0");
    }

	if (isIE) {
		if(!winNew) {
			window.location = winUrl;
		}
	} else if (isSAF){
    	if(!winNew) {
			getSwf(swfId).openWindowFromSwf(winUrl);
		}
		else {
			winNew.focus();
		}
    } else {
    	if(!winNew) {
			getSwf(swfId).openWindowFromSwf(winUrl);
		}
		else {
			winNew.focus();
		}
    }
 }

 function openNormalWindow(winUrl) {
    var winName = Math.round(9999*Math.random()) + new Date().getTime();
	var winNew = window.open(winUrl,winName)

     if(!winNew) {
         getSwf(swfId).openWindowFromSwf(winUrl);
     }
     else {
         winNew.focus();
     }
 }

 function getSwf(id) {
     if (navigator.appName.indexOf("Microsoft") != -1) {
         return window[id];
     }
     else {
         return document[id];
     }
 }

 function openChangeSeatsWindow() {
     var winName = Math.round(9999*Math.random()) + new Date().getTime();
     var w = 650;
     var h = 250;
     wleft = (screen.width - w) / 2;
     wtop = (screen.height - h) / 2;
	window.open('/en/change_number_of_seats.jsf?f=1',winName,'width=' + w + ',height=' + h + ',left='+wleft+',top='+wtop+',status=no,toolbar=no,menubar=no,location=no');
 }
 
 function openTellAFriendWindow() {
     var winName = Math.round(9999*Math.random()) + new Date().getTime();
	window.open('/tell_a_friend.jsf?f=1',winName,'width=600,height=700,status=0,toolbar=0,menubar=0,scrollbars=1');
 }
  function openTellAFriendWindowVs() {
     var winName = Math.round(9999*Math.random()) + new Date().getTime();
	window.open('/tell_a_friend.jsf?f=1',winName,'width=850,height=700,status=0,toolbar=0,menubar=0,scrollbars=1');
 }
 function openPrivacyPolicyWindow() {
     var winName = Math.round(9999*Math.random()) + new Date().getTime();
	window.open('/privacy.jsf',winName,'width=1000,height=700,status=0,toolbar=0,menubar=0,scrollbars=1');
 }
 function openTermsOfUseWindow() {
     var winName = Math.round(9999*Math.random()) + new Date().getTime();
	window.open('/terms_and_conditions.html',winName,'width=600,height=700,status=0,toolbar=0,menubar=0,scrollbars=1');
 }
 function openContactUsWindow() {
     var winName = Math.round(9999*Math.random()) + new Date().getTime();
	window.open('/contact_us.jsf?f=1',winName,'width=600,height=440,status=0,toolbar=0,menubar=0');
 }

 function openFeedbackWindow() {
     var winName = Math.round(9999*Math.random()) + new Date().getTime();
	window.open('/feedback.jsf?f=1',winName,'width=600,height=570,status=0,toolbar=0,menubar=0');
 }
  function openReleaseNotes() {
     var winName = Math.round(9999*Math.random()) + new Date().getTime();
	window.open('/files/Verishow 2.0 release notes.html',winName,'width=600,height=570,status=0,toolbar=0,menubar=0,,scrollbars=1');
 }
