﻿// JScript File


//********************************************************************************
function Trim(str)
{
    return str.replace(/^\s*|\s*$/g,"");
}

//********************************************************************************
//********************************************************************************
function readObj(obj,type)
{
    var x= '';
    
    for(i in obj)
    {
        if(type=='a')
        {
            x+= i + ':' + obj[i] + '\n';
        }
        else
        {
            x+= i + ':<b>' + obj[i] + '</b><hr>';
        }

    }
    if (type=='a')
    {
        alert(x);
    }
    else
    {
        document.write(x);
    }
}



//********************************************************************************
//********************************************************************************
function OpenWindow(windowUrl)
{
 var win =  window.open(windowUrl,'none','width=550,height=400,left=220,top=100');
 win.focus();
}


//********************************************************************************
//********************************************************************************
function OpenSizedWindow(windowUrl,width,height)
{
 var win =  window.open(windowUrl,'none','width='+ width +',height='+ height +',left=220,top=100');
 win.focus();
}

//********************************************************************************
//********************************************************************************
function ShowHide(areaID,path)
{
    var area = document.getElementById(areaID);
    var imageIcon = document.getElementById('Img_' + areaID);
    
    if (path==null)
    {
     path = "../"
    }

    
    if (area.style.display=='none')
    {
        area.style.display='';
        if (imageIcon)
        {
            imageIcon.src= path + 'Images/Icons/minus.gif';
        }
        
    }
    else
    {
        area.style.display='none';
        if (imageIcon)
        {
            imageIcon.src= path + 'Images/Icons/plus.gif';
        }
    } 
}

//********************************************************************************
//********************************************************************************

function ShowHideBox(areaID1,areaID2,path)
{
    var area = document.getElementById(areaID1);
    var area2 = document.getElementById(areaID2);
    
    var area_li = document.getElementById('mainSearchBox_Li');
    var area2_li = document.getElementById(areaID2 + '_Li');
    
    
    if (area.style.display=='none' || area.style.display=='')
    {
        area.style.display='';
        area2.style.display='none';
        
        //area_li.className='';
        //area2_li.className = 'activelink';
    }  
}

//********************************************************************************
//********************************************************************************



//********************************************************************************
//********************************************************************************




