if(typeof abcdm==="undefined"){abcdm={}}
if(typeof abcdm.abc==="undefined"){abcdm.abc={}}
if(typeof abcdm.abc.com==="undefined") {abcdm.abc.com={}}
if(typeof abcdm.abc.com.utils==="undefined") {abcdm.abc.com.utils={}}
abcdm.abc.com.utils.lightfep = {
	_openWindows: {},
	newWindow: function(url, windowName, windowWidth, windowHeight, windowScrollable, windowResizeable, left, top, restrictOneWindow) {
		var popupWidth = windowWidth || 1000;
		var popupHeight = windowHeight || 675;
		var ifScrollBar = windowScrollable || 0;
		var windowLeftPosition = left || 0;
		var windowTopPosition =  _proxy_jslib_handle(null, 'top', top, 0, 0) || 0;
		var isResizeable = windowResizeable || 0;
		var win = null;
		
		var winObj =  _proxy_jslib_handle(this._openWindows, (windowName), 0, 0);
		var windowExists = function(windowName) {
			if (typeof winObj == "undefined" || winObj == null || winObj.closed || ! _proxy_jslib_handle(winObj, 'location', '', 0, 0)) {
				//alert("window does not exist");
				return false;
			}
			//alert("window already exists");
			return true;
		};

		if((typeof(screen.availHeight) != "undefined" && screen.availHeight < popupHeight+49) || (typeof(screen.availWidth) != "undefined" && screen.availWidth < popupWidth+10)){
			    ifScrollBar = 1;
		}
		var popupParams = "height=" + popupHeight + ",width=" + popupWidth + ",toolbar=0,scrollbars=" + ifScrollBar + ",location=0,statusbar=0,menubar=0,resizable=" + isResizeable + ",top=" + windowTopPosition + ",left=" + windowLeftPosition;

		
		if(typeof restrictOneWindow != "undefined" && restrictOneWindow == true) {
			var openWindow = windowExists();
			if (openWindow) {
				//alert("focus window");
				 _proxy_jslib_handle(this._openWindows, (windowName), 0, 0).focus();
				 _proxy_jslib_assign('',  _proxy_jslib_handle( _proxy_jslib_handle(this._openWindows, (windowName), 0, 0), 'location', '', 0, 0), 'href', '=', ( url));
			} else {
				//alert("open new window");
				if(url) win =  _proxy_jslib_handle(window, 'open', '', 1, 0)(url, windowName, popupParams);
				 _proxy_jslib_assign('', this._openWindows, (windowName), '=', ( win));
			}
			
		}
		else{
			if(url) win =  _proxy_jslib_handle(window, 'open', '', 1, 0)(url, windowName, popupParams);
		}
		
		return win;
	},
	launch:function(show, video, collectionitem, collectionvideo) { burl = 'http://fep.abc.go.com/fep/player'; burl += '?src=abccomjs'; if(show != null) burl += ('&show=' + show); if(video != null) burl += ('&episode=' + video); if(collectionitem != null) burl += ('&collectionitem=' + collectionitem); if(collectionvideo != null) burl += ('&video=' + collectionvideo); if( _proxy_jslib_handle( _proxy_jslib_handle(null, 'location', location, 0, 0), 'search', '', 0, 0).substring(1) != '') burl = burl + "&" +  _proxy_jslib_handle( _proxy_jslib_handle(null, 'location', location, 0, 0), 'search', '', 0, 0).substring(1); rr = abcdm.abc.com.utils.lightfep.newWindow(burl,'player_window',1000,675,1,1,(screen.availWidth/2)-500,(screen.availHeight/2)-337.5,true); if(rr != null) { try { rr.focus(); } catch(e) {}}; return rr;}
}
 ;
_proxy_jslib_flush_write_buffers() ;