//var min = 75;
//var max = 115;

var min = 75;
var max = 95;

function showPopUp(Ref, Height, Width) {
	var ScreenWidth = window.screen.availWidth
	var ScreenHeight = window.screen.availHeight
	var ScreenLeft = ((ScreenWidth - Width) / 2)
	var ScreenTop = ((ScreenHeight - Height) / 2)	
	WindowProps = "status=no,toolbar=no,resizable=no,scrollbars=no,"
				+ "height=" + Height +",width=" + Width +",left="+ ScreenLeft +"px,top="+ ScreenTop +"px";
	window.open(Ref, "PopWin", WindowProps);
}

function showPopUpScroll(Ref, Height, Width) {
	var ScreenWidth = window.screen.availWidth
	var ScreenHeight = window.screen.availHeight
	var ScreenLeft = ((ScreenWidth - Width) / 2)
	var ScreenTop = ((ScreenHeight - Height) / 2)	
	WindowProps = "status=no,toolbar=no,resizable=no,scrollbars=yes,"
				+ "height=" + Height +",width=" + Width +",left="+ ScreenLeft +"px,top="+ ScreenTop +"px";
	window.open(Ref, "PopWin", WindowProps);
}

function BookmarkPage() 
{ 
	//var url = "http://67.199.90.236/nomoremedicines/";
	//var title = "NoMoreMedicines.Com - Inspiring people to live longer & healthfully";  	
	var url = window.location.href ;
	var title = document.title;
	var msg = "Don't forget to bookmark us!";
	
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");	} 
	else if(window.external) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		msg += " (CTRL-D)";
		alert(msg); }
	else {		
		if(navigator.appName == "Netscape") msg += " (CTRL-D)";
		alert(msg); }
}

function SetCookie(c_name,value,expiredays)
{
    var exdate=new Date();
    exdate.setDate(exdate.getDate()+expiredays);
    document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function GetCookie(c_name)
{
    if (document.cookie.length>0)
    {
        c_start=document.cookie.indexOf(c_name + "=");
        
        if (c_start!=-1)
        { 
            c_start=c_start + c_name.length+1 ;
            c_end=document.cookie.indexOf(";",c_start);
    
            if (c_end==-1) 
                c_end=document.cookie.length;
                
            return unescape(document.cookie.substring(c_start,c_end));
        } 
  }
  
    return "";
}


function IncreaseFontSize() 
{
   var p = document.getElementsByTagName('body');
   
   for(i=0;i<p.length;i++) 
   {
      if(p[i].style.fontSize) 
      {
         var s = parseInt(p[i].style.fontSize.replace("%",""));
      } 
      else 
      {
         var s = 75;
      }
      
      if(s!=max) 
      {
         s += 10;
      }
      else
      {
        s = min;
      }
      
      p[i].style.fontSize = s+"%";
      SetCookie("NMM_FontSize", s, 365);
   }
}

function DecreaseFontSize() 
{
   var p = document.getElementsByTagName('body');
   
   for(i=0;i<p.length;i++) 
   {
        if(p[i].style.fontSize) 
        {
            var s = parseInt(p[i].style.fontSize.replace("%",""));
        } 
        else 
        {
            var s = 75;
        }
      
        if(s!=min) 
        {
            s -= 10;
        }
      
        p[i].style.fontSize = s+"%";
        SetCookie("NMM_FontSize", s, 365);
   }   
}	
		
