﻿$(document).ready(function () {
    $('.block-hover').hover(function () {
        $(this).addClass('hover');
    }, function () {
        $(this).removeClass('hover');
    });

    $(".block-hover").click(function () {
        window.location = $(this).find("a").attr("href"); return false;
    });
    $('.inp-value').click(
		function () {
		    if (this.value == this.defaultValue) {
		        this.value = '';
		    }
		})
	.blur(
		function () {
		    if (this.value == '') {
		        this.value = this.defaultValue;
		    }
		}
	);
    $('#thematique ul li').hover(function () {
        $(this).css('opacity', '0.5');
    }, function () {
        $(this).css('opacity', '1');
    });
    $('#container #produit .product-tabs').show();
    $('ul#nav-top').children().last().css('border', '0');
    $('ul#nav-top li').each(function () {
        var largeurOnglets = $(this).width();
        $(this).children('ul').css('width', largeurOnglets + 'px');
        $(this).children('ul').children('li').children('a').css('width', largeurOnglets - 36 + 'px');
    });
    $('h3.ms-WPTitle').append('<br class="clear" />');
    $('#container #standard-content #wf-brochetdoc ul li:not(.rcbItem)').each(function () {
        $(this).not(':has(div, input)').remove();
    });
    $('ul.RequestJournalistAccount_Container li').each(function () {
        $(this).not(':has(label)').remove();
    });
    $('#bodywf .custom-font, #bodywf .panier h3,#bodywf #container.ms-WPTitle, #bodywf .custom-font-selus, #bodywf #produit h4.custom-font-selus, #bodywf #wf-contactus-minimal a, #bodywf #header #recherche-top td.ms-sbtext span, #bodywf .product-subscription a, #bodywf .helvetica, #bodywf a.btn-red, #bodywf .wp-webfactory-createuser .wp-webfactory-createuser-btnsubmit, #bodywf .wp-webfactory-createuser .wp-webfactory-createuser-btnmodify, #bodywf a.wf-trans').show();
    $('.wp-webfactory-createuser .fieldset ul, #wf-brochetdoc ul').not(':has(li)').remove();
    $("input[type='text'], input[type='password']", "ul.demos-login").bind({ "keyup": function (event) { if (event.keyCode == '13') { event.stopPropagation(); event.preventDefault(); $("input[type='submit']", "ul.demos-login").trigger("click"); } }, "keydown": function (event) { if (event.keyCode == '13') { event.stopPropagation(); event.preventDefault(); } }, "keypress": function (event) { if (event.keyCode == '13') { event.stopPropagation(); event.preventDefault(); } } });
    $(".wp-webfactory-createuser input").bind({ "keyup": function (event) { if (event.keyCode == '13') { event.stopPropagation(); event.preventDefault(); $.globalEval($(".wp-webfactory-createuser-btnsubmit").attr("href").replace("javascript:", "")); } }, "keydown": function (event) { if (event.keyCode == '13') { event.stopPropagation(); event.preventDefault(); } }, "keypress": function (event) { if (event.keyCode == '13') { event.stopPropagation(); event.preventDefault(); } } });
    $("div#payment-content-top input").bind({ "keyup": function (event) { if (event.keyCode == '13') { event.stopPropagation(); event.preventDefault(); if ($(this).parents("div.block-payment-content").length && $(this).parents("div.block-payment-content").siblings("div.block-payment-bottom").length && $(this).parents("div.block-payment-content").siblings("div.block-payment-bottom").find("a[href*=Update]").length) { $.globalEval($(this).parents("div.block-payment-content").siblings("div.block-payment-bottom").find("a[href*=Update]").attr("href").replace("javascript:", "")); } } if (event.keyCode == '27') { event.stopPropagation(); event.preventDefault(); if ($(this).parents("div.block-payment-content").length && $(this).parents("div.block-payment-content").siblings("div.block-payment-bottom").length && $(this).parents("div.block-payment-content").siblings("div.block-payment-bottom").find("a[href*=Cancel]").length) { $.globalEval($(this).parents("div.block-payment-content").siblings("div.block-payment-bottom").find("a[href*=Cancel]").attr("href").replace("javascript:", "")); } } }, "keydown": function (event) { if (event.keyCode == '13') { event.stopPropagation(); event.preventDefault(); } }, "keypress": function (event) { if (event.keyCode == '13') { event.stopPropagation(); event.preventDefault(); } } });
    $.each($(".telerikPlayer"), function (index, elem) { var $elem = $(elem); var videoUrl = $elem.text(); $elem.text(""); $elem.css({ height: "390px", width: "550px", display: "block" }); $elem.flowplayer("/_LAYOUTS/Demos/ClientSide/flowplayer-3.2.7.swf", { key: "#@66804b03b3b27f18eb2", clip: { autoPlay: false, autoBuffering: true, url: videoUrl} }); });
    $.each($(".demos-brainplayer"), function (index, elem) { var context = $(this); var videoUrl = $(".videoUrl", context).text(); var pictureUrl = $(".pictureUrl", context).text(); var width = $(".width", context).text(); var height = $(".height", context).text(); if (!videoUrl) { return; } context.empty(); $("<object>").attr({ "classid": "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000", "codebase": "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0", "width": width, "height": height, "id": "dif_" + index + "_250X188", "align": "middle" }).append($("<param>").attr({ "name": "allowScriptAccess", "value": "sameDomain" })).append($("<param>").attr({ "name": "quality", "value": "high" })).append($("<param>").attr({ "name": "bgcolor", "value": "#fff" })).append($("<param>").attr({ "name": "movie", "value": "http://storage02.brainsonic.com/customers/demos/player4_3.swf?richPlayerConfigFileUrl=http://storage02.brainsonic.com/customers/demos/player.xml&fileFLV=" + videoUrl + (!!pictureUrl ? "&filePicture=" + pictureUrl : "") })).append($("<embed>").attr({ "quality": "high", "bgcolor": "#fff", "width": width, "height": height, "name": "video_stage", "align": "middle", "allowscriptaccess": "sameDomain", "type": "application/x-shockwave-flash", "pluginspage": "http://www.macromedia.com/go/getflashplayer", "src": "http://storage02.brainsonic.com/customers/demos/player4_3.swf?richPlayerConfigFileUrl=http://storage02.brainsonic.com/customers/demos/player.xml&fileFLV=" + videoUrl + (!!pictureUrl ? "&filePicture=" + pictureUrl : "") })).appendTo(context); context.css("display", "inline-block"); });
});
