function imgWindow(mediaurl, windowname, mywidth, myheight, caption, mediatitle) {


	if (mywidth == "") {width = 650};


	if (myheight == "") {height = 300};
	

	if ((screen.width < mywidth) || (screen.height < myheight))  {
		mywidth = mywidth * 0.75; 
		myheight = myheight * 0.75;
	}

//	popWin = window.open(url + "?width=" + width, "", "resizable=yes,toolbar=no,menubar=no,width=" + width + ", height=" + height + " ");

	popWin = window.open("/local/global_includes/popup.htm?mediaurl="+mediaurl+"&caption="+caption+'&width='+mywidth, "", "resizable=yes,toolbar=no,menubar=no,width=" + (mywidth+40) + ", height=" + (myheight+100) + ",scrollbars=yes");

	popWin.focus();

}


function bfbInit () {
	try{
		}
	catch(err){
		return;
	}
}


/* BEST OF ABC script */

/*
function bfbInit () {
		
		

       var bfb;

       if (bfb = document.getElementById('bestof')) {

              var flvRegex = /^[^\?]+\.flv(\?.*)?$/;

              var mp3Regex = /^[^\?]+\.mp3(\?.*)?$/;

              var a = bfb.getElementsByTagName('A');

              for (var i=0; i<a.length; i++) {

                     if (a[i].href.indexOf('iview') != -1) {

                           // a[i].onclick = function(){return confirm('Warning: ABC iView uses large, high-quality video files.\n\nIt is recommended only for users with high-speed (ADSL2+) Internet connections.\n\nDo you wish to continue?');};

                     }

                     else if (flvRegex.test(a[i].href)) {

                           a[i].flv = a[i].href;

                           a[i].onclick = function(){var lb = lightboxCreate(400,224,'Best of abc.net.au');lb.innerHTML='<div id="lb-anchor"><div id="masterplayer"></div><div id="masterplayer_text"></div></div>';showVideo(this.flv,'masterplayer'); if (document.getElementById("flash")) {document.getElementById("flash").style.display = "none"}; return false;};

                           a[i].href = '/news/video/bestofabc.htm?file='+a[i].href;

                     }

                     else if (mp3Regex.test(a[i].href)) {

                           a[i].mp3 = a[i].href;

                           a[i].onclick = function(){var lb = lightboxCreate(325,50,'Best of abc.net.au');lb.innerHTML='<div style="width: 285px; height: 50px; padding: 5px 20px; background-color: #FFF;"><div id="lb-anchor" style="width:285px; height:53px; overflow:hidden;"><div id="masterplayer"></div><div id="masterplayer_text"></div></div></div>';showAudio(this.mp3,'masterplayer'); if (document.getElementById("flash")) {document.getElementById("flash").style.display = "none"}; return false;};

                           a[i].href = '/news/audio/bestofabc.htm?file='+a[i].href;

                     }

              }

       }

}

*/

/************ LIGHTBOX EFFECT **************/

/*
function lightboxCreate (w, h, title) {
	if (typeof w == 'undefined') var w = 400;
	if (typeof h == 'undefined') var h = 224;
	if (typeof title == 'undefined') var title = '';
	var lb, html = '', pad = 5;
	lightboxClose();
	html += '<div id="lb-dimmer" onclick="lightboxClose();" style="background-color: #222; zoom: 1; opacity: 0.5; -moz-opacity: 0.5; -khtml-opacity: 0.5; filter: alpha(opacity=50); position: absolute; z-index: 9999998; left: 0; top: 0; width: '+document.body.scrollWidth+'px; height: '+document.body.scrollHeight+'px;"></div><div id="lb-dialog" style="background-color: #000; position: absolute; z-index: 9999999; left: 100px; top: 100px; width: '+w+'px; padding: '+pad+'px;"><p style="padding: 0 5px; margin: 0 0 5px 0; font-size: 8pt; color: #FFF;"><a href="javascript: flashDisplay(); void(lightboxClose());" style="float: right; color: #FFF; margin-left: 1em;"><b>Close</b></a>'+title+'&nbsp;</p><div id="lb-content"></div></div>';
	lb = document.createElement('DIV');
	lb.id = 'lightboxbfb';
	lb.innerHTML = html;
	document.body.appendChild(lb);
	lightboxPos(w, h, pad);
	onscroll = function () { eval('lightboxPos('+w+', '+h+', '+pad+');') };
	return document.getElementById('lb-content');
}

function lightboxPos (w, h, pad) {
	var lbd, d;
	d = (typeof document.documentElement != 'undefined' ? document.documentElement : document.body);
	if (lbd = document.getElementById('lb-dialog')) {
		var x, y;
		x = (typeof d.scrollLeft != 'undefined' ? d.scrollLeft : window.pageXOffset) + (typeof d.clientWidth != 'undefined' ? d.clientWidth : window.innerWidth)/2 - w/2 - pad;
		y = (typeof d.scrollTop != 'undefined' ? d.scrollTop : window.pageYOffset) + (typeof d.clientHeight != 'undefined' ? d.clientHeight : window.innerHeight)/2 - h/2 - pad;
		lbd.style.left = x+'px';
		lbd.style.top = y+'px';
	}
}

function lightboxClose () {
	
	var lb;
	if (lb = document.getElementById('lightboxbfb')) lb.parentNode.removeChild(lb);
	onscroll = function () {};
	if (typeof nowPlaying != 'undefined') delete nowPlaying;
}


function flashDisplay() {
	if (document.getElementById("flash")) {
		document.getElementById("flash").style.display = "block";
	}
}
*/



/* END BEST OF ABC script */

