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=$("a");obj_link_targets.each(function(index,item){if(item.getAttribute("rel")==="external"){item.target="_blank"}})};shell.update_link_targets=function(jquery_obj){if(jquery_obj){var obj_links=$("a");obj_links.each(function(index,item){item.target="_top"})}};shell.update_target=function(jquery_obj){if(jquery_obj){jquery_obj.target="_top"}};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}}}shell.CountrySelectorModule={initialize:function(jquery_obj){if(jquery_obj.length===0){return}this.wrapper=jquery_obj;this.display_mode=false;this.location_form=this.wrapper.find("form:first");this.location_fieldset=this.location_form.find("fieldset:first");this.location_select=this.location_fieldset.find("select:first");this.location_submit=this.location_fieldset.find("input:first");this.location_options=this.location_select.find("option");this.text_block=this.wrapper.find("div:first");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.decorate();if($.browser.msie&&!shell.is_application_frameset){this.initialize_country_animation()}},decorate:function(){this.switcher_anchor=$('<a href="#"></a>');this.switcher_anchor.innerHTML=this.switcher_anchor.title=(this.display_mode)?this.hide_location_str:this.change_location_str;this.switcher_anchor.append(this.switcher_anchor.innerHTML);this.switcher_anchor.bind("click",this,this.toggle_site_locations);this.text_block.append(this.switcher_anchor);this.location_form.bind("submit",function(){return false});this.location_submit.bind("click",this,this.changeLocation);this.location_form.css("display","none")},changeLocation:function(e){if(e.data.location_select.selectedIndex){top.location.href=e.data.location_options[e.data.location_select.selectedIndex].value}else{top.location.href=e.data.location_select.val()}e.preventDefault()},toggle_site_locations:function(e){e.data.toggle_display_mode();if(e.data.display_mode){e.data.wrapper.find("a:first").html(e.data.hide_location_str)}else{e.data.wrapper.find("a:first").html(e.data.change_location_str)}e.data.show_hide_content();e.preventDefault()},toggle_display_mode:function(){this.display_mode=!this.display_mode},show_hide_content:function(){if(($.browser.msie)&&(this.country_trigger)&&!shell.is_application_frameset){this.country_trigger.css("display",(this.display_mode)?"block":"none")}this.location_form.css("display",(this.display_mode)?"block":"none")},initialize_country_animation:function(){this.location_list_wrapper=$('<div id="location_list_wrapper"></div>');this.location_list_wrapper.css("display","none");this.location_list=$('<ul id="location_list"></ul>');this.country_trigger=$('<h4 id="country_trigger"></h4>');var obj_span=$('<span style="display:block">Shell.com</span>');this.country_trigger.append(obj_span);this.location_fieldset.prepend(this.country_trigger);for(var i=0;i<this.location_options.length;i++){var obj_li=$('<li id="location_'+i+'"></li>');obj_li.append(this.location_options[i].innerHTML);obj_li.bind("click",this,this.select_country);obj_li.bind("mouseover",this,function(e){$(e.target).addClass("hover")});obj_li.bind("mouseout",this,function(e){$(e.target).removeClass("hover")});this.location_list.append(obj_li)}this.location_list_wrapper.append(this.location_list);this.location_form.append(this.location_list_wrapper);this.location_select.css("display","none");this.country_trigger.bind("click",this,this.animate_country_options);$("body:first").bind("mousedown",this,this.click_window)},animate_country_options:function(e){if(e.data.displayed_animated_list){e.data.close_country_options()}else{e.data.open_country_options()}},open_country_options:function(){this.location_list_wrapper.slideDown("3000");this.displayed_animated_list=true;$(document).find("body:first").bind("mousedown",this,this.click_window)},close_country_options:function(){this.location_list_wrapper.slideUp("3000");this.displayed_animated_list=false;$(document).find("body").unbind("mousedown",this.click_window)},select_country:function(e){var option_index=parseInt(e.target.id.substring(9));if(option_index>=0){e.data.location_select.selectedIndex=option_index;var new_option_text=$(e.data.location_options[option_index]).text();e.data.country_trigger.find("span").text(new_option_text)}e.data.animate_country_options(e)},click_window:function(e){var in_list=false;try{if($(e.target).parents("#location").length>0){in_list=true}}catch(error){}if(!in_list){if(e.data.displayed_animated_list){e.data.animate_country_options(e)}}}};shell.newsModule={enable:function(jquery_obj){var items=$(".module.rss_wrapper");if(items.length===0){return}items.each(function(){var tmp,prev,next,info,size,html="";size=$(this).find("> ul > li").size();tmp=$(".switch_rss_items a.news_and_media_releases").text();html+='<div class="old_pager">';html+='<a class="prevStoryLink" href="#">&nbsp;</a>';html+='<span class="info"> 1 '+shell.of_str+" "+size+" </span>";html+='<a class="nextStoryLink" href="#">&nbsp;</a>';html+=' | <a href="#" class="expand">'+tmp+"</a>";html+="</div>";$(this).find("> ul").after(html);next=$(this).find(".nextStoryLink");prev=$(this).find(".prevStoryLink").hide();info=$(this).find(".info");$(this).find("> ul").cycle({fx:"none",speed:"fast",timeout:0,pause:0,next:next,prev:prev,after:function(curr,next,opts,fwd){var height=$(this).height();$(this).parent().height(height+16)},onPrevNextEvent:function(isNext,idx,element){idx===0?prev.hide():prev.show();idx===size-1?next.hide():next.show();idx+=1;info.text(" "+idx+" "+shell.of_str+" "+size+" ")}});$(this).find(".switch_rss_items a.news_and_media_releases").hide();$(this).find(".expand").click(function(){shell.newsModule.disable();return false})})},disable:function(){var items=$(".module.rss_wrapper");if(items.length===0){return}items.find("> ul").cycle("destroy");items.find(".old_pager").remove();items.find("ul:first").attr("style","");items.find("ul:first > li").attr("style","");items.find(".switch_rss_items a.news_and_media_releases").show()},reload:function(){this.disable();this.enable()}};shell.tabsModule={enable:function(){var items=$(".module.tabbed");if(items.length===0){return}items.each(function(){$(this).find("ul:first").before('<div class="pager"></div>');$(this).find("ul:first").cycle({fx:"none",speed:"fast",timeout:0,pause:0,pager:$(this).find(".pager"),pagerAnchorBuilder:function(idx,element){var h2=$(element.firstChild),link=h2.html();h2.hide();return link},after:function(curr,next,opts,fwd){var h=$(this).height();$(this).parent().height(h)}})})},disable:function(){var items=$(".module.tabbed");items.find(".pager").remove();items.find("ul:first > li > h2").show();items.find("ul:first").attr("style","");items.find("ul:first > li").attr("style","")},reload:function(){this.disable();this.enable()}};shell.SearchModule={initialize:function(jquery_obj){if(jquery_obj.length===0){return}this.form=jquery_obj;this.search_button=this.form.find("input[type=image]");this.search_input=this.form.find("input[type=text]");this.search_initial_value=this.search_input.val();this.decorate()},decorate:function(){this.search_input.bind("focus",this,this.clear_input_search_text);this.search_button.bind("click",this,this.check_search_input);this.search_input.bind("keydown",this,this.check_keystroke_input);this.search_input.bind("blur",this,this.reset_input_search_text)},check_search_input:function(e){var value=$(e.target).parents("form").find("input:text").val();if(value==""||value==e.data.search_initial_value){e.preventDefault()}},check_keystroke_input:function(e){if(e.keyCode==13){e.data.check_search_input(e)}},clear_input_search_text:function(e){if(e.target.value==e.data.search_initial_value){e.target.value=""}},reset_input_search_text:function(e){if(e.target.value==""){e.target.value=e.data.search_initial_value}}};shell.SearchNewsModule={initialize:function(jquery_obj){if(jquery_obj.length===0){return}this.wrapper=jquery_obj;this.initial_search_value=shell.search_news_default_text;this.decorate()},decorate:function(){this.wrapper.find("input.submit:first").css("display","none");$("#search_news_term").bind("focus",this,function(e){if(e.target.value==e.data.initial_search_value){e.target.value=""}});$("#search_news_term").bind("blur",this,function(e){if(e.target.value==""){e.target.value=e.data.initial_search_value}});var fieldset=this.wrapper.find("fieldset:first");var input_form_submit_div=$('<div class="livetext_button"></div>');var input_form_submit_a=$('<a href="#"></a>');input_form_submit_a.bind("click",function(){$("#search_news").submit();return false});var input_form_submit_strong=$("<strong></strong>").text(shell.search_news_button_label);input_form_submit_a.append(input_form_submit_strong);input_form_submit_div.append(input_form_submit_a);fieldset.append(input_form_submit_div)}};shell.PageToolsModule={initialize:function(jquery_obj){this.wrapper=jquery_obj;this.bookmarks_container=this.wrapper.find("li.bookmark div:first");this.email_form=this.wrapper.find("#email_to_a_friend_form");this.decorate()},decorate:function(){this.bookmarks_container.css("display","none");this.wrapper.find("li.printer a:first").bind("click",this,this.print_page);this.wrapper.find("li.printer a:first").bind("keypress",this,this.print_page);this.wrapper.find("li.message a:first").bind("click",this,this.email_to_friend);this.wrapper.find("li.bookmark a:first").bind("click",this,this.toggle_bookmarks)},print_page:function(e){window.print();e.preventDefault()},toggle_bookmarks:function(e){e.data.bookmarks_container.toggle("slow");e.preventDefault()},email_to_friend:function(e){var popup=window.open("about:blank","emaff");if(popup&&popup.focus){popup.focus()}e.data.email_form.attr("target","emaff");e.data.email_form.submit();e.preventDefault()}};shell.AccordionModule={initialize:function(){var items=$(".module.accordion"),that=this;if(items.length===0){return}items.each(function(){var i;that.container=$(this);that.title=$(this).find(".title");that.toggled_elems=$(this).find(".toggle");that.default_selected_index=-1;for(i=0;i<that.title.length;i+=1){if($(that.title[i]).hasClass("selected")){that.default_selected_index=i;break}}that.display_options={show:that.default_selected_index,opacity:false};that.decorate()})},decorate:function(){if(this.title.length>1){for(var i=0;i<this.toggled_elems.length;i++){var title=$(this.title[i]);var toggled=$(this.toggled_elems[i]);if(i!=this.display_options.show){toggled.css({display:"none"});title.bind("click",this,this.showHideContent)}else{title.addClass("selected");toggled.addClass("expanded")}}}else{$(this.title[0]).addClass("selected");$(this.toggled_elems[0]).addClass("expanded");if(this.container.hasClass("accordion_non_its")){$(this.title[0]).addClass("expanded_single")}}},showHideContent:function(e){var clicked_title=($(e.target).hasClass("title"))?$(e.target):$(e.target).parent(".title:first");var related_content=clicked_title.next();var titles=$(e.target).parents(".module:first").find(".title");var toggled=$(e.target).parents(".module:first").find(".toggle");for(var i=0;i<titles.length;i++){if($(titles[i]).hasClass("selected")){$(titles[i]).bind("click",e.data,e.data.showHideContent);$(titles[i]).removeClass("selected");$(toggled[i]).removeClass("expanded");$(toggled[i]).slideUp("500")}}clicked_title.addClass("selected");related_content.addClass("expanded");clicked_title.unbind("click",e.data.showHideContent);related_content.slideDown("500");e.preventDefault()}};shell.SectionOverviewModule={initialize:function(jquery_obj){if(jquery_obj.length===0){return}this.wrapper=jquery_obj;this.forms=this.wrapper.find("form");if(this.forms.length>0){for(var i=0;i<this.forms.length;i++){this.decorate($(this.forms[i]))}}},decorate:function(form){var button=$('<input type="image" src="'+shell.server_prefix+'images/global/go_button.gif">');form.find("input:first").replaceWith(button);form.css("display","block");form.bind("submit",function(){return false});button.bind("click",this,this.changeURL);button.bind("keypress",this,this.changeURL)},changeURL:function(e){var options=$(e.target).parents("form:first").find("option");for(var i=0;i<options.length;i++){if(options[i].selected){top.location.href=options[i].value;break}}e.preventDefault()}};shell.FlashModule={initialize:function(jquery_obj){this.container=jquery_obj;this.config=null;for(var i=0;i<shell.flash_modules.length;i++){if(this.container.find("div:first").length>0&&this.container.find("div:first").id){if(shell.flash_modules[i].id==this.container.find("div:first").id){this.config=shell.flash_modules[i];break}}}this.initial_innerHTML=this.container.innerHTML;if(swfobject&&swfobject.getFlashPlayerVersion().major==shell.gFpVersion){return}else{if(this.config!=null&&this.config.video_file!=""){this.display_html5_video(this.container);$(document).load(this.check_html5_video)}}},display_html5_video:function(mootools_elem){mootools_elem.innerHTML="";var video_elem=$('<video width="'+this.config.width+'" height="'+this.config.height+'" controls="controls" preload="none"></video>');var source_elem=$("<source src="+this.config.video_file+'"></source>');video_elem.append(source_elem);mootools_elem.append(video_elem)},check_html5_video:function(e){var video=e.data.container.find("video:first");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()}}},reset_html:function(){this.container.innerHTML=this.initial_innerHTML}};shell.ie_fix_for_flash_and_text_with_options=function(jquery_obj){var flash=jquery_obj.find(".flash"),flash_obj=null;if(!$.browser.msie){return}for(var i=0;i<flash.length;i++){flash[i]=$(flash[i]);if(flash[i].hasClass("right")){if(flash[i].find("object:first").length>0){flash_obj=flash[i].find("object:first");if(flash_obj.width){flash[i].css("width",flash_obj.width+"px")}}}}};shell.ie_fix_for_flash_and_impulse_pane=function(jquery_obj){var impulse_pane=$("#impulse_pane"),clearing_div;if(!$.browser.msie){return}if(impulse_pane.length>0){clearing_div=impulse_pane.find("div.clearfix:first-child");if(clearing_div.length==0){clearing_div=$('<div class="clearfix" style="height:0.1em;"> </div>');impulse_pane.prepend(clearing_div)}}};shell.check_if_application_frameset=function(){if(location.href.indexOf("/home/page/")!=-1){if(top.frames&&top.frames.length>0){for(var i=0;i<top.frames.length;i+=1){if(top.frames[i].name&&top.frames[i].name=="top_bar"){return true}}}}return false};$(document).ready(function(){shell.is_application_frameset=shell.check_if_application_frameset();shell.AccordionModule.initialize();shell.CountrySelectorModule.initialize($(".module.country_selector"));shell.newsModule.enable();shell.SearchModule.initialize($(".module.search"));shell.SearchNewsModule.initialize($(".module.search_news"));shell.tabsModule.enable();shell.SectionOverviewModule.initialize($(".module.section_overview"));shell.ie_fix_for_flash_and_impulse_pane($(".module.flash"));shell.ie_fix_for_flash_and_impulse_pane($(".module.text_with_options"));shell.ie_fix_for_flash_and_text_with_options($(".module.text_with_options"));if(shell.is_application_frameset){shell.update_link_targets($("#content"));shell.update_link_targets($(".navigation:first"));shell.update_link_targets($(".shell_logo:first"));shell.update_link_targets($("#country_switch"));shell.update_link_targets($("#header"));shell.update_target($("form.search:first"))}});$(window).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="50,"+(top.frames.breadcrumbs.$("#content").height()+20)+","+(top.frames.heading.$("#content").height()+20)+", *";break}}}});shell.appObj=function(oNew,oDef){var oTemp={},propertyName;for(propertyName in oDef){if(!(oDef[propertyName] instanceof Function)){oTemp[propertyName]=oDef[propertyName]}}for(propertyName in oNew){if(!(oNew[propertyName] instanceof Function)){oTemp[propertyName]=oNew[propertyName]}}return oTemp};
