﻿// JScript File
/* ATL HJAIA2008 JavaScript file v1.0 
   Written by ChaoLi (webmaster@atlanta-airport.com)

   Copyright (c) 2008 City of Atlanta, Department of Aviation (http://www.atlanta-airport.com)
   Date: 11-11-2008  
   Purposes for this file: to dismiss the Modal Popup
   */

 var cookie_year = current_date.getFullYear ( );
 var cookie_month = current_date.getMonth ( );
 var cookie_day = current_date.getDate ( );
       
 function onOk() {
    var blnHide = $get('ckDoNotShow').checked;
    if (blnHide) {
        set_cookie ( "atlAlert_WebSurvey", "True", cookie_year, cookie_month, cookie_day + 30 );
                 }
    else{
        set_cookie ( "atlAlert_WebSurvey", "True");// expires after closing the browser
        }
    //now open new window
    window.open("survey.aspx");
                        }
 function onCancel() {            
    var blnHide = $get('ckDoNotShow').checked;
    if (blnHide) {
    set_cookie ( "atlAlert_WebSurvey", "True", cookie_year, cookie_month, cookie_day + 30 );            
    }
    else{
    set_cookie ( "atlAlert_WebSurvey", "True", cookie_year, cookie_month, cookie_day -1);// expires immediately
    }
 }
                
 function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure ){
    var cookie_string = name + "=" + escape ( value );
    if ( exp_y )
    {
        var expires = new Date ( exp_y, exp_m, exp_d );
        cookie_string += "; expires=" + expires.toGMTString();
    }
    
    if ( path )
        cookie_string += "; path=" + escape ( path );
    
    if ( domain )
        cookie_string += "; domain=" + escape ( domain );
  
    if ( secure )
        cookie_string += "; secure";
  
    document.cookie = cookie_string;
}
        // The following snippet works around a problem where FloatingBehavior
        // doesn't allow drops outside the "content area" of the page - where "content
        // area" is a little unusual for our sample web pages due to their use of CSS
        // for layout.
        function setBodyHeightToContentHeight() {
            document.body.style.height = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight) + "px";
        }
        setBodyHeightToContentHeight();
        $addHandler(window, "resize", setBodyHeightToContentHeight);    