/**
*
* @author Sarzhanov Ilya <i.sarzhanov@msgtelecom.com>
*/

function setCookie(c_data,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_data+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_data)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_data + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_data.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 show_popup(){
showPopWin('http://www.getreception.com/modalcontent.html', 600,370, setCookie('modal','da',1));
}


function checkCookie(){  
var cdomain='http://'+document.domain+'/';
c_data=getCookie('modal');
if (c_data!=null && c_data!="")
  {  return true;  }
else {
if (document.URL==cdomain){
    setCookie('modal','da',1);
    setTimeout("show_popup()", 3000);
    return false;    
    }
    }
  }

  
function redirect_to_shop(){
      hidePopWin();
      window.location='http://store.getreception.com';
  }