    function getWindowHeight(){
        if(window.innerHeight){
            return window.innerHeight;
        }else if(document.documentElement.clientHeight){
            if(document.documentElement.clientHeight==0){
                return document.body.clientHeight;
            }
            else{
                return document.documentElement.clientHeight;
            }
        }
    }
    
	function vid_popup_74fd8x7(o){
		if(o.attr("id") == "background_popup_74fd8x7" || 
		   o.attr("id") == "popup_cont_close_74fd8x7"){
			swfobject.removeSWF("popup_flash_74fd8x7");
			jQuery("#background_popup_74fd8x7").hide();
			jQuery("#popup_cont_74fd8x7").hide();
			jQuery("#popup_flash_wrap_74fd8x7").html('<div id="popup_flash_74fd8x7"></div>');
		} else {
			center_popup_74fd8x7();
			jQuery("#background_popup_74fd8x7").css({"opacity": "0.7"});
			jQuery("#background_popup_74fd8x7").fadeIn(300);
			jQuery("#popup_cont_74fd8x7").fadeIn(300, function(){vid_content_load_74fd8x7(o.attr("href"));});
		}
	}

	function center_popup_74fd8x7(){
		if(window.XMLHttpRequest) {
			jQuery("#popup_cont_74fd8x7").css({
				"top": getWindowHeight()/2 - jQuery("#popup_cont_74fd8x7").height()/2,
				"left": document.documentElement.clientWidth/2 - jQuery("#popup_cont_74fd8x7").width()/2
			});
		} else { 
			jQuery("#background_popup_74fd8x7").css({
				"height": getWindowHeight()*1.5, 
				"width": document.documentElement.clientWidth,
				"top": jQuery().scrollTop()
			});
			jQuery("#popup_cont_74fd8x7").css({
				"top": jQuery().scrollTop() + getWindowHeight()/2 - jQuery("#popup_cont_74fd8x7").height()/2,
				"left": document.documentElement.clientWidth/2 - jQuery("#popup_cont_74fd8x7").width()/2
			});
		}
	}

	jQuery(function(){
		jQuery(".vid_links_74fd8x7 a, .img_vis_1_2_74fd8x7, #popup_cont_close_74fd8x7, #background_popup_74fd8x7").click(function(){
			vid_popup_74fd8x7(jQuery(this));
			return false;
		});
	});

	function vid_content_load_74fd8x7(file_id) { 
		var flashvars = {};
		flashvars.videoSource = "http://www.productsandservices.bt.com/consumer/consumerProducts/flash/entertainment/videos/" + file_id.replace('#','') + ".flv";
		var params = {allowScriptAccess:"sameDomain"};
		swfobject.embedSWF(
			"http://www.productsandservices.bt.com/consumer/consumerProducts/flash/entertainment/BTVideoPlayer.swf", 
			"popup_flash_74fd8x7", 
			"640", "360", "9.0.0","", 
			flashvars, params);
	}

    jQuery(function() { 
	
		jQuery('.pnl_search_74fd8x7 form a').click(function(){
			jQuery(this).parent().submit();
		});

		jQuery('.cntnt_swch_74fd8x7').click(function() {
			cntnt_swtchr_74fd8x7( jQuery(this).attr('href') );
			jQuery('.cntnt_swch_74fd8x7').removeClass('active_74fd8x7');
			jQuery(this).addClass('active_74fd8x7');
			return false;
	    });
		
        jQuery('.head_m_link_74fd8x7').click(function() {
			if (jQuery(this).hasClass('bt_vision_m_link_74fd8x7_u')) {
				jQuery('#tab_slider_74fd8x7').animate({left:'+=208'},500);
				jQuery('.bt_vision_m_link_74fd8x7_u').removeClass("bt_vision_m_link_74fd8x7_u").addClass("bt_vision_m_link_74fd8x7_a");
				jQuery('.bt_broadband_m_link_74fd8x7_a').removeClass("bt_broadband_m_link_74fd8x7_a").addClass("bt_broadband_m_link_74fd8x7_u");
			} else 
			if (jQuery(this).hasClass('bt_broadband_m_link_74fd8x7_u')){
				jQuery('#tab_slider_74fd8x7').animate({left:'-=208'},500);
				jQuery('.bt_vision_m_link_74fd8x7_a').removeClass("bt_vision_m_link_74fd8x7_a").addClass("bt_vision_m_link_74fd8x7_u");
				jQuery('.bt_broadband_m_link_74fd8x7_u').removeClass("bt_broadband_m_link_74fd8x7_u").addClass("bt_broadband_m_link_74fd8x7_a");
			}
			
			if (jQuery(this).hasClass('bt_vision_m_link_74fd8x7_a')) { 
				cntnt_swtchr_74fd8x7("#vision_74fd8x7_2");
			} else
			if (jQuery(this).hasClass('bt_broadband_m_link_74fd8x7_a')) {
				cntnt_swtchr_74fd8x7("#broadband_74fd8x7_0");
			}
			jQuery('.cntnt_swch_74fd8x7').removeClass('active_74fd8x7');
			return false;
	    });
		jQuery('.cntnt_pnl_74fd8x7').filter(':not(:first)').hide();
		jQuery('#rss_cntnr_74fd8x7').html(generate_rss_74fd8x7());
    });
	
	String.prototype.trim = function() {
		return this.replace(/^\s+|\s+$/g,"");
	}

	function cntnt_swtchr_74fd8x7(the_element){
		if (jQuery(the_element).is(':not(:visible)')) {
			jQuery('.cntnt_pnl_74fd8x7:visible').fadeOut(200, function(){
				jQuery(the_element).fadeIn(350);
			});
		}
		return false;
	}
	
	function generate_rss_74fd8x7() {
		var output = '';
		for(i in feed1){
			if (i < 4) {
				if (i != 0) output+='<div class="rss_spcr_74fd8x7"></div>';
				output+='<a class="rssitem_74fd8x7" href="'+feed1[i].url+'">'+feed1[i].title.trim()+'</a>';
			}
		} 
		return output;
	}
        
    function BTPopup(href) {
        var bt_window = window.open(href,"BT_"+Math.ceil(Math.random()*1000),"width=800,height=600,titlebar=no,scrollbars=yes");
        bt_window.focus();
        return false;
    }
