$(document).ready(function(){
	$("img.dropshadow").wrap("<div class='wrap1'><div class='wrap2'><div class='wrap3'></div></div></div>");
	
	//$("#go-top").ScrollToAnchors('normal');
	
	$("body").ScrollToAnchors('normal')
	
	$('.flashMessageSuccess').Highlight(3000, '#FFFFFF');
	$('.flashMessageStatus').Highlight(3000, '#FFFFFF');
	$('.flashMessageError').Highlight(3000, '#FFFFFF');
	$('.form-top-error-msg').Highlight(3000, '#FFFFFF');
	
	$('.footer').corner("20px")
	$('.ads-right-box').corner("10px");
	
	$("#nav-one li").hover(
        function(){ $("ul", this).show("fast"); }, 
        function() { } 
    );
    if (document.all) {
        $("#nav-one li").hoverClass ("sfHover");
    }
    
    // fix for target=”_blank”
	$("a[@rel~='external']").click(function(){
	window.open($(this).attr('href'));
	return false;
	});

});

//fix for jQuery.dequeue is not a function in Interface plugin
//http://groups.google.com/group/jquery-en/browse_thread/thread/d094a3f299055a99/920c3490fe7e689b
( function( $ ) {
        $.dequeue = function( a , b ){
                return $(a).dequeue(b);
        };

 })( jQuery ); 



$.fn.hoverClass = function(c) {
    return this.each(function(){
        $(this).hover( 
            function() { $(this).addClass(c);  },
            function() { $(this).removeClass(c); }
        );
    });
};

function selectBoxGoto(sel){
	urltogoto = sel.options[sel.options.selectedIndex].value;
	if(urltogoto == "") {
		return false;
	}
	else {
	window.location.href = urltogoto;
	}	
}
  
function hideFlashMessage(){
	$('#flashMessage').slideUp('slow');
}

var yesUrl;
yesUrl = $("a#delete-confirm-yes").attr("href");
	
function deleteConfirm(msg, txtYes, txtNo){
 
	$("div#view-action-links").hide();
	$("div#view-action-links").after('<div id="view-action-links-confirm"></div>');
	$("div#view-action-links-confirm").html('<span>' + msg + '</span>' + '&nbsp;[<a href="javascript:void(0)" onclick="window.location=yesUrl;return false;">'+ txtYes +'</a>]&nbsp;[<a href="javascript:void(0)" onclick="deleteConfirmNo();return false;">'+ txtNo +'</a>]');
	$("div#view-action-links-confirm").fadeIn('fast');
}

function deleteConfirmNo(){
	$("div#view-action-links-confirm").remove();
	$("div#view-action-links").fadeIn('fast');
}

function submitProgress(s, txt)
{
	$(s).attr("disabled","disabled");
	$(s).val(txt);
	$('div.submit-loading').css('display','inline');
	s.form.submit();
}

