
function loadInOpener(myURL) {
	uTopWindow=window.open(myURL,'mainwindow');
}

function openWindow(whereto, whoami) {
	top.name = "mainwindow"
	popup = window.open(whereto, whoami,'toolbar=no,location=no,directories=no,status=no, scrollbars=0, resizable=no,copyhistory=no,width=450,height=570');
	window.popup.focus();
}

function open_popup(src, name, width, height,location,menubar,resizeable,scrollbars,status,titlebar,toolbar,hotkeys)
{
	var xposition = ((screen.availWidth - width)/2);
	var yposition = ((screen.availHeight - height)/2);
	var win;
	var args =	"width=" + width + "," 
					+ "height=" + height + "," 
					+ "location=" + location + "," 
					+ "menubar=" + menubar + ","
					+ "resizable=" + resizeable + ","  
					+ "scrollbars=" + scrollbars + "," 
					+ "status=" + status + ","
					+ "titlebar=" + titlebar + ","
					+ "toolbar=" + toolbar + ","
					+ "hotkeys=" + hotkeys + "," 
					+ "screenx=" + xposition + ","
					+ "screeny=" + yposition + ","
					+ "left=" + xposition + ","
					+ "top=" + yposition;     

	win = window.open(src, name, args);
	win.focus();
}

// variables for popup window
var newwin;

function doPopup(winurl,winname,winfeatures)
{
	// This closes the popup window if one is already open
	if (newwin && !newwin.closed) {
		newwin.close();
	}
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	newwin = window.open(winurl,"popup",winfeatures);
	if(javascript_version > 1.0)
	{
		//delay a bit here because IE4 encounters errors
		//when trying to focus a recently opened window
 		setTimeout('newwin.focus();',250);
	}
}

var newwin;






function launchwin(winurl,winname,winfeatures)
{
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	newwin = window.open(winurl,"popup",winfeatures);
	if(javascript_version > 1.0)
	{
		//delay a bit here because IE4 encounters errors
		//when trying to focus a recently opened window
 		setTimeout('newwin.focus();',250);
	}
}

//function rightAlign
function rightAlign(obj, size){
    var tmp = obj.value;
    if(tmp == "") return;
    for (var i = tmp.length; i < size; i++){
    tmp = " " + tmp;
    }
    obj.value = tmp;
}

function nav()
   {
   var w = document.entertainment_regions.region_list.selectedIndex;
   var url_add = document.entertainment_regions.region_list.options[w].value;
   window.location.href = url_add;
   }
function box (boxname,menustate)
	      {
	      if (document.getElementById)
		     {
			    document.getElementById(boxname).style.visibility = menustate;
		     }else
	       {
		     document[boxname].visibility = menustate
		   }
		 }

function submit(){
		if(document.forms["languageForm"].language.value=="en"){
			document.forms["languageForm"].language.value="fr";
		}else if (document.forms["languageForm"].language.value=="fr") {
			document.forms["languageForm"].language.value="en";
		}
		return document.forms["languageForm"].submit();
}

function dropdownNav(control) {
	var dest = control.value;
	if (dest) {
		window.location.href = dest;
	}
}

function popUp(URL,winWidth,winHeight) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=" + winWidth + ",height=" + winHeight + "');");
		}
