/*
*<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
*/
function center_form(id){
		  var scheight = screen.height;
		  var tblheight = $("#" + id).height();
		  var browers = (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
		  var D_height = (scheight - tblheight);
		  if(D_height > 0)
		  {
			  D_height /= 2;
		  }
		  else if(D_height < 0)
		  {
			  D_height *= -1;
			  D_height /= 2;
		  }
		  var tops = browers.scrollTop + D_height /2 + 'px';
		  $("#"+id).css('top',tops);
		  $("#"+id).css("left",(($(document).width())/2-(parseInt($("#"+ id).width())/2))+"px");
}

function showTips (elem) {
		tipsBackground();
		jQuery('#'+elem).css({display:'block',position:'absolute',zIndex:'9999'});
		center_form(elem);
		$("#"+elem).show();
}

function closeTips (elem) {
		jQuery('#'+elem).css({display:'none'});
		jQuery('#tipsBackground').remove();
}

function tipsBackground () {
		 var styleValue = {
			background:'#000',
			opacity:'0.7',
			position:'absolute',
			top:'0',
			right:'0',
			width:jQuery(window).width()+'px',
			height:jQuery(document).height()+'px',
			zIndex:'8888'
		};
		jQuery('body').append('<div id="tipsBackground"></div>');
		jQuery('#tipsBackground').css(styleValue);
		resize();
}
	
function resize() {
		window.onresize = function () {
			if (jQuery('tipsBackground').css('display') == 'block') {
				tipsBackground();	
			}	
		};
}
