window.focus();

<!--
/*----------------------------------
LCBO goLOCAL javascript for popup windows
---------------------------------*/

	//launch main movie
	var win1 = null;
	function launch() { 
  		var p = "golocal.html";
  		var pn = "golocalmain";
		var features = "location=0,status=0,scrollbars=0";  	
		var w = 1000;
  		var h = 725;
  		var winl = (window.screen.width-w)/2;
  		var wint = (window.screen.height-h)/2;
 		if (winl < 0) winl = 0;
  		if (wint < 0) wint = 0;
  		var settings = 'height=' + h + ',';
  		settings += 'width=' + w + ',';
  		settings += 'top=' + wint + ',';
 		settings += 'left=' + winl + ',';
  		settings += features;
  		win1 = window.open(p,pn,settings);
  		win1.window.focus();
  		
	}
	
	//launch child windows
	var win2 = null;
	function launchWindow(type, url) { 
		//alert(url); //TPO
		var w = 518;
  		var h = 580;
  		
  		switch(type) {
  			case "wm1":
  				var p = "/promo/golocal2009/html/en/winery_01.shtml";
  				break;
  			case "wm2":
  				var p = "/promo/golocal2009/html/en/winery_02.shtml";
  				break;
  			case "wm3":
  				var p = "/promo/golocal2009/html/en/winery_03.shtml";
  				break;
  			case "wm4":
  				var p = "/promo/golocal2009/html/en/winery_04.shtml";
  				break;
  			case "a1":
  				var p = "/promo/golocal2009/html/en/artisan_01.shtml";
  				break;
  			case "a2":
  				var p = "/promo/golocal2009/html/en/artisan_02.shtml";
  				break;
  			case "a3":
  				var p = "/promo/golocal2009/html/en/artisan_03.shtml";
  				break;
  			case "a4":
  				var p = "/promo/golocal2009/html/en/artisan_04.shtml";
  				break;
  			case "a5":
  				var p = "/promo/golocal2009/html/en/artisan_05.shtml";
  				break;
  			case "a6":
  				var p = "/promo/golocal2009/html/en/artisan_06.shtml";
  				break;
  			case "a7":
  				var p = "/promo/golocal2009/html/en/artisan_07.shtml";
  				break;
  			case "a8":
  				var p = "/promo/golocal2009/html/en/artisan_08.shtml";
  				break;
  			case "s1":
  				var p = "/promo/golocal2009/html/en/stories_cat01.shtml";
  				break;
  			case "s2":
  				var p = "/promo/golocal2009/html/en/stories_cat02.shtml";
  				break;
  			case "s3":
  				var p = "/promo/golocal2009/html/en/stories_cat03.shtml";
  				break;
  			case "s4":
  				var p = "/promo/golocal2009/html/en/stories_cat04.shtml";
  				break;
  			case "deeplink":
  				var p = "deeplink-example.html";
  				break;
  			case "events":
  				var p = "/promo/golocal2009/html/en/events.shtml";
  				break;
  			case "submit":
  				var p = "https://www.lcbo.com/lcbo-ear/contest/goLocal_2009/form.jsp";
  				var w = 587;
  				var h = 580;
  				break;
  			case "gmap":
  				var p = url;
  				var w = 750;
  				var h = 600;
  				break;
  				
  			
   		}
  		
  		
  		var pn = "golocalwindow";
		var features = "location=0,status=0,scrollbars=1";  	
		//var w = 518;
  		//var h = 580;
  		var winl = (window.screen.width-w)/2;
  		var wint = (window.screen.height-h)/2;
 		if (winl < 0) winl = 0;
  		if (wint < 0) wint = 0;
  		var settings = 'height=' + h + ',';
  		settings += 'width=' + w + ',';
  		settings += 'top=' + wint + ',';
 		settings += 'left=' + winl + ',';
  		settings += features;
  		win2 = window.open(p,pn,settings);
  		win2.window.focus();
  		
	}
	
	//deeplink to specified map
	function goToMap(mapNo) { 
		var flashMovie=getFlashMovieObject("myContent");
		flashMovie.goToMap(mapNo);
		win2.window.close();
	
	}
	
	//determine flash movie object
	function getFlashMovieObject(movieName){
		if (window.document[movieName]){
			return window.document[movieName];
		}
		if (navigator.appName.indexOf("Microsoft Internet")==-1){
			if (document.embeds && document.embeds[movieName]) {
				return document.embeds[movieName];
				}
		}
		else // if (navigator.appName.indexOf(ÓMicrosoft InternetÓ)!=-1)
		{
			return document.getElementById(movieName);
		}
	}
-->