(function($){

/*   */
  $.fn.later = function (msec, method) {

    var that = this,
    args = Array.prototype.slice.apply(arguments, [2]); 
    if (typeof method === 'string') { 
      method = that[method]; 
    } 

    setTimeout(function () { 
      $(that).each(function(){
        method.apply($(this), args);
      });        
    }, msec);
    return $(that); 
  }; 
  /* highlight opened menu*/
 $(function(){
  $('a').each(function(){ 
  if (document.location.href.indexOf(this.href)==0){
    $(this).addClass('act');
  }
  });
  if($('a.act').length==1){
    $('a').each(function(){ 
    if (document.location.href.indexOf(this.href)!=0){
      $(this).addClass('onback');
    }
    });
  }
  }); 
  
/* show and hide */
$(function(){
    $("a.login_show").click(function(){
        $(".login_panel").slideToggle("slow");
        $('a.login_show').toggleClass("active");
    });
});


/* hover link */
$(function(){

	$('.block_inside a')
		.css( {backgroundPosition: "0 0"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(-250px 0)"}, {duration:500})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(-450px 0)"}, {duration:200, complete:function(){
				$(this).css({backgroundPosition: "0 0"})
			}})
		})

	$('.acc_btn a')
		.css( {backgroundPosition: "-20px 35px"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(-20px 94px)"}, {duration:500})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(40px 35px)"}, {duration:200, complete:function(){
				$(this).css({backgroundPosition: "-20px 35px"})
			}})
		})
		
			$('.vblock_next a')
		.css( {backgroundPosition: "-20px 35px"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(-20px 94px)"}, {duration:500})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(40px 35px)"}, {duration:200, complete:function(){
				$(this).css({backgroundPosition: "-20px 35px"})
			}})
		})

});

/* skroll news */
/*
	$(document).ready(function(){
		$(".skroll_news").ScrollNews({
				  inizialize : 'true',
				  size : '130px',
				  timeout : 1800,
				  speed : 'medium',
				  direction : 'up',
				  onmouseover : 'stop'
		});	
	});
*/

/* txt gradient */ 
/*
	$(function(){
$('.scan_txt').spanize('anim',1);
function animateit(){
$('.navitem').hide();
$('.scan_txt').textscan({
  spanize:-1,
  unspanize:-1,
  spanClass:'anim',
  initColor:'000',
  endColor:'000',
  transColor:'0F0',
  cb:function(){$('.navitem').show();}});
}
});
*/
/*end txt gradient*/

/* hover animate */
	$(document).ready(function(){
		var f_color = '';
		$(".navitem a").hover(function() {
    		f_color = this.style.color;
			$(this).animate({ backgroundColor: "#4f94d0", color: "#ffffff" }, 700);
		},function()
		{
			$(this).animate({ backgroundColor: "white", color: f_color }, 200);
		});
	});



/* go top */
$(document).ready(function(){
    $(".go_top a").click(function(){
	     for (I=150; I>=1; I--)
         {self.scroll(1,I)}});
    });
/* end */


})(jQuery);

