/*
*	swfUtils ver. 1.0
*	author: me@krzepa.com
*/

function swfUtils_fixResizing( divID, minWidth, minHeight ) {
	
	var div=document.getElementById( divID );
	
	div.style.minWidth=minWidth+'px';
	div.style.minHeight=minHeight+'px';
	
	var ieFixVer=(navigator.appName.indexOf('Microsoft') != -1) && ( parseInt( navigator.appVersion.split('MSIE ')[1] ) < 7);
	var operaFixVer=(navigator.appName.indexOf('Opera') != -1);

	if(ieFixVer || operaFixVer) {
		
		var fixSWFResizing=function(e) {

			clearTimeout(arguments.callee.timID);

			if(e) {
				arguments.callee.timID=setTimeout(arguments.callee, 200);
				return;
			} 
			
			if(document.body.clientHeight < minHeight) {
				div.style.height=minHeight+'px';
				document.body.style.overflowY='scroll';
			} else {
				div.style.height='100%';
				document.body.style.overflowY='auto';
			}
			if(document.body.clientWidth < minWidth) {
				div.style.width=minWidth+'px';
				document.body.style.overflowX='scroll';
			} else {
				div.style.width='100%';
				document.body.style.overflowX='auto';
			}
	
		}
		
		window.attachEvent('onresize', fixSWFResizing);
		
		fixSWFResizing();
	}
	

}

function swfUtils_setFocus( swfID ) {

	var swf=document.getElementById( swfID );
	
	if(swf.setActive) {
		swf.setActive();
	}
	
}


function swfUtils_callNoHttpProtocol() {
	
	var win;
	var str=arguments[0];
	
	if( str.indexOf('javascript:') == 0 ) {
		
		eval(str.substr(11));
		
	} else {
		
		win = window.open(str,'win','');

		win.close();
		
	}

}
