﻿jQuery.noConflict();

jQuery(document).ready(function($) {

	$('a.external').attr('target', '_blank');
	$('.itpajegos-gallery-image').css({ opacity: 0.4 });
	$('.itpajegos-preview-image').css({ opacity: 0.4 });
	$('img.itpajegos-gallery-image').tooltip();

	if ($.browser.msie){
		$('#s5_loginpop').attr('style', 'filter:alpha(opacity=0)');
	} else {
		$('#s5_loginpop').attr('style', 'opacity:0');
	}
	
	$('span[rel]').overlay({
		expose: { 
			color: '#fff', 
			loadSpeed: 200, 
			opacity: 0.7 
		}, 
		effect: 'apple',
		closeOnClick: false 
	});
		
	$('img[rel]').overlay({
		expose: { 
			color: '#fff', 
			loadSpeed: 200, 
			opacity: 0.7 
		}, 
		effect: 'apple',
		closeOnClick: false 
	});
	
	$('.itpajegos-gallery-image').hover(
        function() {
            $(this).fadeTo('fast', 1);
        },
        function() {
            $(this).fadeTo('fast', 0.4);
	});

    $('.itpajegos-preview-image').hover(
        function() {
            $(this).fadeTo('fast', 1);
        },
        function() {
            $(this).fadeTo('fast', 0.4);
	});
	
	$('td.itpajegos-table-title a').hover(
        function() {
            var cControl = $(this).parent().parent().parent().children();
            var cGallery = cControl[0].children[0];
            $(cGallery).fadeTo('fast', 1);
        },
        function() {
            var cControl = $(this).parent().parent().parent().children();
            var cGallery = cControl[0].children[0];
            $(cGallery).fadeTo('fast', 0.4);
	});

    $('.itpajegos-preview-image').click(function() {
        $(this).overlay({
            expose: {
                color: '#fff',
                loadSpeed: 200,
                opacity: 0.7
            },
            effect: 'apple',
            closeOnClick: false
		}); 
	});
})
