var curr = window.location.pathname;
var filename = curr.substring(curr.lastIndexOf('/')+1);
jQuery(function($) {
	$('a[target=_blank],area[target=_blank]').click(function(){
		this.target = '_blank';
		if (filename=='clips.html' || filename=='index.html' || filename=='')
		{
			var obj = swfobject.getObjectById('flashItem');
			if (obj) { obj.stopVideo(); }
		}
	});
	$('#bcr-vts a').click(function(){
		if (filename=='clips.html' || filename=='index.html' || filename=='')
		{
			var obj = swfobject.getObjectById('flashItem');
			if (obj) { obj.stopVideo(); }
		}
		
		var w = screen.width; //fixed width
		var h = screen.height; //fixed height
		leftPosition = 0;                      // centering horizontal position to middle of screen
  		topPosition = 0;          // centering vertical position to middle of screen
  		var windowprops = 'width=' + w + ',height=' + h + ',top='+ topPosition +',left='+ leftPosition +',toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no'; //set popup window properties
		var url = "http://www.sonypictures.com/movies/21/site/?hs317=21+VisitTheatricalSite";
	  	var popup = window.open(url,'remote',windowprops); // open popup window with properties
		popup.resizeTo(screen.width,screen.height);
		
		return false;
	});
});