// floating DIV for help icon: var messageflag = 0; function showMessage(element, message, width, height) { messageflag = 0; width = parseInt(width); height = parseInt(height); if(!width){ var width = 200; } if(!height){ var height = 100; } var pos = $(element).offset(); var left = (pos.left + 20) + "px"; var top = pos.top + "px"; $("#info").css({ position: "absolute", zIndex: 5000, width:width+"px", height:height+"px", left: left, top: top }); $("#info").show(); $("#info").html(message); } function firstHideMessage() { messageflag = 1; setTimeout("hideMessage()",500); } function hideMessage() { if(messageflag){ $("#info").hide(); } } // Counter for textarea: function limit(obj, limit, counterId) { if (counterId == 'undefined' || !counterId) { counterId = 'count'; } if (obj.value.length > limit) { obj.value = obj.value.substr(0,limit); } document.getElementById(counterId).innerHTML = limit - obj.value.length; } function printr(obj) { var text = ''; var j = 0; for (var i in obj) { text += '[' + i + ']' + ' => ' + obj[i] + "\n"; if (j >= 25) { alert(text); text = ''; j = 0; } j++; } } function winResize(width,height) { if (document.all) { var newTop = (screen.width-width)/2 var newLeft = (screen.height-height)/2 window.moveTo(newTop,newLeft) window.resizeTo(width,height) } } function include(filename) { var ext = /^.+\.([^.]+)$/.exec(filename); filetype = ext == null ? "" : ext[1]; if (filetype=="js"){ //if filename is a external JavaScript file var fileref=document.createElement('script'); fileref.setAttribute("type","text/javascript"); fileref.setAttribute("src", filename); } else if (filetype=="css"){ //if filename is an external CSS file var fileref=document.createElement("link"); fileref.setAttribute("rel", "stylesheet"); fileref.setAttribute("type", "text/css"); fileref.setAttribute("href", filename); } if (typeof fileref!="undefined") { document.getElementsByTagName("head")[0].appendChild(fileref); } } function popup(mypage, winname, w, h, scroll) { if (winname=='' || winname=='undefined' || winname==null){winname='editor';}; if (scroll=='' || scroll=='undefined' || scroll==null){scroll='auto';}; var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',notresizable'; win = window.open(mypage, winname, winprops); if (win.opener == null) { win.opener = self } if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } } function nospam(prefix, suffix){ document.write(''+prefix+'@'+suffix+''); } function alterCate(elm, onoff) { if (typeof(onoff) == "undefined" ) { onoff = "blur"; } if (!elm.base) { elm.base = elm.value; } if (elm.value == elm.base && onoff != "blur") { elm.value = ""; } else if (elm.value == "" && onoff == "blur") { elm.value = elm.base; } } var win = null; function NewWindow(mypage,myname,w,h){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',status=0,resizable=0' win = window.open(mypage,myname,settings) } function swap_display(main_div_id, second_div_id) { var main_div = document.getElementById(main_div_id); if (second_div_id) var second_div = document.getElementById(second_div_id); if (main_div) { document.cookie = 'main_div_id=' + main_div_id + '; path=/'; main_div.style.display = (main_div.style.display=="none") ? "block" : "none"; if (second_div) second_div.style.display = (main_div.style.display=="none") ? "block" : "none"; } } LOADING = { show: function(title, help, image) { var default_skin = "#ajax-load-background {opacity:0.5; filter:alpha(opacity=50); position:fixed; width:100%; height:100%; left:0; top:0; background:none repeat scroll 0% 0%; background-color:#fff; z-index:99997;}#ajax-load {position:fixed; z-index:99998; top:50%; left:50%; margin-left:-20px; text-align:center;}#ajax-load #ajax-load-title, #ajax-load #ajax-load-help {color:#000;}#ajax-load #ajax-load-title {font-size:16px; font-weight:bold;}#ajax-load #ajax-load-help {font-size:10px;}"; var head = document.getElementsByTagName("head")[0]; // tricky hack for IE var htmDiv = document.createElement('div'); htmDiv.innerHTML = '
x<\/p>