﻿function CreateBookmarkLink() 
{ 
    title = "SNAP, Inc";   
    url = "http://www.snapinc.net";  
  
    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		
        return true; 
       } 
} 
         

function PopupWindow(strLocation,strWindowName)
{
   window.open(strLocation,strWindowName,"status=0,toolbar=0,resizable=1,menubar=0,scrollbars=1,height=400,width=750");
}



function setCookie(name, value, expires) 
{ 
    document.cookie = name + "=" + escape(value) + "; path=/" + ((expires == null) ? "" : "; expires=" + expires); 
} 

function getCookie(search_name) { 
  // note: document.cookie only returns name=value, not the other components 
  var tab_cookies = document.cookie.split( ';' ); 
  
  for ( i = 0; i < tab_cookies.length; i++ ) { 
    // now we'll split apart each name=value pair 
    var cookie_tmp = tab_cookies[i].split('='); 
    // and trim left/right whitespace while we're at it 
    var cookie_name = cookie_tmp[0].replace(/^\s+|\s+$/g, ''); 
    // if the extracted name matches passed search_name 
    if (cookie_name==search_name) { 
      // we need to handle case where cookie has no value but exists (no = sign, that is): 
      if (cookie_tmp.length>1) { 
        return unescape( cookie_tmp[1].replace(/^\s+|\s+$/g, '') ); 
      } 
      // cookie is initialized but no value => result = null 
      return null; 
    } 
  } 
  return null; 
} 


function resizeText(multiplier,CookieName,DefaultValue) {
 if (document.body.style.fontSize == "") {
    document.body.style.fontSize = DefaultValue;
  }
  document.body.style.fontSize = parseFloat(document.body.style.fontSize) + (multiplier * 0.03) + "em";
  
  var myDate = new Date();
  myDate.setDate(myDate.getDate() + 7);
  
  setCookie(CookieName,  document.body.style.fontSize, myDate);
}


function setFontSize(CookieName)
{
    var fontsize = getCookie(CookieName) ;
 
    if (fontsize != null && fontsize != '')
    {
        document.body.style.fontSize = fontsize;
    }
}



