function recordLink(link, category, action) {
      _gat._getTrackerByName()._trackEvent(category, action);
      setTimeout('document.location = "' + link.href + '"', 100);
}



//Clear and restore text field with default values
function clickclear(thisfield, defaulttext){   
  if(thisfield.value == defaulttext){
     thisfield.value = "";   
  }   
}   
function clickrecall(thisfield, defaulttext) {   
  if (thisfield.value == ""){   
    thisfield.value = defaulttext;  
  }   
}


function launchPopup(){

if($.cookie('phoenixts_popup_cookie') != 'Session'){

  if($.cookie('phoenixts_popup_cookie') != 'Closed'){

    //alert('made it!');
    setTimeout( 

    function(){$('a.fancydelay').fancybox({
        'type':'ajax',
        'scrolling':'no',
        'showCloseButton': true,
        'href':'http://www.phoenixts.com/popup'
        }).trigger('click'); 

    }

    , 1000); 

  }

}

}
/*
jQuery(document).ready(function($) {
  $("a.popup-button").click(function() {
    alert('work please!');
    //$.cookie('phoenixts_popup_cookie', 'Session', { expires: 1, path: '/', domain: 'phoenixts.com'});
  });
});
*/

function setSessionCookie(){
   $.cookie('phoenixts_popup_cookie', 'Session', { expires: 0, path: '/', domain: 'phoenixts.com'});
}
