function statusDebug(status) {
	statusDebug = status
	makeDisplayLogTextArea()
}
function statusDebugDialog(staDialog){
    statusDebugDialog = staDialog;
    dialogStatusJS = true;
    makeDisplayLogTextArea()

}
function dialogJS(status){
    if (status) {
        $('dialogLog').style.display = '';
        new Draggable('dialogLog', { scroll: window });
    }
        statusDebug = status;
        dialogStatusJS = status;
        makeDisplayLogTextArea();
        window.onscroll = logPesterSrcoll;
}


function makeDisplayLogTextArea() {
    if ($('displayLogTextArea')== null) {
        if(dialogStatusJS == true) {
            setNoneOverlay = false;
            checkBodyLog = $('logShowPro');
            Acols = (checkBodyLog.offsetWidth/8 +10);
        } else {
            checkBodyLog = document.getElementsByTagName('body')[0];
            Acols = (window.screen.width/8 +18);
        }
        idDisplayDiv = document.createElement('div');
        idDisplayArea = document.createElement('textarea');
        idDisplayArea.id ='displayLogTextArea';
        idDisplayArea.cols = Acols;
        idDisplayArea.rows = "20";
        checkBodyLog.appendChild(idDisplayArea);
            }
    if(setNoneOverlay == true) {
        $('overlay').style.display='none';
    }
return true;
}
function RVdebug(obj) {

    if (statusDebug != true) {
    } else {
        $('displayLogTextArea').value += '[DEBUG][' + setDisplayTime() + ']::' + obj + '\n';
        $('displayLogTextArea').scrollTop = $('displayLogTextArea').scrollHeight;
}
/*
    if (statusDebugDialog == true) {
        //$('displayLogDialog').value += '[DEBUG][' + setDisplayTime() + ']::' + obj + '\n'
    }
*/
}
function RVdebugDLG(bugDL){
	if (statusDebugDialog == true) {
		$('showDetailDialog').value += '[' + setDisplayTime() + ']::'+bugDL+'\n';
		$('showDetailDialog').scrollTop = $('showDetailDialog').scrollHeight;
	}
}

function oGetTime()
{
	thistime= new Date()
	/*
		var hours=thistime.getHours()
		var minutes=thistime.getMinutes()
		var seconds=thistime.getSeconds()
*/
return thistime
}
function setDisplayTime()
{
	thistime = oGetTime()
	return time = thistime.getHours() + ':' + thistime.getMinutes() + ':' +thistime.getSeconds()
}


// dialog button action
function dialogLogActClear()
{
    if(!$('displayLogTextArea')) {
        return false;
    } else {
        $('displayLogTextArea').value='';
        return true;
        }
}
function dialogLogActEnd()
{
    $('dialogLog').style.display='none';
    statusDebug = false;
}

function logPesterSrcoll(e) {
//RVdebug($('logPesterScrolbar').checked +'='+ statusDebug)
    if($('logPesterScrolbar')) {
	    if($('logPesterScrolbar').checked && statusDebug) {
	        bodyscroll = document.all ? document.getElementsByTagName('body')[0].scrollTop: document.documentElement.scrollTop;
	        $('dialogLog').style.top = (bodyscroll + $('dialogLog').offsetHeight)+'px';
	    }
	}
}

function logBrowserBarOnkeyUp(field, evt)
{
var keyCode =
    document.layers ? evt.which :
    document.all ? event.keyCode :
    document.getElementById ? evt.keyCode : 0;
    if(keyCode == '13') {
        logBrowserBar();
    }
}
function logBrowserBar()
{
    $('bIF').src = (($('bBar').value).match(/http\:\/\//i) ? '' : 'http://')+$('bBar').value;
    $('bIF').style.width = $('dialogLog').offsetWidth+'px';
    $('bIF').style.height = $('dialogLog').offsetHeight+'px';
    $('bIF').style.display = '';
}
function shwBar(obj)
{
    if($('bIF').style.display == 'none') {
        $('bIF').style.display='';
        obj.value = '<';
    } else {
        $('bIF').style.display='none';
        obj.value = '>';
    }
}
function runScriptRVdebug()
{
    try{
        eval($('displayLogTextArea').value);
    }catch(e){
        RVdebug(e);
    }
}