jQuery.noConflict();
jQuery(document).ready(function($) {

    $('.noJS').remove();

    // IE6 hover states
    $('#header .nav li').hover(function() {
		$(this).toggleClass("shover");
	});

    // Add last class to left navigation
    $('#colL .nav > ul > li:last').addClass('last');

    // Region Networks Flash Map
    if($('#flashMapReplace').length>0) {
        var vars = {sXMLFile: '/join-cip/regional-networks/default.xml'};
        var params = {};
        params.wmode = "transparent";
        swfobject.embedSWF("/flash/regional/map.swf", "flashMap", "793", "466", "9", false, vars, params);
    }

    clearInput('#searchsite');

    // Focus remove text
	function clearInput(fieldType) {
		if(!fieldType) {
			var fieldType = 'input[type=text][value]';
		}
		var swap_text_boxes = [];

		$(fieldType).each(function() {
			swap_text_boxes[$(this).attr('id')] = $(this).siblings('span').text();
		});
		$(fieldType).bind('focus', function() {
			if($(this).val() == swap_text_boxes[$(this).attr('id')]) {
				$(this).val('');
			}
		});
		$(fieldType).bind('blur', function() {
			if($(this).val() == '') {
				$(this).val(swap_text_boxes[$(this).attr('id')]);
			}
		});
	}

    // Calculate margin to place above right side navigation
    if($('.regions').length>0) {
        if($('.imagesCol').length>0) {
            $('.imagesCol').css('margin', ($('.regions').height()-114) + 'px 0 0');
        }
    }

});
