$(document).ready(function (){
	$('#menuhead').click(function (e){
		e.stopPropagation();
		$('#menucontent').toggle();
		return false;
		});
	$('body').click(function (){
		$('#menucontent').hide();
	});
});

$(document).ready(function(){
    $('div#footer, .divider').corner("round 4px");
	$('.boxcol.last .box, .boxcol .box').corner("round 4px"); //.parent().css('padding-bottom', '1px').css('padding-left', '1px').css('padding-right', '1px').corner("br bl round 5px");
    $('div.imgbox').corner("round 4px");
    $('div#content-box').corner("bl br round 4px");
});

var cimages = new Array()
var detailimages = new Array()

jQuery.preloadImages = function()
{
	for(var i = 0; i<arguments.length; i++)
	{
		jQuery("<img>").attr("src", arguments[i]);
	}
}

var prefix = '/media/'
$(document).ready(function(){
    
    $(".rollover").each(function () {
        cimages[$(this).attr('id')] = $(this).attr('src');
        detailimages[$(this).attr('id')] = $(this).attr('ci');
        jQuery("<img>").attr("src", prefix+$(this).attr('ci'));
    });
     $(".rollover").hover(
				function(){
					if($(this).attr("src") == cimages[$(this).attr('id')]) {
						var newSrc = prefix+detailimages[$(this).attr('id')]
                        $(this).attr("src",newSrc);
					}
				},
                function(){
					if($(this).attr("src") == prefix+detailimages[$(this).attr('id')]) {
						var newSrc = cimages[$(this).attr('id')]
                        $(this).attr("src",newSrc);
					}
				}
			);

    $("input#submit_btn").hover(
				function(){
					if($(this).attr("src").indexOf("-on") == -1) {
						var newSrc = $(this).attr("src").replace(".png","-on.png#hover");
						$(this).attr("src",newSrc);
					}
				},
				function(){
					if($(this).attr("src").indexOf("-on.png#hover") != -1) {
						var oldSrc = $(this).attr("src").replace("-on.png#hover",".png");
						$(this).attr("src",oldSrc);
					}
				}
			);
})
