
//document.onkeypress = docKeyDown;
//document.onkeyup= docKeyDown;
//document.onkeydown = docKeyDown;

function getObj(id){
	ret=null;
	try{    ret=document.getElementById(id); }catch(e){}
	return ret;
}

function ShowImg(image,id,imageHref,width,height){
    m = getObj(id);
    href = getObj(imageHref);
    href.href = image;
    m.src = image;
    if(width > 235)
        m.width = 235;
     else
        m.width = width;
}

function openfile(id,site, from)
{
    w = window.location = site + '/Common/OpenFile.aspx?from=' + from + '&id=' + id;
}

//function openfile(id,site){
//    w = window.location = site + '/Common/OpenFile.aspx?id=' + id;
//}

function printResults(site){
    w = window.open(site + '/Common/PrintMembers.aspx?all=0', null, 'resizable=no,scrollbars=yes status=no, width=650, height=800, left=10, top=10');
}

function printAll(site){
    w = window.open(site + '/Common/PrintMembers.aspx?all=1', null, 'resizable=no, scrollbars=yes, status=no, width=650, height=800, left=10, top=10');
}

function printOne(site, id){
    w = window.open(site + '/Common/Print.aspx?all=0&NID='+id+'', null, 'resizable=no,scrollbars=yes status=no, width=650, height=800, left=10, top=10');
}

function printMany(site,fv1,fv2,fv3){
    w = window.open(site + '/Common/Print.aspx?all=1&fv1='+fv1+'&fv2='+fv2+'&fv3='+fv3+'', null, 'resizable=no, scrollbars=yes, status=no, width=650, height=800, left=10, top=10');
}

function setFocus(id){
    if(getObj(id))
        getObj(id).focus();
}

function docKeyDown(e)
{
    if (!e) 
        var e = window.event
    
    if (e.target) 
        targ = e.target
    else if (e.srcElement) 
        targ = e.srcElement
    
    if (targ.nodeType == 3) // defeat Safari bug
        targ = targ.parentNode
    
    
    if(targ.tagName != "INPUT" && targ.tagName != "TEXTAREA")
        return false;
}

function keyUp(e, id)
{
    try { 
        k = event.keyCode   // ie
    }catch(e){}
    
    try { 
        k = e.keyCode       // mozilla
    }catch(e){}
    
    if(k == 13)
    {
        setFocus(id);
        getObj(id).click();
    }
}

function searchClick(e, id){
    if(getObj(id).value == "Search...")
        getObj(id).value = ""; 
}

function searchOut(e, id){
    if(getObj(id).value == "")
        getObj(id).value = "Search..."
}

function showDownloadPanel(id,displ)
{
    setTimeout("viewPanel("+id.id+")",10);
}

function viewPanel(id)
{
    id.style.display="block";
}

function hidePanel(id)
{
    id.style.display="none";
}

function redirectIBOX(id)
{
    setTimeout("getObj('"+id+"').click();",1000);
}

