
//Validate that the browser can open windows
WindowEnabled =  1;
WindowEnabled = ((navigator.userAgent.indexOf("MSIE 4.0") >= 1))? 0 : 1;

function popUp(URL, ATTRIBUTES)
	//OPEN WINDOW JS
	// takes all attributes in direct format
{
	DEF_ATTRIB = 'width=200,height=200,top=100,left=100,resizable=yes,scrollbars';
	if (ATTRIBUTES == null) {
	ATTRIBUTES = DEF_ATTRIB;
	}
	if (WindowEnabled){
	child = window.open(URL, "spawn", ATTRIBUTES);
	child.opener = self;
	if	(navigator.appName == 'Microsoft Internet Explorer' && parseInt(navigator.appVersion) == '2') {
	// Do Nothing
	} else {
		child.focus();
	}
	} else {
		document.location = URL;
	}
}

function emailafriend(URL, ATTRIBUTES)
	//OPEN WINDOW JS
	// takes all attributes in direct format
{
	ATTRIBUTES = 'width=450,height=225,top=100,left=100,resizable=yes,scrollbars';
	MYURL = "http://weather.calgary.globaltv.com/services/toafriend/index.cfm?page=" + window.location;
	
	if (WindowEnabled){
		child = window.open(MYURL, "spawn", ATTRIBUTES);
		child.opener = self;
		if	(navigator.appName == 'Microsoft Internet Explorer' && parseInt(navigator.appVersion) == '2') {
			// Do Nothing
		} else {
			child.focus();
		}
	} else {
		document.location = MYURL;
	}
}

function health_archive(day)
	//Function closes Health Daily tips window and redirects user to archive
	{
			window.opener.location=("/sh/health/dailytips/"+day+"-archive.html");
			window.close();
	}	
	
function openVideo(sUrl, sName, sOptions) {
	// Function for the new Video Blast popup window
 	window.open(sUrl,sName,sOptions+',scrollbars=no,resizable=1,top=50,left=50,width=780,height=504');
}

