var thisURL = window.location.href.toLowerCase();
var argStartIndex = thisURL.indexOf("?");
argString = thisURL.slice(argStartIndex+1);
var argPairs = argString.split("&");
var width=false;
var height=false;
for (var i = 0; i < argPairs.length; i++) {
	var argPair = argPairs[i].split("=");
	if (argPair.length > 1) {
		if(argPair[0] == "w") width=unescape(argPair[1]);
		if(argPair[0] == "h") height=unescape(argPair[1]);
	}
}
temp = argString.split("&")[0].split("=")[1];
if(!width && !height || navigator.platform.indexOf("Linux")>-1) {
	switch(temp){
		case "0":
			width=515;
			height=177;
			break;
		case "1":
			if(navigator.platform.indexOf("Linux")>-1){
				width=screen.width;
				height=screen.height;
				break;
			}
			width=320;
			height=288;
			break;
		case "2":
		case "3":
			if(navigator.platform.indexOf("Linux")>-1){
				width=screen.width;
				height=screen.height;
				break;
			}
			width=800;
			height=464;
			break;
		case "4":
			width=1000;
			height=700;
			break;
		case "5":
			if(navigator.platform.indexOf("Linux")>-1){
				width=screen.width;
				height=screen.height;
				break;
			}
			width=515;
			height=400;
			break;
	}
}
function popup_stream(){
	openExternal('stream_popup.html?'+argString,width,height);
}

