/*
 * global.js
 *
 *
 */


// adds a function to the page onload, so we don't overwrite existing onload functions
function addOnLoad(f) {
    var currentOnLoad = window.onload;
    if (typeof window.onload != "function") {
        window.onload = f;
    } else {
        window.onload = function() {
            currentOnLoad();
            f();
        }
    }
}

// generic popup function for a window with limited chrome

function popChromeless(url,name,w,h) {
	awindow=window.open(url,name,'scrollbars=0,menubar=0,statusbar=0,resize=0,width='+w+',height='+h);
	if (window.focus) {awindow.focus()}
	return false;
}

function openNewWindow(url, name) {
	aWindow=window.open(url,name);
	if (window.focus) {aWindow.focus()}
	//return false;	
}
// opens nbc video player window

function launchvideo(pathid) 
{
	// test
	//site='http://video-proto.nbcuni.com/player.html';
	// prod
	site='http://video.nbc.com/player.html';
	
	param = '?dlid=';
	newwindow=window.open(site+param+pathid,'sendtofriend','toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=no,width=750,height=550');
	if (window.focus) {newwindow.focus()}
	//return false;
}
document.write('<script type="text/javascript" language="javascript" src="http://a.as-us.falkag.net/dat/dlv/aslmain.js"></script>');
document.write('<script type="text/javascript" language="javascript" src="/__utm.js"></script>');


function jumpTo(element) {
	var val = element.options[element.selectedIndex].value;
	document.location.href = val;
}
