// JavaScript Document

function magic() {
		for (var i=0; i<40;i++){
				if (document.getElementById('it'+i)){
						var div=document.getElementById('it'+i)
						var len=div.innerHTML.length;
						if (len<5){
								div.style.display='none';
							}
					}
			}
	}



function magic2() {
		for (var i=0; i<40;i++){
				if (document.getElementById('cd'+i)){
						var div=document.getElementById('cd'+i)
						if (document.getElementById('c'+i)) var div2=document.getElementById('c'+i);
						if (document.getElementById('c'+i)) var len=div2.innerHTML.length;
						if (len<4){
								div.style.display='none';
							}
					}
			}
	}



function magic3() {
		if (document.getElementById('left_c')){
						var div=document.getElementById('left_c')
		}
		if (document.getElementById('right_c')){
						var div2=document.getElementById('right_c')
		}
		if (document.getElementById('c1')) var box1=document.getElementById('c1');
		if (box1) var len1=box1.innerHTML.length;
		if (document.getElementById('c2')) var box2=document.getElementById('c2');
		if (box2) var len2=box2.innerHTML.length;
		if (document.getElementById('c3')) var box3=document.getElementById('c3');
		if (box3) var len3=box3.innerHTML.length;
		if (document.getElementById('c4')) var box4=document.getElementById('c4');
		if (box4) var len4=box4.innerHTML.length;
		if (document.getElementById('c5')) var box5=document.getElementById('c5');
		if (box5) var len5=box5.innerHTML.length;
		
		if (box1 && box2 && box3 && box4 && box5 && div && div2) {
				if ((len1 + len2 + len3 + len4 + len5)<5){
						div.style.display='none';
						div2.style.width='auto';
					}
			}
		
	}
	
	
// This is the JS to avoid the About Us cutting off
var showed = false;
function showMe() {
	if(!showed){
		setTimeout('showMe1()', 1);
		showed = true;
	}else{
		showMe1();
	}
}

function showMe1() {
	var height1 = $('div#aboutnav').height();
	$('div.main-left-top').css('min-height', height1);
	$('div#aboutnav').css('display','block');
	$('div#aboutus1').addClass(' about-over');
}


function hideMe() {
	$('div.main-left-top').css('min-height', '0px');
	$('div#aboutnav').css('display','none');
	$('div#aboutus1').removeClass(' about-over');
}

	
// when the DOM is ready...



$(document).ready(function () {

$('div#aboutnav').removeAttr('onmouseout');
$('div#aboutnav').removeAttr('onmouseover');

$('div#aboutnav').mouseenter(function() {
  	var height1 = $('div#aboutnav').height();
	$('div.main-left-top').css('min-height', height1);
	$('div#aboutnav').css('display','block');
	$('div#aboutus1').addClass(' about-over');
});

$('div#aboutnav').mouseleave(function() {
  	$('div.main-left-top').css('min-height', '0px');
	$('div#aboutnav').css('display','none');
	$('div#aboutus1').removeClass(' about-over');
});
	
	
// Rotating header script:	
	
if (document.getElementById("thumbs_container")!=null) {
							
	$('#infinite_slider img').attr('width', '577');
	$('#infinite_slider img').attr('height', '331');
	
	$('#infinite_slider').infiniteCarousel({
		transitionSpeed: 400,
		displayTime: 5000,
		displayProgressBar:false,
		displayThumbnails: true,
		displayThumbnailBackground: false,
		displayThumbnailNumbers: true,
		thumbnailWidth: 'auto',
		thumbnailHeight: '19px',
		thumbnailFontSize: '1.1em',
		imagePath: 'Files/Admin/DesignImages/'
	});
}	
});

          
