

//-------accordion
$(document).ready(function(){
  /* if ( $("#commodities")){
	$("#commodities h4").next().hide("slow"); 
        $("#commodities h4").click(function () { 
        if(this.index==0||!this.index){ 
              	   $(this).removeClass();
          	   $(this).next().show("slow"); 
                   this.index=1;
            	 }else{ 
                   $(this).next().show("slow"); 
                   $(this).removeClass();
                   $(this).next().hide("slow"); 
                   this.index=0; 
                 }
         });
         $("#commodities h4").mouseover(function () {
                   $(this).css("cursor","pointer");
         });
         $("#commodities h4").mouseout(function () {
                   $(this).removeClass()
     		
      	 });
  }


  //----------------------- /accordion
  //-----------------------tabs
	var arr=[];
	var active = ("#tab_list li:first-child a");
	var passive=null;
    

  	$("#tab_list li:first-child a").addClass("active");
        var a=1;
        $("#fragment-2").hide(); 
	$("#tab_list a").click(function(){
        if(a==1){$("#tab_list li:first-child a").removeClass("active"); a=2;}
        if(passive==null ){$("#fragment-1").hide();}
       			if(passive!=null){
                $(passive).hide("slow");
 				$(passive_btn).removeClass("active");
 				$(passive_btn).addClass("passive");
  		}
        
		$(this).addClass("active");
		$(this.hash).show("slow");
		 passive = this.hash;
		 passive_btn=this;
			  
 	 })*/

	//------------------------gallery
	var liq =  $('ul#gallery_points >li').length;
	var imageHeight = 112;
	var pointsHeight = (imageHeight*liq);
	var pointsHeight = ("130"*liq);
    	var startPose;
    	var endPose;
    	var curPose;
	startPose =  $("#gallery_points").css("top");
     	endPose = startPose + pointsHeight;
                var isMoving = false;
		function Moved() {
			isMoving = false;
		}
 
        
        function showBigPic(x, y){
                $("#bigpic").hide();
         	$("#bigpic").html(x);
         	$("#bigpic").fadeIn("slow");

        }
        var htmlStr = "<img src='"+     $("#gallery_points img:first").attr("src")+"' />";
        hPic = $("#gallery_points img").attr("height");
        if( $("#bigpic") ){
        	showBigPic(htmlStr, hPic);
        }

//--------------------------OVER PREV
	$("#gallery_prev").mouseover(function() {
	 	$(this).css("cursor","pointer");          
	}).mouseout(function(){ 

	});

	 
//--------------------------OVER NEXT
	$("#gallery_next").mouseover(function() {
    	 	$(this).css("cursor","pointer");
	}).mouseout(function(){

	});

//--------------------------CLICK PREV
	$("#gallery_next").click(function() {
 		ep=(pointsHeight*(-1))+200;       
	curPose = $("#gallery_points").css("top");
	var e = Math.abs(ep);
	var c = Math.abs(parseInt(curPose));
	if(c < e){

	isMoving = true;
 	$("#gallery_points").animate( { top:"-=100px" } , 100, 'swing', Moved);
 	 curPose = $("#gallery_points").css("top");
 	 
	}
	})

//--------------------------CLICK NEXT
$("#gallery_prev").click(function() {        
	curPose = $("#gallery_points").css("top");
	if( curPose < startPose+100 && isMoving == false){
		isMoving = true;
 		$("#gallery_points").animate( { top:"+=100px" } , 100, 'swing', Moved)
	}
})

//---------------------------------------
	 $("img.imagepoint").mouseover(function () {
	  	 $(this).css("cursor","pointer").css("border","1px solid #387da8").animate({opacity:1},100)
         }).mouseout(function () {
		 $(this).css("border","1px solid #b2b6be").animate({opacity:0.6},100)
         });
 
	 $("img.imagepoint").click(function () {
		var heightAttr = $("#bigpic img").attr("height"); 
	    	htmlStr = "<img src='"+     $(this).attr("src")+"' />";
            	//hPic = $(this).attr("height");
                hPic = $("#bigpic").attr("height","400px");
            
            if( $("#bigpic") ){
    		showBigPic(htmlStr, hPic);
            }
  	
         });
    
    
//-----------------------DECORATION
 
/*

$("#identification").prepend("<div id='IDclose'><h3>Login</h3></div>");
$("#identification").hide(); 
$("#IDshort").click(function () { 
                 $("#IDshort").hide(); 
                 $("#identification").slideDown(); 
  
                 });
$("#IDclose").click(function () { 
                 $("#identification").slideUp('fast', function() {
    // Animation complete.
  });

                 $("#IDshort").show(); 
                 });

 $("body").mousemove(function(e){
      var pageCoords = e.pageX;
      var xFlakes = $("#flakes").css("left", (pageCoords*(-1))/4);
      var xShariki = $("#shariki").css("left", (pageCoords*(-1))/6);
 });

//





*/


//------------------------------top menu


$("#navigation ul li").each(function() { if ($.trim( $(this).find('span a').text() ).length < 12) $(this).find('a').css('padding-top','5px') })


});

//jScrollPane
$(document).ready(function(){
	$('.scroll-pane').jScrollPane();
});



