Cufon.replace('#content H3,#content H1,#content H2.entry-title');
var old_index=0;
jQuery(document).ready(function($){
	$('INPUT.auto-hint').focus(function(){
		if ($(this).attr('value') == $(this).attr('title')) $(this).attr('value', '');
	});
	$('INPUT.auto-hint').blur(function(){
		if ($(this).attr('value') == '') $(this).attr('value', $(this).attr('title'));
	});
	
	$(".main-menu>LI").each(function(){
        $(this).css('z-index', $(this).children('A').css('z-index'));
    });

	$('.main-menu LI:last A').addClass('last-link');
	
	
	$(".main-menu LI").hover(function(){
		if ($(this).hasClass('with-arrow')) {
			$(this).addClass('with-arrow-hover');
		}else
			$(this).addClass('hover');
		/*if ($(this).children('A').hasClass('with-arrow')) {
			old_index = $(this).css('z-index');
			$(this).css('z-index','15');
		}
		$(this).addClass('hover');*/
	},function(){
		/*if ($(this).children('A').hasClass('with-arrow')) {$(this).css('z-index',old_index);}
		$(this).removeClass('hover');*/
		if ($(this).hasClass('with-arrow')) {
			$(this).removeClass('with-arrow-hover');
		}else
			$(this).removeClass('hover');
	});
	
	
/*	if( $('.rotator-box').length > 0 ) {
		$('.rotator-box .list-item').scrollable({
			 speed: 700, 
			 circular: true		
		}).navigator().autoscroll({
		interval: 3000		
		});
	} */
	/*$(".rotator-box").easySlider();*/
	if ($('.news-box .item').length>0) {
		$('.news-box .item:first').addClass('open');
	};
	
	$('.news-box .top-area').click(function(){
		if ($(this).parent().hasClass('open')) {
			$(this).parent('div').children('.text-area').slideUp(500, function(){});
			$(this).parent('div').removeClass('open');
			
		} else {
			$(this).parent('div').children('.text-area').slideDown(500, function(){});
			$(this).parent('div').addClass('open');
		}
		
	});

/*	function mycarousel_initCallback(carousel) {
		var cnt = $('.list-item li.item').length;
		for (var i = 1; i <= cnt; i++) {
			$('.jcarousel-control').append("<a href='javascript:;'>"+i+"</a>")
		}
		jQuery('.jcarousel-control a').bind('click', function() {
		carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
		return false;
		}); 
	};
	*/
	/*jQuery(".rotator-box").jcarousel({
		scroll: 1,
		initCallback: mycarousel_initCallback, 
		auto: 5,
		wrap: 'last', 
		buttonNextHTML: null,
		buttonPrevHTML: null
	}); */
	if ((".rotator-box").length > 0) {
		jQuery(".rotator-box UL.items").cycle({
			fx:      'scrollLeft', 
			speed:    1000, 
			timeout:  7000,
			pager:  '#nav'		
		});
	}
	
	
	jQuery(".play-btn").click(function(){
		if (jQuery(this).hasClass('pause')) {
			jQuery(".rotator-box UL.items").cycle('pause');
			jQuery(this).removeClass('pause').addClass('play');
		} else {
			jQuery(".rotator-box UL.items").cycle('resume');
			jQuery(this).removeClass('play').addClass('pause');
		}
	});
		
	
	if( $('a[rel=myip]').length > 0 ){
		 $("a[rel=myip]").fancybox();
	};
	
	if( $('a[rel=webmail]').length > 0 ){
		 $("a[rel=webmail]").fancybox();
	};
	if( $('a[rel=myip2]').length > 0 ){
		 $("a[rel=myip2]").fancybox();
	};
	
	if( $('a[rel=webmail2]').length > 0 ){
		 $("a[rel=webmail2]").fancybox();
	};

	if( $('.iframe').length > 0 ){
		$('LI.iframe').removeClass('iframe').children('A').addClass('iframe');
		 $(".iframe").fancybox({
		  zoomSpeedIn: 0,
		  zoomSpeedOut:0,
		  frameWidth: 800,
		  frameHeight: 600
		});
	};



	$('#search-form .input-box INPUT').focus(function(){
		$(this).parent('.input-box').children('SPAN').css('display','none');

	});
	$('#search-form .input-box INPUT').blur(function(){ 
		if ($('#search-form .input-box INPUT').val()=='') {
			$(this).parent('.input-box').children('SPAN').css('display','block');
		}
	});
	
	
	
	
	jQuery('div.wpcf7-response-output').replaceWith('');
	jQuery('.wpcf7').prepend('<div class="wpcf7-response-output wpcf7-display-none"></div>');
	
});


