// JavaScript Document

$(function() {
	 
	 $('#ScrollingNews2 marquee').marquee('pointer').mouseover(function () {
            $(this).trigger('stop');
        }).mouseout(function () {
            $(this).trigger('start');
        }).mousemove(function (event) {
            if ($(this).data('drag') == true) {
                this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
            }
        }).mousedown(function (event) {
            $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
        }).mouseup(function () {
            $(this).data('drag', false);
     });
	 
	 var options0 = {
		format: '%H:%M:%S' // 24-hour
     }
    $('.jclock').jclock(options0);
	 
	/*$('#datepicker').datepicker({
		inline: true
	});*/
	 	 
});


$(document).ready(function(){
				/*
				$(".fancyopen").fancybox({
					'width'				: '30%',
					'height'			: '28%',
					'autoScale'			: false,
					'transitionIn'		: 'elastic',
					'transitionOut'		: 'elastic',
					'type'				: 'iframe'
				});
				*/
				
				$("#titleBar").mouseover( function() {
					$(this).css("color","#d71921");
				});
				$("#titleBar").mouseout( function() {
					$(this).css("color","#6d6e71");
				});
				
				$("#AllCalendar").click(function(){
					$("#div4_example").slideToggle("normal");
					$(this).toggleClass("active");
				});
				$("#Language").click(function(){
					$("#topmenu1").animate({width: 'toggle'}, 130);
					$(this).toggleClass("active");
				});
				$("#Search").click(function(){
					$("#SearchFields").animate({width: 'toggle'}, 280);
					$(this).toggleClass("active");
				});
					
				//$("#navi").makeFloat({x:"current",y:"current",Speed:"fast"});
				
				$("#navi a").click(function(){
					$(this).addClass("active");
					$("#navi a").removeClass("active");
					$('#navi a').css('backgroundColor','');
					$(this).css('backgroundColor','#9a0000');
					var target = $(this).attr("href");
					var targetoffset = $(target).offset();
					var container = $("#contentpanels").offset();
					var targetleft = container.left - targetoffset.left;
					var targettop = container.top - targetoffset.top;
					$("#contentpanels").animate({top:targettop,left:targetleft},600);
					return false;
				});
				$("#navi a:first").addClass("active");
				
				$("#MainFlashMask a").click(function(){
					$("#MainFlashMask a").removeClass("active");
					$(this).addClass("active");
					var target = $(this).attr("title");
					var targetoffset = $(target).offset();
					var container = $("#contentpanels").offset();
					var targetleft = container.left - targetoffset.left;
					var targettop = container.top - targetoffset.top;
					$("#contentpanels").animate({top:targettop,left:targetleft},600);
					return false;
				});
				$("#MainFlashMask a:first").addClass("active");
				
				$("#ContentMain a").click(function(){
					$("#ContentMain a").removeClass("active");
					$(this).addClass("active");
					var target = $(this).attr("href");
					var targetoffset = $(target).offset();
					var container = $("#contentpanels").offset();
					var targetleft = container.left - targetoffset.left;
					var targettop = container.top - targetoffset.top;
					$("#contentpanels").animate({top:targettop,left:targetleft},600);
					return false;
				});
				$("#ContentMain a:first").addClass("active");
				
				$('.ImageHover').each(function() {
					$(this).mouseover( function() {
						$(this).attr("src", $(this).attr("src").replace("_over","_up"));
						return false;
					});
					$(this).mouseout( function() {
						$(this).attr("src", $(this).attr("src").replace("_up","_over"));
						return false;
					});
				});				
				
				$('.ImageHover1').each(function(){
					$(this).mouseover(function(){
						$(this).attr("src", $(this).attr("src").replace("_Up","_Over"));
						return false;
					});
					$(this).mouseout(function(){
						$(this).attr("src", $(this).attr("src").replace("_Over","_Up"));
						return false;
					});
				});
				
});
//document.write('Your resolution is'+screen.width);
