﻿


/**
 * --------------------------------------------------------------------
 * jQuery-Plugin "pngFix"
 * Version: 1.1, 11.09.2007
 * by Andreas Eberhard, andreas.eberhard@gmail.com
 *                      http://jquery.andreaseberhard.de/
 *
 * Copyright (c) 2007 Andreas Eberhard
 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([237-9n-zA-Z]|1\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(s(m){3.fn.pngFix=s(c){c=3.extend({P:\'blank.gif\'},c);8 e=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 5.5")!=-1);8 f=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 6.0")!=-1);p(3.browser.msie&&(e||f)){3(2).B("img[n$=.C]").D(s(){3(2).7(\'q\',3(2).q());3(2).7(\'r\',3(2).r());8 a=\'\';8 b=\'\';8 g=(3(2).7(\'E\'))?\'E="\'+3(2).7(\'E\')+\'" \':\'\';8 h=(3(2).7(\'F\'))?\'F="\'+3(2).7(\'F\')+\'" \':\'\';8 i=(3(2).7(\'G\'))?\'G="\'+3(2).7(\'G\')+\'" \':\'\';8 j=(3(2).7(\'H\'))?\'H="\'+3(2).7(\'H\')+\'" \':\'\';8 k=(3(2).7(\'V\'))?\'float:\'+3(2).7(\'V\')+\';\':\'\';8 d=(3(2).parent().7(\'href\'))?\'cursor:hand;\':\'\';p(2.9.v){a+=\'v:\'+2.9.v+\';\';2.9.v=\'\'}p(2.9.w){a+=\'w:\'+2.9.w+\';\';2.9.w=\'\'}p(2.9.x){a+=\'x:\'+2.9.x+\';\';2.9.x=\'\'}8 l=(2.9.cssText);b+=\'<y \'+g+h+i+j;b+=\'9="W:X;white-space:pre-line;Y:Z-10;I:transparent;\'+k+d;b+=\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;\';b+=\'J:K:L.t.M(n=\\\'\'+3(2).7(\'n\')+\'\\\', N=\\\'O\\\');\';b+=l+\'"></y>\';p(a!=\'\'){b=\'<y 9="W:X;Y:Z-10;\'+a+d+\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;">\'+b+\'</y>\'}3(2).hide();3(2).after(b)});3(2).B("*").D(s(){8 a=3(2).11(\'I-12\');p(a.A(".C")!=-1){8 b=a.13(\'url("\')[1].13(\'")\')[0];3(2).11(\'I-12\',\'none\');3(2).14(0).15.J="K:L.t.M(n=\'"+b+"\',N=\'O\')"}});3(2).B("input[n$=.C]").D(s(){8 a=3(2).7(\'n\');3(2).14(0).15.J=\'K:L.t.M(n=\\\'\'+a+\'\\\', N=\\\'O\\\');\';3(2).7(\'n\',c.P)})}return 3}})(3);',[],68,'||this|jQuery||||attr|var|style||||||||||||||src|navigator|if|width|height|function|Microsoft|appVersion|border|padding|margin|span|px|indexOf|find|png|each|id|class|title|alt|background|filter|progid|DXImageTransform|AlphaImageLoader|sizingMethod|scale|blankgif|appName|Internet|Explorer|parseInt|MSIE|align|position|relative|display|inline|block|css|image|split|get|runtimeStyle'.split('|'),0,{}))






//Alternative message for browsers that don't support window.print
function printPage(){
  if (window.print){
    window.print();
  }else{
    alert("Sorry, your browser does not support this feature. To print the page choose Print from your browser's menu (usually File > Print). Windows users can also use 'CTRL + P' and Mac users can also use 'Command + P'.");
  }
}

//Writes out the print page icon and link - x is for all the pages, y is for the home page
function printlink(){
    var x, y
    
    if (document.getElementById("printpage") != null ) {
        x = document.getElementById("printpage");
        x.innerHTML = '<p><a class="print" href="#" onclick="printPage();return false;" title="Print this page">Print this page</a></p>';
    }
    if (document.getElementById("printhomepage") != null ) {
        y = document.getElementById("printhomepage");
        y.innerHTML = '<a href="#" onclick="printPage();return false;" title="Print this page"><img src="/assets/images_structure/icon_print_page.gif" width="14" height="13" alt="Print this page" /> <span class="hidden">Print this page</span></a>';    
    }
}




var theframe = $('<iframe frameborder="0" scrolling="auto"></iframe>');
var iframe_href = "";


$(document).ready(function() {
/***************************************************************************************************
    Left navigation
****************************************************************************************************/
$(".left-col ul ul ul ").wrap("<span></span>");

$('.header').removeClass('noscript');

/***************************************************************************************************
    Accessibility on focus
****************************************************************************************************/
$(".skip_acc").click(function(){ 
   $(".acc").focus();
   return false;
 }
);



/***************************************************************************************************
  Video light box
***************************************************************************************************/ 



	$('.lightbox-iframe').bind("click",function(){
		
		$('.videoLightBox').remove();
		$('body').append('<div class="videoLightBox"><a href="#" alt="Close video" class="close"><img src="/rio-apps/video-lightbox/close.png"  width="28" height="28"/></a><div class="contentWrap"></div></div>');
			
			iframe_href = $(this).attr("href"); 
		
				$(".videoLightBox").overlay({
					mask: {
						color: '#0F0F0F',
						loadSpeed: 200,
						opacity: 0.9
					},
					onLoad:function(){
								$('.videoLightBox .close').fadeIn(600);
					},
					onBeforeLoad: function() {
						var wrap = this.getOverlay().find(".contentWrap");
						$(theframe).attr({ src: iframe_href, style: 'height:345px; width:541px; border:none; background-color:#FFFFFF;' });
						wrap.html(theframe);
					},
					load: true,
					onClose: function(){
				
									$('.contentWrap').empty();

						/*$(theframe).find("#videoplayer")
					
					
						var myVideoPlayer = document.getElementById("myVideoPlayer_id");
						myVideoPlayer.sendEvent("STOP");*/
						
					}
				});
	
	
			return false;
	});





/***************************************************************************************************
    Fontsize images replacement
***************************************************************************************************/ 



var language = $('.language .active');
var fontsize = $('.fontsize .active');

if($('ul').hasClass("language")) {
  language.attr('src',language.attr('src').replace(/([^.]*)\.(.*)/, "$1_o.$2"));
}

fontsize.attr('src',fontsize.attr('src').replace(/([^.]*)\.(.*)/, "$1_o.$2"));


  
$('.hoverThis').hover(
  function(){ 
    var t = $(this);
    if(!$(this).hasClass("active")){
    
      if(!$(this).attr('src').match(/_o.gif$/)) {
        t.attr('src',t.attr('src').replace(/([^.]*)\.(.*)/, "$1_o.$2"));
      }
      
    }
  },
  function(){ 
    var t= $(this);
    if(!$(this).hasClass("active")){    
      t.attr('src',t.attr('src').replace('_o',''));
    }
  }
);

$('.hoverThis').parent().focus(
  function(){ 
    var t = $(this).children();
    if(!$(this).children().hasClass("active")){
    
     if(!$(this).children().attr('src').match(/_o.gif$/)) {
      t.attr('src',t.attr('src').replace(/([^.]*)\.(.*)/, "$1_o.$2"));
      }
     }
  }),

$('.hoverThis').parent().blur(  
  function(){ 
    var t= $(this).children();
    if(!$(this).children().hasClass("active")){    
    
      t.attr('src',t.attr('src').replace('_o',''));
    }
  }
);





$('input[type="image"]').hover(function(){ 
    var t = $(this);
    if(!$(this).hasClass("active")){
    
      if(!$(this).attr('src').match(/_o.gif$/)) {
        t.attr('src',t.attr('src').replace(/([^.]*)\.(.*)/, "$1_o.$2"));
      }
      
    }
  },
  function(){ 
    var t= $(this);
    if(!$(this).hasClass("active")){    
      t.attr('src',t.attr('src').replace('_o',''));
    }
  }
);


$('input[type="image"]').focus(function(){ 
    var t = $(this);
    if(!$(this).hasClass("active")){
    
      if(!$(this).attr('src').match(/_o.gif$/)) {
        t.attr('src',t.attr('src').replace(/([^.]*)\.(.*)/, "$1_o.$2"));
      }
      
    }
  }),

$('input[type="image"]').blur(
function(){ 
    var t= $(this);
    if(!$(this).hasClass("active")){    
      t.attr('src',t.attr('src').replace('_o',''));
    }
  }
);


/***************************************************************************************************
    Homepage carousel
****************************************************************************************************/  


  $('#s4').before('<div id="nav" class="nav">').cycle({
  fx:     'fade',
  speed:  'slow',
  timeout: 6000,
  pager:  '#nav',
  before: function() {/* if (window.console) console.log(this.src); */ }
  });

  $('#nav').children(':first').addClass('pad');

   $('.png-fix').pngFix(); 
   

});



























