// JavaScript Document
	
		
		
		
	 //scroller vars
var headline_count;
var headline_interval;
var old_headline = 0;
var current_headline = 0;


function dovertical(){
$getvertical= $("#pagewrap").height();
$adjustvertical= $getvertical - 600 ;
$setvertical= ($adjustvertical)/2 ;
$("#inner_content_wrap").css("top",($setvertical));
$("#inner_content").css("min-width",980);
$("#underimageScale").css("height",($getvertical));


$gethorz= $("#pagewrap").width();
$adjusthorz= $gethorz - 980 ;
$sethorz= ($adjusthorz)/2 ;
$("#whitestrip").css("left",($sethorz));
$("#personalize_text_container").css("height",($getvertical)-114);
};


// gall
			$(function(){
				$(".child_divs").mousedown(function(){
				$(".child_divs").css("border-color","#999999");
					$(this).css("border-color","#CCCC33");
					child_array=$("#"+$(this).parent().attr("id")).children();					
					my_index=0;
					for(var i=0; i<child_array.length; i++){
						if($(this).attr("id")==child_array[i].id)
						my_index=i;
						$("#status").text(my_index);	
					    $(".child_divs2").hide();	
						$(".child_divs2 .photodescription").css({backgroundColor:'#333333',opacity:'0.8'});				
					}
					$(".child_divs2:eq("+my_index+")").fadeIn(400);
				},
				function(){
				$(this).css("background-color","#DEDEDE");
				$("#status").text("");				
				$(".child_divs2:eq("+my_index+")").hide();
				});
			});

$(window).resize( function() {					   
			
	dovertical();
});	



$(window).load( function() {
	
	
setTimeout ("$('#home_introbox').show()", 500); 
//gallerry start
$(".child_divs2 .photodescription").css({backgroundColor:'#333333',opacity:'0.8'});			
$('.child_divs2').eq(0).fadeIn(1000);


	//whitestrip

$('#consult_form_wrap').hide();
$('#whitestrip').hide();
$('#whitestrip').fadeIn(2000,function(){
   $('#consult_form_wrap').show(2000);
 });	
// alternate
$('#whitestrip2').css({backgroundColor:'#ffffff',opacity:'0.9'});
$('#whitestrip2_inner').css({backgroundColor:'#ffffff',opacity:'0.9'});
$('whitestrip2_inner').hide();
$('#whitestrip2').hide();
$('#whitestrip2').fadeIn(2000,function(){
   $('#whitestrip2_inner').fadeIn(2000);
 });


	dovertical();
	
	

	
// index page larger thumbs flash
// thumbnailflash
$('.index_thumb img').mouseover(function(){
$(this).animate({opacity:".05"},100).animate({opacity:"1"},100);
return false;
});	  	
	
	
});




$(document).ready(function(){
	//consult

	

						   




$(document).pngFix(); 

dovertical();

//home 
//$('#home_introbox').hide().fadeIn(2000);						   
$('#home_introbox').hide();					   
						   
  headline_count = $("div.headline").size();
  $("div.headline:eq("+current_headline+")").css('left', '0px');
  headline_interval = setInterval(headline_rotate,5000);
  
  

//  $('#scrollleft').hover(function() {
//	clearInterval(headline_interval);
//  }, function() {
//	headline_interval = setInterval(headline_rotate,5500);
//	headline_rotate();
//  });
  

// details
$('#display_desc_trans').css({backgroundColor:'#ffffff',opacity:'0.9'});
$('detail_thumb ').css({opacity:'1'});
$('#display_desc').hide().fadeIn(2000);
$('#display_desc_trans').hide().fadeIn(2000);
$('.detail_thumb img').mouseover(function(){
$(this).animate({opacity:".05"},100).animate({opacity:"1"},100);
return false;		
	});	
  

 
  
});



function headline_rotate() {
  current_headline = (old_headline + 1) % headline_count;
  $("div.headline:eq(" + old_headline + ")")
	.animate({left: -800},"slow", function() {
	  $(this).css('left', '800px');
	  $('.butt_viewdetails').css({borderColor:'#ffffff'});
	$('.butt_viewdetails a').css({color:'#ffffff'});
	
	});
  $("div.headline:eq(" + current_headline + ")")
	.animate({left: 0},"slow");
		$('.butt_viewdetails').css({borderColor:'#999999'});
		$('.butt_viewdetails a').css({color:'#999999'});
		
  old_headline = current_headline;
}
 
 


		
