var fadeobj = {
	preloader: {
		loadedImages: [],
		load: function (url){
			var img = this.loadedImages;
			var l = img.length;
			img[l] = new Image();
			img[l].src = url;
		}
	}
};

function fadeoverinit(){
	$('.fadeover').each(function(){
		this.originalSrc = $(this).attr('src');
		this.rolloverSrc = this.originalSrc.replace(/(\.gif|\.jpg|\.png)/, "_on$1");
		fadeobj.preloader.load(this.rolloverSrc);
	});
	$('.fadeover').hover(function(){
		$(this).stop().fadeTo(500,0.5,function() {
			$(this).attr("src",this.rolloverSrc);
			$(this).fadeTo(500,1.0);
		});
	},function(){
		$(this).stop().fadeTo(300,0.5,function() {
			$(this).attr('src',this.originalSrc);
			$(this).fadeTo(300,1.0);
		});
	});
}

function mainmenu(){
	$("#nav ul ").css({display: "none"}); // Opera Fix
	$("#nav li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});

	s = (new Date()).getSeconds();
	bgcol = new Array("#ffcc00", "#00ccff", "#33cc66", "#000099" , "#ff66ff" , "#cc99ff" ,"#66ffcc" ,"#ff3366" ,"#cccc33" ,"#cc9933");
	$("#topline").css("background-color", bgcol[s%10]);
}

function rolloverinit(){
	$("img.rollover,input.rollover").each(function(){
		$(this).fadeTo("slow", 0.6);
		$(this).hover(function(){
		$(this).stop().fadeTo("slow", 1.0);
		},function(){
		$(this).stop().fadeTo("slow", 0.6);
		});
	});
}

$(document).ready(function(){
//	rolloverinit();
	
//	mainmenu();
});


