// JavaScript Document

curImage = '';
 curImageDiv = 'divimg7';
 toggleSwitch = 0;
 function myToggle(){
 	
 	if(toggleSwitch == 0){
		toggleSwitch = 1;
		$(".pictures img").animate({width:'hide'},1000);
		$(".pictures div").animate({width:'hide'},1000);
		$(".pictures").animate({opacity:'hide',width:'hide'},1000);
		$("#showhide").animate({marginLeft: "140px"},1000);
 		$(".PanelContent").animate({width:'hide', opacity: 'hide'  }, 1000,function(){
			$("#imgPanel").attr("class",'PanelClosed');
			//$("#showhide").animate({marginLeft: "657px"},0);
	 		
			if(curImageDiv == 'divimg7'){
				$(".aboutSection").attr("id",'bgbox2-clean');
				$("#content-int-landing").attr("style","display:none;");
			}
	 	});
	}else{
		toggleSwitch = 0;
			//
		//$("#showhide").animate({marginLeft: "145px"},0);
		$("#showhide").animate({marginLeft: "0px"},1000);
		$("#imgPanel").attr("class",'Panel');
		if(curImageDiv == 'divimg7'){
		 $(".aboutSection").attr("id",'bgbox2-landing');
		 $("#content-int-landing").attr("style","display:inline;");
		}
    	 $(".PanelContent").animate({width: 'show',opacity: 'show'  }, 1000,function(){
		  });	
		
			 $(".pictures img").animate({opacity:'show',width:'show'},1000);
			 $(".pictures div").animate({opacity:'show',width:'show'},1000);
			 $(".pictures").animate({opacity:'show', width:'show'},1000);
		
		 
	}
/*	*/
 }

 $(document).ready(function(){
 	
  $("#showhide").click(function(){
	//alert(curImageDiv);
  	myToggle();
  });
  
   $(".pictures div").click(function(){
		//alert($(this).attr('id'));
   		//myToggle();
		
   		curImageDiv = $(this).attr('id');
		$(".pictures div").attr('class','imgDim');
		$(this).attr('class', 'imgBright');
   		theDiv = $(this).attr('id');
		//alert($(this).attr('class'));
		if(theDiv == 'divimg7'){
			$(".aboutSection").attr("id",'bgbox2-landing');
			$("#content-int-landing").attr("style","display:inline;");
		}else{
			$(".aboutSection").attr("id",'bgbox2-clean');
			$("#content-int-landing").attr("style","display:none;");
		}
		
		theimg = theDiv.replace('div','');
		newSrc = $("#"+theimg).attr('src');
		newSrc = newSrc.replace('-img-','-');
   		$(".img7").attr("style","background: url("+ newSrc +") no-repeat");//alert();
		//$(".img7").animate({style:"background: url("+ newSrc +") no-repeat"},500);
		
   });
   
   $(".pictures div").hover(function(){
			//alert($(this).attr('background'));
			//$(this).attr('background', 'url(/images/clear.png) no-repeat');
			$(".pictures div").attr('class','imgDim');
			$(this).attr('class', 'imgDimHover');
			$("#"+curImageDiv).attr('class','imgBright');
   });
   
    $(".pictures div").mouseout(function(){
		//alert(curImageDiv);
		//settimeout(
		$(this).attr('class', 'imgDim');
		$("#"+curImageDiv).attr('class','imgBright');
   });
   /*
   $(".pictures div").hover(function(){
		//$(".pictures div").attr('class','imgDim');
		$(".pictures div").attr('class','imgDim');
		$(this).attr('class', 'imgBright',function(){
								  
		});
		//$("."+curImageDiv).attr('class','imgBright');
   });
   
    $(".pictures div").mouseout(function(){
		//alert(curImageDiv);
		$("."+curImageDiv).attr('class','imgBright');
			$(this).attr('class', 'imgDim');
   });
   */
 });