// the functions in this file require the supplementary library lib.js

var _POPUP_FEATURES = 'location=0,statusbar=0,menubar=0,width=680,height=580';

var myWindow;

function openDefaultWindow(url) {
    var width = 680;
    var height = 580;
    var innerWidth = 680;
    var innerHeight = 580;
    var left = parseInt((screen.availWidth/2) - (width/2));
   var top = parseInt(((screen.availHeight/2) - (height/2))-75);
    var windowFeatures = "innerWidth=" + innerWidth + ",innerHeight=" + innerHeight + ",width=" + width + ",height=" + height + ",scrollbars=yes,resizable=yes,location=no,status=no,menubar=no,titlebar=no,toolbar=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    myWindow = window.open(url, "defaultWin", windowFeatures);
}


function openCreditsWindow(url) {
    var width = 400;
    var height = 400;
    var innerWidth = 400;
    var innerHeight = 400;
    var left = parseInt((screen.availWidth/2) - (width/2));
   var top = parseInt(((screen.availHeight/2) - (height/2))-75);
    var windowFeatures = "innerWidth=" + innerWidth + ",innerHeight=" + innerHeight + ",width=" + width + ",height=" + height + ",scrollbars=yes,resizable=yes,location=no,status=no,menubar=no,titlebar=no,toolbar=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    myWindow = window.open(url, "defaultWin", windowFeatures);
}

function openXLWindow(url) {
    var width = 710;
    var height = 580;
    var innerWidth = 710;
    var innerHeight = 580;
    var left = parseInt((screen.availWidth/2) - (width/2));
   var top = parseInt(((screen.availHeight/2) - (height/2))-75);
    var windowFeatures = "innerWidth=" + innerWidth + ",innerHeight=" + innerHeight + ",width=" + width + ",height=" + height + ",scrollbars=yes,resizable=yes,location=no,status=no,menubar=no,titlebar=no,toolbar=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    myWindow = window.open(url, "defaultWin", windowFeatures);
}



function openClipsWindow(url) {
    var width = 450;
    var height = 450;
    var innerWidth = 450;
    var innerHeight = 450;
    var left = parseInt((screen.availWidth/2) - (width/2));
   var top = parseInt(((screen.availHeight/2) - (height/2))-75);
    var windowFeatures = "innerWidth=" + innerWidth + ",innerHeight=" + innerHeight + ",width=" + width + ",height=" + height + ",location=no,status=no,menubar=no,titlebar=no,toolbar=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    myWindow = window.open(url, "subWind", windowFeatures);
}



function checkBrowserWidth()
{
	var w = getBrowserWidth();
	
	return w;
};


function getBrowserWidth()
{
	if (window.innerWidth)
	{
		return window.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth != 0)
	{
		return document.documentElement.clientWidth;
	}
	else if (document.body)
	{
		return document.body.clientWidth;
	}
	
	return 0;
};

// alert(checkBrowserWidth()); 