
(function(jQuery) {
jQuery.fn.fadeInSequence = function(fadeInTime, timeBetween)
{
    //Default Values
    timeBetween = typeof(timeBetween) == 'undefined' ? 0 : timeBetween;
     fadeInTime = typeof(fadeInTime) == 'undefined' ? 500 : fadeInTime;
 
    //The amount of remaining time until the animation is complete.
    //Initially set to the value of the entire animation duration.
    var remainingTime = jQuery(this).size() * (fadeInTime+timeBetween);
 
    var i=0; //Counter
    return jQuery(this).each(function()
    {
        //Wait until previous element has finished fading and timeBetween has elapsed
        jQuery(this).delay(i++*(fadeInTime+timeBetween));
 
        //Decrement remainingTime
        remainingTime -= (fadeInTime+timeBetween);
 
        if(jQuery(this).css('display') == 'none')
        {
            jQuery(this).slideDown(fadeInTime);
        }
        else //If hidden by other means such as opacity: 0
        {
            jQuery(this).animate({'opacity' : 1}, fadeInTime);
        }
 
        //Delay until the animation is over to fill up the queue.
        jQuery(this).delay(remainingTime+timeBetween);
 
    }); 
 
};
 
})(jQuery);


$().ready(function(){
	if(typeof keywordz != 'undefined'){
		 var elm = jQuery("#kwordz");
    var i = 0;
	if(elm){
		    elm.append(keywordz[i]);
			i++;
    setInterval(function(){
        
		elm.fadeOut(600,function(){
		elm.empty().append(keywordz[i]);
		elm.fadeIn(600);
		})
        i++;
        if(i>4){i=0}
    },4000)
	}
	}
   

	$("#sendfile").click(function(){
		$("input[type=file]").show().focus().trigger("click").hide();

	})
	 $("input[type=file]").filestyle({ 
     image: "uploads/images/search_doc_icon.png",
     imageheight : 21,
     imagewidth : 15,
     width : 250
 });
	/*var cont = $("#aplic_page")
	var lists = cont.find("ul")
	var pars = cont.find(".title-content")
	lists.find("li").hide();
	//lists.hide();
pars.each(function(){
		var timeout
		var par = $(this)
		var list = par.next("ul")
	 par.click(function(){
		if(list.find("li").is(":visible")){
		list.find("li").fadeOut(400)
		}else{
		list.find("li").fadeInSequence(130,0)
		}
		})
	
		
		par.hover(function(){
		par
		list.find("li").fadeInSequence(130,0)
		list.hover(function(){
			list.find("li").stop(true,true).show()
		},function(){
		
				
				lists.find("li").stop(true,true).fadeOut(400)
		
		})
		},function(){
				
				lists.find("li").stop(true,true).fadeOut(400)
	
	
			
		})
	})*/
	
	
$(".title-content").each(function(){
	var elm = $(this)
	var exp = elm.next(".explanation")
	var page = $("body, html")
	var timeO

	elm.hover(function(){
	clearTimeout(timeO)
		exp.stop(true,true).show("fast",function(){
		})
		
	},function(){	
		timeO = setTimeout(function(){
			exp.stop(true,true).hide("fast")
		},500)
		
	})
	exp.hover(function(){
	clearTimeout(timeO)
		exp.stop(true,false).show("fast")
	},function(){
		timeO = setTimeout(function(){
			exp.stop(true,true).hide("fast")
		},500)
	})
	
})
$('#mb66a0feu_input_username').val("Username")
$('#mb66a0feu_input_password').val("password")
	$("#sitemap_bt").click(function(){
		if($("#sitemap").css("top")=="100px"){
			$("#close").trigger("click")
		}else{
			
								$("#sitemap").css("top","3000px")
			$("#sitemap").show();
			$("#sitemap").animate({top:"100px"},1000,function(){
			});
		}

	})
	$("#close").click(function(){
		$("#sitemap").animate({top:"3000px"},1000,function(){
		$("#sitemap").css("top","-3000px")
		});
	})
	var bub1 = $("#bub1")
var bub2 = $("#bub2")
var bub3 = $("#bub3")
	bub1.show()
	bub1.css({left:"646px",top:"101px"})
	bub1.animate({top: "140px",left:"464px"},4000,"linear",function(){
		bub1.animate({top: "142px",left: "385px"},2000,"linear",function(){
			bub1.animate({top: "116px",left: "257px"},2000,"linear",function(){
							bub1.hide()
							bub2.show()
							bub2.css({left:"646px",top:"101px"})
							bub2.animate({top: "50px",left:"552px"},1000,"linear",function(){
							bub2.animate({top: "44px",left: "484px"},1000,"linear",function(){
								bub2.animate({top: "78px",left: "325px"},3000,"linear",function(){
										bub2.animate({top: "2px",left: "186px"},3000,"linear",function(){
												bub2.hide()
												bub3.show()
												bub3.css({left:"646px",top:"69px"})
												bub3.animate({top: "23px",left:"594px"},1000,"linear",function(){
												bub3.animate({top: "13px",left: "514px"},1000,"linear",function(){
													bub3.animate({top: "88px",left: "290px"},5000,"linear",function(){
															bub3.animate({top: "74px",left: "179px"},1000,"linear",function(){
																bub3.hide()
															})
													})
												})
											})
										})
								})
							
							})
						})
					})
		})
	})
setInterval(function(){
	bub1.show()
	bub1.css({left:"646px",top:"101px"})
	bub1.animate({top: "140px",left:"464px"},4000,"linear",function(){
		bub1.animate({top: "142px",left: "385px"},2000,"linear",function(){
			bub1.animate({top: "116px",left: "257px"},2000,"linear",function(){
							bub1.hide()
							bub2.show()
							bub2.css({left:"646px",top:"101px"})
							bub2.animate({top: "50px",left:"552px"},1000,"linear",function(){
							bub2.animate({top: "44px",left: "484px"},1000,"linear",function(){
								bub2.animate({top: "78px",left: "325px"},3000,"linear",function(){
										bub2.animate({top: "2px",left: "186px"},3000,"linear",function(){
												bub2.hide()
												bub3.show()
												bub3.css({left:"646px",top:"69px"})
												bub3.animate({top: "23px",left:"594px"},1000,"linear",function(){
												bub3.animate({top: "13px",left: "514px"},1000,"linear",function(){
													bub3.animate({top: "88px",left: "290px"},5000,"linear",function(){
															bub3.animate({top: "74px",left: "179px"},1000,"linear",function(){
																bub3.hide()
															})
													})
												})
											})
										})
								})
							
							})
						})
					})
		})
	})
},24000)

	


	


			
			
})
