
/* Modified by Attila Pest, 2010-04-09 09:59:32 EST */
  
  // POST JSON
  $.postJSON = function(url, data, callback) { $.post(url, data, callback, "json"); };
  
  $(document).ready(function(){

    // FANCYBOX
    $("a.fancybox").fancybox({
      'overlayShow'     : false,
      'zoomSpeedIn'     : 600,
      'zoomSpeedOut'    : 500,
      'easingIn'        : 'easeOutBack',
      'easingOut'       : 'easeInBack',
      'titlePosition'   : 'inside',
      'centerOnScroll'  : 'true',
      'cyclic'          : 'true'
    }); 
    
    $("#videocat").change(function(){
        link= "http://www.tibet.hu/videok/";
        if (($("#videocat").val()!=0)) link = link + $("#videocat").val();
        document.location.href=link;   
    });
    
    $("#linkcat").change(function(){
        link= "http://www.tibet.hu/linkek/";
        if (($("#linkcat").val()!=0)) link = link + $("#linkcat").val();
        document.location.href=link;   
    });
    
    $("#linkcat").change(function(){
        link= "http://www.tibet.hu/linkek/";
        if (($("#linkcat").val()!=0)) link = link + $("#linkcat").val();
        document.location.href=link;   
    });
    
    $("#hirdatum").change(function(){
        link= "http://www.tibet.hu/tibet-press/";
        link = link + $("#hirdatum").val();    
        document.location.href=link;   
    });
    
    $("#filmtartalom").change(function(){
        link= "http://www.tibet.hu/filmtartalom/";
        if (($("#filmtartalom").val()!=0)) link = link + $("#filmtartalom").val();
        document.location.href=link;   
    });
    
    $("#mozidatum").change(function(){
        link= "http://www.tibet.hu/mozi/";
        if (($("#mozidatum").val()!=0)) link = link + $("#mozidatum").val();
        document.location.href=link;   
    });

    $("#dharmadatum").change(function(){
        link= "http://www.tibet.hu/dharma-press/";
        if (($("#dharmadatum").val()!=0)) link = link + $("#dharmadatum").val();
        document.location.href=link;   
    });
    
    $("#ehirdatum").change(function(){
        link= "http://www.tibet.hu/tibet-press-english/";
        if (($("#ehirdatum").val()!=0)) link = link + $("#ehirdatum").val();    
        document.location.href=link;   
    });
    
    $("#konyvrendez").change(function(){
        link= "http://www.tibet.hu/dharma-bolt-konyvek/";
        if (($("#konyvrendez").val()!=0)) link = link + $("#konyvrendez").val();    
        document.location.href=link;   
    });
    
    $("#dvdrendez").change(function(){
        link= "http://www.tibet.hu/dharma-bolt-mozgokep/";
        if (($("#konyvrendez").val()!=0)) link = link + $("#dvdrendez").val();    
        document.location.href=link;   
    });
    
    $("#szoborrendez").change(function(){
        link= "http://www.tibet.hu/dharma-bolt-szobrok/";
        if (($("#szoborrendez").val()!=0)) link = link + $("#szoborrendez").val();    
        document.location.href=link;   
    });

    $("#targyrendez").change(function(){
        link= "http://www.tibet.hu/dharma-bolt-targyak/";
        if (($("#targyrendez").val()!=0)) link = link + $("#targyrendez").val();    
        document.location.href=link;   
    });    
    
    $("#keprendez").change(function(){
        link= "http://www.tibet.hu/dharma-bolt-kepek/";
        if (($("#keprendez").val()!=0)) link = link + $("#keprendez").val();    
        document.location.href=link;   
    });

    $("#fustolorendez").change(function(){
        link= "http://www.tibet.hu/dharma-bolt-fustolok/";
        if (($("#fustolorendez").val()!=0)) link = link + $("#fustolorendez").val();    
        document.location.href=link;   
    });        
    
    //Comment answer
    $("[id^='comm_']").click(function(event){
      event.preventDefault();
      id=$(this).attr("id").split("_");
      var str = $("#commnent_" + id[1]).text();
      str1 = "Válasz erre: " + str + "\r\n";
      $("#more").empty();
      $("#more").append(str1 + "<input type='hidden' name='CommAnsw' value='" + str + "' />" + "<input type='hidden' name='CommAnswID' value='" + id[1] + "' />");
      window.top.location.href="#hsz"; 
    });
      //Comment previous
    $("[id^='pre_']").click(function(event){
      event.preventDefault();
      id=$(this).attr("id").split("_");
      $("#prev" + id[1]).toggle();
    });
    
    //image fancybox
    $("img[src*='tn_']").click(function(event){      
      var src = $(this).attr("src");
      src = src.replace("tn_", "");
      if (src.indexOf("/write/galeria",0)==-1){
        event.preventDefault();
      //alert(src);
        $.fancybox({
    			'overlayShow'     : false,
          'zoomSpeedIn'     : 600,
          'zoomSpeedOut'    : 500,
          'easingIn'        : 'easeOutBack',
          'easingOut'       : 'easeInBack',
          'titlePosition'   : 'inside',
          'centerOnScroll'  : 'true',
          'href'			      : src
        });
      }  
		}); 
  });

