var new_win
function center_Cords(tmp_dim,type) {
	
	
	if (document.body && typeof(document.body.offsetHeight) == 'number')
		{
			 var cHeight = document.body.offsetHeight;
			 var cWidth = document.body.offsetWidth;
		}
		else if (typeof(window.innerHeight) == 'number')
		{
			 var cHeight = window.innerHeight;
			 var cWidth = window.innerWidth;
		}
		else
		{
			 var cHeight = 500;	
			 var cWidth = 800;
		}		

	//alert("height = " + tmp_dim + " height from top = "  + cHeight);
	
	
	if (type == 'x') {
		
		var	pass = ((cWidth-tmp_dim)/2)
		return pass
		
	} else if (type == 'y') {
		
		var	pass = ((tmp_dim-cHeight)/2)
		return pass
		
	} else {
		return pass

	}
							
							
				
							
}


function NewWindow(url,width,height) {
	//alert("NewWindow : " + url);
	if (width=='undefined' || !width) {
		var width = window.getWidth() * .7;
	}
	if (height=='undefined' || !height ) {
		var height = window.getHeight() * .7;
		if (height<580) {
			 height = 580;
			 width = 790;
		}
	}
	
	var tmp_x = center_Cords(width,'x');
	var tmp_y = center_Cords(height,'y');
	return window.open(url,'_blank','status=yes,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,top=' + tmp_y + ',left=' + tmp_x + ',width=' + width + ',height=' + height);		
	
}
