function startPage() {
  
  var location=getCookie('hyg-location')
  
  if (location!=null && location!="") {
    
    if (location == 'originalsani') {
    
      window.location = 'http://66.129.74.117/canada/';
      
    }
    
  } else {
    
    $('#fade').css('display', 'block');
    $('#fade').fadeTo("fast", 0.80);
 
    $('#choose_province_box').css('display', 'block');
    $('#choose_province_box').fadeTo("fast", 1.00);
    
  }
  
  
  // 
  // jQuery("#show_embed_link").click(function () {
  //       jQuery("#embed_content").slideToggle("slow");
  //       jQuery("#share_content").slideUp("slow");
  //       
  // });
  // 
  // jQuery("#show_share_link").click(function () {
  //       jQuery("#share_content").slideToggle("slow");
  //       jQuery("#embed_content").slideUp("slow");
  //       
  // });
 			
}
  
$(document).ready(startPage);

function setProvince (prov_value) {
  
  if (prov_value == 1) {
    
    setCookie('hyg-location','saniserv',365)
    
  } else if (prov_value == 0) {
  
    return false
    
  } else {
    
    setCookie('hyg-location','originalsani',365)
    
  }
  
  window.location.reload()
  
}

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 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());
}
