jQuery.noConflict();
jQuery(document).ready(function($) {
    jQuery('#nav li').hover(
		function() {
		    jQuery('div.flyout', this).show().end().children('a:first').addClass('active');
		    if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
		        var ieversion = new Number(RegExp.$1);
		        if (ieversion < 7) {
		            jQuery('.content-wide, #sap-main.gallery').css({ zIndex: -1 });
		        }
		    }
		},
		function() {
		    jQuery('div.flyout', this).hide().end().children('a:first').removeClass('active');
		    if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
		        var ieversion = new Number(RegExp.$1);
		        if (ieversion < 7) {
		            jQuery('.content-wide, #sap-main.gallery').css({ zIndex: 1 });
		        }
		    }
		}
	);

    //		function showTip(which) {
    //		    var tipPos = $(which).text();
    //		    tipPos = parseInt(tipPos);
    //		    switch (tipPos) {
    //		        case 1:
    //		            var text = 'Welcome';
    //		            break;
    //		        case 2:
    //		            var text = 'Totally Tie-Dye';
    //		            break;
    //		        case 3:
    //		            var text = 'Duck Products';
    //		            break;
    //		        case 4:
    //		            var text = 'Duck Tape Club';
    //		            break;
    //		        default:
    //		            var text = 'Welcome';
    //		    }
    //		    var arrowPos = tipPos * 20 - 9;
    //		    var tip = '<div id="rotator-tip">' + text + '<div id="rotator-tip-arrow" style="left:' + arrowPos + 'px"></div></div>';
    //		    $(which).before(tip);
    //		}

    //    function hideTip() {
    //        $('#rotator-tip').remove();
    //    }

    //    $('#rotator-nav a').hover(function() {
    //        showTip(this);
    //    },
    //		function() {
    //		    hideTip();
    //		}
    //	);
    jQuery('input:text:not(.dont-replace)').each(function() {
        var boxID = jQuery(this).attr('id');
        var boxLabel = jQuery(this).parent().find('label[for="' + boxID + '"]');
        boxLabel.hide();
        if (jQuery(this).val() === '') {
            var boxText = boxLabel.text();
            jQuery(this).val(boxText);
        } else {

            var boxText = jQuery(this).val();
        }

        jQuery(this).focus(function() {
            if (jQuery(this).val() === boxText) {
                jQuery(this).val('')
            }
        });
        jQuery(this).blur(function() {
            if (jQuery(this).val() === '') {
                jQuery(this).val(boxText);
            }
        });
    });
    if ($('#home-rotator').length > 0) {
        $('#home-rotator').after('<div id="rotator-nav">').cycle({
            fx: 'fade',
            timeout: 10000,
            cleartype: 1,
            pager: '#rotator-nav'
        });
    }

});