function TrapEnterKeyForSearch(evt,sourceTextBoxName)
{
  
 var txtValue;
	if(evt && evt.target)
	{
		if (evt.keyCode == 13)
			    { 
			        txtValue = document.getElementById(sourceTextBoxName).value;
                    RedirectToSearchURL(txtValue,'0');
                    return false;
                }
	}
	else if(window.event)
	{
		if (event.keyCode == 13)
		        { 
                    txtValue = document.getElementById(sourceTextBoxName).value;
                    RedirectToSearchURL(txtValue,'0');
                    return false;
                }
	    }
}

function RedirectToSearchURL(sourceName,option) 
{ 
    var searchURL,txtboxValue;

    if (option == '1')//button click
    {
        txtboxValue = document.getElementById(sourceName).value;
    }
    else if(option = '0')//enter key
    {
        txtboxValue = sourceName;
    }

    searchURL = "http://search.mercola.com/Results.aspx?k=" + txtboxValue   ;
	location.href = searchURL ;
}	

function CheckFormEmail(Form) 
{                    
        if (emailCheck(Form.emailAddress.value))
        {       
            return true;
        }   
        return false;            
}
					
/* new code from here June 25 2008 */

var subid;
var msgBoard;
var wheelobj;        
var textbox;

function showprogress(Loding,wheel,Subscribe,EmailAddress)  
{                
        textbox = document.getElementById(EmailAddress);
	textbox.value = textbox.value.trim();
        if (emailCheck(textbox.value))
        {
            subid = document.getElementById(Subscribe);
            msgBoard=document.getElementById(Loding);
            wheelobj=document.getElementById(wheel);  
            msgBoard.style.display="block";
            wheelobj.style.display="block";
            subid.style.display="none";  	
            setTimeout("hideprogress()",10000);
            return true;   	    	
        }
        else
        {
            return false;
        }
}

function hideprogress()
{
    msgBoard.style.display="none";
    wheelobj.style.display="none";
    subid.style.display="block";
}

function ContinueSubscription(e, buttonid,EmailAddress)
{
    textbox = document.getElementById(EmailAddress);
    var bt = document.getElementById(buttonid); 
    if (typeof bt == 'object')
    { 
        bt.disabled = false;
        if(navigator.appName.indexOf("Netscape")>(-1))
        { 
            if (e.keyCode == 13)
            { 
               if (emailCheck(textbox.value))
               {       
                    bt.click(); 
               }
               return false; 
            } 
        } 
        if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
        { 
            if (event.keyCode == 13)
            { 
               if (emailCheck(textbox.value))
               {       
                    bt.click(); 
               } 
               return false; 
            } 
        } 
     }
}


function emailCheck (emailStr) {


/* The following variable tells the rest of the function whether or not
to verify that the address ends in a two-letter country or well-known
TLD.  1 means check it, 0 means don't. */

var checkTLD=1;

/* The following is the list of known TLDs that an e-mail address must end with. */

var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;

/* The following pattern is used to check if the entered e-mail address
fits the user@domain format.  It also is used to separate the username
from the domain. */

var emailPat=/^(.+)@(.+)$/;

/* The following string represents the pattern for matching all special
characters.  We don't want to allow special characters in the address. 
These characters include ( ) < > @ , ; : \ " . [ ] */

var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";

/* The following string represents the range of characters allowed in a 
username or domainname.  It really states which chars aren't allowed.*/

var validChars="\[^\\s" + specialChars + "\]";

/* The following pattern applies if the "user" is a quoted string (in
which case, there are no rules about which characters are allowed
and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
is a legal e-mail address. */

var quotedUser="(\"[^\"]*\")";

/* The following pattern applies for domains that are IP addresses,
rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
e-mail address. NOTE: The square brackets are required. */

var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;

/* The following string represents an atom (basically a series of non-special characters.) */

var atom=validChars + '+';

/* The following string represents one word in the typical username.
For example, in john.doe@somewhere.com, john and doe are words.
Basically, a word is either an atom or quoted string. */

var word="(" + atom + "|" + quotedUser + ")";

// The following pattern describes the structure of the user

var userPat=new RegExp("^" + word + "(\\." + word + ")*$");

/* The following pattern describes the structure of a normal symbolic
domain, as opposed to ipDomainPat, shown above. */

var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");

/* Finally, let's start trying to figure out if the supplied address is valid. */

/* Begin with the coarse pattern to simply break up user@domain into
different pieces that are easy to analyze. */

var matchArray=emailStr.match(emailPat);

if (matchArray==null) {

/* Too many/few @'s or something; basically, this address doesn't
even fit the general mould of a valid e-mail address. */

alert("Please Enter Valid Email address!!");
return false;
}
var user=matchArray[1];
var domain=matchArray[2];

// Start by checking that only basic ASCII characters are in the strings (0-127).

for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("Ths username contains invalid characters. Please Enter Valid Email address!!");
return false;
   }
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("Ths domain name contains invalid characters. Please Enter Valid Email address!!");
return false;
   }
}

// See if "user" is valid 

if (user.match(userPat)==null) {

// user is not valid

alert("The username doesn't seem to be valid. Please Enter Valid Email address!!");
return false;
}

/* if the e-mail address is at an IP address (as opposed to a symbolic
host name) make sure the IP address is valid. */

var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {

// this is an IP address

for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid! Please Enter Valid Email address!!");
return false;
   }
}
return true;
}

// Domain is symbolic name.  Check if it's valid.
 
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
alert("The domain name does not seem to be valid. Try with all lower case letters. Please Enter Valid Email address!! ");
return false;
   }
}

/* domain name seems valid, but now make sure that it ends in a
known top-level domain (like com, edu, gov) or a two-letter word,
representing country (uk, nl), and that there's a hostname preceding 
the domain or country. */

if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("The address must end in a well-known domain. Please Enter Valid Email address!!");
return false;
}

// Make sure there's a host name preceding the domain.

if (len<2) {
alert("This address is missing a hostname! Please Enter Valid Email address!!");
return false;
}

// If we've gotten this far, everything's valid!
return true;
}

//  End -->


/* New code ends here june 25 2008*/



 function checkEnter(e){if(e.which || e.keyCode){  if ((e.which == 13) || (e.keyCode == 13))
   {    tempvar=document.getElementById('btnSubscribe'); tempvar.click();    return false;  }} else {return true}; }


//Open new window functions
var onet_width=725;
var onet_height=620; 
var rest_width=725;  
var rest_height=620
var oMyWin;
var oSearchWin;

function OpenPopup(url, width, height, bscrollbars,isfullscreen,type) {
	var name = "";
	var win ;
	var left, top; 
	
	
	var width1,height1;
	
	if(isfullscreen == 1 ){
		
		
	  if(type.toUpperCase() == "REST") { width1=rest_width; height1=rest_height;}
	  else {  width1=onet_width; height1=onet_height;  }
	  
	  if(navigator.userAgent.toUpperCase().indexOf("OPERA")!= -1 || navigator.userAgent.toUpperCase().indexOf("MAC") != -1){
	    height1+=15;
	  }
	  
	  if(document.all) 
		{
		var scroll = "no";
		if(bscrollbars)
		{
			scroll = "yes";
		}
		
		left = 0;//(screen.width -width1)/2;	
		top =0; //(screen.height - height1)/2;
		width1=screen.width;
		height1=screen.height;
		
		var features ="fullscreen=yes";
		  //var features ="menubar=no,address=no,titlebar=no,resize=no,scrollbars="+scroll;
		
		win = window.open(url, name, features);
		
	}else{
		width1+=20;
		left = 0;//(screen.width -width1)/2;	
		top =0; //(screen.height - height1)/2;
		width1=screen.width;
		height1=screen.height;	
		//var features = "left="+left+",top="+top+",width="+width1+",height="+height1+",menubar=no,address=no,resize=no";
	    var features ="fullscreen=yes";
		win = window.open(url, name, features);
	}
	
	}else{
	
	if(document.all) 
		{
		var scroll = "no";
		if(bscrollbars)
		{
			scroll = "yes";
		}
				
		left = (screen.width - width)/2;	
		top = (screen.height - height)/2;
		var features = "left="+left+",top="+top+",width="+width+",height="+height+",menu=no,address=no,resize=no,scrollbars="+scroll+",titlebar=no,status=no";
		win = window.open(url, name, features);
	}else{
		width+=20;
		left = (screen.width - width)/2;	
		top = (screen.height - height)/2;		
		var features = "left="+left+",top="+top+",width="+width+",height="+height+",menu=no,address=no,resize=no,status=no";
		win = window.open(url, name, features);
	}
 }
	return win;
}
function OpenPopupReuseExistingWindow(sURL,oWin,iWidth,iHeight,bScrollBars,isfullscreen,type)
{
	var iW,iH;
	try{
		//oWin.location.href=sURL;
		oWin.navigate(sURL);
		
		if(type.toUpperCase() == "REST"){
			iW=rest_width;
			iH=rest_height;
		}
		else{
			iW=onet_width;
			iH=onet_height;
		}
		  
		oWin.focus();
		
	}catch(e){
		oWin=OpenPopup(sURL,iWidth,iHeight,bScrollBars,isfullscreen,type); 
	}
	return oWin;
}


function openwindow(value)
{
    
	window.open(value,"mywindow","menubar=1,resizable=1,toolbar=no,scrollbars=yes,width=650,height=580,left=250,top=200");
}


var disappeardelay = 250 ; //menu disappear speed onMouseout (in miliseconds)
var enableanchorlink = 0 ;//Enable or disable the anchor link when clicked on? (1=e, 0=d)
var hidemenu_onclick = 1 ;//hide menu when user clicks within menu? (1=yes, 0=no)

/////No further editting needed

var ie5=document.all;
var ns6=document.getElementById&&!document.all ;

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function showhide(obj, e, visible, hidden){
if (ie5||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500;
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible;
else if (e.type=="click")
obj.visibility=hidden;
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0;
if (whichedge=="rightedge"){
var windowedge=ie5 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15;
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth;
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth;

}
else{
var topedge=ie5 && !window.opera? iecompattest().scrollTop : window.pageYOffset;
var windowedge=ie5 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18;
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight;
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight;
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge;
}
}
return edgeoffset;
}

function dropdownmenuSubBlog(obj, e, dropmenuID){
if (window.event) event.cancelBubble=true;
else if (e.stopPropagation) e.stopPropagation();
if (typeof dropmenuobj!="undefined") //hide previous menu
dropmenuobj.style.visibility="hidden";
clearhidemenu();
if (ie5||ns6){
obj.onmouseout=delayhidemenu;
dropmenuobj=document.getElementById(dropmenuID);
if (hidemenu_onclick) dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden';}
dropmenuobj.onmouseover=clearhidemenu;
dropmenuobj.onmouseout=ie5? function(){ dynamichide(event)} : function(event){ dynamichide(event)}
showhide(dropmenuobj.style, e, "visible", "hidden");
dropmenuobj.x=getposOffset(obj, "left");
dropmenuobj.y=getposOffset(obj, "top");
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+-1+"px";
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+7+"px";
}
return clickreturnvalue();
}

function clickreturnvalue(){
if ((ie5||ns6) && !enableanchorlink)  return false;
else return true;
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie5&&!dropmenuobj.contains(e.toElement))
delayhidemenu();
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu();
}

function delayhidemenu(){
delayhide=setTimeout("dropmenuobj.style.visibility='hidden'",disappeardelay);
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide);
}


function EmailToFriend()
{
   parent.location = 'mailto:?Subject=Healthy News Article from Mercola.com&body=A friend of yours highly recommends you read this health article: ' + self.location ;
}


  
onerror = hideError;
function hideError()
{
        return true;
}


/*function to highligh Tag */

  
    function ActiveTab(id1,id2)
    {
    var Tab=document.getElementById(id1);
    var TabDisable=document.getElementById(id2);
    if(id1=='HomeTd')
    {
    Tab.className="Home_high";
    TabDisable.className="basic";
    }
    else
    Tab.className="Archive_high";
    TabDisable.className="basic";
    }
      
function HomePageNewsOn()
{
if(document.getElementById("news").className = "NewsTabOn")
	{ 
	document.getElementById("story").className = "NewsTabOff";
	document.getElementById("news").className = "NewsTabOn";
 	document.getElementById("StoryCnt").className = "TopVideoDivOff";
 	document.getElementById("NewsCnt").className = "TopDivTwoOn";
	} 
} 

	
function HomePageTopStoriesOn()
{ 
if(document.getElementById("story").className = "NewsTabOn")
	{
 	document.getElementById("story").className = "NewsTabOn";
 	document.getElementById("news").className = "NewsTabOff";
	document.getElementById("StoryCnt").className = "TopVideoDivOn";
 	document.getElementById("NewsCnt").className = "TopDivTwoOff"; 
 	} 
}	
	
 

function InitOverlayProfile() {  

	if(document.getElementById('overlayProfile') != null)
    	{
	var scrheight = document.body.clientHeight;
	var tmpDivOverlayProfile = document.getElementById('overlayProfile');
	var tmpDivOverlayBaseProfile = document.getElementById('overlaybaseProfile');
    
    	tmpDivOverlayBaseProfile.style.height = scrheight + 1500 + "px";
	tmpDivOverlayProfile.style.display="";
	tmpDivOverlayBaseProfile.style.display="";      
    
    	return false;
	}
}


function Validate()
		{
		
			var txtEmail = document.getElementById('textBoxEmailAddress');
			 response = RegistrationPopUp.SubscribeToNewsletter(txtEmail.value);
			if(response.value== 2)
			{
				alert("Email Address is not valid ");
				return false;
			}
			if(response.value == 3)
			{
			    alert("Sorry! We are not able to connect to validation server. Please try again.");
				return false;
			}
			if(response.value == 4)
			{
			    alert("Please enter email address.");
				return false;
			}
			
            return true;
		}
function LoginPage(url){
            window.open(url,'Parent_Window','')
            window.close();
	    }

function JoinPage(url){
window.open(url,'Parent_Window','');
window.close();
}


   function EnableContinue(e, buttonid)

    {     
        var bt = document.getElementById(buttonid); 
        if (typeof bt == 'object')
        { 
           bt.disabled = false;
           if(navigator.appName.indexOf("Netscape")>(-1))
            { 
                  if (e.keyCode == 13)
                  { 
                        bt.focus();
                        bt.click(); 
                        return false; 
                  } 
            } 
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
            { 
                 if (event.keyCode == 13)
                  { 
                        bt.focus();
                        bt.click(); 
                        return false; 
                 } 
            } 
        } 
}




function DetectRes()
{
if (screen.width<=900&&(window.location.href!='http://articles.mercola.com/home.aspx' && window.location.href!='http://articles.mercola.com/' && window.location.href!='http://articles223.mercola.com/home.aspx'&& window.location.href!='http://articles223.mercola.com/' && window.location.href!='http://articles217.mercola.com/home.aspx' && window.location.href!='http://articles217.mercola.com/' 
&& window.location.href!='http://articles.mercola.com/sites/current.aspx' &&     window.location.href!='http://articles223.mercola.com/sites/current.aspx'&&       window.location.href!='http://articles217.mercola.com/sites/current.aspx'
))
{

document.write("<LINK REL='STYLESHEET' HREF='/themes/blogs/MercolaArticle/style/MercolaBlog800.css' TYPE='text/css'>");
}
else
{

 document.write("<LINK REL='STYLESHEET' HREF='/themes/blogs/MercolaArticle/style/MercolaBlog.css' TYPE='text/css'>");
}
}

function OpenNewWindow(sURL)
{
	var left = parseInt((screen.availWidth/2) - (300/2));
    var top = parseInt((screen.availHeight/2) - (200/2));

    var features="toolbar=0,scrollbars=0,resizable=0,location=no,status=0,menubar=0,titlebar=0,width=380,height=120,left="+left+",top="+top
	oMyWin=window.open(sURL,"Confirm",features)
	
}

function wrap(quem){

	var larg_total,larg_carac,quant_quebra,pos_quebra, over_orig;
	var elementos,quem, pai, caracs, texto, pai_texto, display_orig, wid_orig;
    
    if(quem.nodeType==3){
				
		if(quem.nodeValue.replace('\n','').replace('\t','').trim()==''){
			
			return true;
		}
		
		pai = quem.parentNode;		
		texto = quem.nodeValue;			
		display_orig = pai.style.display;
		over_orig = pai.style.overflow;
		wid_orig = pai.style.width;
		pai.style.display="block";
		pai.style.overflow="hidden";
		larg_oficial = pai.offsetWidth;
		pai.style.display="table";
		pai.style.width = "auto"; 
		pai.style.overflow = "visible";
		larg_total = pai.offsetWidth;
		
		pai.style.overflow = over_orig;
		
		if(larg_total>larg_oficial){ 
			pos_quebra = 0;
			caracs = pai.textContent.length;
			
			larg_total = pai.offsetWidth;
			pai.style.display = display_orig;
			
			larg_carac = larg_total / caracs ;
			quant_quebra = parseInt(larg_oficial/larg_carac) - 2; 
			
			quem.nodeValue = '';
			
			while(pos_quebra<=caracs){
				quem.nodeValue += texto.substring(pos_quebra,pos_quebra + quant_quebra) + " "
				pos_quebra = pos_quebra + quant_quebra;
			}			
		}
		pai.style.display = display_orig;
		pai.style.display = over_orig;
		pai.style.width = wid_orig;
		
	}else if(quem.childNodes.length==1 && quem.childNodes[0].nodeType==3){
		
		texto = String(quem.innerHTML); 
		display_orig = quem.style.display;
		over_orig = quem.style.overflow;
		wid_orig = quem.style.width;
		quem.style.display="block";
		quem.style.overflow="hidden";
		larg_oficial = quem.offsetWidth;
		
		
		quem.style.display="table";
		quem.style.width = "auto"; 
		quem.style.overflow = "visible";
		larg_total = quem.offsetWidth;
		
		quem.style.overflow = over_orig;
				
		if(larg_total>larg_oficial){ 
			pos_quebra = 0;
			caracs = texto.length;
			
			
			larg_total = quem.offsetWidth;
			larg_carac = larg_total / caracs ;
			
			quant_quebra = parseInt(larg_oficial/larg_carac) - 2; 
			quem.innerHTML = ""
			
			while(pos_quebra<=caracs){
				quem.innerHTML += texto.substring(pos_quebra,pos_quebra + quant_quebra) + " "
				pos_quebra = pos_quebra + quant_quebra;
			}
			
		}	
		quem.style.display = display_orig;
		quem.style.display = over_orig;
		quem.style.width = wid_orig;
		
	}else if(quem.childNodes.length>0){
		
		for(var i=0;i<quem.childNodes.length;i++){
			wrap(quem.childNodes[i]);
		}
	}
}
function wordWrap(){  
    var elementos = document.body.getElementsByTagName("*") 
 
    if(navigator.appName.indexOf("Internet Explorer")>-1){
        for(var i=0; i<elementos.length;i++){
            if(elementos[i].className.indexOf("word-wrap")>-1){
                elementos[i].style.wordWrap = "break-word";
            }
        }
    }else{
        for(var i=0; i<elementos.length;i++){
            if(elementos[i].className.indexOf("word-wrap")>-1){
                wrap(elementos[i]);
            }
        }
    }
}
String.prototype.trim = function() { 
   return this.replace(/^[ ]+|[ ]+$/g,"");
}
function addEvent(obj, evType, fn){
    if (obj.addEventListener)
        obj.addEventListener(evType, fn, true)
    if (obj.attachEvent)
        obj.attachEvent("on"+evType, fn)
        
}
addEvent(window,'load',wordWrap);


function SetFocus()
{
if(Get_Cookie( 'FocusCookie' ) )
{
 window.location.hash="commentfocus"; 
Delete_Cookie('FocusCookie', '/', '')

}
    
}

// Cookies writter for setting focus

function Set_Cookie( name, value, expires, path, domain, secure ) 
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct 
expires time, the current script below will set 
it for x number of days, to make it for hours, 
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}


function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		
		
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}		


function Delete_Cookie( name, path, domain ) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

 

var persistclose=0 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
var startX = 750 //set x offset of bar in pixels
var startY = 300 //set y offset of bar in pixels
var verticalpos="fromtop" //enter "fromtop" or "frombottom"

function iecompattest()
{
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function get_cookie(Name) 
{

var search = Name + "="
var returnvalue = "";

if (document.cookie.length > 0) 
 {
  offset = document.cookie.indexOf(search)

    if (offset != -1) 
    {
        offset += search.length
        end = document.cookie.indexOf(";", offset);
        if (end == -1) end = document.cookie.length;
            returnvalue=unescape(document.cookie.substring(offset, end))
    }

 }
return returnvalue;
}

 

function staticbar()
{
if(document.getElementById('overlayProfile') != null)
    {
    barheight=document.getElementById('overlayProfile').offsetHeight
    var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
    var d = document; 

   function ml(id)
   {
    
    var el=d.getElementById(id);
    if (!persistclose || persistclose && get_cookie("remainclosed")=="")
    el.style.visibility="visible"    

    if(d.layers)el.style=el;
        el.sP=function(x,y){this.style.left=x+"px";this.style.top=y+"px";};

        el.x = startX;
    if (verticalpos=="fromtop")
        el.y = startY;
    else
    {
        el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
        el.y -= startY;
    }
    return el;

   }

     window.stayTopLeft=function()
     {
       if (verticalpos=="fromtop")
       {
        var pY = ns ? pageYOffset : iecompattest().scrollTop;
        ftlObj.y += (pY + startY - ftlObj.y)/8;
       }
       else
       {
        var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
        ftlObj.y += (pY - startY - ftlObj.y)/8;
       }

        ftlObj.sP(ftlObj.x, ftlObj.y);
        setTimeout("stayTopLeft()", 10);

      }

        ftlObj = ml('overlayProfile');
        stayTopLeft();
	}
}

if (window.addEventListener)
    window.addEventListener("load", staticbar, false)
else if (window.attachEvent)
    window.attachEvent("onload", staticbar)
else if (document.getElementById)
    window.onload=staticbar
//ends here

/* Home Page Starts Here */
function isHomePageSet()
{
    var agt=navigator.userAgent.toLowerCase();
    
   if (agt.indexOf("msie") != -1)
    {
        var sQueryHome = oHomePage.isHomePage('http://www.mercola.com/');
        if(sQueryHome == true)
        {
            document.getElementById('makeHomepage').style.display = 'none';
        }
    }


	
    else if (agt.indexOf("firefox") != -1)
    {
    
         document.getElementById('olNavigator').style.display = 'none';
         document.getElementById('olSafari').style.display = 'none';
         document.getElementById('olFireFox').style.display = 'block';
    }    
    else if (agt.indexOf("safari") != -1)
    {
         document.getElementById('olNavigator').style.display = 'none';
         document.getElementById('olFireFox').style.display = 'none';
         document.getElementById('olSafari').style.display = 'block';
      
    }    
    else if (agt.indexOf("netscape") != -1)
    {
         document.getElementById('olNavigator').style.display = 'block';
         document.getElementById('olFireFox').style.display = 'none';
         document.getElementById('olSafari').style.display = 'none';
    }
    else
    {
          document.getElementById('makeHomepage').style.display = 'none';
        
    }
}



var mmOpenContainer = null;
var mmOpenMenus = null;
var mmHideMenuTimer = null;

function MM_menuStartTimeout(hideTimeout) {
	mmHideMenuTimer = setTimeout("MM_menuHideMenus()", hideTimeout);	
}

function MM_menuHideMenus() {
	MM_menuResetTimeout();
	if(mmOpenContainer) {
		var c = document.getElementById(mmOpenContainer);
		c.style.visibility = "inherit";
		mmOpenContainer = null;
	}
	if( mmOpenMenus ) {
		for(var i = 0; i < mmOpenMenus.length ; i++) {
			var m = document.getElementById(mmOpenMenus[i]);
			m.style.visibility = "hidden";			
		}
		mmOpenMenus = null;
	}
}

function MM_menuHideSubmenus(menuName) {
	if( mmOpenMenus ) {
		var h = false;
		var c = 0;
		for(var i = 0; i < mmOpenMenus.length ; i++) {
			if( h ) {
				var m = document.getElementById(mmOpenMenus[i]);
				m.style.visibility = "hidden";
			} else if( mmOpenMenus[i] == menuName ) {
				h = true;
			} else {
				c++;
			}
		}
		mmOpenMenus.length = c+1;
	}
}


function MM_menuShowSubMenu(subMenuName) {
	MM_menuResetTimeout();
	var e = document.getElementById(subMenuName);
	e.style.visibility = "inherit";
	if( !mmOpenMenus ) {
		mmOpenMenus = new Array;
	}
	mmOpenMenus[mmOpenMenus.length] = "" + subMenuName;
}

function MM_menuResetTimeout() {
	if (mmHideMenuTimer) clearTimeout(mmHideMenuTimer);
	mmHideMenuTimer = null;
}

function MM_menuShowMenu(containName, menuName, xOffset, yOffset) {
	MM_menuHideMenus();
	MM_menuResetTimeout();
	MM_menuShowMenuContainer(containName, xOffset, yOffset);
	MM_menuShowSubMenu(menuName);
}

function MM_menuShowMenuContainer(containName, x, y) {	
	var c = document.getElementById(containName);
	var s = c.style;
	s.visibility = "inherit";
	
	mmOpenContainer = "" + containName;
}


/*WebTrend JavaScript*/

var gImages=new Array;
var gIndex=0;
var DCS=new Object();
var WT=new Object();
var DCSext=new Object();

var gDomain="statse.webtrendslive.com";
var gDcsId="dcs0sapavqljwp9m8brr0j29b_1l1j";

function dcsVar(){
	var dCurrent=new Date();
	WT.tz=dCurrent.getTimezoneOffset()/60*-1;
	if (WT.tz==0){
		WT.tz="0";
	}
	WT.bh=dCurrent.getHours();
	WT.ul=navigator.appName=="Netscape"?navigator.language:navigator.userLanguage;
	if (typeof(screen)=="object"){
		WT.cd=screen.colorDepth;
		WT.sr=screen.width+"x"+screen.height;
	}
	if (typeof(navigator.javaEnabled())=="boolean"){
		WT.jo=navigator.javaEnabled()?"Yes":"No";
	}
	if (document.title){
		WT.ti=document.title;
	}
	WT.js="Yes";
	if (typeof(gVersion)!="undefined"){
		WT.jv=gVersion;
	}
	WT.sp="@@SPLITVALUE@@";
	DCS.dcsdat=dCurrent.getTime();
	DCS.dcssip=window.location.hostname;
	DCS.dcsuri=window.location.pathname;
	if (window.location.search){
		DCS.dcsqry=window.location.search;
	}
	if ((window.document.referrer!="")&&(window.document.referrer!="-")){
		if (!(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)<4)){
			DCS.dcsref=window.document.referrer;
		}
	}
}

function A(N,V){
	return "&"+N+"="+dcsEscape(V);
}

function dcsEscape(S){
	if (typeof(RE)!="undefined"){
		var retStr = new String(S);
		for (R in RE){
			retStr = retStr.replace(RE[R],R);
		}
		return retStr;
	}
	else{
		return escape(S);
	}
}

function dcsCreateImage(dcsSrc){
	if (document.images){
		gImages[gIndex]=new Image;
		gImages[gIndex].src=dcsSrc;
		gIndex++;
	}
	else{
		document.write('<IMG BORDER="0" NAME="DCSIMG" WIDTH="1" HEIGHT="1" SRC="'+dcsSrc+'">');
	}
}

function dcsMeta(){
	var myDocumentElements;
	if (document.all){
		myDocumentElements=document.all.tags("meta");
	}
	else if (document.documentElement){
		myDocumentElements=document.getElementsByTagName("meta");
	}
	if (typeof(myDocumentElements)!="undefined"){
		for (var i=1;i<=myDocumentElements.length;i++){
			myMeta=myDocumentElements.item(i-1);
			if (myMeta.name){
				if (myMeta.name.indexOf('WT.')==0){
					WT[myMeta.name.substring(3)]=myMeta.content;
				}
				else if (myMeta.name.indexOf('DCSext.')==0){
					DCSext[myMeta.name.substring(7)]=myMeta.content;
				}
				else if (myMeta.name.indexOf('DCS.')==0){
					DCS[myMeta.name.substring(4)]=myMeta.content;
				}
			}
		}
	}
}

function dcsTag(){
	var P="http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://"+gDomain+(gDcsId==""?'':'/'+gDcsId)+"/dcs.gif?";
	for (N in DCS){
		if (DCS[N]) {
			P+=A(N,DCS[N]);
		}
	}
	for (N in WT){
		if (WT[N]) {
			P+=A("WT."+N,WT[N]);
		}
	}
	for (N in DCSext){
		if (DCSext[N]) {
			P+=A(N,DCSext[N]);
		}
	}
	if (P.length>2048&&navigator.userAgent.indexOf('MSIE')>=0){
		P=P.substring(0,2040)+"&WT.tu=1";
	}
	dcsCreateImage(P);
}

dcsVar();
dcsMeta();
dcsTag();


function writetoLyr(name, message) {
if (document.layers) {
document.layers[name].document.close();
document.layers[name].document.write(message);
document.layers[name].document.close();    
} else {
if (document.all) {
eval("document.all." + name + ".innerHTML='" + message + "'"); 
} else {
 document.getElementById(name).innerHTML = message;
} 
}}


/*END of WebTrend*/

/*Site seal js from http://seal.networksolutions.com/siteseal/javascript/siteseal.js */

function SiteSeal(img,type){
if(window.location.protocol.toLowerCase()=="https:"){var mode="https:";} else {var mode="http:";}
var host=location.host;
var baseURL=mode+"//seals.networksolutions.com/siteseal_seek/siteseal?v_shortname="+type+"&v_querytype=W&v_search="+host+"&x=5&y=5";
document.write('<a href="#" onClick=\'window.open("'+baseURL+'","'+type+'","width=450,height=500,toolbar=no,location=no,directories=no,\
status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no");return false;\'>\
<img src="'+img+'" style="border:none;" oncontextmenu="alert(\'This SiteSeal is protected\');return false;"></a>');}

function clickButton(e, buttonid){

      var evt = e ? e : window.event;

      var bt = document.getElementById(buttonid);

      if (bt){

          if (evt.keyCode == 13){

                bt.click();

                return false;

          }

      }

}
