jQuery(document).ready(
	function()
	{
		jQuery('.doSildeDown').click(function()
		{
			jQuery('#section'+jQuery(this).attr('rel')).slideToggle("normal");
		});

	jQuery(".hover").hover(function () {
		// on
		jQuery(this).stop().animate({
			opacity:1
		},200);
	}, function () {
		// off
		jQuery(this).stop().animate({
			opacity:0
		},200);
		
	});
	
	//Slideshow
	jQuery('#slideshow').before('<div id="pager">').cycle({ 
		fx:     'fade', 
		speed:  1500, 
		timeout: 8000, 
		pager:  '#pager' 
	});
	
	jQuery('.showToggle-title').each(function(){
		var $me = jQuery(this);
		var $parent = $me.parents('.showToggle:first');
		var $content = jQuery('.showToggle-content', $parent);
		$content.css('overflow','hidden');
		var curHTML = $content.html();
		$content.html('<div class="showToggle-wrap">' + curHTML + '</div>');
		if(!$parent.hasClass('open'))
		{
			$content.css('height','0px');
		}
	}).click(function(){
		var $me = jQuery(this);
		var $parent = $me.parents('.showToggle:first');
		var $content = jQuery('.showToggle-content', $parent);
		if($parent.hasClass('open'))
		{
			$content.stop().animate({ 'height' : 0 }, 'fast');
			$parent.removeClass('open');
		}
		else
		{
			var $wrapper = jQuery('.showToggle-wrap', $content);
			var wrapper_height = $wrapper.height();
			wrapper_height = isNaN(wrapper_height) ? 0 : wrapper_height;
			$content.stop().animate({ 'height' : wrapper_height }, 'fast');
			$parent.addClass('open');
		}
	});

	//tipTip Tool
	$(".someClass").tipTip({maxWidth: "auto", edgeOffset: 10});
	$(".30dayBadge").tipTip({ delay: 1, defaultPostion: "bottom", maxWidth: "250px", enter: aFunction });
	$(".buttonBadge").tipTip({activation: "click", delay: 1, fadeIn: 0, keepAlive: true, defaultPostion: "bottom", maxWidth: "auto", enter: aFunction });


	}
);

function aFunction() {
	setTimeout(function(){
		$("#tiptip_content input[type=text]").get(0).select();
						},150);
}

function dropChange( product, idName ) {
	var menuitem, oSelect = document.getElementById( idName );
	var menulength = oSelect.options.length;
	for (var i=1; i<menulength; i++) {
	menuitem = oSelect.options[i].value;
		if (menuitem == product) {
		oSelect.options[i].selected = true;
		return true;
		}
	}
}

function autoClearShow(theText, defaultValue) {
     if (theText.value == defaultValue) {
         theText.value = ""
     }
}

function toggle(e){e.checked = !(e.checked);}
function toggle_child(e){toggle(e.firstChild);}

function toggleCheckBoxes( idName )   {
// toggle Check Boxes using Prototype Library
	var i=document.getElementById( idName );
		if (i.checked){
			i.checked=false;
		}
		else {
			i.checked=true;
		}
} 


