// dropdown menus - suckerfish technique

	jQuery(document).ready(function() {
	
	    jQuery('.primary-nav .item').hover(function(e) {
    			jQuery(this).addClass("hover");
    		}, function(e) {
	    		jQuery(this).removeClass("hover");
	    });  
	     jQuery('.global-links .item').hover(function(e) {
    			jQuery(this).addClass("hover");
    		}, function(e) {
	    		jQuery(this).removeClass("hover");
	    });     
	 
	 });


// input field clearing/resetting helper

	jQuery(document).ready(function() {
	
	    jQuery('.clear-field').each(function() {
	
	    	// cache original text
	    	this.original_value = this.value;
	    	
	    	// clearing event
	    	jQuery(this).bind("focus", function(e) {
	    		if (e.target.value == e.target.original_value) {
	    			e.target.value = "";
	    		}
	    	});
	    	
	    	// resetting event
	    	jQuery(this).bind("blur", function(e) {
	    		if (e.target.value == "") {
	    			e.target.value = e.target.original_value;
	    		}
	    	});
	    
	    });
	 
	 });
	 
 // sidebar accordians 

	jQuery(document).ready(function() {
		
		jQuery(".sidebar-nav").accordion({ header: ".button", active: false, collapsible: true, autoHeight: false, event: 'mouseover' });
	 
	 });

	 function HideEditorMenu() {
	     $ektron('.EktronEditorsMenuMarker').removeClass('EktronEditorsMenuMarker').addClass('noshow');
	 }
	 $ektron(document).ready(function() {
	     $ektron(".dd-right").each(function() { if ($ektron(this).html() == "") { $ektron(this).css('display', 'none').parent().css('width', 'auto'); } });
	 });
	 function clickButton(e, buttonid) {
	     var evt = e ? e : window.event;

	     var bt = document.getElementById(buttonid);
	     if (bt) {
	         if (evt.keyCode == 13) {
	             bt.click();
	             return false;
	         }
	     }
	 }
	 function RepositionMenu() {
	     $ektron('.header div.search').hide();
	     $ektron('.header div.search').css('left', '10px');
	     $ektron('.header div.primary-nav ul.item-list').css('float', 'right');
	     $ektron('.header div.search').show();

	 }

	 $ektron(document).ready(function() {
	     var loginout = $ektron(".isloggedin").val();
	     if (loginout == 0) {
	         //$ektron(".loginoutname").html($ektron(".isloggedin").val());
	         $ektron(".loginoutname").html($ektron("#loginnamevalue").html());
	     }
	     else {
	         $ektron(".loginoutname").html($ektron("#logoutnamevalue").html());

	     }
	 });    
