function call_user_func_array( strFunctionName , arrParam ){
    var strCommand = "";
    var i;
    strCommand += "return " + strFunctionName + "(";
    for( i = 0; i < arrParam.length; ++i ) {
        strCommand += "arrParam[" + i + "]" ;
        if( ( i + 1 ) != arrParam.length ) {
            strCommand += ",";
        }
    }
    strCommand += ")";
    var oFunction = new Function( "arrParam" , strCommand );
    return oFunction( arrParam );
}

function count( mixed_var, mode ){
    var key, cnt = 0;
    if( mode == 'COUNT_RECURSIVE' ) mode = 1;
    if( mode != 1 ) mode = 0;
    for (key in mixed_var){
        cnt++;
        if( mode==1 && mixed_var[key] && (mixed_var[key].constructor === Array || mixed_var[key].constructor === Object) ){
            cnt += count(mixed_var[key], 1);
        }
    }
    return cnt;
}

function htmlspecialchars(string, quote_style) {
    string = string.toString();
    string = string.replace('/&/g', '&amp;');
    string = string.replace('/</g', '&lt;');
    string = string.replace('/>/g', '&gt;');
    if (quote_style == 'ENT_QUOTES') {
        string = string.replace('/"/g', '&quot;');
        string = string.replace('/\'/g', '&#039;');
    } else if (quote_style != 'ENT_NOQUOTES') {
        string = string.replace('/"/g', '&quot;');
    }
    return string;
}

function isSet(name){
	return !(typeof document.all[name] == "undefined");
}

function animShow(id) {
	if(document.getElementById(id).style.display!='block')
		$('#'+id).slideDown(300);
}

function animHide(id) {
	if(document.getElementById(id).style.display!='none')
		$('#'+id).slideUp(300);
}

function showHide(id) {
	var elem=document.getElementById(id);
	if(elem) {
		if(elem.style.display=='none') {
			$('#'+id).slideDown(300);
		}
		else {
			$('#'+id).slideUp(300);
		}
	}
}

function inputBlur(input,text,className) {
	if(input.value=='') {
		input.value=text;
		input.className=className;
	}
}

function inputFocus(input,text,className) {
	if(input.value==text) {
		input.value='';
		input.className=className;
	}
}

function fadeIn(folder) {
	$(folder).fadeTo(500, 1.0);
}

function fadeOut(folder) {
	$(folder).fadeTo(500, 0.6);
}