﻿var $ = jQuery.noConflict();



$(document).ready(function () {
    $('.mainpagebutton').hover(function () {
        var imageUrl = $(this).attr('value');
        $('#mainimage').attr("src", imageUrl);
    }, function () {
        $('#mainimage').attr("src", "Resources/img/mainDefault.jpg");
    });
});



$(document).ready(function () {
    /* homepage slideshow */
    $('#slider').cycle({
        timeout: 8000,  // milliseconds between slide transitions (0 to disable auto advance)
        fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...            
        pager: '#pager',  // selector for element to use as pager container
        next: '#next-slider',  // selector for element to use as click trigger for next slide
        prev: '#prev-slider',  // selector for element to use as click trigger for previous slide
        pause: 0,   // true to enable "pause on hover"
        cleartypeNoBg: true, // set to true to disable extra cleartype fixing (leave false to force background color setting on slides)
        pauseOnPagerHover: 0 // true to pause when hovering over pager link
    });

    $("span[class^='newstitle']").hover(function () {
        $("span[id^='datebox" + $(this).attr("id") + "']").css("background", "#fe872a");
    }, function () {
        $("span[id^='datebox" + $(this).attr("id") + "']").css("background", "#ccc");
    });

    $('.txtSearch').bind("click hover", function () {
        if ($(this).val() == "Arama" || $(this).val() == "Arama için en az üç karakter girmelisiniz!")
            $(this).attr("value", "");

        $(this).css("color", "#000");
    });
    $('.txtSearch').blur(function () {
        if ($(this).val() == "")
            $(this).attr("value", "Arama");

        $(this).css("color", "#858585");
    });
});

function Redirect(_url) {
    window.location.href = _url;
}

function ShowPreview(_videoUrl, _previewUrl) {
    $("#player").html('<div id="temp"></div>');
    var flashvars = {}; var params = {};
    params.quality = "high";
    params.wmode = "transparent";
    params.allowscriptaccess = "sameDomain";
    params.allowfullscreen = "true";
    var attributes = {};
    attributes.id = "playerobject";
    attributes.name = "playerobject";
    attributes.align = "middle";
    flashvars.videoUrl = _videoUrl;
    flashvars.previewUrl = "preview.jpg";
    flashvars.IsShare = true;
    flashvars.width = 460;
    flashvars.height = 345;
    flashvars.cingilUrl = ""
    flashvars.mediaUrl = document.location.href;
    swfobject.embedSWF("/Resources/avp.swf", "temp", "460", "345", "10.0.0", "", flashvars, params, attributes);
}

Cufon.replace('h1')('h1 a')('h2')('h3')('h4')('h5')('h6')('#top-navigation ul#topnav > li > a', { hover: true })('.datebox')('.header-right p');
