$(document).ready(function() {
	$('a[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
	/*$.sifr({
		build: 436,
		version: 3,
		save: true
	});
	$("h1").sifr({
		path: "/flash/fonts/",
		font: 'sifr',
		fontSize: 23,
		style: {
			letterSpacing: 0.6
		}
	}); 
	$("h2").sifr({
		path: "/flash/fonts/",
		font: 'sifr',
		fontSize: 17,
		style: {
			letterSpacing: 0.3
		}
	}); 
	$("h3").sifr({
		path: "/flash/fonts/",
		font: '01',
		fontSize: 16,
		style: {
			letterSpacing: 0
		}
	}); 
	$("h4").sifr({
		path: "/flash/fonts/",
		font: '01',
		fontSize: 14,
		style: {
			letterSpacing: 0
		},
		overX:1.5
	}); 
	 $("#main li a").sifr({
		path: "/flash/fonts/",
		font: '01',
		fontSize: 14,
		style: {
			letterSpacing: 0
		},
		overX:1.08
	}); 
	$("li.phone .phone-code").sifr({
		path: "/flash/fonts/",
		font: '01',
		fontSize: 13,
		style: {
			leading: 20
		}
	}); 
	$("li.phone .phone-number").sifr({
		path: "/flash/fonts/",
		font: '01',
		fontSize: 33
	});*/
});

$(document).ready(function(){
//align element in the middle of the screen
 $.fn.alignCenter = function() {
 //get margin left
 var marginLeft = - $(this).width()/2 + 'px';
 //get margin top
 var marginTop = - $(this).height()/2 + 'px';
 //return updated element
 return $(this).css({'margin-left':marginLeft, 'margin-top':marginTop});
 };

 $.fn.togglePopup = function(){
 //detect whether popup is visible or not
 if($('#popup').hasClass('hidden'))
 {
 //hidden - then display
 //when IE - fade immediately
 if($.browser.msie)
 {
 $('#opaco').height($(document).height()).toggleClass('hidden')
 .click(function(){$(this).togglePopup();});
 }
 else
 //in all the rest browsers - fade slowly
 {
 $('#opaco').height($(document).height()).toggleClass('hidden').fadeTo('slow', 0.4)
 .click(function(){$(this).togglePopup();});
 }

 $('#popup')
 .html($(this).html())
 .alignCenter()
 .toggleClass('hidden');
 }
 else
 {
 //visible - then hide
 $('#opaco').toggleClass('hidden').removeAttr('style').unbind('click');
 $('#popup').toggleClass('hidden');
 }
 };
}); 
