function Obj(o){var d=document;if(d.getElementById&&d.getElementById(o)){return d.getElementById(o);}else if(d.all&&d.all(o)){return d.all(o);}else{return false;}}


function HoverIn(id,cl){
//	var i=Obj("li_"+id);	i.className="active";
	var i=Obj("a_"+id);		i.className="topactivelink";
}

function HoverOut(id,cl){
	if(cl=="active"){
//		var i=Obj("li_"+id);	i.className="active";
		var i=Obj("a_"+id);		i.className="topactivelink";
	}else{
//		var i=Obj("li_"+id);	i.className="";
		var i=Obj("a_"+id);		i.className="";
	}
}


function HoverInSliding(id,cl){

	var i=Obj("a_"+id);		i.className="activeslider";
}

function HoverOutSliding(id,cl){
	if(cl=="active"){

		var i=Obj("a_"+id);		i.className="activeslider";
	}else{
	
	
	
$(document).ready(function(){
	$(".dropdownlinks" && "#panel" && ".id-1" && ".panels" && "#sliding-dropdown" && "#panels" && "#panel-nav").mouseleave(function(){
		var i=Obj("a_"+id);		i.className="";
 		Timer = setTimeout("CollapseMenu()", 3000); 
	});

	$(".dropdownlinks" || "#panel" || ".id-1" || ".panels" || "#sliding-dropdown" || "#panels" || "#panel-nav").mouseover(function(){
		 clearTimeout(Timer);
	});
});
		
	}
}

$(function(){
    $('a.new-window').click(function(){
        window.open(this.href);
        return false;
    });
});


function Toggle(id){
	o=Obj(id);
	if(o){
		o.style.display=((o.style.display=="none")?"block":"none");
	}
	
}

 function toggleYear(id){
 	//$('#'+id).toggle();
 	$('#'+id).slideToggle("slow")
 }
 
 $(document).ready(function() {
				$('input[type="text"]').addClass("idleField");
				$('input[type="text"]').focus(function() {
					$(this).removeClass("idleField").addClass("focusField");
					if (this.value == this.defaultValue){ 
						this.value = '';
					}
					if(this.value != this.defaultValue){
						this.select();
					}
				});
				$('input[type="text"]').blur(function() {
					$(this).removeClass("focusField").addClass("idleField");
					if ($.trim(this.value) == ''){
						this.value = (this.defaultValue ? this.defaultValue : '');
					}
				});
			
				$('textarea').addClass("idleField");
					$('textarea').focus(function() {
						$(this).removeClass("idleField").addClass("focusField");
						if (this.value == this.defaultValue){ 
							this.value = '';
						}
						if(this.value != this.defaultValue){
							this.select();
						}
					});
					$('textarea').blur(function() {
						$(this).removeClass("focusField").addClass("idleField");
						if ($.trim(this.value) == ''){
							this.value = (this.defaultValue ? this.defaultValue : '');
						}
					});
			
			
			/* START SLIDESHOW */
		
		$('#slideshow').cycle({ 
			fx:     'fade', 
			timeout: 6000, 
			delay:  -2000 
		});
		
		
		/* SLIDESHOW PAUSE ON HOVER OF MAIN IMAGE DIV */
		
		$(function() {
		$("#mainimg")
			.mouseover(function() { 
				$('#slideshow').cycle('pause');
			})
			.mouseout(function() {
				$('#slideshow').cycle('resume');
			});
		});
		
		
		/* BUTTON HOVER - SHOW CONTENT AND PAUSE ANIMATION */
		
		$(function() {
		$(".home-subnav-building")
			.mouseover(function() { 
				$('#slideshow').cycle('pause');
				$('#slideshow').hide();
				$('#anim-building').show();
				$('#anim-cleaning').hide();
				$('#anim-fire').hide();
				$('#anim-manu').hide();
				$('#anim-national').hide();
				$('#anim-special').hide();
			})
		});
		
		$(function() {
		$(".home-subnav-cleaning")
			.mouseover(function() { 
				$('#slideshow').cycle('pause');
				$('#slideshow').hide();
				$('#anim-building').hide();
				$('#anim-cleaning').show();
				$('#anim-fire').hide();
				$('#anim-manu').hide();
				$('#anim-national').hide();
				$('#anim-special').hide();
			})
		});
		
		$(function() {
		$(".home-subnav-fire")
			.mouseover(function() { 
				$('#slideshow').cycle('pause');
				$('#slideshow').hide();
				$('#anim-building').hide();
				$('#anim-cleaning').hide();
				$('#anim-fire').show();
				$('#anim-manu').hide();
				$('#anim-national').hide();
				$('#anim-special').hide();
			})
		});
		
		$(function() {
		$(".home-subnav-manu")
			.mouseover(function() { 
				$('#slideshow').cycle('pause');
				$('#slideshow').hide();
				$('#anim-building').hide();
				$('#anim-cleaning').hide();
				$('#anim-fire').hide();
				$('#anim-manu').show();
				$('#anim-national').hide();
				$('#anim-special').hide();
			})
		});
		
		$(function() {
		$(".home-subnav-national")
			.mouseover(function() { 
				$('#slideshow').cycle('pause');
				$('#slideshow').hide();
				$('#anim-building').hide();
				$('#anim-cleaning').hide();
				$('#anim-fire').hide();
				$('#anim-manu').hide();
				$('#anim-national').show();
				$('#anim-special').hide();
			})
		});
		
		$(function() {
		$(".home-subnav-special")
			.mouseover(function() { 
				$('#slideshow').cycle('pause');
				$('#slideshow').hide();
				$('#anim-building').hide();
				$('#anim-cleaning').hide();
				$('#anim-fire').hide();
				$('#anim-manu').hide();
				$('#anim-national').hide();
				$('#anim-special').show();
			})
		});
		
		
		/* IF HOVER OUT OF MAST DIV THEN PLAY SLIDESHOW FROM WHERE WE LEFT OFF */
		
		$(function() {
		$("#mast")
			.mouseleave(function() {
				$('#slideshow').cycle('resume');
				$('#slideshow').show();
				//$('#anim-building').hide();
				//$('#anim-cleaning').hide();
			});
		});
		
		
		/* BUTTON HOVER BG CHANGE - FOOTER */
		
		$(function() {
		$(".homenav-building-footer")
			.mouseover(function() { 
				$(this).addClass('homenav-building-footer-hover');
			})
			.mouseout(function() {
				$(this).removeClass('homenav-building-footer-hover');
			});
		});
		
		$(function() {
		$(".homenav-cleaning-footer")
			.mouseover(function() { 
				$(this).addClass('homenav-cleaning-footer-hover');
			})
			.mouseout(function() {
				$(this).removeClass('homenav-cleaning-footer-hover');
			});
		});
		
		$(function() {
		$(".homenav-fire-footer")
			.mouseover(function() { 
				$(this).addClass('homenav-fire-footer-hover');
			})
			.mouseout(function() {
				$(this).removeClass('homenav-fire-footer-hover');
			});
		});
		
		$(function() {
		$(".homenav-manu-footer")
			.mouseover(function() { 
				$(this).addClass('homenav-manu-footer-hover');
			})
			.mouseout(function() {
				$(this).removeClass('homenav-manu-footer-hover');
			});
		});
		
		$(function() {
		$(".homenav-national-footer")
			.mouseover(function() { 
				$(this).addClass('homenav-national-footer-hover');
			})
			.mouseout(function() {
				$(this).removeClass('homenav-national-footer-hover');
			});
		});
		
		$(function() {
		$(".homenav-special-footer")
			.mouseover(function() { 
				$(this).addClass('homenav-special-footer-hover');
			})
			.mouseout(function() {
				$(this).removeClass('homenav-special-footer-hover');
			});
		});
			
			
			});
			
			 
				
			
			
		
		
		
		
		
		