var doesDHTML = (document.getElementById || document.all || document.layers);

//**************************************************
//get object
//**************************************************
function getObject(id)
{
    var obj;
    
    if (document.getElementById)
    {
       obj = document.getElementById(id);
       //this.style = document.getElementById(id).style;
    }
    else if (document.all)
    {
        obj = document.all[id];
        //this.style = document.all[id].style;
    }
    else if (document.layers)
    {
        obj = document.layers[id];
        //this.style = document.layers[id].style;
    }    
    return obj;
}

//hide answer box
function hideAnswer(faqContainer)
{
	if (doesDHTML)
	{
		var objContainer = new getObject(faqContainer); 	
		objContainer.style.visibility = "hidden";			
	}
}

//**************************************************
//show answer to question
//**************************************************
function showAnswer(questionNbr)
{
    if (doesDHTML)
    {         
        var objContainer;
        var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body;
		var dsocleft=document.all? iebody.scrollLeft : pageXOffset;
		var dsoctop=document.all? iebody.scrollTop : pageYOffset;
             
        if (questionNbr==1)        
        {   
			objContainer = new getObject('one');                                        
            objContainer.style.height = "300px";
            objContainer.style.width = "525px";
            objContainer.style.left = "150px";
            objContainer.style.top = dsoctop+100 + "px";
            objContainer.style.visibility = "visible";               
        }
        else if (questionNbr==2)                            
        {
            objContainer = new getObject('two');                                        
            objContainer.style.height = "310px";
            objContainer.style.width = "525px";
            objContainer.style.left = "150px";
            objContainer.style.top = dsoctop+75 + "px";
            objContainer.style.visibility = "visible";
        }
        else if (questionNbr==3)
        {
            objContainer = new getObject('three');                                        
            objContainer.style.height = "475px";
            objContainer.style.width = "525px";
            objContainer.style.left = "150px";
            objContainer.style.top = dsoctop+15 + "px";
            objContainer.style.visibility = "visible";
        }
        else if (questionNbr==4)
        {                
            objContainer = new getObject('four');                                        
            objContainer.style.height = "410px";
            objContainer.style.width = "525px";
            objContainer.style.left = "150px";
            objContainer.style.top = dsoctop+50 + "px";
            objContainer.style.visibility = "visible";            
        }
        else if (questionNbr==5)
        {    
            objContainer = new getObject('five');                                        
            objContainer.style.height = "400px";
            objContainer.style.width = "535px";
            objContainer.style.left = "125px";
            objContainer.style.top = dsoctop+50 + "px";
            objContainer.style.visibility = "visible";
        }    
        else if (questionNbr==6)
        {
            objContainer = new getObject('six');                                        
            objContainer.style.height = "490px";
            objContainer.style.width = "525px";
            objContainer.style.left = "150px";
            objContainer.style.top = dsoctop+10 + "px";
            objContainer.style.visibility = "visible";     
        }
        else if (questionNbr==7)
        {
            objContainer = new getObject('seven');                                        
            objContainer.style.height = "265px";
            objContainer.style.width = "525px";
            objContainer.style.left = "150px";
            objContainer.style.top = dsoctop+100 + "px";
            objContainer.style.visibility = "visible";     
        }
    }   
}


//**************************************************
//set background color
//**************************************************
function setBackground(layerID, color)
{ 
    if (doesDHTML)
    {        
        var objLayer = new getObject(layerID);         
        objLayer.style.backgroundColor = color;         
    }
    else
    {
        return;
    }
}


//**************************************************
//show/hide layer by using ZIndex
//**************************************************
function changeZIndex(layerID, layerZIndex, layerTop, layerLeft, imageID, imageSource)
{ 
    if (doesDHTML)
    {        
        // update layer z-index
        var objLayer = new getObject(layerID);   
        objLayer.style.zIndex = layerZIndex;  
        
        if (layerTop != null)
        {
            objLayer.style.top = layerTop;
            objLayer.style.left = layerLeft;    
        }
        
        // update image in layer      
        if (imageID != null)  
            imageID.src = imageSource;
    }
    else
    {
        return;
    }
}

