
/* javascript common thingy */

function wo(what) {
	var p = 'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1';
	window.open(what, '', p);
}

function wop(pic, w, h) {
	var maxw = 900;
	var maxh = 650;
	var p = "";
	if (w > maxw || h > maxh) {
		p = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + maxw + ',height=' + maxh;
	} else {
		p = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=' + w + ',height=' + h;
	}
	window.open('pic.php?s=' + pic, '', p);
}

function switchDisplay(id) {
	var obj = $(id);
	if (obj) {
		if (obj.getStyle("display") == "none") {
			obj.setStyle("display", "block");
		} else {
			obj.setStyle("display", "none");
		}
	}
}

function switchDisabled(id) {
	var obj = $(id);
	if (obj) {
		if (obj.getProperty("disabled") == "disabled" || obj.getProperty("disabled") == true) {
			obj.removeProperty("disabled");
		} else {
			obj.setProperty("disabled", "disabled");
		}
	}
}


/* ********* */

function zmax() {
	// do nothing
}

/**
  * tooltip function
***/
function toggleTooltip(show, a, msg) {
	if (show) {
		$("tooltip").set("html", msg);
		$("tooltip").setStyle("display", "block");
		var pos = $(a).getPosition();
		pos.x += 10;
		pos.y -= 10;
		$("tooltip").setPosition(pos);
	} else {
		$("tooltip").setStyle("display", "none");
	}
}

/**
  * APPLICATION INITIALIZATION
***/
window.addEvent('domready', function() {
	//alert("The DOM is ready.");
	initScrolling(); // see scrolling.js
});

/**
  * JS file end
***/

