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 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";
}
}