function open_window(url, width, height, pos){
	url = encodeURI(url);
	var browser_size = getBrowserDim();
	
	var attr_str = '';
	if(width == '' || width == 'undefined' || width == undefined || width == null){
		width = browser_size[0];
	}
	
	attr_str += 'width='+width;
	if(height == '' || height == 'undefined' || height == undefined || height == null){
		height = browser_size[1];
	}
	attr_str += ',height='+height;
	if(pos == 'center'){
		var left = Math.ceil((browser_size[0]-width)/2);
		var top = Math.floor((browser_size[1]-height)/2);
		attr_str += 'left='+left+',top='+top+',screenX='+left+',screenY='+top;		
	} else if(pos == 'topleft'){
		if(attr_str != '') attr_str += ',';
		attr_str += 'left=0,top=0,screenX=0,screenY=0';
	} else if(pos == 'topright'){
		if(attr_str != '') attr_str += ',';
		attr_str += 'left='+browser_size[0]+',top=0,screenX='+browser_size[0]+',screenY=0';
	}
	attr_str += ',scrollbars=yes';
	window.open(url,'EV_Window',attr_str);
}

function getBrowserDim(){
	if( typeof( window.innerWidth ) == 'number' ) { 

		//Non-IE 

		myWidth = window.innerWidth;
		myHeight = window.innerHeight; 

	} else if( document.documentElement && 
		( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { 
		//IE 6+ in 'standards compliant mode' 

		myWidth = document.documentElement.clientWidth; 
		myHeight = document.documentElement.clientHeight; 

	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { 

		//IE 4 compatible 

		myWidth = document.body.clientWidth; 
		myHeight = document.body.clientHeight; 

	}
	return new Array(myWidth,myHeight);
}

function resize_flash(id, height){
	id = $(id);
	if($type(id) == 'element'){
		$(id).setStyle('height', height+'px');
	}
}
