﻿// 初始化背景色 copyright by sunnyswim@gmail.com
$(document).ready(function(){menuList();})
//随机获得背景
function getbgcolor(){
	function GetRandomNum(Min,Max){//随机数范围
        var Range = Max - Min;
        var Rand = Math.random();
        return(Min + Math.round(Rand * Range));
		}
		var tempArray = new Array();//色彩数组
		tempArray [1] ="#B7EFFB";
		tempArray [2] ="#D7FFD7";
		tempArray [3] ="#FFDDDD";
		tempArray [4] ="#FFFFD0";
		tempArray [5] ="#FFBFBF";
		tempArray [6] ="#FFFFCC";
		tempArray [7] ="#fff";
		$("#bgcolors").css("background",tempArray[GetRandomNum(1,7)]);
	}
//无限下拉菜单效果	
	function menuList(){
	$('#subMenu li').hover(function(){		
		$(this).children('ul').stop(true,true).show('slow');	
		
	},
	function(){
		$(this).children('ul').stop(true,true).hide('slow');		
	}
	);	
	
}
//禁止copy
function forbidcopy(){
		function click1() {
		if (event.button==2) {alert('操作错误:禁止按鼠标右键！') }}
		function CtrlKeyDown(){
		if (event.ctrlKey) {alert('操作错误:禁止按CTRL键！') }}
		document.onkeydown=CtrlKeyDown;
		document.onmousedown=click1;
}
