function Get_Cookie(name) { 

   var start = document.cookie.indexOf(name+"="); 

   var len = start+name.length+1; 

   if ((!start) && (name != document.cookie.substring(0,name.length))) return null; 

   if (start == -1) return null; 

   var end = document.cookie.indexOf(";",len); 

   if (end == -1) end = document.cookie.length; 

   return unescape(document.cookie.substring(len,end)); 

} 

 

function Set_Cookie(name,value,expires,path,domain,secure) { 

    var cookieString = name + "=" +escape(value) + 

       ( (expires) ? ";expires=" + expires.toGMTString() : "") + 

       ( (path) ? ";path=" + path : "") + 

       ( (domain) ? ";domain=" + domain : "") + 

       ( (secure) ? ";secure" : ""); 

    document.cookie = cookieString; 

} 

 

function launch_support()

{

                var request_url = "http://corp2.aloweb.com.br/atendimento.php?l=cia&x=363&deptid=0";

                newwin = window.open( request_url, 'unique', 'top=10,left=10,width=450,height=380') ;

                newwin.focus() ;

                DoClose() ;

}

 

 

 

function checkinitiate()

{

                if (!Get_Cookie('show')) {

                               

                               if (confirm('Você está recebendo um convite para atendimento on-line dos empreendimentos da Cia Goiânia-GO. Você aceita?')) {

                                               chat_opened = 1 ;

                                               launch_support() ;

                               } else {

                               }

                }

                

                Set_Cookie( "show" , "0" , 0 , "/" , false ); 

}
