﻿///   GENERIC HIDE DIV  - OMAR AA - V[1.0.8] - 4/8/2007 11:12:49 AM -
function HideDiv(DivName) 
{
    j$Obj(DivName).style.visibility = "hidden";
    j$Obj(DivName).style.display = "none";
}

///   GENERIC SHOW DIV  - OMAR AA - V[1.0.8] - 4/8/2007 11:12:54 AM -
function ShowDiv(DivName) 
{
    j$Obj(DivName).style.visibility = "visible";
    j$Obj(DivName).style.display = "block";
}

//method that shows the div if it is hidden and hide it if it visible --SARA AA 21/5/2007
function DisplayDiv(divName)
{
    if (j$Obj(divName).style.display == 'none')
    {
      ShowDiv(divName);
    }
    else 
    { 
      HideDiv(divName);
    }
}

///  MOVE CONTENT OF A DIV TO ANOTHER   - OMAR AA - V[1.0.8] - 4/24/2007 11:32:56 AM -
function MoveDivContent(From, To)
{
    j$Obj(To).innerHTML = j$Obj(From).innerHTML;
    j$Obj(From).innerHTML = "";
}

/// Sets the contents of any div or span tag
function SetTextOfLayer(LayerID, Contents)
{  
    j$Obj(LayerID).innerHTML = Contents;  
}

/// Sets the value of any input tag
function SetInputValue(InputID, InputValue)
{
   j$Obj(InputID).value = InputValue;
}

function ShowLightBox(referringURL)
{
    var lightBoxHeight = document.body.offsetHeight;    
    j$Obj("lightBox").style.height = lightBoxHeight +'px';
    
    ShowDiv('lightBox');
    ShowDiv('loginBox');
    
    var doc = j$Obj("iframeLogin").contentDocument;
    if (doc == undefined || doc == null)
        doc = j$Obj("iframeLogin").contentWindow.document;
    doc.open();
    doc.write("<div style='text-align:center'><img src='" + LoadingImageURL + "'></div>");
    doc.close();            
    
    j$Obj("iframeLogin").src = LightBoxLoginPageURL + "&ReferringURL=" + referringURL;
    changeOpac(75,'lightBox');
}

function HideLightBox()
{
    HideDiv('lightBox');
    HideDiv('loginBox');
}    

function changeOpac(opacity, id) { 
    var object = j$Obj(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
}


