var go = true;
if (document.location.toString().indexOf('?refreshme=true')!=-1) {
SetCookie('refreshed','true');
go=false;
document.location=document.location.toString().split('?')[0];
}
if (GetCookie('refreshed')=='true' && go) {
SetCookie('refreshed','false');
document.location.reload();
}

var moretxtvalue='';
var nRec = 0;
var related = new Array();
var CurrItemId='addcook';
var ie = false;
var ns6 = false;
var ns = false;
var opera = false;

if (eval(document.layers)) { ns=true; }
else {
    if (eval(document.all)) { ie=true; if (navigator.userAgent.indexOf('Opera')!=-1) opera=true;}
        else {
            if (eval(document.getElementById)) { ns6=true;}
            }
    }

/////////////////////////////////////////////////
//
//	Image Preloader & RollOvers
//
	
function rollover(id,src,css){
	Layer(id+'_image').childNodes[0].src = src;
	Layer(id+'_anchor').className = css;
}	
	
// Hide and Show menu
function lnavhovers(id, cls){
	TD = id.parentNode;
	TD.className = cls;
}

function AddBookmark(){
	  if (document.all){
		 document.write("<br><img width=1 height=4><br>&middot; ");
		  document.write("<a href=\"javascript:window.external.AddFavorite(document.location.href,'www.naturalgoodlife.com - '+document.title)\">Bookmark this page</a>");
	}
}
//finds and return <DIV> object by given name

function Layer(layerName) {
return (ns)?(document.layers[layerName]):((ns6)?(document.getElementById(layerName)):(document.all(layerName)));
}

function enlarge(url,imgw,imgh) {
var leftPos = (screen.availWidth-900) / 2;
var topPos = (screen.availHeight-600) / 2;
imgw=eval(imgw)+20; if (imgw > 800) imgw = 800;
imgh=eval(imgh)+30; if (imgh > 600) imgh = 600;
window.open(url, 'EnlargePicture','width='+imgw+',height='+imgh+',scrollbars=no,resizable=no,statusbar=no,location=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}



	
function TellToFriend() {
var NewPop = new Object();
NewPop=window.open("http://files.naturalgoodlife.com/custom/ytellafriend.php?link="+pid.toLowerCase(),"tellafriend","HEIGHT=375,WIDTH=520,scrollbars=no,resizable=yes,top=50,left=50");
NewPop.window.focus();
}

function EmailWhenAvaliable() {
var NewPop = new Object();
NewPop=window.open("http://files.naturalgoodlife.com/custom/emailwhenavailable.php?link="+pid.toLowerCase()+"&code="+code.toLowerCase(),"tellafriend","HEIGHT=170,WIDTH=520,scrollbars=yes,resizable=yes,top=50,left=50");
NewPop.window.focus();
}

function maillist(emailval) {
var NewPop = new Object();
NewPop=window.open('http://files.naturalgoodlife.com/custom/addemail.php?mail='+emailval,'popupemail','HEIGHT=150,WIDTH=520,scrollbars=yes,resizable=yes,top=50,left=50');
NewPop.window.focus();
}

function maillistform() {
var NewPop = new Object();
NewPop=window.open('http://files.naturalgoodlife.com/custom/addemailform.htm','popupemail','HEIGHT=180,WIDTH=520,scrollbars=yes,resizable=yes,top=50,left=50');
NewPop.window.focus();
}


function retriveimages(arrname) {
return eval(arrname);
}

//date;
var timer=null ;
var timerrun=false ;
function stoptime ()  { 
if (timerrun) 
clearTimeout (timer) ; 
timerrun=false ; 
 } 
function starttime()	{ 
stoptime(); 
showtime(); 
} 
function showtime() { 
dt = new Date();
day = dt.getDate();
date = dt.getDate();
month = dt.getMonth();
minutes = dt.getMinutes();
hours= dt.getHours();

if(minutes < 10) {minutes = "0" + minutes;}

var f_month = "";
var f_date = "";

if (month == 0){f_month = 'January';}
else if (month == 1){f_month = 'February';}
else if (month == 2){f_month = 'March';}
else if (month == 3){f_month = 'April';}
else if (month == 4){f_month = 'May';}
else if (month == 5){f_month = 'June';}
else if (month == 6){f_month = 'July';}
else if (month == 7){f_month = 'August';}
else if (month == 8){f_month = 'September';}
else if (month == 9){f_month = 'October';}
else if (month == 10){f_month = 'November';}
else if (month == 11){f_month = 'December';}

f_date += f_month + ' ' ;
f_date += date + ', ';

f_date += ( (hours>12) ? hours-12 : hours ) ;
f_date += ':' + minutes;  
f_date +=( (hours>=12) ? " P.M." : " A.M."  )

document.clock.next.value = f_date; 
timer=setTimeout ( 'showtime()' ,1000); 
timerrun=true; 

} 