/*********************
//* jQuery Multi Level CSS Menu #2- By Dynamic Drive: http://www.dynamicdrive.com/
//* Last update: Nov 7th, 08': Limit # of queued animations to minmize animation stuttering
//* Menu avaiable at DD CSS Library: http://www.dynamicdrive.com/style/
*********************/
var surClic = true ;
color = new Array
	color[1]='rgb(123,255,116)'
	color[2]='rgb(23,250,255)'
	color[3]='rgb(255,84,137)'
	color[4]='rgb(84,253,156)'
	color[5]='rgb(255,233,73)'
	color[6]='rgb(255,32,94)'
	
	/*
 *
 *	jQuery Timer plugin v0.1
 *		Matt Schmidt [http://www.mattptr.net]
 *
 *	Licensed under the BSD License:
 *		http://mattptr.net/license/license.txt
 *
 */
 
 jQuery.timer = function (interval, callback)
 {
 /**
  *
  * timer() provides a cleaner way to handle intervals  
  *
  *	@usage
  * $.timer(interval, callback);
  *
  *
  * @example
  * $.timer(1000, function (timer) {
  * 	alert("hello");
  * 	timer.stop();
  * });
  * @desc Show an alert box after 1 second and stop
  * 
  * @example
  * var second = false;
  *	$.timer(1000, function (timer) {
  *		if (!second) {
  *			alert('First time!');
  *			second = true;
  *			timer.reset(3000);
  *		}
  *		else {
  *			alert('Second time');
  *			timer.stop();
  *		}
  *	});
  * @desc Show an alert box after 1 second and show another after 3 seconds
  *
  * 
  */
  
  

	var interval = interval || 100;

	if (!callback)
		return false;
	
	_timer = function (interval, callback) {
		this.stop = function () {
			clearInterval(self.id);
		};
		
		this.internalCallback = function () {
			callback(self);
		};
		
		this.reset = function (val) {
			if (self.id)
				clearInterval(self.id);
			
			var val = val || 100;
			this.id = setInterval(this.internalCallback, val);
		};
		
		this.interval = interval;
		this.id = setInterval(this.internalCallback, this.interval);
		
		var self = this;
	};
	
	return new _timer(interval, callback);
 };
	
	

					  
	
	

					
					 
		var stripecounter=-300;
	
	
$(document).ready(function($)
{
	
	/*$.timer(80, function (timer) {
 	var headerbg = Math.floor((7-1)*Math.random()) + 1;
    $(".header").css('background-color', color[headerbg]);
	
   });*/
	
	
	$(".colory").hover(
      
	  function () {
  $(this).css('background-color', '#202020');
	   $(this).css('color', 'white');

			$("#stripe"+stripecounter+"").css('background-color', color[rand_no]);
	   		stripecounter++;
		
	
	;
	  },
	  function () {
     
	   	var rand_no = Math.floor((7-1)*Math.random()) + 1;
       $(this).css('background-color', color[rand_no]);
	   $(this).css('color', 'rgb(40,00,00)');
	   
      }

    )
	
	
	
	$(".subcolory").hover(
	  function () {
	var rand_no = Math.floor((7-1)*Math.random()) + 1;
      
	   $(this).css('color', color[rand_no]);
	   
	   $("#stripe"+stripecounter+"").css('background-color', color[rand_no]);
	   		stripecounter++;
	
	  },
	  function () {
  
      }
    );

	
	//random colours at the beginning
	
	for(i=0;i<32;i++){
		
		
		var rcprobability = Math.floor((32-1)*Math.random()) + 1;
		
		if (rcprobability<1) {
			var rand_no = Math.floor((7-1)*Math.random()) + 1;
			$("#randomcolory"+i+"").css('color', color[rand_no]);
		}

	};
	
							
	
	
	// append .new class with tiny tag
	
	$('.new').after(' <span class="tag"> new</span>'); 
	
	for(j=0;j<12;j++){
	var rand_no = Math.floor((7-1)*Math.random()) + 1;
	$('#main'+j+'').css('background-color',color[rand_no]);
	$('#main'+j+'').css('color','rgb(40,00,00)');
	}
	
	for(j=0;j<3;j++){
	var rand_no = Math.floor((7-1)*Math.random()) + 1;
	$('.colorletter'+j+'').css('color',color[rand_no]);
	}

}) ;


// JavaScript Document
