var util={
	referer:null,
	openWin:function(url, width, height){
		var win2;
		var screen_width = window.screen.width;
		var screen_height = window.screen.height;
	 
		width += 40;
		height += 30;
	
		if(width > screen_width){
			width = screen_width - 40;
		}
		if(height > screen_height){
			height = screen_height - 100;
		}
		win2=window.open( url , 'windetail', 'width='+width+',height='+height+', top=20, left=20, resizable=1, scrollbars=1' );
		win2.focus();
	},
	notice:function(msg){
		
		$('#notice').html(msg).toggle(500,function(){
			var el=this;
			var hd=function(){$(el).toggle(200)};
			setTimeout(hd,1000) ;		
		});
	}
};
$(function(){	
	$('input[name=close],button[name=close]').each(function(){
		if(util.referer==''){
			$(this).hide();
		}
	}).click(function(){
		if(util.referer==null){
			window.history.back();
		}else{
			document.location=util.referer;
		}
		return false;
	});	
});
