﻿// JScript File

function getItem(itemName)
{
    var elem;
	
    if( document.getElementById ) elem = document.getElementById( itemName );  
    else if( document.all ) elem = document.all[itemName];  
    else if( document.layers ) elem = document.layers[itemName]; 
	
    return elem;
}	
//	vidOn = new Image;
//	vidOff = new Image;
//	vidOn.src = 'http://www.i-do.com.au/weddings/gui/videosOn.gif';
//	vidOff.src = 'http://www.i-do.com.au/weddings/gui/videosOff.gif';
//	
//	chOn = new Image;
//	chOff = new Image;
//	chOn.src = 'http://www.i-do.com.au/weddings/gui/channelsOn.gif';
//	chOff.src = 'http://www.i-do.com.au/weddings/gui/channelsOff.gif';

function gotoVids()
{
    var vidTab = getItem("vidTab");
    var idoTab = getItem("idoTab");
    var usrTab = getItem("usrTab");
	
    idoTab.style.backgroundImage = 'url(http://www.i-do.com.au/weddings/gui/tabOffsm.gif)';
    usrTab.style.backgroundImage = 'url(http://www.i-do.com.au/weddings/gui/tabOfflg.gif)';
    vidTab.style.backgroundImage = 'url(http://www.i-do.com.au/weddings/gui/tabOnsm.gif)';

    toggleLayerOff('channelScroll');
    toggleLayerOff('userScroll');
    toggleLayerOn('videoScroll');
}

function gotoIdo()
{
    var vidTab = getItem("vidTab");
    var idoTab = getItem("idoTab");
    var usrTab = getItem("usrTab");
	
    idoTab.style.backgroundImage = 'url(http://www.i-do.com.au/weddings/gui/tabOnsm.gif)';
    usrTab.style.backgroundImage = 'url(http://www.i-do.com.au/weddings/gui/tabOfflg.gif)';
    vidTab.style.backgroundImage = 'url(http://www.i-do.com.au/weddings/gui/tabOffsm.gif)';	
	
    toggleLayerOff('videoScroll');
    toggleLayerOff('userScroll');
    toggleLayerOn('channelScroll');
	
}

function gotoUsr()
{
    var vidTab = getItem("vidTab");
    var idoTab = getItem("idoTab");
    var usrTab = getItem("usrTab");
	
    idoTab.style.backgroundImage = 'url(http://www.i-do.com.au/weddings/gui/tabOffsm.gif)';
    usrTab.style.backgroundImage = 'url(http://www.i-do.com.au/weddings/gui/tabOnlg.gif)';
    vidTab.style.backgroundImage = 'url(http://www.i-do.com.au/weddings/gui/tabOffsm.gif)';	
	
    toggleLayerOff('videoScroll');
    toggleLayerOff('channelScroll');
    toggleLayerOn('userScroll');
}

function toggleLayerOff( whichLayer )
{  
    var elem, vis;  
    if( document.getElementById ) // this is the way the standards work    
    elem = document.getElementById( whichLayer );  else if( document.all ) // this is the way old msie versions work
    elem = document.all[whichLayer];  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];  
	
    vis = elem.style; 
    vis.display = 'none';
}
	
function toggleLayerOn( whichLayer )
{  
    var elem, vis;  
    if( document.getElementById ) // this is the way the standards work    
    elem = document.getElementById( whichLayer );  else if( document.all ) // this is the way old msie versions work
    elem = document.all[whichLayer];  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];  
	
    vis = elem.style; 
    // if the style.display value is blank we try to figure it out here
    //if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)    
    vis.display = 'block';
        //(elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
        //vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

            
