
function paddAppendClear() {
	jQuery('.append-clear').append('<div class="clear"></div>');
}

function paddWrapInner1() {
	jQuery('.wrap-inner-1').wrapInner('<div class="inner"></div>');
}

function paddWrapInner2() {
	jQuery('.wrap-inner-2').wrapInner('<div class="interior"><div class="inner"></div></div>');
}

function paddWrapInner3() {
	jQuery('.wrap-inner-3').wrapInner('<div class="m"></div>');
	jQuery('.wrap-inner-3').prepend('<div class="t"></div>');
	jQuery('.wrap-inner-3').append('<div class="b"></div>');
}

function Toggle(classname,value) {
	jQuery(classname).focus(function() {
		if (value == jQuery(classname).val()) {
			jQuery(this).val('');
		}
	});
	jQuery(classname).blur(function() {
		if ('' == jQuery(classname).val()) {
			jQuery(this).val(value);
		}
	});
}

function ToggleTitles() {
		jQuery('#featured').hover(
			function() {
				jQuery('.front-more-info').animate({'bottom': 10, 'opacity': 0.8,filter:'alpha(opacity=80)' },300)
				//,jQuery(this).stop().animate({'border-color': '#3a5896;' },300)
				;
			},
			function() {
				jQuery('.front-more-info').animate({'bottom': -10, 'opacity': 0.2, filter:'alpha(opacity=20)' },300)
				//,jQuery(this).stop().animate({'border-color': '#7989a9;' },300)
				;
			}
		);
}

function PagerBuilder(index,elem) {
	return '<button class="jqc-button jqc-button-pages" id="jqc-button-' + index + '" value="' + index + '"><span>' + (index+1) + '</span></button>'
}

function CreateSlideShow() {
	jQuery('div#jquery-cycle').append('<div id="jqc-pages" class="jqc"></div>');
	len = jQuery('div#jquery-cycle div.list div.item').length;
	jQuery('div#jquery-cycle .button-l').css('z-index',len+2);
	jQuery('div#jquery-cycle .button-r').css('z-index',len+3);
	jQuery('div#jquery-cycle div.list').cycle({ 
		fx: 'fade', 
		speed: 1000, 
		timeout: 4500,
		random: 0,
		pause: 1,
		prev: '#jqc-prev',
		next: '#jqc-next',
		pager: '#jqc-pages',
		activePagerClass: 'jqc-active',
		pagerAnchorBuilder: PagerBuilder
 	});
	jQuery('div#jquery-cycle-quotes').cycle({
		fx: 'fade',
		speed: 3000,
		timeout: 15000,
		delay:-4000,
		random:1
	});
}

jQuery(document).ready(function() {
	jQuery.noConflict();
	
	paddAppendClear();
	paddWrapInner1();
	paddWrapInner2();
	paddWrapInner3();
	
	jQuery('div.pagination span.pages').wrap('<span class="pseudo-li"></span>');
	jQuery('div.pagination span.extend').wrap('<span class="pseudo-li"></span>');
	jQuery('div.pagination span.current').wrap('<span class="pseudo-li"></span>');
	jQuery('div.pagination a').wrap('<span class="pseudo-li"></span>');

	jQuery('div#menubar div > ul').supersubs({
		minWidth: 15, 
		maxWidth: 27, 
		extraWidth: 1 
	}).superfish({
		hoverClass: 'hover',
		speed: 1500,
		delay: 1,
		animation: { opacity: 'show', height: 'show' }
	}); 
	
	jQuery('input#s').val('Search');
	Toggle('input#s','Search');

	jQuery('div.search form').click(function () {
		jQuery('input#s').focus();
	});
	
	CreateSlideShow();
	ToggleTitles();

	Toggle('input#comment-author','Name');
	Toggle('input#comment-email','Email');
	Toggle('input#comment-url','Website');
	Toggle('textarea#comment-comment','Message');
	//jQuery('.page_item').wrapInner('<span class="inner1"></span>');
	//jQuery('.page_item').wrapInner('<span class="inner2"></span>');
	//jQuery('.current_page_item').wrapInner('<span class="inner1-current"></span>');
	//jQuery('.current_page_item').wrapInner('<span class="inner2-current"></span>');
});

jQuery(function() {
jQuery('.radio-option1').click(function() {
  jQuery('.radio-option1-active').show('slow')
  jQuery('.ratio-option2-active').hide('slow');
});
jQuery('.radio-option2').click(function() {
  jQuery('.radio-option2-active').show('slow')
  jQuery('.ratio-option1-active').hide('slow');
});
});



