var total=4;

isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;

// declare global variable to hold a reference to the 
// marquee object.
var marquee;

var html = '';


if(document.all)
{
    doc = "document.all";
    sty = ".style";
    htm = ""
}
else if(document.layers)
{	
    doc = "document";
    sty = "";
    htm = ".document"
}
else // isNS6... doesn't support .layers anymore...
{
    doc = "document";
    sty = ".style";
    htm = ".document"
}

function getObj2 (sID)
{
    if (document.getElementById)
        return document.getElementById (sID);
    
    return eval(doc + '[' + sID + ']');
}

function showDiv (divId, bShow)
{
  var div = document.getElementById(divId); 
  
  sDisplay = 'none';
  if (bShow)
	sDisplay = 'block';
  div.style.display = sDisplay;
}


function toggleDisplay(divId) {
  var div = document.getElementById(divId); 
  div.style.display = (div.style.display=="block" ? "none" : "block");
/*
  var img = document.getElementById("img" + divId);
  img.src = (img.src.indexOf('Down')>0 ? "images/icon_arrowUp.gif" : "images/icon_arrowDown.gif");
  */
}


function ie_getElementsByTagName(str) 
{ 
    if (str=="*") 
        return document.all 
    else 
    {
        var inputs = document.all.tags(str);
        return document.all.tags(str);
    } 
} 

if (document.all) 
    document.getElementsByTagName = ie_getElementsByTagName 

function test ()
{
	alert ('pass');
}

function getObj (sName, sType)
{
	var items = document.getElementsByTagName (sType);
	
	for (var i=0; i<items.length; i++)
		if (items[i].name == sName)
			return items[i];
			
	return null;
}



function addOption (ctrl, iIndex, value, text, selectedValue)
{
    ctrl.options[iIndex] = new Option (text, value);
    if (selectedValue == value)
        ctrl.options[iIndex].selected = true;
}

function popup (url, title, width, height)
{    
    window.open(
    		url, title, 'width=' + width + ',height='+ height +
    		',status=no,resizable=no,top=200,left=200,dependent=yes,alwaysRaised=yes'
    	);
}

// SULWARE : JULY 2008
//
function GetOption (lb, iIndex)
{
	return (lb.options[iIndex].text);
}

function GetOptionsFile (lb)
{
	// go through the passed in list box and create a comma delimmeted string containing all product names...
	//
	var sRC = '';
	var sExtra = '';
	
	for (i =0; i<lb.length; i ++)
	{
		sRC += sExtra + lb.options[i].text;
		sExtra = ',';
	}
	
	return sRC;
}

function RemoveOption(lb, iIndex)
{
	lb.options[iIndex] = null;
}