function open_bf_window(url,name,wth,hgt,display)
{
	if(wth == 'full'){
		sgswindow = window.open(url);
	}else{
		var winwidth = 800;
		var winheight = 600;
		var winname='';
		var windisplay = ',scrollbars=yes,menubar=yes,status=yes';
		
		if(wth){ winwidth = wth; }
		if(hgt){ winheight = hgt; }
		if(name){ winname = name; }
		
		if(display && display == 'plain'){
			windisplay = ',scrollbars=no,menubar=no,status=no';
		}
		sgswindow = window.open(url,winname, 'top=100,left=100,resizable=yes,width='+winwidth+',height='+winheight+windisplay);
	}
	sgswindow.focus();
}

function FitPic()
{
	var windowWidth, windowHeight;
	if(self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	}else if(document.documentElement && document.documentElement.clientHeight){ // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	}else if(document.body){ // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
	
	if(document.images[0]){
		windowWidth = document.images[0].width - windowWidth;
		windowHeight = document.images[0].height - windowHeight;
		window.resizeBy(windowWidth, windowHeight);
	}
	
	var video = document.getElementById('flash_video');
	if(video){
		windowWidth = video.width - windowWidth;
		windowHeight = video.height - windowHeight;
		window.resizeBy(windowWidth, windowHeight);
	}
	
	self.focus();
}
