﻿function launchPopup(loc,w,h)
{
	var id = Math.round(Math.random()*1000);
	window.open(loc, id,"width="+numW+", height="+numH+", left=100, top=100, scrollbars=auto, toolbar=no, location=no, status=no, menubar=no, resizable=yes");
}

var swfId = "mainswf";

function openWindow(pageUrl, w, h) 
{
	var winName = Math.round(9999*Math.random()) + new Date().getTime();
	var numW = Number(w);
	var numH = Number(h);
	var winNew = window.open(pageUrl,winName,"width="+numW+", height="+numH+", left=100, top=100, scrollbars=auto, toolbar=no, location=no, status=no, menubar=no, resizable=yes");
	
	if(!winNew) 
	{
		getSwf(swfId).openWindowFromSwf(pageUrl);
	}
	else 
	{
		winNew.focus();
	}
}

function getSwf(id) 
{
	if (navigator.appName.indexOf("Microsoft") != -1) 
	{
		return window[id];
	} 
	else 
	{
		return document[id];
	}
}
