	var win= null;

	
	function PrintWindow(){
		if (window.print) {
			window.print();
			}
		}

	function NewWindow(mypage,myname,w,h,scroll,mediaid)
		{
			mypage = PBEURL(mypage);
			mypage = mypage + "&a-Common_PicturePopUp-id=" + mediaid + "&button-Common_PicturePopUp-find=";
			var winl = (screen.width-w)/2;
			var wint = (screen.height-h)/2;			settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbar=no,location=no,status=no,menubar=no,resizable=yes,dependent=no'
			win=window.open(mypage,myname,settings)
			if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
		}


// copyright by blackbit interactive gmbh, stefano viani, 2002 
// Script Submit Search on Enter or Return
function FormSubmit(theForm) {
	isNetscape=(document.layers);
	thekey = (isNetscape) ? keyStroke.which : event.keyCode;
	if	((thekey == 13) || (thekey == 3)) {
		if (theForm.name == 'Common_StorySearch')	{
			document.forms.Common_StorySearch.elements['command-Common_StorySearch-story_search'].value='x';
			theForm.submit();
			}
		else if (theForm.name == 'o_EcardSearch')	{
			document.forms.o_EcardSearch.elements['command-o_EcardSearch-start_search'].value='x';
			theForm.submit();
		}
		else if (theForm.name == 'Common_Login')	{
			document.forms.Common_Login.elements['command-Common_Login-common_login'].value='x';
			theForm.submit();
		}
	}
}


//defer the instantiation of Lightbox. Call when the page has finished loading.
init = function()
{
	// creating a data source object
	lightBoxes = document.getElementsByName("lightBox");

	var dataSource = new Object();

	for ( i=0; i<lightBoxes.length; i++)
	{
		currentLightBox = lightBoxes[i];
		var image = new Object();
		image['url'] = currentLightBox.getAttribute('popup');
		image['title'] = currentLightBox.getAttribute('title');
		dataSource[currentLightBox.getAttribute('id')] = image;
	}
	// Instantiate a Lightbox object
	var lightbox = new YAHOO.com.thecodecentral.Lightbox({
		imageBase: '/static/javascript/_assets/skins/sam',
		dataSource: dataSource
	});
}
YAHOO.util.Event.on(window, 'load', init);

// Embed Flash

jQuery(function() {
	var link = jQuery('.showAsFlashVideo a').eq(0).attr('href');
	var flashvars = {
		flv: link,
		autoplay: true,
		backcolor: 'FFFFFF',
		frontcolor: '000000'
	};
	var params = {
		allowFullScreen: true
	};
	var attributes = {};
	
	swfobject.embedSWF("/static/flash/player.swf", "flashVideoContainer", "752", "451", "9.0.0", false, flashvars, params, attributes);
});


