function dim(){$("#dim_div").html()==null&&$('<div id="dim_div"></div>').appendTo(document.body).addClass("ui-widget-overlay").css({width:$(document).width(),height:$(document).height()})}function unDim(){$("#dim_div").html()!=null&&$("#dim_div").remove()}
function alertDialog(b,a,c,d){if(typeof $().dialog=="undefined")setTimeout("alert('"+a+"')",1500);else{$(document.body).append('<div id="alert_dialog" class="dialog" title="'+b+'"><p>'+a+"</p></div>");if(c==null)c="OK";b={};b[c]=function(){$("#alert_dialog").remove();d!=null&&d()};$("#alert_dialog").dialog({modal:true,buttons:b})}}
function booleanDialog(b,a,c,d,e){$(document.body).append('<div id="boolean_dialog" class="dialog" title="'+b+'"><p>'+a+"</p></div>");if(c==null)c="OK";if(d==null)d="Cancel";b={};b[d]=function(){$("#boolean_dialog").remove();if(e!=null)e(false);else return false};b[c]=function(){$("#boolean_dialog").remove();if(e!=null)e(true);else return true};$("#boolean_dialog").dialog({modal:true,buttons:b})}var compact_text_open={};
$.fn.compactText=function(b,a){var c=$(this).html();if(c!=null){var d=$(this).attr("id");compact_text_open[d]=false;c=c.replace(new RegExp(/^\s+|\s+$/g),"");if(c.length>b){b=c.substr(0,b);b+='...<br /><span class="tooltip_entry tooltip_entry_'+d+'"></span>';a=getQtipPostion(a);$(this).html(b);$(".tooltip_entry_"+d).html("View More&#9658;");$(".tooltip_entry_"+d).qtip({content:c,show:{when:{event:"click"},effect:{type:"fade",length:750}},hide:{when:{event:"click"},effect:{type:"fade",length:750}},
position:a}).click(function(){if(compact_text_open[d]){compact_text_open[d]=false;$(".tooltip_entry_"+d).html("Close&#9660;")}else{compact_text_open[d]=true;$(".tooltip_entry_"+d).html("View More&#9658;")}})}}};
function getQtipPostion(b){var a={};a.corner={};switch(b){case "top_left":a.corner.target="topLeft";a.corner.tooltip="bottomRight";break;case "top":a.corner.target="topMiddle";a.corner.tooltip="bottomMiddle";break;case "top_right":a.corner.target="topRight";a.corner.tooltip="bottomLeft";break;case "right":a.corner.target="topRight";a.corner.tooltip="topLeft";break;case "bottom_right":a.corner.target="bottomRight";a.corner.tooltip="topLeft";break;case "bottom":a.corner.target="bottomMiddle";a.corner.tooltip=
"topMiddle";break;case "bottom_left":a.corner.target="bottomLeft";a.corner.tooltip="topRight";break;case "left":a.corner.target="topLeft";a.corner.tooltip="topRight";break;default:a.corner.target="topRight";a.corner.tooltip="bottomLeft"}return a}function setAutoTab(b,a,c){$("#"+b).keyup(function(d){c!=null&&this.value.length==a&&$("#"+c).focus()})}jQuery.fn.exists=function(){return jQuery(this).length>0};

