// JavaScript Document

$(document).ready(function() {	
		       




		// Keep the word "search" in the search box when not in use		       
		$('input[type="text"]').addClass("idleField");
    		$('input[type="text"]').focus(function() {
    			$(this).removeClass("idleField").addClass("focusField");
 		    if (this.value == this.defaultValue){ 
 		    	this.value = '';
			}
			if(this.value != this.defaultValue){
    			this.select();
    		}
 		});
 		$('input[type="text"]').blur(function() {
 			$(this).removeClass("focusField").addClass("idleField");
 		    if ($.trim(this.value) == ''){
		    	this.value = (this.defaultValue ? this.defaultValue : '');
			}
 		});		


/*************************************************/



$("#leftmenu ul li a")
		.hoverIntent(function(){
			$(this).animate({backgroundPosition:"(148px 0)"}, 400);

		},
		function(){
			$(this).animate({backgroundPosition:"(0 0)"}, {duration:300});

		}
		);



/*************************************************/


$(".nextlinks a")
		.hoverIntent(function(){
			$(this).animate({backgroundPosition:"(210px 0)"}, 400);
			$(this).css({ "color": "#fff" }, 400);

		},
		function(){
			$(this).animate({backgroundPosition:"(0 0)"}, {duration:300});
			$(this).css({ "color": "#045082" }, 400);

		}
		);
 


/*************************************************/

		// Set the standard style for beauty tip tooltip
		$('.tipInfo').bt({
		  padding: 10,
		  width: 110,
		  spikeLength: 8,
		  spikeGirth: 8,
		  cornerRadius: 0,
		  fill: 'rgba(230, 239, 246, .5)',
		  strokeWidth: 0,
		  strokeStyle: '#ccc ',
		  cssStyles: {color: '#444', fontWeight: 'normal', lineHeight:'1.25', fontSize: '11px'}
		});




/*************************************************/



/*************************************************/
// Content Tabs


    	var tabContainers = $('div.tab-content > div');
		tabContainers.hide().filter(':first').slideDown();
		
		$('ul.contentTabs a').click(function () {
			//hide all tab containers
			tabContainers.hide();
			//show the selected tab container
			tabContainers.filter(this.hash).show();
			// clear the 'current' tab class
			$('ul.contentTabs a').removeClass('current');	
			// set the the 'current' tab class for newly selected tab	
			$('ul.contentTabs a')
			$(this).addClass('current');
			return false;		
			}).filter(':first').click();




/*************************************************/



/*************************************************/
// jquery.bgpos.js 

/**
 * @author Alexander Farkas
 * v. 1.02
 */
 
(function($) {
	$.extend($.fx.step,{
	    backgroundPosition: function(fx) {
            if (fx.state === 0 && typeof fx.end == 'string') {
                var start = $.curCSS(fx.elem,'backgroundPosition');
                start = toArray(start);
                fx.start = [start[0],start[2]];
                var end = toArray(fx.end);
                fx.end = [end[0],end[2]];
                fx.unit = [end[1],end[3]];
			}
            var nowPosX = [];
            nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
            nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];
            fx.elem.style.backgroundPosition = nowPosX[0]+' '+nowPosX[1];

           function toArray(strg){
               strg = strg.replace(/left|top/g,'0px');
               strg = strg.replace(/right|bottom/g,'100%');
               strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");
               var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);
               return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];
           }
        }
	});
})(jQuery);



  });



