function makeLarger(){
	createCookie('fontSize','2','365');
	try{
	  targetElement=document.getElementById('content').className = "font_basesize-large";
	  targetElement=document.getElementById('mesa').className = "font_basesize-large";
	} catch(oException){
	   try{
	    targetElement=document.getElementById('content_v2').className = "font_basesize-large";
	   } catch(oException){
	   }
	}
	   
	//targetElement=document.getElementById('content_v2').className = "font_basesize-large";
	if (document.getElementById('enlarge_icon') != null){
		document.getElementById('enlarge_icon').innerHTML = '<a href="#" onclick="makeSmaller();"><img src="/images/common/toolbar-enlarge_text.gif" alt="Reduce Text" border="0" title="Reduce Text" /></a>';
	}
	if (document.getElementById('enlarge_text') != null){
		document.getElementById('enlarge_text').innerHTML = '<a href="#" onclick="makeSmaller();"><nobr>Reduce Text</nobr></a>';
	}
	if (document.getElementById('info_program_hd') != null){
		document.getElementById('info_program_hd').innerHTML = '<img src="/images/sub/gout_get_facts_lg.gif" alt="Gout: Get the facts" title="Gout: Get the facts" border="0" />';
	}
	if (document.getElementById('gout_cause') != null){
		document.getElementById('gout_cause').innerHTML = '<img src="/images/sub/gout_cause_lg.gif" alt="You know the cause of gout. Now get the latest information." title="You know the cause of gout. Now get the latest information." border="0" />';
	}
	if (document.getElementById('gout_diet') != null){
		document.getElementById('gout_diet').innerHTML = '<img src="/images/sub/gout_diet_lg.gif" alt="Gout and diet: It&#039;s not as simple as you think." title="Gout and diet: It&#039;s not as simple as you think." border="0" />';
	}
	if (document.getElementById('gout_facts') != null){
		document.getElementById('gout_facts').innerHTML = '<img src="/images/sub/gout_know_facts_lg.gif" alt="You know the facts about gout. Now get the latest information." title="You know the facts about gout. Now get the latest information." border="0" />';
	}
	if (document.getElementById('gout_problems') != null){
		document.getElementById('gout_problems').innerHTML = '<img src="/images/sub/gout_problem_lg.gif" alt="Gout is an everyday problem. get the latest information about dealing with it." title="Gout is an everyday problem. get the latest information about dealing with it." border="0" />';
	}
}

function makeSmaller(){
	createCookie('fontSize','1','365');
	try{
	  targetElement=document.getElementById('content').className = "font_basesize-normal";
	  targetElement=document.getElementById('mesa').className = "font_basesize-normal";
	} catch(oException){
	   try{
	    targetElement=document.getElementById('content_v2').className = "font_basesize-normal";
	   } catch(oException){
	   }
	}
	//targetElement=document.getElementById('content_v2'||'content').className = "font_basesize-normal";
	if (document.getElementById('enlarge_icon') != null){
		document.getElementById('enlarge_icon').innerHTML = '<a href="#" onclick="makeLarger();"><img src="/images/common/toolbar-enlarge_text.gif" alt="Enlarge Text" border="0" title="Enlarge Text" /></a>';
	}
	if (document.getElementById('enlarge_text') != null){
		document.getElementById('enlarge_text').innerHTML = '<a href="#" onclick="makeLarger();"><nobr>Enlarge Text</nobr></a>';
	}
	if (document.getElementById('info_program_hd') != null){
		document.getElementById('info_program_hd').innerHTML = '<img src="/images/sub/gout_get_facts.gif" alt="Gout: Get the facts" title="Gout: Get the facts" border="0" />';
	}
	if (document.getElementById('gout_cause') != null){
		document.getElementById('gout_cause').innerHTML = '<img src="/images/sub/gout_cause.gif" alt="You know the cause of gout. Now get the latest information." title="You know the cause of gout. Now get the latest information." border="0" />';
	}
	if (document.getElementById('gout_diet') != null){
		document.getElementById('gout_diet').innerHTML = '<img src="/images/sub/gout_diet.gif" alt="Gout and diet: It&#039;s not as simple as you think." title="Gout and diet: It&#039;s not as simple as you think." border="0" />';
	}
	if (document.getElementById('gout_facts') != null){
		document.getElementById('gout_facts').innerHTML = '<img src="/images/sub/gout_know_facts.gif" alt="You know the facts about gout. Now get the latest information." title="You know the facts about gout. Now get the latest information." border="0" />';
	}
	if (document.getElementById('gout_problems') != null){
		document.getElementById('gout_problems').innerHTML = '<img src="/images/sub/gout_problem.gif" alt="Gout is an everyday problem. get the latest information about dealing with it." title="Gout is an everyday problem. get the latest information about dealing with it." border="0" />';
	}
}

function makeLargerHome(){
	createCookie('fontSize','2','365');
	targetElement=document.getElementById('body').className = "font_basesize-large";
	document.getElementById('enlarge_type').innerHTML = '<a href="#" onclick="makeSmallerHome();"><img src="/images/home/nav-bottom_reduce.jpg" alt="Reduce Text" title="Reduce Text" border="0" /></a>';
	document.getElementById('bottom_callout1_hd').innerHTML = '<img src="/images/home/callout_hdr_get_large.gif" alt="Online Gout Study" title="Online Gout Study" border="0" />';
	document.getElementById('bottom_callout2_hd').innerHTML = '<img src="/images/sub/gout_get_facts_lg.gif" alt="Gout.com Information Program" title="Gout: Get the facts" border="0" />';
	document.getElementById('bottom_callout3_hd').innerHTML = '<img src="/images/home/callout_hdr_qp_large.gif" alt="Quick Poll" title="Quick Poll" border="0" />';
}

function makeSmallerHome(){
	createCookie('fontSize','1','365');
	targetElement=document.getElementById('body').className = "font_basesize-normal";
	document.getElementById('enlarge_type').innerHTML = '<a href="#" onclick="makeLargerHome();"><img src="/images/home/nav-bottom_enlarge.jpg" alt="Enlarge Text" title="Enlarge Text" border="0" /></a>';
	document.getElementById('bottom_callout1_hd').innerHTML = '<img src="/images/home/callout_hdr_get_through.gif" alt="Online Gout Study" title="Online Gout Study" border="0" />';
	document.getElementById('bottom_callout2_hd').innerHTML = '<img src="/images/sub/gout_get_facts.gif" alt="Gout.com Information Program" title="Gout: Get the facts" border="0" />';
	document.getElementById('bottom_callout3_hd').innerHTML = '<img src="/images/home/callout_hdr_quick_poll.gif" alt="Quick Poll" title="Quick Poll" border="0" />';
}

function sizeToggle(){
	var cookie = readCookie('fontSize');
	if(cookie == '1' || cookie == null) {
		makeSmaller();
	}
	else {
		makeLarger();
	}
}

function sizeToggleHome(){
	var cookie = readCookie('fontSize');
	if(cookie == '1' || cookie == null) {
		makeSmallerHome();
	}
	else {
		makeLargerHome();
	}
}

function createCookie(name,value,days){
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	var ck = name+"="+value+expires+"; path=/";
//	if (days != -1) alert('Cookie\n' + ck + '\ncreated');
	document.cookie = ck;
}

function readCookie(name){
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i<ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name){
	createCookie(name,"",-1);
}

function backToPage() {
var targetURL;
var backToUrl = viewCookie("backToUrl"); // grab the tracked status
alert("value of cookie: " + backToUrl);	
	if (backToUrl == null) {
    var ref = document.referrer;
    var currentDomain = document.domain;
    var newRef = ref.indexOf(currentDomain);
    var fullDomain = ref.substr(0, newRef + currentDomain.length);
    ref = ref.replace(fullDomain, "");
    setCookie("backToUrl", ref, 10000);
    targetURL = ref;
    } else {
    targetURL = viewCookie("backToUrl");
    }
    var backToLink = document.createElement("a");
    backToLink.setAttribute('href', targetURL);
    backToLink.setAttribute('id', "Subtiertemplate1_aBack");
    backToLink.setAttribute("onclick","removeCookie('backToPage')");        
    
    var backToImage = document.createElement("img");
            backToImage.setAttribute('src',"/images/sub/btn_back.jpg");
            backToImage.setAttribute('alt',"go back to previous page");
            backToImage.setAttribute('title',"Go back to previous page");
           
            
            // Attach this to our hard coded DIV
            destination = document.getElementById("backToPage");
            backToLink.appendChild(backToImage);
            destination.appendChild(backToLink);
            document.getElementById("backToPage").innerHTML = document.getElementById("backToPage").innerHTML; // Necessary for IE6
            }
            
            function setCookie(cookieName,cookieValue,nDays) {
            var today = new Date();
            var expire = new Date();
                if (nDays==null || nDays==0) {
                nDays=1;
                }
            expire.setTime(today.getTime() + 3600000*24*nDays);
            document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString();
            }

            function viewCookie(name) {
           var nameEQ = name + "=";
           var ca = document.cookie.split(';');
				for(var i=0;i<ca.length;i++) {
				var c = ca[i];
					while (c.charAt(0)==' ') c = c.substring(1,c.length);
						if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
				}
            
            return null;
            }
            
            
            function removeCookie(cookieName) {
            setCookie(cookieName, null, -1);
           
           // location.href = urlPath;
            }

//function trackUser() {
//  var tracked = readCookie("tracked"); // grab the tracked status
//	if (tracked == null) {
//	  var ref = document.referrer;/
//		createCookie("tracked", ref, 1000000);
//	}
//}
function getCookie(){
   var temp = readCookie("tracked");
   eraseCookie("tracked");
   return temp;
}
function searchSubmit() {
    searchText = document.search.searchText.value;
    window.location = "http://search.atomz.com/search/?sp-q=" + searchText + "&sp-a=sp100340f9&sp-p=all&sp-f=ISO-8859-1";
}
currentQuestionSet = "1_4";
function showQuestionSet(target){

	currentQuestions = document.getElementById("questions_"+currentQuestionSet);
	targetQuestions = document.getElementById("questions_"+target);
	if(currentQuestions) currentQuestions.className = "hidden";
	if(targetQuestions) targetQuestions.className = "visible";
	currentQuestionSet = target;
	document.getElementById("hdnPanelID").value = target;
	document.getElementById("panel1").firstChild.nodeValue = target.replace("_","-");
}
/*
function next_1_4(output){
    //set questions
    var oDiv = document.getElementById("questions_1_4");
    oDiv.style.display = "block";
    var oDiv = document.getElementById("questions_5_8");
    oDiv.style.display = "none";
    var oDiv = document.getElementById("questions_9_12");
    oDiv.style.display = "none";
}
function next_5_8(output){
    //set questions
    var oDiv = document.getElementById("questions_1_4");
    oDiv.style.display = "none";
    var oDiv = document.getElementById("questions_5_8");
    oDiv.style.display = "block";
    var oDiv = document.getElementById("questions_9_12");
    oDiv.style.display = "none";
}
function next_9_12(output){
    //set questions
    var oDiv = document.getElementById("questions_1_4");
    oDiv.style.display = "none";
    var oDiv = document.getElementById("questions_5_8");
    oDiv.style.display = "none";
    var oDiv = document.getElementById("questions_9_12");
    oDiv.style.display = "block";
}
*/
/* Function for Glossary*/

highlightTerm = function(){
var url = unescape(window.location.href).replace('+',' ');
var gt = url.split("#");
var termBgColor = "#f7e76b";
var termColor = "#427bce";
var term = document.getElementById(gt[1]);
term.style.background = termBgColor;
term.firstChild.style.display = "block";
term.firstChild.nextSibling.style.color = termColor;
}

var noneCheckedPrevState;


function disableListItems(checkBoxListId, checkBoxIndex, numOfItems, clickedID)
{
	//alert("noneCheckedPrevState: " + noneCheckedPrevState);
	var noneCheckedCurState;
	var noneCheckedStateChanged;
	var objItem;
	var objOtherItem;
	
	var objNoneOfThese = document.getElementById(checkBoxListId + '_' + checkBoxIndex);
	if (objNoneOfThese == null)
		return;
	noneCheckedCurState = objNoneOfThese.checked;
	//alert("noneCheckedCurState: " + noneCheckedCurState);
	
	if ( noneCheckedPrevState == 'undefined' && noneCheckedCurState == true)
		noneCheckedStateChanged = true;
	else if (noneCheckedPrevState == true && noneCheckedCurState == false)
		noneCheckedStateChanged = true;
	else if (noneCheckedPrevState == false && noneCheckedCurState == true)
		noneCheckedStateChanged = true;
	else
		noneCheckedStateChanged = false;
	//alert("noneCheckedStateChanged: " + noneCheckedStateChanged);

	
	//click not in "None of these" checkbox	
	if(noneCheckedStateChanged == false)
	{
		for(i = 0; i < numOfItems; i++)
		{
			objItem = document.getElementById(checkBoxListId + '_' + i);
			if (objItem == null)
				return;
			if(i != checkBoxIndex)
			{
				// Uncheck the "None of these" checkbox if any other has been checked
				if (objItem.checked == true)
					objNoneOfThese.checked = false;
			}
		}	
	}
	else
	{
		// click in "None of these" checkbox
		if (objNoneOfThese.checked == true)
		{
			for(i = 0; i < numOfItems; i++)
			{
				objOtherItem = document.getElementById(checkBoxListId + '_' + i);
				if (objOtherItem == null)
					return;
				if(i != checkBoxIndex)
				{
					// Uncheck the "None of these" checkbox if any other has been checked
					objOtherItem.checked = false
				}
			}	
		}
	}
	noneCheckedPrevState = objNoneOfThese.checked;
}




/*
//alert (clickedID);
	var chkObj = document.getElementById(checkBoxListId);
	var i = 0;
	var objItem = null;
	// Get the checkbox to verify.
	var objItemChecked = document.getElementById(checkBoxListId + '_' + checkBoxIndex);
		alert(objItemChecked.checked);
	for(i = 0; i < numOfItems; i++)
	{
		objItem = document.getElementById(checkBoxListId + '_' + i);
		if(objItem == null)
			return;
		if (objItem.checked == null)
			return;
			
		if(i != checkBoxIndex)
		{	
			if(objItem.checked == true)
			{
				// Uncheck the "none of the above" checkbox.
				objItemChecked.checked = false;
			}
		}
		else
		{
			// Loop through the checkboxes in the list.
			if (objItemChecked.checked == true)
			{
				for(i = 0; i < numOfItems; i++)
				{
					objItem = document.getElementById(checkBoxListId + '_' + i);
				
					if(i != checkBoxIndex)
					{
						// Uncheck the checkbox.
						objItem.checked = false;
					}
				}
			}
		}		
	}
*/

	
/*	// Loop through the checkboxes in the list.
	if (objItemChecked.checked == true)
	{
		for(i = 0; i < numOfItems; i++)
		{
			objItem = document.getElementById(checkBoxListId + '_' + i);
		
			if(i != checkBoxIndex)
			{
				// Uncheck the checkbox.
				objItem.checked = false;
			}
		}
	}
	else
	{
		objItemChecked.checked = false;
	}
*/
function PTP(){
   pageTracker._trackPageview('/ptp/'+pageName);
}

/***********************************************************************
   Author: Luis Tello  
   Date: 01/26/09
   
   Version 0.1   
   
   Description: This AJAX app grabs the pageName from the "path" in the URL.
   
   example:/utilities/etp_response.aspx?path=/what_is_gout/what_is_gout.aspx
   
   Parameters:path
   
   Example:Rosetta.SiteCatalyst.Ajax();
   
***********************************************************************/
   var Rosetta = Rosetta || {};
   Rosetta.SiteCatalyst = {
       Ajax: function(){      
          $(document).ready(function() {
              $(function(){
                  $.ajax({
                      url: '/includes/xml/pagedata.xml',
                      type: 'GET',
                      dataType: 'xml',
                      timeout:3000,
                      error: function(){
                        //alert('Error loading XML document');
                         
                      },
                      success: function(xml){
                          $(xml).find('page').each(function(){
                            //grab the data from xml
                            var XMLpathname = $(this).attr('pathname');
                            var Pagename = $(this).attr('pagename');
                            
                            //grab the path
                            var queryString = location.search;
                            var temp = queryString.split('=');
                            var currentPathname = temp[1];
                            
                            //compare pathnames and if so get
                            if(XMLpathname == currentPathname){
                                this.pageName = $(this).attr('pagename');
                                pageTracker._trackPageview('/etp/'+this.pageName);
                            }
                          });
                          
                      }
                  });
              })              
          }) 
       }
   };
   Rosetta.GoogleTracking = {
       Track: function(value){
         pageTracker._trackPageview(''+value);
       }
   };
   Rosetta.SiteCatalyst.Ajax();

