var DHTML = (document.getElementById || document.all || document.layers);

function print_r(theObj){
    if(theObj.constructor == Array ||
    theObj.constructor == Object){
        document.write("<ul>")
        for(var p in theObj){
            if(theObj[p].constructor == Array||
            theObj[p].constructor == Object){
                document.write("<li>["+p+"] => "+typeof(theObj)+"</li>");
                document.write("<ul>")
                print_r(theObj[p]);
                document.write("</ul>")
            } else {
                document.write("<li>["+p+"] => "+theObj[p]+"</li>");
            }
        }
        document.write("</ul>")
    }
}


/***********************************************
* Disable "Enter" key in Form script- By Nurul Fadilah(nurul@REMOVETHISvolmedia.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
*
* WOW - he wrote 10 lines and wants to read his name in a source code....strange
***********************************************/

function handleEnter (field, event) {
    var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
    if (keyCode == 13) {
        var i;
        for (i = 0; i < field.form.elements.length; i++)
        if (field == field.form.elements[i])
        break;
        i = (i + 1) % field.form.elements.length;
        field.form.elements[i].focus();
        return false;
    }
    else
    return true;
}



function trim(str) {
    return str.replace(/^\s*|\s*$/g,"");
}


function popUp(file,width,height) {

    height = parseInt(height);
    width = parseInt(width);
    popup = window.open('/rtc-popUp/'+file,'popup','width='+width+',height='+height);
}

function setStatus(str) {
    window.status = str;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
}


function toggle_visibility(id, status) {
    if(!document.getElementById(id)) {
        return false;
    }
    if (!DHTML) return;
    var e = document.getElementById(id);
    if(status == true)
    e.style.display = 'block';
    else
    e.style.display = 'none';
}



function toggleInputColor(objElement)
{
    if (objElement.className=='stdinput')
    objElement.className='stdinputfocus';
    else
    objElement.className='stdinput';
}

