
/* Data item type flags. These should match up with the flags
 * from config.php.
 */
var DATA_ITEM_CANDIDATE = 100;
var DATA_ITEM_COMPANY   = 200;
var DATA_ITEM_CONTACT   = 300;
var DATA_ITEM_JOBORDER  = 400;

/* Set by TemplateUtility drawing headers. */


/* Default timeout for AJAX requests; 15 seconds. */
var AJAX_TIMEOUT = 30000;

/**
 * Returns true if the string is a valid positive integer.
 *
 * @return boolean
 */
function stringIsNumeric(string)
{
    for (var i = 0; i < string.length; i++)
    {
        var character = string.charAt(i);
        if ((character < '0') || (character > '9'))
        {
            return false;
        }
    }

    return true;
}

/**
 * Changes a parent document block's style attribute to make it hidden (by id).
 *
 * @return void
 */
function hideParentBlock(elementID)
{
    element = parent.document.getElementById(elementID);
    element.parentNode.removeChild(element);
}

/**
 * Changes a parent document block's style attribute to make it hidden (by id).
 *
 * @return void
 */
function showParentBlock(elementID)
{
    element = parent.document.getElementById(elementID);
    element.parentNode.removeChild(element);
}

/**
 * Opens a centered popup window.
 *
 * @return void
 */
function openCenteredPopup(url, name, width, height, scrollBars)
{
    var optionString;

    optionString  = 'width=' + width + ',height=' + height;
    optionString += ',top=' + ((screen.availHeight - height) / 2) + ',left=' + ((screen.availWidth - width) / 2);
    optionString += ',scrollbars=';
    optionString += (scrollBars ? 'yes' : 'no');

    /* Open the new window. */
    newWindow = window.open(url, name, optionString);

    /* If this window (parent) has focus, give focus to the popup (child). */
    if (window.focus)
    {
        newWindow.focus();
    }
}

/**
 * Redirects the browser to a url.
 *
 * @return void
 */
function goToURL(url)
{
    window.location = url;
}

/**
 * Redirects the browser to a url.
 *
 * @return void
 */
function parentGoToURL(url)
{
    parent.window.location = url;
}

function parentHidePopWin()
{
    parent.hidePopWin();
}

function parentHidePopWinRefresh()
{
    parent.hidePopWinRefresh();
}

function parentSetPopTitle(title)
{
    parent.setPopTitle(title);
}

/**
 * Replaces HTML special characters in text to be output-safe.
 *
 * @param string text to escape
 * @return string escaped text
 */
function escapeHTML(text)
{
    text = text.replace('&', '&amp;');
    text = text.replace('<', '&lt;');
    text = text.replace('>', '&gt;');
    text = text.replace('"', '&quot;');
    text = text.replace("'", '&apos;');

    return text;
}

/**
 * Replaces output-save HTML with real text characters.
 *
 * @param string text to unescape
 * @return string escaped text
 */
function unEscapeHTML(text)
{
    text = text.replace('&amp;', '&');
    text = text.replace('&lt;', '<');
    text = text.replace('&gt;', '>');
    text = text.replace('&quot;', '"');
    text = text.replace('&apos;', "'");

    return text;
}

/**
 * Encodes text for transmission via HTTP.
 *
 * @param string text to encode
 * @return string encoded text
 */
function urlEncode(text)
{
    /* Force JavaScript to always treat 'text' as a string. */
    text += '';

    /* encodeURIComponent() doesn't handle the ' character. */
    text = text.replace(/\'/g, '%27');
    
    /* Don't use escape(), as it doesn't properly handle UTF-8. */
    text = encodeURIComponent(text);

    return text;
}

/**
 * Acts the same as PHP's urldecode.
 *
 * @param string text to unescape
 * @return string escaped text
 */
function urlDecode(text)
{
	while (text.indexOf('+') != -1)
	{
    	text = text.replace('+', '%20');
	}
	
    /* Don't use unescape(), as it doesn't properly handle UTF-8. */
	text = decodeURIComponent(text);

    return text;
}

/**
 * Converts a JavaScript array to a seralize()-formatted PHP array in string
 * format.
 *
 * PHP: $myArray = unserialize(urldecode($_POST['myArray']));
 * Remember this is unsafe input and it should not be trusted!
 *
 * Pass this through urlEncode() (above) before adding to a request.
 */
function serializeArray(array)
{
    var string = 'a:' + array.length + ':{';
    
    for (var i = 0; i < array.length; ++i)
    {
        string += 'i:' + i + ';s:' + String(array[i]).length + ':"'
            + String(array[i]) + '";';
    }
    
    return string + '}';
}

/**
 * Removes leading and trailing whitespace from text.
 *
 * @param string text to clean up
 * @return string cleaned string
 */
function trim(text)
{
  //console.log(text);  
  return text.replace(/^\s*|\s*$/g, '');
}



/*
 ****************************************************************************
 * Notes / Job Description Truncation
 ****************************************************************************
 */


showFullDescription = false;
showFullNotes       = false;

function toggleDescription()
{
    var shortNode = document.getElementById('shortDescription');
    var fullNode  = document.getElementById('fullDescription');

    toggleNode(showFullDescription, shortNode, fullNode);

    if (showFullDescription == true)
    {
        showFullDescription = false;
    }
    else
    {
        showFullDescription = true;
    }
}

function toggleNotes()
{
    var shortNode = document.getElementById('shortNotes');
    var fullNode  = document.getElementById('fullNotes');

    toggleNode(showFullNotes, shortNode, fullNode);

    if (showFullNotes == true)
    {
        showFullNotes = false;
    }
    else
    {
        showFullNotes = true;
    }
}

function toggleNode(showFull, shortNode, fullNode)
{
    if (showFull == true)
    {
        shortNode.style.display = 'block';
        fullNode.style.display  = 'none';
    }
    else
    {
        shortNode.style.display = 'none';
        fullNode.style.display  = 'block';
    }
}



/* Returns the value of the radio button that is selected from a radio button
 * group.
 */
function getCheckedValue(radioObj)
{
    if (!radioObj)
    {
        return '';
    }

    var radioLength = radioObj.length;
    if (typeof(radioLength) == 'undefined')
    {
        if (radioObj.checked)
        {
            return radioObj.value;
        }

        return '';
    }

    for (var i = 0; i < radioLength; i++)
    {
        if (radioObj[i].checked)
        {
            return radioObj[i].value;
        }
    }

    return '';
}

/* Checks the specified radio button out of the radio button group by value. */
function setCheckedValue(radioObj, newValue)
{
    if (!radioObj)
    {
        return;
    }

    var radioLength = radioObj.length;
    if (typeof(radioLength) == 'undefined')
    {
        radioObj.checked = (radioObj.value == newValue.toString());
        return;
    }

    for (var i = 0; i < radioLength; i++)
    {
        radioObj[i].checked = false;
        if (radioObj[i].value == newValue.toString())
        {
            radioObj[i].checked = true;
        }
    }
}

function docjslib_getRealLeft(imgElem)
{
    var xPos = eval(imgElem).offsetLeft;
    var tempEl = eval(imgElem).offsetParent;

    while (tempEl != null)
    {
        xPos += tempEl.offsetLeft;
        tempEl = tempEl.offsetParent;
    }

    return xPos;
}

function docjslib_getRealTop(imgElem)
{
    var yPos = eval(imgElem).offsetTop;
    var tempEl = eval(imgElem).offsetParent;

    while (tempEl != null)
    {
        yPos += tempEl.offsetTop;
        tempEl = tempEl.offsetParent;
    }

    return yPos;
}

function findValueInArray(array, value)
{
    for (var i = 0; i < array.length; i++)
    {
        if (array[i] == value)
        {
            return i;
        }
    }

    return -1;
}

function findValueInSelectList(selectList, value)
{
    for (var i = 0; i < selectList.length; i++)
    {
        if (selectList[i].value == value)
        {
            return i;
        }
    }

    return -1;
}

if (Array.prototype.inArray == null)
{
    Array.prototype.inArray = function(value)
    {
        var i;

        for (i = 0; i < this.length; i++)
        {
            if (this[i] === value)
            {
                return true;
            }
        }

        return false;
    };
}

if (Array.prototype.push == null)
{
    Array.prototype.push = function()
    {
        for (var i = 0; i < arguments.length; i++)
        {
            this[this.length] = arguments[i];
        };

        return this.length;
    };
}

/* Event Cache uses an anonymous function to create a hidden scope chain.
 * This is to prevent scoping issues.
 */
var EventCache = function()
{
    var listEvents = [];

    /* This open-brace MUST BE on the same line as the return. */
    return {
        listEvents : listEvents,

        add : function (node, eventName, handler, useCapture)
        {
            listEvents.push(arguments);
        },

        flush : function()
        {
            var i, item;

            for (i = listEvents.length - 1; i >= 0; i = i - 1)
            {
                item = listEvents[i];

                if (item[0].removeEventListener)
                {
                    item[0].removeEventListener(item[1], item[2], item[3]);
                };

                /* From this point on we need the event names to be prefixed
                 * with 'on". */
                if (item[1].substring(0, 2) != 'on')
                {
                    item[1] = 'on' + item[1];
                };

                if (item[0].detachEvent)
                {
                    item[0].detachEvent(item[1], item[2]);
                };

                item[0][item[1]] = null;
            };
        }
    };
}();

function addEvent(obj, type, fn, useCapture)
{
    if (obj.addEventListener)
    {
        obj.addEventListener(type, fn, useCapture);
        EventCache.add(obj, type, fn, useCapture);
    }
    else if (obj.attachEvent)
    {
        obj['e' + type + fn] = fn;
        obj[type + fn] = function()
        {
            obj['e' + type + fn](window.event);
        }
        obj.attachEvent('on' + type, obj[type + fn]);
        EventCache.add(obj, type, fn, useCapture);
    }
    else
    {
        //alert('Handler could not be attached.');
    }
}

function removeEvent(obj, type, fn, useCapture)
{
    if (obj.removeEventListener)
    {
        obj.removeEventListener(type, fn, useCapture);
        return true;
    }

    if (obj.detachEvent)
    {
        return obj.detachEvent('on' + type, fn);
    }

    //alert('Handler could not be removed.');
}

function checkQuickSearchForm(form)
{
    var fieldValue = document.getElementById('quickSearchFor').value;
    var fieldLabel = document.getElementById('quickSearchLabel');

    if (fieldValue == '')
    {
        fieldLabel.style.color = '#ff0000';
        return false;
    }

    fieldLabel.style.color = '#000';

    return true;
}

/* This executes all the <script> tags in dynamically loaded JavaScript. */
function execJS(text)
{
    var working = text;

    var pos = working.indexOf('<script');
    while (pos != -1)
    {
        working = working.substring(pos);
        pos = working.indexOf('>');
        if (pos == -1)
        {
            return;
        }
        working = working.substring(pos);
        pos = working.indexOf('</script>');
        var js = working.substring(1,pos);
        working = working.substring(pos);
        pos = working.indexOf('<script');
        eval(js);
    }
}



function rot13(theString)
{ 
	return theString.replace(/[a-zA-Z]/g, function(c)
	    {
		    return String.fromCharCode((c <= "Z" ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26);
	    }
	);
};

/*
PROJECT: Javascript Based Base64 Encoding and Decoding Engine

DATE: 02/10/2004

AUTHOR: Adrian Bacon

COPYRIGHT: You are free to use this code as you see fit provided
that you send any changes or modifications back to me.
*/
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
"abcdefghijklmnopqrstuvwxyz" +
"0123456789+/=";

function decode64(input)
{
   var output = "";
   var chr1, chr2, chr3;
   var enc1, enc2, enc3, enc4;
   var i = 0;

   // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
   input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

   do {
      enc1 = keyStr.indexOf(input.charAt(i++));
      enc2 = keyStr.indexOf(input.charAt(i++));
      enc3 = keyStr.indexOf(input.charAt(i++));
      enc4 = keyStr.indexOf(input.charAt(i++));

      chr1 = (enc1 << 2) | (enc2 >> 4);
      chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
      chr3 = ((enc3 & 3) << 6) | enc4;

      output = output + String.fromCharCode(chr1);

      if (enc3 != 64) {
         output = output + String.fromCharCode(chr2);
      }
      if (enc4 != 64) {
         output = output + String.fromCharCode(chr3);
      }
   } while (i < input.length);

   return output;
}







function GetSelectedItem(sObj) {

	var chosen = new Array();
	
	i = 0;
	y=0;
    
	Obj = document.getElementById(sObj);

	


	if(Obj.type==undefined)
	{
		field = sObj+'[]';
		var boxes = document.getElementsByName(field);
	//	alert(field + " : " +  boxes.length);

		for( var i=0; i < boxes.length; i++ ) {
				
				
				
				if (boxes[i].checked) {
						pnode = boxes[i].parentNode;
						pnodeName='';

						for(var l=0; l<pnode.attributes.length; l++)
						{
							if(pnode.attributes[l].nodeName == 'id')
							{ 
								pnodeName = pnode.attributes[l].nodeValue ;

							}
						}

						chosen[y] = new Array();
						chosen[y] =new Array(boxes[i].id, boxes[i].value, pnodeName );
						y++;
				}
				
		}
		
	}else
	{
		len = Obj.length;
		for (i = 0; i < len; i++) {
			if (Obj[i].selected) {
				chosen[y] = new Array();
				//alert(Obj.parentNode);

				chosen[y] =new Array(Obj[i].text, Obj[i].value);
				y++;
				
			}
		}
	}

	
	
	return chosen;
} 

function GetItem(sObj) {
	Obj = document.getElementById(sObj);
	len = Obj.length;
	i = 0
	var chosen = new Array();
	y=0;
	for (i = 0; i < len; i++) {
		
			chosen[y] = new Array();
			chosen[y] =new Array(Obj[i].text, Obj[i].value);
			y++;
			
		
	}

	return chosen;
} 


function getDiv(targetDiv)
{
	var allInsideElements= new Array();
	var x=0;
	
	cn = document.getElementById(targetDiv).childNodes;
	
	

  for (var i = 0; i < cn.length; i++) 
  {
    //alert( "i='" + i + "', n='" + cn[i].name + "', nt='" + cn[i].nodeType + "', nv='" + cn[i].nodeValue + "'" );  
    if ( cn[i].nodeType==1 ){
      	allInsideElements[x]=cn[i].name;
		x++;
	}

  }
  return allInsideElements;

}
function has(myArray, value) {
	for (var i = 0; i < myArray.length; i++) 
	{
		if (myArray[i]== value) {
			return true;
		}
	}
	return false;
};
function childSelectedItem(tObjClickPos, selInd , objPreifix, targetElement)
{			

		
			var ourElements = new Array();
			var elem = new Array();
			var msg='';
			var firstSelectedItems = new Array();
			var secondSelectedItems = new Array();
			var prevSelectedListItems = new Array();
			ourElements	= getDiv(targetElement);
			prevIndex=0;
			var tempArray = new Array();
			var SelectedArray = new Array;
			var DynamicArray = new Array;
			var currentSelBoxId;
			var currentId;
			var parentId;
			var parentIds= new Array();
			var parentSelBoxId;
			var parentElements = new Array();
			var childElements = new Array();
			tClickPos= tObjClickPos.split(objPreifix);
			ClickPos= tClickPos[1];
			var selValues= new Array();
			var selInd=0;
			var allItems=0;
			var tmpvalues=0;
			var selValuesIndex= new Array();
			//alert(ourElements.length + ", Click Pos" + ClickPos);
			// code By shuvendu
		

			for(x=0; x<eval(ourElements.length); x++)
			{	
				//alert("Test:"+tObjClickPos +" ,No of loops(x):"+x);
				var msg= "";
				var secSelectedVal = new Array();
				var removeElements = new Array();
				var selBox=document.getElementById(objPreifix+x);
				firstSelectedValues = GetSelectedItem(objPreifix+x);
				allItems = GetItem(objPreifix+x);
				
				if(x>=ClickPos)
				{
					if(x==ClickPos)
					{
						var selBox=document.getElementById(objPreifix+(x));
						if(!selBox.length){
							document.getElementById(targetElement).removeChild(selBox);
						}


					}else
					{

						var selBox=document.getElementById(objPreifix+(x));
						parentNode = selBox.parentNode;
						document.getElementById(targetElement).removeChild(selBox);
					}
					
				}
				


				eval('SEL' + x + ' = new Array()');
				
				for(m=0; m<firstSelectedValues.length; m++)
				{
					eval('SEL' + x + ' = firstSelectedValues');

				
				}
				
				

			}
			
}

function removeByIndex(arrayName,arrayIndex){ 
	arrayName.splice(arrayIndex,1); 
}
function inArray(elem, ary)
{	
	for(j=0; j<ary.length; j++)
	{
		if(ary[j][1].split("-")[0]==elem)
		{
			return true;
		}
	}
	return false;

}
function removeByIndex(arrayName,arrayIndex){ 
	arrayName.splice(arrayIndex,1); 
}
function isArray(obj) {
	if (obj.constructor.toString().indexOf("Array") == -1)
		return false;
	else
		return true;
}
function get_firstchild(n)
{
x=n.firstChild;
while (x.nodeType!=1)
  {
  x=x.nextSibling;
  }
return x;
}


function checkPublic(e)
{
    var styleSheet = document.getElementById('displayQuestionnaires').style;

    if (e.checked)
    {
        if (styleSheet.display)
        {
            styleSheet.display = 'table-row';
        }
    }
    else
    {
        if (styleSheet.display)
        {
            styleSheet.display = 'none';
        }
    }
}


function getXMLNodeValue(val)
{

	return trim(validValue(val))
}

function validValue(nodeName)
{

	if(nodeName.firstChild)
	{
		return  urlDecode(nodeName.firstChild.nodeValue);

	}else
	{ 
		return '';
	}	

}


function textChanged(txtVal, txtElement)
{
	
	txtVal= document.getElementById(txtElement).value;

}


function mil(str) {
  var t = str.split(':')
  var hh = parseInt(t[0],10);
  var mm = parseInt(t[1],10);
  
  hh += (str.toLowerCase().indexOf('pm')!=-1)?12:0;
  
  var d = new Date(2009,0,1,hh,mm,00); // just a date not around daylightsaving
  return d.getTime();
}
 
function checkDates(sDate, eDate , sTime , eTime)
{
		

	if (Date.parse(sDate) > Date.parse(eDate))
	{
		alert("The dates you selected are not valid! The from date must be after the to date!");
		
		return false;
	}
	else if(Date.parse(sDate) == Date.parse(eDate))
	{
		
		
		if (mil(sTime)>mil(eTime))
		{	
			
			alert("The From time must be before the To time on the same day!");
			return false;
		}
	}
	return true;
}
/**
 * Gets an XMLHTTP / XMLHttpRequest object for AJAX use.
 *
 * @return void
 */

   var xmlHttp;
function AJAX_getXMLHttpObject()
{
    /* Array of possible names for the Microsoft XMLHTTP ActiveX. */
    var MSXML_XMLHTTP_PROGIDS = new Array(
        'Microsoft.XMLHTTP',
        'MSXML2.XMLHTTP',
        'MSXML2.XMLHTTP.5.0',
        'MSXML2.XMLHTTP.4.0',
        'MSXML2.XMLHTTP.3.0'
    );

   

    try
    {
        xmlHttp = new XMLHttpRequest();
    }
    catch (errorA)
    {
        var found = false;

        /* Try to figure out what Microsoft might have called their ActiveX control. */
        for (var i = 0; (i < MSXML_XMLHTTP_PROGIDS.length && !found); i++)
        {
            try
            {
                xmlHttp = new ActiveXObject(MSXML_XMLHTTP_PROGIDS[i]);
                found = true;
            }
            catch (errorB)
            {
            }
        }

        if (!found)
        {
            return null;
        }
    }

    return xmlHttp;
}
function AJAX_callFunction(http, funcName, POSTData, callBack,
    extraTimeout, sessionCookie, silentTimeout, disableBuffering)
{
    /* Prepend the function name to the postdata. */
    var newPOSTData = 'action=' + funcName + POSTData ;

    if (disableBuffering)
    {
        newPOSTData += '&nobuffer=true';
    }	
    AJAX_POST(
        http,
        'index.php',
        newPOSTData,
        callBack,
        (AJAX_TIMEOUT + extraTimeout),
        sessionCookie,
        silentTimeout
    );
}

/**
 * Sends an AJAX HTTP POST request back to the specified URL.
 *
 * @return void
 */
function AJAX_POST(http, url, POSTData, callBack, timeout, sessionCookie, silentTimeout)
{
    /* Add a random hash to the POST data to keep IE from caching it. */
    POSTData += AJAX_getRandomPOSTHash();
    /* Append the session cookie if we're using secure AJAX. */
    if (sessionCookie != null)
    {
        POSTData += AJAX_getPOSTSessionID(sessionCookie);
    }

    /* Uncomment for debugging. */
	// alert("http://localhost/bidcelebrity/admin/celebrity/"+url + "?"+POSTData);
	var strHref = window.location.href.substring(0, window.location.href.indexOf("?"));
	//var strHref = ""
	//alert(POSTData);
	//alert(caturl);

	if((POSTData.indexOf("getUsers")>0 || POSTData.indexOf("getCharity")>0 ) && POSTData.indexOf("dataName")<=0 )
	{
		//window.location.href =url + "?"+POSTData;
		url= strHref + "?"+POSTData;
		//window.location.href=url;


	} else if(POSTData.indexOf("getUserCategory")>0 )
	{

		url= strHref + "?"+POSTData;

	}else if(POSTData.indexOf("getOrgCategory")>0 )
	{
		url= strHref + "?"+POSTData;
		//popup = window.open(url,'windowName',"location=1,status=1,scrollbars=1,width=400,height=600");
	}else if(caturl!='')
	{
			strHref = caturl;
			url= strHref + "?"+POSTData;
	}	
	else
	{
		url= strHref + "?"+POSTData;
		//alert(url);

		//popup = window.open(url,'windowName',"location=1,status=1,scrollbars=1,width=400,height=600");
		//window.location.href ="http://localhost/bidcelebrity/admin/celebrity/"+url + "?"+POSTData;


	}
	

    /* Open the socket and send POST headers. */
    http.open('POST', url, true);
    AJAX_sendPOSTHeaders(http, POSTData.length);

    /* Callback function. */
	//alert(callBack);
    http.onreadystatechange = callBack;

    /* Send the data. */
    http.send(POSTData);
	xmlHttp=http;

	isSent = true;
	


    /* Abort after timeout expires. */
    if (timeout != 0)
    {
        var timeoutCallback = function()
        {
            if (!AJAX_isCallInProgress(http))
            {
                return;
            }

           http.abort();

           if (!silentTimeout)
           {
               alert(
                   'Timeout on AJAX query after ' + (timeout / 1000) +
                   ' seconds. Please refresh the page and try again.'
               );
           }
        }

        window.setTimeout(timeoutCallback, timeout);
    }
}
/**
 * Returns a random hash to append to an HTTP POST to keep data from being
 * cached (URL-encoded).
 *
 * @return random POST variable hash
 */
function AJAX_getRandomPOSTHash()
{
    return '&rhash=' + urlEncode(parseInt(Math.random() * 99999999).toString());
}

/**
 * Returns a formatted session cookie to append to an HTTP POST.
 *
 * @return formatted cookie
 */
function AJAX_getPOSTSessionID(sessionCookie)
{
    return '&' + sessionCookie;
}
/**
 * Sends HTTP content headers for an AJAX POST request.
 *
 * @return void
 */
function AJAX_sendPOSTHeaders(http, contentLength)
{
    http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
    http.setRequestHeader('Content-length', contentLength);
    http.setRequestHeader('Connection', 'close');
	http.CacheControl = "no-cache";
	http.setRequestHeader('Pragma', 'no-cache');
	http.Expires = -1;
}

/**
 * Is an XMLHTTP object being used for an active call?
 *
 * @return boolean is object active
 */
function AJAX_isCallInProgress(http)
{
    switch (http.readyState)
    {
        case 1:
        case 2:
        case 3:
            return true;
            break;
    }

    return false;
}

function hidediv(divname) {

  //console.log(divname);

	if (document.getElementById)
	{ // DOM3 = IE5, NS6
		document.getElementById(divname).style.display = 'none';
	}
	else
	{
		if (document.layers)
		{ // Netscape 4
			eval("document."+divname+".display = 'none'");
		}
		else
		{ // IE 4
			eval("document.all."+divname+".style.display= 'none'");
		}
	}
}

function showdiv(divname) {
	if (document.getElementById)
	{ // DOM3 = IE5, NS6
		document.getElementById(divname).style.display = 'block';
	}
	else
	{
		if (document.layers) { // Netscape 4
			eval("document."+divname+".display  = 'block'");
		}
		else
		{ // IE 4
			eval("document.all."+divname+".style.display = 'block'");
		}
	}
}
