// JavaScript Document

$(function(){
	$(".rollover").mouseover(function(){
		$(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/,"$1_over$2"));
	}).mouseout(function(){
		$(this).attr("src",$(this).attr("src").replace(/^(.+)_over(\.[a-z]+)$/,"$1$2"));
	}).each(function(){
		$("<img>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/,"$1_over$2"));
	});
	$(".popup").click(function(){
		window.open(this.href, "WindowName","width=820,height=680,resizable=yes,scrollbars=yes");
		return false;
	});
	$(".popup2").click(function(){
		window.open(this.href, "WindowName","width=830,height=530,resizable=yes,scrollbars=yes");
		return false;
	});
	$(".popup3").click(function(){
		window.open(this.href, "WindowName","width=920,height=620,resizable=yes,scrollbars=yes");
		return false;
	});
	$(".popup4").click(function(){
		window.open(this.href, "WindowName","width=915,height=730,resizable=yes,scrollbars=yes");
		return false;
	});
	$(".popup6").click(function(){
		window.open(this.href, "WindowName","width=915,height=850,resizable=yes,scrollbars=yes");
		return false;
	});
	$(".popup5").click(function(){
		window.open(this.href, "WindowName","width=460,height=650,resizable=yes,scrollbars=yes");
		return false;
	});
});

this.randomtip = function(){
	var length = $(".mainPic li").length; // this is where we put the id of the list
	var ran = Math.floor(Math.random()*length) + 1;
	$(".mainPic li:nth-child(" + ran + ")").show();
};
$(document).ready(function(){	
	randomtip();
});

