/**
 *	Copyright 2008 Scott Nelson All Rights Reserved. Use is prohibited without express written permission
 **/
var initialScrollHeight;
function checkScrollBars()
{
	var cssSheets		= null;
	var sheetRules		= null;
	var ruleName		= null;
	var classRule		= null;
	if(initialScrollHeight && document.body.scrollHeight>initialScrollHeight)
	{
		cssSheets = document.styleSheets;
		
		for(i=0; i < cssSheets.length; i++)
		{
			if(cssSheets[i] && cssSheets[i].href && cssSheets[i].href.length > 0 && cssSheets[i].href.match('fyw.css'))
			{
				if(cssSheets[i].cssRules){ sheetRules = cssSheets[i].cssRules;}
				else {sheetRules = cssSheets[i].rules;}
				break;
			}
		}	
		for(i=0; i < sheetRules.length; i++)
		{
			ruleName = sheetRules[i].selectorText.toLowerCase();
			if(ruleName=='html')
			{
				classRule = sheetRules[i];
				break;
			}
		}
		//COMMENTED OUT WHILE CHECKING BUG
//		if(classRule!=null){classRule.style.overflow='';}
	}
}

	function showComments(index)
	{
		document.getElementById('commentsDiv').style.display = '';
		document.getElementById('commentIcon').style.display = 'none';
		document.getElementById('comment'+index).style.color = '#000000';
		if(index <=7){setTimeout("showComments("+(++index)+")",1000);}	
	}
	function displayExpandedText(textId)
	{
		var setX = eval(document.getElementById('detailTextPosition').offsetLeft);
		var setY = eval(document.getElementById('detailTextPosition').offsetTop);
		document.getElementById('expandedText').innerHTML = document.getElementById(textId).innerHTML;
		document.getElementById('expandedTextHeader').innerHTML = document.getElementById(textId+'Header').innerHTML;
		document.getElementById('expandedTextDiv').style.display = '';
		document.getElementById('expandedTextDiv').style.top = (setY+10)+'px';
		document.getElementById('expandedTextDiv').style.left = (setX+10)+'px';
	}
	
	var showOnTo;
	
	
	function showYouKnow(index)
	{
		document.getElementById('youKnow'+index).style.color = '#000000';
		if(index <=7){setTimeout("showYouKnow("+(++index)+")",1000);}
	}
	
	function showSection(sectionId)
	{
		var section = sectionId.substring(0, 8);
		var sectionDiv = document.getElementById(section);
		if(sectionDiv.style.display=='none')
		{
			sectionDiv.style.display = '';
			document.getElementById(sectionId).src = 'images/iconMinus.gif';
			document.getElementById(sectionId).alt = 'Close';
		}
		else
		{
			sectionDiv.style.display = 'none';
			document.getElementById(sectionId).src = 'images/iconPlus.gif';
			document.getElementById(sectionId).alt = 'More';
		}
	}
	
	function loadAjaxContentDoc(url, div, displayFunction)
{
	var xmlhttp;
	xmlhttp=null;
/*
	 try {
    netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
   } catch (e) {
//    alert("Permission UniversalBrowserRead denied.");
   }
*/	
	if (window.XMLHttpRequest)// code for IE7, Firefox, Mozilla, etc.
	{
		xmlhttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)// code for IE5, IE6
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}

	if(xmlhttp.overrideMimeType)xmlhttp.overrideMimeType('text/xml');
	if (xmlhttp!=null)
	{
		xmlhttp.onreadystatechange=function() 
		{ 
        	if (xmlhttp.readyState==4)
        	{
//            	if (xmlhttp.status==200)
                displayFunction(xmlhttp, div);
			}
			
    	}

		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}
//TODO: GET ERROR CONTENT FROM BUNDLES
}

function onResponse(xmlhttp, div)
{
	if (xmlhttp.status==200)document.getElementById(div).innerHTML = xmlhttp.responseText;
/*
	else 
	{
		document.getElementById(div).innerHTML = "No content available";
		document.getElementById(div).style.margin='0';
		document.getElementById(div).style.padding='0';
		document.getElementById(div).style.height='20px';
	}
*/	
}
/**
 *	Copyright 2008 Scott Nelson All Rights Reserved. Use is prohibited without express written permission
 **/

