
window.U=window.U||{};U.tack_modal={current_name:'',body_string:'<div id="modal-overlay" style="display:none" /><div id="modal-body" style="display:none"><div id="modal-header"><div id="modal-header-title" class="af text-shadow" /><a href="#" id="modal-close" class="pngBg" /></div><div id="modal-content" /></div>',$trigger:'.modal-trigger',$contents:'.modal-content',$overlay:'',$body:'',$header:'',$title:'',$close:'',$content:'',default_width:700,default_height:450,head_height:0,use_position_absolute:false,init:function(){if($.browser.msie&&parseInt($.browser.version,10)<8){U.tack_modal.use_position_absolute=true;}
U.tack_modal.$trigger=$(U.tack_modal.$trigger);U.tack_modal.$contents=$(U.tack_modal.$contents);if(U.tack_modal.$contents.length>0){U.tack_modal.create_modal();U.tack_modal.test_hash();U.tack_modal.test_get();}},create_modal:function(){$('body').append(U.tack_modal.body_string);U.tack_modal.$overlay=$('#modal-overlay');U.tack_modal.$body=$('#modal-body');U.tack_modal.$header=$('#modal-header');U.tack_modal.$title=$('#modal-header-title');U.tack_modal.$close=$('#modal-close');U.tack_modal.$content=$('#modal-content');U.tack_modal.$trigger.live('click',U.tack_modal.click_trigger);U.tack_modal.$close.click(U.tack_modal.close_modal);U.tack_modal.$overlay.click(U.tack_modal.close_modal);$(document).keypress(function(e){if(e.which===27){U.tack_modal.close_modal();}});if(U.tack_modal.use_position_absolute){$(window).bind('scroll resize',function(){U.tack_modal.adjust_position();});U.tack_modal.$overlay.css('position','absolute');U.tack_modal.$body.css('position','absolute');}
U.tack_modal.head_height=U.tack_modal.$header.outerHeight(true);},click_trigger:function(){U.tack_modal.current_name=$(this).data('modal');U.tack_modal.change_content();if(_gaq!==undefined){_gaq.push(['_trackEvent','modal','click-trigger-open',U.tack_modal.current_name,1]);}
return false;},test_hash:function(){var hash=window.location.hash.substring(1),$match=U.tack_modal.$contents.filter('[data-modal="'+hash+'"]');if($match.length>0){U.tack_modal.current_name=hash;U.tack_modal.change_content();return false;}},test_get:function(){var get=U.tack_modal.parseQueryString(),hash=get.modal,$match;if(hash!==undefined){hash=hash[0];}
if(hash!==undefined){$match=U.tack_modal.$contents.filter('[data-modal="'+hash+'"]');}
if($match!==undefined&&$match.length>0){U.tack_modal.current_name=hash;U.tack_modal.change_content();return false;}},open_modal:function(string){var $match=U.tack_modal.$contents.filter('[data-modal="'+string+'"]');if($match.length>0){U.tack_modal.current_name=string;U.tack_modal.change_content();return false;}},change_content:function(){U.tack_modal.$content.empty();U.tack_modal.$title.empty();var $content_ref=U.tack_modal.$contents.filter('[data-modal="'+U.tack_modal.current_name+'"]'),$content=$content_ref.clone();U.tack_modal.check_and_add_video($content,$content_ref);U.tack_modal.check_matches_and_setup($content);U.tack_modal.adjust_size($content);if(U.tack_modal.use_position_absolute){U.tack_modal.adjust_position();}
U.tack_modal.show_modal();U.tack_modal.$content.trigger('ready');},check_matches_and_setup:function($content){if($content.length===0){U.tack_modal.$content.append('<p>No matching content.</p>');}else if($content.length>1){U.tack_modal.$content.append('<p>More than one matching content element.</p>');}else{U.tack_modal.$content.append($content.html());U.tack_modal.$title.append($content.attr('title'));}
U.tack_modal.$content.hide();},check_and_add_video:function($content,$content_ref){if($content_ref.data('youtube')!==undefined||$content_ref.data('vimeo')!==undefined){var vid={},vid_params,$vid;if($content_ref.data('vimeo')!==undefined){vid.type='vimeo';}else{vid.type='youtube';}
vid.data=$content_ref.data(vid.type);vid.data=vid.data.split(':');if(vid.type==='vimeo'){vid.code='http://player.vimeo.com/video/'+vid.data[0];vid.code+='?title=0&byline=0&portrait=0&autoplay=1';}else{vid.code='http://www.youtube.com/embed/'+vid.data[0];vid.code+='?hd=1&rel=0&wmode=opaque&autoplay=1';}
vid_params={width:vid.data[1],height:vid.data[2],frameborder:0,src:vid.code};$vid=$('<iframe />',vid_params);$content.prepend($vid);}},adjust_size:function($content){var h=$content.data('modal-height'),w=$content.data('modal-width'),p=$content.data('modal-pad'),total_height,total_width;w=parseInt(w,10)||false;h=parseInt(h,10)||false;p=parseInt(p,10)||0;if(h!==undefined&&h){total_height=h+p*2+U.tack_modal.head_height;U.tack_modal.$body.css({height:total_height,'margin-top':-(total_height/2)});U.tack_modal.$content.css({height:h,padding:p});}else{U.tack_modal.$body.css({height:U.tack_modal.default_height,'margin-top':-(U.tack_modal.default_height/2)});U.tack_modal.$content.css({height:U.tack_modal.default_height,padding:0});}
if(w!==undefined&&w){total_width=w+p*2;U.tack_modal.$body.css({width:total_width,'margin-left':-(total_width/2)});}else{U.tack_modal.$body.css({width:U.tack_modal.default_width,'margin-left':-(U.tack_modal.default_width/2)});}},adjust_position:function(){U.tack_modal.$overlay.css({top:$(window).scrollTop()});U.tack_modal.$body.css({top:$(window).scrollTop()+$(window).height()/2-U.tack_modal.$body.outerHeight()/2,'margin-top':0});},show_modal:function(){U.tack_modal.$overlay.fadeIn(100,function(){U.tack_modal.$body.show(500,function(){U.tack_modal.$content.show();});});},close_modal:function(){U.tack_modal.$content.trigger('close');if(_gaq!==undefined){_gaq.push(['_trackEvent','modal','close-modal',U.tack_modal.current_name,1]);}
U.tack_modal.$title.empty();U.tack_modal.$content.empty();U.tack_modal.$body.hide(500,function(){U.tack_modal.$overlay.fadeOut(100);});return false;}};U.tack_modal.parseQueryString=function(queryString){var result={};if(queryString===undefined){queryString=location.search?location.search:'';}
if(queryString.charAt(0)=='?')queryString=queryString.substring(1);queryString=queryString.replace(/\+/g,' ');var queryComponents=queryString.split(/[&;]/g);for(var i=0;i<queryComponents.length;i++){var keyValuePair=queryComponents[i].split('=');var key=decodeURIComponent(keyValuePair[0]);var value=decodeURIComponent(keyValuePair[1]);if(!result[key])result[key]=[];result[key].push((keyValuePair.length==1)?'':value);}
return result;};
window.U=window.U||{};U.new_window={init:function(){$('a.new-window').live('click',function(){window.open($(this).attr('href'));return false;});}};
window.U=window.U||{};U.ajax_email_form={$parent:'',$submit:'',to_email:'',init:function(){U.ajax_email_form.$parent=$("#ajaxform");if(U.ajax_email_form.$parent.length>0){U.ajax_email_form.bind_on_submit();}},bind_on_submit:function(){U.ajax_email_form.$submit=U.ajax_email_form.$parent.find(':submit');U.ajax_email_form.$parent.submit(U.ajax_email_form.on_submit);U.ajax_email_form.to_email=U.ajax_email_form.$parent.data('to-email')||'sales@paloalto.com';},on_submit:function(){var success=true;$(this).find('.required').each(function(){if($(this).val().length>0){$(this).css({borderColor:'#cccccc'});}else{$(this).css({borderColor:'#d8000c'});success=false;}});if(!success){U.ajax_email_form.show_message('Required fields are empty');return false;}
U.ajax_email_form.show_message('Sending...');U.ajax_email_form.$submit.hide();var data={'to':U.ajax_email_form.to_email,'referer':window.location.href};$(this).find('select, input, textarea').each(function(){var name=$(this).attr('name');var type=$(this).attr('type');var value=$(this).val();if(type==='checkbox'||type=='radio'){if($(this).is(':checked')){if(data[name]){data[name]+=", "+value;}else{data[name]=value;}}}else{if(data[name]){data[name]+=", "+value;}else{data[name]=value;}}});$.getJSON('http://ws.paloalto.com/mail/ajax_email.php?callback=?',data,function(msg){U.ajax_email_form.show_message(msg.msg);if(msg.msg.indexOf('getting in touch')!==-1){U.ajax_email_form.$parent.find('label, select, input, textarea').slideUp();window.location.hash='ajaxform';}else{U.ajax_email_form.$submit.show();}});return false;},show_message:function(msg){$('.ajaxform-msg').remove();U.ajax_email_form.$submit.after('<p class="ajaxform-msg" style="font-weight:bold">'+msg+'</p>');}};
window.U=window.U||{};U.init_objs=function(parent,objs){if(parent===undefined||objs===undefined){return false;}
if(objs.constructor==Array){for(var i in objs){var obj=parent[objs[i]];if(obj!==undefined&&$.isFunction(obj.init)){obj.init();}}}else if(parent[objs]!==undefined&&$.isFunction(parent[objs].init)){parent[objs].init();}};U.test_in_url=function(test){return window.location.href.indexOf(test)!==-1;};
window.LP={};$(function(){U.init_objs(U,['tack_modal','new_window']);if(U.test_in_url('pricing')){LP.form_modal.init();}
if(U.test_in_url('impressive_plans')){LP.annotated.init();}});LP.form_modal={init:function(){if(U.tack_modal!==undefined&&U.tack_modal!==null){U.tack_modal.$content.bind('ready',function(){U.tack_modal.$content.find('#ajaxform-pricing').attr('id','ajaxform');U.ajax_email_form.init();});}}};LP.annotated={$images:'',$buttons:'',index:0,init:function(){if($('#feature-annotated-sample-plan').length>0){LP.annotated.move_to_second();if(U.tack_modal!==undefined&&U.tack_modal!==null){U.tack_modal.$content.bind('ready',function(){if(U.tack_modal.$content.find('#is-annotated').length>0){LP.annotated.hide_any_but_first();LP.annotated.add_next_back_markup();}});}}},hide_any_but_first:function(){LP.annotated.index=0;LP.annotated.$images=U.tack_modal.$content.find('img');LP.annotated.$images.not(':first').hide();LP.annotated.update_title();},add_next_back_markup:function(){U.tack_modal.$content.append('<a href="#" class="next-button">Next &#9654;</a>'+'<a href="#" class="back-button">&#9664; Back</a>');LP.annotated.$buttons=U.tack_modal.$content.find('.next-button, .back-button');LP.annotated.$buttons.filter('.back-button').hide();LP.annotated.$buttons.click(LP.annotated.linear_nav);},linear_nav:function(){var current=LP.annotated.index;if($(this).hasClass('back-button')){LP.annotated.index--;}else{LP.annotated.index++;}
if(LP.annotated.index>=LP.annotated.$images.length-1){LP.annotated.index=LP.annotated.$images.length-1;LP.annotated.$buttons.filter('.next-button').hide();}
else if(LP.annotated.index<=0){LP.annotated.index=0;LP.annotated.$buttons.filter('.back-button').hide();}
else{LP.annotated.$buttons.show();}
LP.annotated.$images.eq(current).stop(true,true).fadeOut(100,function(){LP.annotated.$images.eq(LP.annotated.index).stop(true,true).fadeIn(100);});LP.annotated.update_title();return false;},update_title:function(){var slide_title=LP.annotated.$images.eq(LP.annotated.index).attr('alt');U.tack_modal.$title.html(slide_title);},move_to_second:function(){$('.features-listing article').first().after($('#feature-annotated-sample-plan'));}};
