/* Function to hide/unhide a specific Div id */
function toggleDiv (divid){
if (document.getElementById(divid).style.display == 'none') {
document.getElementById(divid).style.display = 'block';
} else {
document.getElementById(divid).style.display = 'none';
}
function winopeng (url, wid) {
open (url, wid,"width=570,height=310,status=no,toolbar=no,menubar=no,scrollbar=no");
// WARNING !! Internet Explorer DOESNT SUPPORT "-" CARACTERS IN WINDOW HANDLE VARIABLE
status =wid;
function pandora_help (help_id) {
open ("general/pandora_help.php?id="+help_id, "pandorahelp", "width=650,height=500,status=0,toolbar=0,menubar=0,scrollbars=1,location=0");
/**
* Decode HTML entities into characters. Useful when receiving something from AJAX
*
* @param str String to convert
* @retval str with entities decoded
*/
function html_entity_decode (str) {
if (! str)
return "";
var ta = document.createElement ("textarea");
ta.innerHTML = str.replace (/</g, "<").replace (/>/g,">");
return ta.value;
* Function to search an element in an array.
* Extends the array object to use it like a method in an array object. Example:
* <code>
a = Array (4, 7, 9);
alert (a.in_array (4)); // true
alert (a.in_array (5)); // false
Array.prototype.in_array = function () {
for (var j in this) {
if(this[j] == arguments[0])
return true;
return false;