/********************************************
 * rye_raptor (forver r2)                   *
 * Naicom jQuery execution file             *
 * Copyright (c) 2009                       *
 * Company - Softcom                        *
 ********************************************/


	jQuery(document).ready(function($){
		
		var header_links = jQuery('#home_headerNavigation a img');
		header_links.each( function(i) {
			var header_link = jQuery(this);
			header_link.hover(
				function(e){
					var upState_src = jQuery(this).attr('src');
					var src_array = upState_src.split('_up.');
					var downState_src = src_array[0] + '_down.' + src_array[1];
					jQuery(this).attr('src', downState_src);
				},
				function(e){
					var downState_src = jQuery(this).attr('src');
					var src_array = downState_src.split('_down.');
					var upState_src = src_array[0] + '_up.' + src_array[1];
					jQuery(this).attr('src', upState_src);
				}
			);
		});
		
		jQuery('#main_navigation').r2content_drop({
			boundary_reference: 'main_navigation',
			top_displacement: -1
		});
		
			jQuery('#submain_navigation').r2content_drop({
			boundary_reference: 'submain_navigation',
			top_displacement: 50
		});
		
		jQuery('#home_slideshow').cycle({
			fx: 'fade',
			speed: 2000,
			cleartype: 1,
			pause: 1
		});
		
		var showCurrentTime = function(){
			jQuery.ajax({
				url : "assets/php/showtime.php",
				success : function (data) {
					$("#time").html(data);
				}
			});
		}
		
		setInterval(showCurrentTime, 1000);
		
	});
