jQuery(function($) {
    
    //$("<p>Hello world!</p>").appendTo("body"); 
    
    // code for image cycler
	var index = 0;
	var images = $(".img_holder img");
	var imgW = $(images).attr("width");
    
	//$(images).slice(0,3).clone().appendTo(".img_holder");
    //$(".img_holder").width(imgW * images.length * 2);
    
	for (i=0; i<images.length; i++)
	{
		$(images[i]).addClass("image-"+i);
        
        if (i != 0) { $(images[i]).hide(); }
	}

	show(index);
	setInterval(sift, 5000);

	function sift()
	{
		if (index<(images.length-1))
        {
			index+=1 ; 
		} else {
			index=0
		}
		
		show(index);
	}

	function show(num)
	{
		$(images).fadeOut(400);
		$(".image-"+num).stop().fadeIn(400);

        //var scrollPos = (num+1)*imgW;
		//$(".img_holder").stop().animate({right: scrollPos}, 400);		
		//console.log(scrollPos, "img.image-"+num);
    }

	$("#slider").easySlider({
		auto: true, 
		continuous: true,
		controlsShow: false,
		pause:	6000,
		speed: 	1200
	});

  
    $(".name_input").hide();
    $(".phone_input").hide();
    $(".org_input").hide();
    $(".org_add_input").hide();
    $(".dept_input").hide();
    $(".email_input").hide();
    $(".pass_input").hide();
    
    
    $(".name_edit .edit").mouseup(function(){
      $(".name_edit").hide();
      $(".name_input").show();
    }).mousedown(function(){ });

    $(".phone_edit .edit").mouseup(function(){
      $(".phone_edit").hide();
      $(".phone_input").show();
    }).mousedown(function(){ });
    
    $(".org_edit .edit").mouseup(function(){
      $(".org_edit").hide();
      $(".org_input").show();
    }).mousedown(function(){ });
    
    $(".org_add_edit .edit").mouseup(function(){
      $(".org_add_edit").hide();
      $(".org_add_input").show();
    }).mousedown(function(){ });
    
    $(".dept_edit .edit").mouseup(function(){
      $(".dept_edit").hide();
      $(".dept_input").show();
    }).mousedown(function(){ });

    $(".email_edit .edit").mouseup(function(){
      $(".email_edit").hide();
      $(".email_input").show();
    }).mousedown(function(){ });
    
    $(".pass_edit .edit").mouseup(function(){
      $(".pass_edit").hide();
      $(".pass_input").show();
    }).mousedown(function(){ });
  
});
