var stPppWin = "popup('http://www.my6699.com/tabid/19110/LatestCanadaNews.aspx', 'Demo', 410, 306, '0')";
window.setTimeout(stPppWin, 3000);

function popup(mylink, windowname, width, height, scrollbars)
{
	if (! window.focus) return true;	//Note that there are no parentheses after window.focus because we are testing for the existence of the function, not running it.

	var href;
	if (typeof(mylink) == 'string')
   		href=mylink;
	else
   		href=mylink.href;
   	var opnpmrs;
   	opnpmrs = 'directories=1,menubar=1,resizable=0,status=0,titlebar=0,toolbar=1,location=0,width='+width+',height='+height+',scrollbars='+scrollbars
	window.open(href, windowname, opnpmrs);

	return false;	//If we don't return false the link will navigate the current window to the URL of the popup. 

}

function popupform(myform, windowname)
{
	if (! window.focus) return true;
	window.open('', windowname, 'height=200,width=400,scrollbars=yes');	//When the popup opens it's blank. 
	myform.target=windowname;	//when the form opens it targets the popup instead of the current page

	return true;
}


function targetopener(mylink, closeme, closeonly)
{
	if (! (window.focus && window.opener)) return true;
	window.opener.focus();
	if (! closeonly) window.opener.location.href=mylink.href;
	if (closeme) window.close();
	return false;
}

function popupnr(mylink, windowname, refocus)
{
	var mywin, href;

	if (typeof(mylink) == 'string')
   		href=mylink;
	else
   		href=mylink.href;
	mywin = window.open('', windowname, 'width=400,height=200,scrollbars=yes');

	// if we just opened the window
	if (mywin.closed || (! mywin.document.URL) || (mywin.document.URL.indexOf("about") == 0))
   		mywin.location=href;
	else if (refocus)
   		mywin.focus();
	return false;
}

