﻿// JScript File

function returnObjById( id ) 
{ 
          
    if (document.getElementById) {
        var returnVar = document.getElementById(id); 
        }
    else if (document.all) {
        var returnVar = document.all[id];  }
    else if (document.layers) {
        var returnVar = document.layers[id];  }

    if (returnVar == null) {
        if (id.indexOf('$') > 0) {
            returnVar = returnObjById(id.replace('$', '_'));
        }
    } 
    return returnVar; 
} 

function setDefault(elementId, defaultText) 
{
    var element = returnObjById(elementId);
    
    if (element.value == defaultText) {
        element.value = '';
        element.style.color = '#666666'
    } else {
        if (element.value == '') {
            element.value = defaultText;
            element.style.color = '#CCCCCC'
        }
    }
}

function AddLoadEvent(func) {
    var oldonload = window.onload;
  
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (typeof(oldonload) == 'function') { oldonload(); }
            if (typeof(func)=='function') { func(); }
        }
    }
}


function doHelp(topic){
	
	window.top.focus()
	var w = window.top.screen.availWidth;
	var h = window.top.screen.availHeight;
	window.top.resizeTo(.75*w,h);
	window.top.moveTo(0.0);
	var sFeatures = "height=" + (h-(.05*h)) + ",width=" + w*.23 + ",resizable,scrollbars=1,top=0,left=" + w*.75; 
	topic = 'http://www.callcourier.biz/cc/help/' + topic 
	var helpPane = window.open(topic,"helpPane",sFeatures)
	helpPane.focus();

}

function popHelp(intHelpID)
{

	helpWin = open("/cc/help/help.asp?IDHelpItem=" + intHelpID, "wnHelp", "scrollbars, width=550, height=400, x=5, y=10, screenX=5, screenY=10");
}
