
$(document).ready(function() {										   
/*   $("#search_phrase").keyup(function() {
		 $("#live_search_results").css({display:"block"});
		 $("#live_search_results").load("includes/livesearch.php?q="+$(this).attr('value'));
   });*/
   if($('.dictionary'))
   {
	   $.get($('#path_var').attr('value')+"includes/word_dict.php?lang=en", function(data){
			var ex = data.split('###');
			$('.dictionary div h3').html(ex[0]);
			$('.dictionary p').html(ex[1]);
			$('.dictionary p').show('fast');
		});
   }

													

   
   
   $('#email_but').click(function()
   {
		$.post($('#path_var').attr('value')+'includes/subscribe.php?mail='+$('#newsletter_email').attr('value'), function(data){
			var message = data.split('#');
			alert(message[0]);
   		});
   });
   
   $('.index_tables > li').hover(function(){
			$(this).children(".index_img").css({display:'block'});
	   },
	   function(){
			$(this).children(".index_img").css({display:'none'});	
   });
   
   
   $("#tables > iframe").slideUp("slow");
	  $.post($('#path_var').attr('value')+'includes/get_frame_src_ajax.php?page_id=4&type_id=11', function(data){
			$('#tables > iframe').attr('src', data);
	        $("#tables > iframe").slideDown("slow");
	});
	  
	   $.fn.wait = function(time, type) {
        time = time || 1000;
        type = type || "fx";
        return this.queue(type, function() {
            var self = this;
            setTimeout(function() {
                $(self).dequeue();
            }, time);
        });
    };

   
   $('#tables > ul > li > span').click
   (
	function(){
	  $("#tables > iframe").slideUp("slow");
	  $.post($('#path_var').attr('value')+'includes/get_frame_src_ajax.php?name='+$(this).html(), function(data){
			$('#tables > iframe').attr('src', data);
	        $("#tables > iframe").slideDown("slow");
	  });
	}
   );
   
   if($('.odds #diagram').attr('src'))
   {
	   if(($('.odds #diagram').attr('src')).indexOf('###')!=-1)
	   {
			var spl = Array();
			var spl0 = Array();
			spl0 = ($('.odds #diagram').attr('src')).split('?');
			spl = spl0[1].split('###');
			
			
	
			$.post($('#path_var').attr('value')+'includes/get_frame_src_ajax.php?page_id='+spl[0]+'&type_id='+spl[1], function(data){
				$('.odds #diagram').attr('src', data);
			 });
	
				 
			  $('.odds #diagram').css({
										width:'172px',
										height: '124px'
	
				});
	
			
	
	   }
   }
   			

});
