var streepnum = 1;
//var bimg_path = "http://"+document.domain+"/wordsearchtest/";
var bimg_path = "http://"+document.domain+"/";

function OneByOneHide(j)
	{
	if(j==1)
	
	{
		$('.button'+j).attr("src",bimg_path+"img/"+j+".jpg");
	}
	else if(j==2)
	{ 
		$('.button'+j).attr("src",bimg_path+"img/"+j+".jpg");
	}
	else if(j==3)
	{ 
		$('.button'+j).attr("src",bimg_path+"img/"+j+".jpg");
	}
	else if(j==4)
	{ 
		$('.button'+j).attr("src",bimg_path+"img/"+j+".jpg");
	}
	else if(j==5)
	{  
		$('.button'+j).attr("src",bimg_path+"img/"+j+".jpg");
	}
	else if(j==6)
	{
		$('.button'+j).attr("src",bimg_path+"img/"+j+".jpg");
	}
	else if(j==7)
	{ 
		$('.button'+j).attr("src",bimg_path+"img/"+j+".jpg");
	}
	   

	}

function OneByOne() {

if(streepnum==1)
	{
		$('#strip'+streepnum+' a').trigger('mouseover');
		$('.button'+streepnum).attr("src",bimg_path+"img/aboutcm.png");
		$('.button'+streepnum).css({opacity: '0.9'});
		$('.button'+streepnum).fadeOut(0);$('.button'+streepnum).fadeIn(1000);
		
	}
	else if(streepnum==2)
	{ 
		  $('#strip'+streepnum+' a').trigger('mouseover');
     	  $('.button'+streepnum).attr("src",bimg_path+"img/souk.png");
     	  $('.button'+streepnum).css({opacity: '0.9'});
     	  $('.button'+streepnum).fadeOut(0);$('.button'+streepnum).fadeIn(1000);
     
	}
	
	else if(streepnum==3)
	{
		$('#strip'+streepnum+' a').trigger('mouseover');
		$('.button'+streepnum).attr("src",bimg_path+"img/emporium.png");
		$('.button'+streepnum).css({opacity: '0.9'});
		$('.button'+streepnum).fadeOut(0);$('.button'+streepnum).fadeIn(1000);
	
	}
	else if(streepnum==4)
	{
	 	$('#strip'+streepnum+' a').trigger('mouseover');
	 	$('.button'+streepnum).attr("src",bimg_path+"img/trust-tower.png");
	 	$('.button'+streepnum).css({opacity: '0.9'});
	 	$('.button'+streepnum).fadeOut(0);$('.button'+streepnum).fadeIn(1000);	
	}
	else if(streepnum==5)
	{
		$('#strip'+streepnum+' a').trigger('mouseover');
		$('.button'+streepnum).attr("src",bimg_path+"img/living.png");
		$('.button'+streepnum).css({opacity: '0.9'});
 		$('.button'+streepnum).fadeOut(0);$('.button'+streepnum).fadeIn(1000);
 	}
	else if(streepnum==6)
	{ 
		$('#strip'+streepnum+' a').trigger('mouseover');
		$('.button'+streepnum).attr("src",bimg_path+"img/hotels.png");
		$('.button'+streepnum).css({opacity: '0.9'});
  		$('.button'+streepnum).fadeOut(0);$('.button'+streepnum).fadeIn(1000);
  	}
	else if(streepnum==7)
	{
	 	$('#strip'+streepnum+' a').trigger('mouseover');
	 	$('.button'+streepnum).attr("src",bimg_path+"img/visitor.png");
	 	$('.button'+streepnum).css({opacity: '0.9'});
  		$('.button'+streepnum).fadeOut(0);$('.button'+streepnum).fadeIn(1000);
  	}
   
	setTimeout("OneByOneHide("+streepnum+")",2000);
	streepnum += 1 ;
	if(streepnum > 7)
	{
		streepnum = 1;
	}
}
	
$(document).ready(function() {
	
$(".button1").hover(function() {
	
		$(this).attr("src",bimg_path+"img/aboutcm.png");
			$(this).css({opacity: '0.9'});
		    $(this).fadeOut(0);$(this).fadeIn(1000);
		}, function() {
		$(this).attr("src",bimg_path+"img/1.jpg");
	

	});
	
		
$(".button2").hover(function() {
		$(this).attr("src",bimg_path+"img/souk.png");
			$(this).css({opacity: '0.9'});
		  	$(this).fadeOut(0);$(this).fadeIn(1000);
		}, function() {
		$(this).attr("src",bimg_path+"img/2.jpg");
	

	});
		
$(".button3").hover(function() {
		$(this).attr("src",bimg_path+"img/emporium.png");
			$(this).css({opacity: '0.9'});
		  	$(this).fadeOut(0);$(this).fadeIn(1000);
		}, function() {
		$(this).attr("src",bimg_path+"img/3.jpg");
	

	});
		

		
$(".button4").hover(function() {
		$(this).attr("src",bimg_path+"img/trust-tower.png");
			$(this).css({opacity: '0.9'});
		  	$(this).fadeOut(0);$(this).fadeIn(1000);
		}, function() {
		$(this).attr("src",bimg_path+"img/4.jpg");
	

	});
		
$(".button5").hover(function() {
		$(this).attr("src",bimg_path+"img/living.png");
			$(this).css({opacity: '0.9'});
		  	$(this).fadeOut(0);$(this).fadeIn(1000);
		}, function() {
		$(this).attr("src",bimg_path+"img/5.jpg");
	

	});
		
$(".button6").hover(function() {
		$(this).attr("src",bimg_path+"img/hotels.png");
			$(this).css({opacity: '0.9'});
		  	$(this).fadeOut(0);$(this).fadeIn(1000);
		}, function() {
		$(this).attr("src",bimg_path+"img/6.jpg");
	

	});
	
		
$(".button7").hover(function() {
		$(this).attr("src",bimg_path+"img/visitor.png");
			$(this).css({opacity: '0.9'});
		  	$(this).fadeOut(50);$(this).fadeIn(1000);
		}, function() {
		$(this).attr("src",bimg_path+"img/7.jpg");
	

	});
	/************************* Auto Slide*********************************/
	
	var test =setInterval('OneByOne('+streepnum+')',2000);

	$(".jimgMenu").mousemove(function(){
	
		clearInterval(test);
		   
 		},function(){
	});
	
	//************************** Auto start after mouse out*********************
   	$('#contentarea_home').mouseout( function () { 
   		//alert("Mouse over content area Home"); 
		test =setInterval('OneByOne('+streepnum+')',2000);
     },  
 	 function () {}  
   	);
 
  
	$('.jimgMenu ul').kwicks({max: 240, duration: 500, easing: 'swing'});	

});
