/*var TimerDelay = null;
*/
var delay = 1000;
    $(document).ready(function(){
				
		//$(".sticky").css({display:'none'})
		//$(".sticky").fadeIn(6000);
		var img_tny = $("<img src=\"http://www.telaga.org/files/advanced.png\" style=\"margin :1\" class=\"img_tanya\">");
	
		$("div.jwb").hide();
		$("div.tny").prepend(img_tny).click(function(){
			if ($(this).next().css("display")== "none"){
					$(this).next().slideDown("slow");		
					$(this).children().attr("src","http://www.telaga.org/files/minus.gif");
			}			
			else {
					$(this).next().slideUp("slow");		
					$(this).children().attr("src","http://www.telaga.org/files/advanced.png");
				}
			
		});
		
		var imgopen = $("<img src=\"http://www.telaga.org/files/maximize.gif\" style=\"margin :0\" class=\"img_open\">");
		$("div.saklar").click(function(){
			if ($(this).html() == "Lengkap"){					
					$(this).html("List").css({width:"30px"});							
					$(".tny").slideDown();
					$(".jwb").slideDown();					
					$(".img_tanya").attr("src","http://www.telaga.org/files/minus.gif");					
			}			
			else {
					$(this).html("Lengkap").css({width:"60px"});										
					$(".tny").slideDown();
					$(".jwb").hide();					
					$(".img_tanya").attr("src","http://www.telaga.org/files/advanced.png");					
				}
			
		});
		
		
			
		$("div.teas").hover(function(){
			
		},function(){
			$(this).css("display","none")
		});
		
		$("div.tny").hover(function(event) {				
			var tanya = $(this);			
			var atas = $(this).offset().top;
			var kiri = $(this).offset().left;
			var tinggi = $(this).height();
			var mix = atas+tinggi;
			if ((tanya).next().css("display")== "none"){
					TimerDelay = setTimeout(function() {			
					TimerDelay = null;						
					var popup = tanya.next().children(".pop_up").html() + "  ...";
					if ($(".teas").length == 0) {						
						var Teas = $("<div class=\"teas\"></div>").css({top: mix, left: kiri}).html(popup);
						$("body").append(Teas);					
					}
					else {
						$(".teas").html(popup);
						$(".teas").css({top: mix, left: kiri});
						$(".teas").fadeIn();
					}
				}, delay);
					
			}					
		}, function(event) {	
			$(".teas").fadeOut();
				if (TimerDelay) {							
					clearTimeout(TimerDelay);
					TimerDelay = null;
				}
			});	 
		
		
	 			
		
		if($("div#id_faq").length != 0){
			$("h2.nodeTitle").next().hide();	
			$("h2.nodeTitle").next().next().hide();	
			$("h2.nodeTitle").next().next().next().hide();	
			$(".nodeTitle").children().css({cursor:'pointer'}).removeAttr("href").click(function(){
				if ($(this).parent().next().next().css("display")=="none"){
					$(this).parent().next().next().slideDown();
					$(this).parent().next().next().next().slideDown();
				}
				else { 
					$(this).parent().next().next().slideUp();
					$(this).parent().next().next().next().slideUp();
				}
			
			});
		
		}
                  $("fieldset.group-audio p").each(function(i){
			 $(this).replaceWith($(this).html());		
		});
		
		$("#edit-submitted-kaset-yang-dipesan").hide();
		$("#webform-component-kaset_yang_dipesan").children().children().eq(0).prepend(imgopen).css({cursor:'pointer'}).click(function(){
			if ($(this).next().css("display")== "none"){				
					
				$(this).next().slideDown("slow");	
				$(this).children().attr("src","http://www.telaga.org/files/minimize.gif");
			
			}			
			else {
				$(this).next().slideUp("slow");	
				//$(this).children().children().eq(0).next().slideDown("slow");
				$(this).children().attr("src","http://www.telaga.org/files/maximize.gif");	
					
				}
			
		});
		
		
	});
	
    

