var shell;if(shell===undefined){shell={}}shell.server_prefix="/static/styles/";shell.gFpVersion="10";shell.flash_modules=[];var flashvars={};var params={};params.allowScriptAccess="always";params.allowFullScreen="true";params.wmode="transparent";shell.date_format="";shell.site_language="";shell.news_and_media_view_all="";shell.close_str="";shell.of_str="";shell.next_str="";shell.previous_str="";shell.hide_location_str="";shell.change_location_str="";shell.is_application_frameset=false;shell.previous_step_str="";shell.next_step_str="";shell.finish_str="";shell.clear_form_str="";shell.input_form_name="";shell.form_paginated_steps=true;var form_labels_selected_index=[];shell.xhtml_doctype_fix=function(){var obj_link_targets=document.getElements("A");obj_link_targets.each(function(item){if(item.getAttribute("rel")==="external"){item.target="_blank"}})};shell.update_link_targets=function(mootools_elem){if(mootools_elem){var obj_links=mootools_elem.getElements("A");obj_links.each(function(item){item.target="_top"})}};shell.update_target=function(mootools_elem){if(mootools_elem){mootools_elem.target="_top"}};shell.NewsModule=new Class({initialize:function(mootools_elem,story){this.wrapper=mootools_elem;this.wrapper.yPosition=this.wrapper.getPosition().y;this.rss_matches=this.wrapper.getElements(".rss_detail");this.non_js_footer_link=this.wrapper.getElement(".news_and_media_releases");this.currentStory=1;this.numStories=this.rss_matches.length;this.paginationWrapper="";this.prevStoryLink=null;this.storyCounterText="";this.nextStoryLink=null;this.showAllLink=null;this.contractAllLink=null;this.footer=this.wrapper.getElement(".switch_rss_items");if(this.numStories>1){this.decorate(this.currentStory)}},decorate:function(story){this.displayStory(story);this.paginationWrapper=new Element("div",{"class":"pagination"});this.prevStoryLink=new Element("a",{href:"#","class":"prevStoryLink",style:"display:none"}).appendText(" ");this.prevStoryLink.addEvent("click",this.displayPrevStory.bind(this));this.storyCounterText=new Element("strong");this.storyCounterText.innerHTML="<span>"+this.currentStory+"</span> "+shell.of_str+" "+this.numStories;this.nextStoryLink=new Element("a",{href:"#","class":"nextStoryLink"}).appendText(" ");this.nextStoryLink.addEvent("click",this.displayNextStory.bind(this));this.showAllLink=new Element("a",{href:"#","class":"showall"});this.showAllLink.innerHTML=shell.news_and_media_view_all;this.showAllLink.addEvent("click",this.displayAllStories.bind(this));this.contractAllLink=new Element("a",{href:"#",style:"display:none;"});this.contractAllLink.innerHTML=shell.close_str;this.contractAllLink.addEvent("click",this.contractAllStories.bind(this));this.prevStoryLink.inject(this.paginationWrapper);this.storyCounterText.inject(this.paginationWrapper);this.nextStoryLink.inject(this.paginationWrapper);this.showAllLink.inject(this.paginationWrapper);this.contractAllLink.inject(this.footer);if(this.non_js_footer_link){this.non_js_footer_link.setStyle("display","none")}this.paginationWrapper.inject(this.footer)},displayStory:function(story){this.rss_matches.each(function(item,index){if(story!==index+1){item.setStyle("display","none")}else{item.setStyle("display","block")}})},displayPrevStory:function(e){for(var i=0;i<this.rss_matches.length;i++){if(this.rss_matches[i].getStyle("display")=="block"){this.rss_matches[i].setStyle("display","none");if(this.rss_matches[i].getPrevious()){this.rss_matches[i].getPrevious().setStyle("display","block");this.nextStoryLink.setStyle("display","inline");this.currentStory--;if(this.currentStory==1){this.prevStoryLink.setStyle("display","none")}break}}}this.setStoryCounterText();e.preventDefault()},displayNextStory:function(e){for(var i=0;i<this.rss_matches.length;i++){if(this.rss_matches[i].getStyle("display")=="block"){this.rss_matches[i].setStyle("display","none");if(this.rss_matches[i].getNext(".rss_detail")){this.rss_matches[i].getNext().setStyle("display","block");this.prevStoryLink.setStyle("display","inline");if(this.rss_matches[i].getNext(".rss_detail").getNext(".rss_detail")){this.nextStoryLink.setStyle("display","inline")}else{this.nextStoryLink.setStyle("display","none")}this.currentStory++;break}}}this.setStoryCounterText();e.preventDefault()},displayAllStories:function(e){this.rss_matches.each(function(item){item.setStyle("display","block")});this.paginationWrapper.setStyle("display","none");this.contractAllLink.setStyle("display","inline");if(this.non_js_footer_link){this.non_js_footer_link.setStyle("display","inline")}e.preventDefault()},contractAllStories:function(e){this.currentStory=1;this.prevStoryLink.setStyle("display","none");this.rss_matches.each(function(item,index){(index>0)?item.setStyle("display","none"):item.setStyle("display","block")});this.paginationWrapper.setStyle("display","block");this.contractAllLink.setStyle("display","none");if(this.non_js_footer_link){this.non_js_footer_link.setStyle("display","none")}this.setStoryCounterText();this.nextStoryLink.setStyle("display","inline");scroll(0,this.wrapper.yPosition);e.preventDefault()},setStoryCounterText:function(){this.storyCounterText.getElement("span").set("text",this.currentStory)}});shell.CountrySelectorModule=new Class({initialize:function(mootools_elem){this.wrapper=mootools_elem;this.display_mode=false;this.location_form=this.wrapper.getElement("form");this.location_fieldset=this.location_form.getElement("fieldset");this.location_select=this.location_fieldset.getElement("select");this.location_submit=this.location_fieldset.getElement("input");this.location_options=this.location_select.getElements("option");this.text_block=this.wrapper.getElement("div");this.switcher_anchor=null;this.hide_location_str=shell.hide_location_str;this.change_location_str=shell.change_location_str;this.country_trigger=null;this.location_list_wrapper=null;this.location_list=null;this.displayed_animated_list=false;this.resize_value=null;this.animation_duration=250;this.click_window_event=null;this.decorate();if(Browser.Engine.trident&&!shell.is_application_frameset){this.initialize_country_animation()}},decorate:function(){this.switcher_anchor=new Element("A",{href:"#"});this.switcher_anchor.innerHTML=this.switcher_anchor.title=(this.display_mode)?this.hide_location_str:this.change_location_str;this.switcher_anchor.addEvent("click",this.toggle_site_locations.bind(this));this.text_block.appendChild(this.switcher_anchor);this.location_form.addEvent("submit",function(){return false});this.location_submit.addEvent("click",function(){top.location.href=this.location_select.options[this.location_select.options.selectedIndex].value}.bind(this));this.location_form.setStyle("display","none")},toggle_site_locations:function(e){var event=Event(e);this.toggle_display_mode();this.switcher_anchor.innerHTML=this.switcher_anchor.title=(this.display_mode)?this.hide_location_str:this.change_location_str;this.show_hide_content();event.preventDefault()},toggle_display_mode:function(){this.display_mode=!this.display_mode},show_hide_content:function(){if((Browser.Engine.trident)&&(this.country_trigger)&&!shell.is_application_frameset){this.country_trigger.style.display=(this.display_mode)?"block":"none"}this.location_form.style.display=(this.display_mode)?"block":"none";if((Browser.Engine.trident&&shell.is_application_frameset)||!Browser.Engine.trident){this.location_select.style.display=(this.display_mode)?"block":"none"}},initialize_country_animation:function(){this.location_list_wrapper=new Element("DIV",{id:"location_list_wrapper"});this.location_list=new Element("UL",{id:"location_list"});var obj_span;this.country_trigger=new Element("H4",{id:"country_trigger"});obj_span=new Element("SPAN",{style:"display:block"});obj_span.innerHTML="Shell.com";obj_span.inject(this.country_trigger,"bottom");this.location_fieldset.insertBefore(this.country_trigger,this.location_fieldset.getElement("input"));for(var i=0;i<this.location_options.length;i++){var obj_li=new Element("LI");obj_li.set("html",this.location_options[i].innerHTML);obj_li.set("id","location_"+i);obj_li.addEvent("click",this.select_country.bind(this));obj_li.addEvent("mouseover",function(){$(this).addClass("hover")});obj_li.addEvent("mouseout",function(){$(this).removeClass("hover")});obj_li.inject(this.location_list,"bottom")}this.location_list.inject(this.location_list_wrapper,"bottom");this.location_list_wrapper.inject(this.location_form,"bottom");this.location_select.style.display="none";this.country_trigger.addEvent("click",this.animate_country_options.bind(this));this.click_window_event=this.click_window.bind(this)},animate_country_options:function(){if(this.displayed_animated_list){this.close_country_options()}else{this.open_country_options()}},open_country_options:function(){var animate=new Chain();var animation1=function(){this.location_list_wrapper.setStyle("border","solid 1px #000");this.location_list_wrapper.setStyle("padding","3px");var myFx=new Fx.Tween(this.location_list_wrapper);myFx.start("height","200px")}.bind(this);var animation2=function(){this.displayed_animated_list=true;$(document).getElement("body").addEvent("mousedown",this.click_window_event)}.bind(this);animate.chain(animation1);animate.chain(animation2);animate.callChain();animate.callChain.delay(1,animate)},close_country_options:function(){var animate=new Chain();var animation1=function(){this.location_list_wrapper.setStyle("paddingBottom","0px");this.location_list_wrapper.setStyle("paddingTop","0px")}.bind(this);var animation2=function(){var myFx=new Fx.Tween(this.location_list_wrapper);myFx.start("height","0px")}.bind(this);var animation3=function(){this.location_list_wrapper.setStyle("border","none");this.displayed_animated_list=false;$(document).getElement("body").removeEvent("mousedown",this.click_window_event)}.bind(this);animate.chain(animation1);animate.chain(animation2);animate.chain(animation3);animate.callChain();animate.callChain.delay(1,animate);animate.callChain.delay(this.animation_duration,animate)},select_country:function(e){var event=Event(e);var option_index=event.target.id.substring(9).toInt();if(option_index>=0){this.location_select.selectedIndex=option_index;var new_option_text=this.location_select[option_index].innerHTML;this.country_trigger.getElement("SPAN").set("html",new_option_text)}this.animate_country_options()},click_window:function(e){var event=Event(e);var in_list=false;try{if($(event.target).getParents()){var parents=$(event.target).getParents();for(var i=0;i<parents.length;i++){if(parents[i].id&&parents[i].id=="location"){in_list=true;break}}}}catch(error){}if(!in_list){if(this.displayed_animated_list){this.animate_country_options()}}}});shell.TabModule=new Class({initialize:function(mootools_elem){this.wrapper=mootools_elem;this.tabList=this.wrapper.getElement("UL");this.tabs=this.tabList.getChildren();this.tabHeaders=this.tabList.getElements("H2");this.tabAnchors=this.tabList.getElements("H2 A");this.tabContentWrappers=this.tabList.getElements("DIV.tab");this.selected_tab_index=1;if(top.location.href.indexOf("#showtab")!=-1){var tab_id=top.location.href.split("#showtab");this.selected_tab_index=(this.tabAnchors.length>=tab_id[1])?tab_id[1]:this.selected_tab_index}this.decorate(this.selected_tab_index)},decorate:function(selected_tab_index){this.tabList.addClass("tab_module");for(var i=0;i<this.tabAnchors.length;i++){this.tabAnchors[i].addEvents({mouseover:this.highlightTab.bind(this),mouseout:this.lowlightTab.bind(this),click:this.setSelectedTabIndex.bind(this)});this.tabHeaders[i].addClass("tab_header_"+(i+1))}this.initTabHeights();this.tabs[this.selected_tab_index-1].addClass("selected")},initTabHeights:function(){var tab_depth=0;var offset=29;this.tabHeaders.each(function(item){tab_depth=Math.max(tab_depth,parseInt(item.getSize().y))});this.tabAnchors.each(function(item){item.setStyle("height",(tab_depth)+"px")});this.wrapper.setStyle("padding-top",(tab_depth+offset)+"px")},setSelectedTabIndex:function(e){var event=new Event(e);var href=$(event.target).href;this.selected_tab_index=href.charAt(href.length-1);this.displayTabContent(this.selected_tab_index);event.preventDefault()},displayTabContent:function(index){for(var i=0;i<this.tabAnchors.length;i++){if(index-1!=i){this.tabs[i].removeClass("selected");this.tabAnchors[i].removeClass("selected")}else{this.tabs[i].addClass("selected");this.tabAnchors[i].addClass("selected")}}},highlightTab:function(e){var event=new Event(e);event.target.addClass("active");event.target.getParent("li").addClass("active")},lowlightTab:function(e){var event=new Event(e);event.target.removeClass("active");event.target.getParent("li").removeClass("active")}});shell.SearchModule=new Class({initialize:function(mootools_elem){this.form=mootools_elem;this.search_button=this.form.getElement("input[type=image]");this.search_input=this.form.getElement("input[type=text]");this.search_initial_value=this.search_input.getProperty("value");if(this.search_button&&this.search_input){this.decorate()}},decorate:function(){this.search_input.addEvent("focus",this.clear_input_search_text.bind(this));this.search_button.addEvent("click",this.check_search_input.bind(this));this.search_input.addEvent("keydown",this.check_keystroke_input.bind(this));this.search_input.addEvent("blur",this.reset_input_search_text.bind(this))},check_search_input:function(e){var event=Event(e);var value=this.search_input.getProperty("value");if(value==""||value==this.search_initial_value){event.preventDefault()}},check_keystroke_input:function(e){if(e.keyCode==13){this.check_search_input(e)}},clear_input_search_text:function(e){if(e.target.value==this.search_initial_value){this.search_input.value=""}},reset_input_search_text:function(e){if(e.target.value==""){this.search_input.value=this.search_initial_value}}});shell.PageToolsModule=new Class({initialize:function(mootools_elem){this.wrapper=mootools_elem;this.decorate();this.bookmarks_container=this.wrapper.getElement("li.bookmark div");this.bookmarks_height=this.get_bookmarks_height();this.bookmarks_container.setStyle("overflow","hidden");this.bookmarks_container.setStyle("height",0)},decorate:function(){this.wrapper.getElement("li.printer a").addEvent("click",this.print_page.bind(this));this.wrapper.getElement("li.printer a").addEvent("keypress",this.print_page.bind(this));this.wrapper.getElement("li.message a").addEvent("click",this.email_to_friend.bind(this));this.wrapper.getElement("li.message a").set("href","#email_to_a_friend_container");this.wrapper.getElement("li.bookmark a").addEvent("click",this.toggle_bookmarks.bind(this))},print_page:function(e){window.print();e.preventDefault()},get_bookmarks_height:function(){return this.bookmarks_container.getSize().y},toggle_bookmarks:function(e){e=Event(e);if(this.get_bookmarks_height()===0){this.bookmarks_container.setStyle("height",this.bookmarks_height)}else{this.bookmarks_container.setStyle("height",0)}e.preventDefault()},email_to_friend:function(e){var popup=window.open();var action=location.protocol+"//"+location.host+$("email_to_a_friend_form").getProperty("action");if(popup){var html=$("email_to_a_friend_container").innerHTML;if(popup.focus){popup.focus()}popup.document.write("<html><body></body></html>");popup.document.body.innerHTML=html;popup.document.forms.email_to_a_friend_form.action=action;popup.document.forms.email_to_a_friend_form.submit()}e.preventDefault()}});shell.AccordionModule=new Class({initialize:function(mootools_elem){this.container=mootools_elem;this.toggle_elems=this.container.getElements(".title");this.toggled_elems=this.container.getElements(".toggle");this.default_selected_index=-1;for(var i=0;i<this.toggle_elems.length;i++){if(this.toggle_elems[i].hasClass("selected")){this.default_selected_index=i;break}}this.display_options={show:this.default_selected_index,opacity:false};this.decorate()},decorate:function(){if(this.toggle_elems.length>1){if(this.display_options.show!=-1){this.toggle_elems[this.default_selected_index].addClass("selected");this.toggled_elems[this.default_selected_index].addClass("expanded")}new this.accordion("#"+this.container.id+" .title","#"+this.container.id+" .toggle",this.display_options)}else{this.toggle_elems[0].addClass("selected");this.toggled_elems[0].addClass("expanded");if(this.container.hasClass("accordion_non_its")){this.toggle_elems[0].addClass("expanded_single")}}},accordion:new Class({Extends:Accordion,display:function(index,useFx){if(!this.check(index,useFx)){return this}useFx=$pick(useFx,true);if(this.options.returnHeightToAuto){var prev=this.elements[this.previous];if(prev&&!this.selfHidden){for(var fx in this.effects){prev.setStyle(fx,prev[this.effects[fx]])}this.togglers[this.previous].removeClass("selected");prev.removeClass("expanded")}}this.togglers[index].addClass("selected");this.elements[index].addClass("expanded");index=($type(index)=="element")?this.elements.indexOf(index):index;if((this.timer&&this.options.wait)||(index===this.previous&&!this.options.alwaysHide)){return this}this.previous=index;var obj={};this.elements.each(function(el,i){obj[i]={};var hide;if(i!=index){hide=true}else{if(this.options.alwaysHide&&((el.offsetHeight>0&&this.options.height)||el.offsetWidth>0&&this.options.width)){hide=true;this.selfHidden=true}}this.fireEvent(hide?"background":"active",[this.togglers[i],el]);for(var fx in this.effects){obj[i][fx]=hide?0:el[this.effects[fx]]}},this);this.internalChain.chain(function(){if(this.options.returnHeightToAuto&&!this.selfHidden){var el=this.elements[index];if(el){el.setStyle("height","auto")}}}.bind(this));return useFx?this.start(obj):this.set(obj)}})});shell.SectionOverviewModule=new Class({initialize:function(mootools_elem){this.forms=mootools_elem.getElements("form");if(this.forms.length>0){for(var i=0;i<this.forms.length;i++){this.decorate(this.forms[i])}}},decorate:function(form){var _select=form.getElement("select");var _submit=form.getElement("input");form.setStyle("display","block");form.addEvent("submit",function(){return false});_submit.addEvent("click",function(){top.location.href=_select.options[_select.options.selectedIndex].value});_submit.addEvent("keypress",function(){top.location.href=_select.options[_select.options.selectedIndex].value});_submit.setProperty("value","")}});shell.FlashModule=new Class({initialize:function(mootools_elem){this.container=mootools_elem;this.config=null;for(var i=0;i<shell.flash_modules.length;i++){if(this.container.getElement("div")&&this.container.getElement("div").id){if(shell.flash_modules[i].id==this.container.getElement("div").id){this.config=shell.flash_modules[i];break}}}this.initial_innerHTML=this.container.innerHTML;if(Browser.Plugins.Flash&&Browser.Plugins.Flash.version&&Browser.Plugins.Flash.version==shell.gFpVersion){return}else{if(this.config!=null&&this.config.video_file!=""){this.display_html5_video(this.container);window.addEvent("load",this.check_html5_video.bind(this))}}},display_html5_video:function(mootools_elem){mootools_elem.innerHTML="";var video_elem=new Element("video",{width:this.config.width,height:this.config.height,controls:"controls",preload:"none"});var source_elem=new Element("source",{src:this.config.video_file});source_elem.inject(video_elem);video_elem.inject(mootools_elem)},check_html5_video:function(){var video=this.container.getElement("video");if(video){if(typeof video.play==="undefined"||(video.error&&video.error.code&&video.error.code>0)){if(video&&typeof video.pause==="function"){video.pause()}this.reset_html(video)}}},reset_html:function(video){this.container.innerHTML=this.initial_innerHTML}});shell.ie_fix_for_flash_and_text_with_options=function(mootools_elem){var flash=mootools_elem.getElements(".flash");var flash_obj=null;for(var i=0;i<flash.length;i++){if(flash[i].hasClass("right")){if(flash[i].getElement("object")){flash_obj=flash[i].getElement("object");if(flash_obj.width){flash[i].setStyle("width",flash_obj.width+"px")}}}}};shell.ie_fix_for_flash_and_impulse_pane=function(mootools_elem){var impulse_pane=$("impulse_pane");var clearing_div;if(Browser.Engine.trident){if(impulse_pane){clearing_div=new Element("div",{"class":"clearfix"});clearing_div.appendText(" ");clearing_div.inject(impulse_pane.getParent(),"bottom")}}};window.addEvent("domready",function(){if(location.href.indexOf("/home/page/")!=-1){if(top.frames&&top.frames.length>0){for(var i=0;i<top.frames.length;i++){if(top.frames[i].name&&top.frames[i].name=="top_bar"){shell.is_application_frameset=true;break}}}}var modules=$$(".module");modules.each(function(module){if(module.hasClass("country_selector")){new shell.CountrySelectorModule(module);return}if(module.hasClass("rss_wrapper")){new shell.NewsModule(module);return}if(module.hasClass("tabbed")){new shell.TabModule(module);return}if(module.hasClass("page_tools")){new shell.PageToolsModule(module);return}if(module.hasClass("accordion")){new shell.AccordionModule(module);return}if(module.hasClass("search")){new shell.SearchModule(module);return}if(module.hasClass("section_overview")){new shell.SectionOverviewModule(module);return}if(module.hasClass("flash")){new shell.FlashModule(module);if(Browser.Engine.trident){shell.ie_fix_for_flash_and_impulse_pane(module)}return}if(module.hasClass("text_with_options")){if(Browser.Engine.trident){shell.ie_fix_for_flash_and_text_with_options(module);shell.ie_fix_for_flash_and_impulse_pane(module)}return}});if(shell.is_application_frameset){shell.update_link_targets($("content"));shell.update_link_targets($$(".navigation")[0]);shell.update_link_targets($$(".shell_logo")[0]);shell.update_link_targets($("country_switch"));shell.update_link_targets($("header"));shell.update_target($$("form.search")[0])}});window.addEvent("load",function(){shell.xhtml_doctype_fix();if(shell.is_application_frameset){var frame_rows=top.document.getElementById("frame_rows");var frame_rows_frames=(frame_rows.children)?frame_rows.children:frame_rows.ChildNodes;for(var i=0;i<frame_rows_frames.length;i++){if(frame_rows_frames[i].name&&frame_rows_frames[i].name=="content"){frame_rows.rows="100,"+(top.frames.heading.$("content").getScrollSize().y+20)+",*";break}}}});shell.appObj=function(oNew,oDef){var oTemp={};for(var propertyName in oDef){if(!(oDef[propertyName] instanceof Function)){oTemp[propertyName]=oDef[propertyName]}}for(var propertyName in oNew){if(!(oNew[propertyName] instanceof Function)){oTemp[propertyName]=oNew[propertyName]}}return oTemp};function flash_transition(objJSON){if(!window.location.href.match(/\.content\.shell\.com/)){if(objJSON.onclick!=""&&objJSON.onclick!="null"){eval(objJSON.onclick)}}if(objJSON.href!=""){if(objJSON.target=="_blank"){window.open(objJSON.href)}else{window.location.href=objJSON.href}}};
