﻿/// <reference path="jquery-1.5.min.js" />
$(document).ready(function () {
    $(".truncate").truncate();

    $(".imodal").fancybox({
        'width': '85%',
        'height': '95%',
        'autoScale': false,
        'transitionIn': 'none',
        'transitionOut': 'none',
        'type': 'iframe',
        'hideOnOverlayClick': false,
        'onClosed': function () {
            location.reload();
        }
    });

    flowplayer("a.video", "/Scripts/flowplayer.commercial-3.2.7.swf", {

        key: '#$9d88b8eb7a1f554bb4e',
        clip: {
            scaling: 'fit'
        },
        canvas: {
            backgroundGradient: 'none',
            backgroundColor: '#000000'
        },
        plugins: {
		controls: {
			
			backgroundColor: "transparent",
			backgroundGradient: "none",
			sliderColor: '#FFFFFF',
			sliderBorder: '1.5px solid rgba(160,160,160,0.7)',
			volumeSliderColor: '#FFFFFF',
			volumeBorder: '1.5px solid rgba(160,160,160,0.7)',

			timeColor: '#ffffff',
			durationColor: '#535353',

			tooltipColor: 'rgba(255, 255, 255, 0.7)',
			tooltipTextColor: '#000000'
		}
	}
    });

    $('#txtSearch').keypress(function (e) {

        if (e.keyCode == 13) {
            window.location = "/SearchResults.aspx?q=" + encodeURIComponent($('#txtSearch').val());
            e.stopPropagation();
            e.preventDefault();
        }

    });


    $(".pager a").each(function (indx, item) {
        item = $(item);
        var attr = item.attr('href');
        if (attr.indexOf("tpv") > 0) {
            item.attr('href', attr + "#gal2");
        }
        else {
            item.attr('href', attr + "#gal");
        }
    });
});
