﻿function GlobalLoad() {

    var BasePath = $("#ctl00_ctl00_Head_Head_BasePath").attr("href");

    LoadFlash();
    
    $("*[rel=jsabox_img]").click(function() {
        $("#jsaboxcontent").html("<a href='" + $(this).attr("href") + "' target='blank' title='Resmin tam boyutu için tıklayın.'><img style='height:70%;border:0;' src='" + $(this).attr("href") + "' /></a>");
        $("#jsabox").show();
        return false;
    });
    
    $("*[rel=jsabox_imgf]").click(function() {
        $("#jsaboxcontent").html("<div class='lightboxcontents'><img src='" + $(this).attr("href") + "' /></div>");
        $("#jsabox").show();
        return false;
    });
    
    $("*[rel=jsabox_swf]").click(function() {
        $("#jsaboxcontent").html("<div type='Flash' src='" + $(this).attr("href") + "' width='" + $(this).attr("width") + "' height='" + $(this).attr("height") + "'></div>");
        $("#jsabox").show();
        LoadFlash();
        return false;
    });
    
    $("#jsabox").click(function() {
        CloseItem();
    });
    
    $("*[rel=jsabox_video]").click(function() {
        $("#jsaboxcontent").html("<div type='Flash' class='lightboxcontents' src='Flash/VideoPlayer.swf?pvideo=" + BasePath + $(this).attr("href") + "' width='300px' height='250px'></div>");
        LoadFlash();
        $("#jsabox").show();
        return false;
    });
    
    $(".container .header .headertop a.icon").each(function(){
        $(this).css("background-image","url('" + $(this).attr("rel") + "')");
    });

    $(".Phone").mask("(999) 999-9999");
    
    
//    $(".inputtext").focus(function(){$(this).css("background-position","left bottom");}).blur(function(){$(this).css("background-position","left top");});
//    $(".focusempty").each(function(){$(this).focusEmpty()});
}

function openImage(fileUrl) {
    $("#jsaboxcontent").hide().html("<div type='Flash' src='Flash/LightBox.swf?urlPic=" + fileUrl + "' width='620px' height='420px'></div>");
    //$("#jsaboxcontent").hide().html("<a href='" + fileUrl + "' target='blank' title='Resmin tam boyutu için tıklayın.'><img style='border:0;' src='" + fileUrl + "' /></a>");
    $("#jsabox").show();
    LoadFlash();
    setTimeout(function(){
    $("#jsaboxcontent").slideDown(300);
    },200);
}

function CloseItem(){
    $("#jsaboxcontent").slideUp(250);
    setTimeout(function(){ $("#jsabox").hide(); $("#jsaboxcontent").show(); },250);
}
