﻿// window.onerror = function(){return true};
        
var LoadingTxt = "<img src='Images/Loading.gif' style='width:15px;'> ";
$(document).ready(function(){


// $("#ResimGalerisiali a").lightBox();

   $(".print").click(function(){
        var thisID = $(this).attr("thisID");
        var PageURL = "../PrintPage/" + thisID
        Popup(PageURL,"Yazıcı Dostu Sayfa","width=700,height=600,scrollbars=1");
   });
   
    $(".Menu").find("div").click(function(){
        var rel = $(this).attr("rel");
        var Hid = $("#" + rel).css("display");
        var thisTxt = $("#" + rel).text();
        if ( thisTxt == "" ) {
            $("#" + rel).html("<div class='NoProduct'>Bu kategoriye ait ürün bulunamadı.</div>")
        }
        if ( Hid == "none" ) {
             $("#" + rel).parent().find(".MenuItems").slideUp("fast").animate({paddingLeft: "0px"},100);
             $("#" + rel).slideDown("fast");
             $("#" + rel).animate({paddingLeft: "5px"},50);
             $("#" + rel).animate({paddingLeft: "10px"},100);
        }
        else {
             $("#" + rel).animate({paddingLeft: "0px"},100);
             $("#" + rel).slideUp("fast");
        }
        var href = $(this).attr("href");
        if ( href != null ) {
            Redirect(href);
        } 
    });
        $(".ProductImagesBig a").lightBox();
          $(".ProductImagesSmall img").click(function(){
              $("#ProductImagesBigPic").attr("src",$(this).attr("thisBig"));
              $("#ProductImagesBigPicA").attr("href",$(this).attr("thisA"))
              $(".ProductImagesBig").lightBox();

        
    });

$(".izlevideo").click(function(){
        var videoURL = "../video.aspx?Video=" + $(this).attr("thisVideo")
        Popup(videoURL,"Video","width=420,height=370,status=no")
    });
    $(".ProductFormTitle").click(function(){
        $(".ProductFormContent").slideToggle("fast");
    })
        $(".ProductFormTitle2").click(function(){
        $(".ProductFormContent2").slideToggle("fast");
    })
});




function Redirect(href) {
    window.location = href;
}

function Popup(URL,Name,W) {
    window.open (URL,name,W); 
}

function Weather(Deger)
 {
    var il = "http://www.dmi.gov.tr/sunum/imgtahmingor-c1-g.aspx?merkez="+ Deger +"&gun=1";
    document.getElementById('resim').src = il;
 }
 
function FlashGetir(Gelen) {
var Adres = "../Uploads/Flash/"+Gelen;
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="600" height="215" id="Object1" align="middle">')
document.write('<param name="allowScriptAccess" value="sameDomain" />')
document.write('<param name="allowFullScreen" value="true" />')
document.write('<param name="quality" value="high" />')
document.write('<param name="movie" value="' + Adres + '" />')
document.write('<embed src="'+ Adres +'" quality="high" width="600" height="215" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />')
document.write('</object>')
}
