//Fancybox Lightbox Effect
$(document).ready(function() {
	$(".fancybox").fancybox({
		'titleShow'		: false,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic'
	});
});

//====================================

//Jquery Popup Tooltip
$(document).ready(function() 
{
	$('#conTip').qtip(
	{
		content: '<span class="toolTitle">Construction</span><p>John Harmon, D.D.S. has over 23 years experience as a General Practice Dentist. He retired from his practice at the end of 2006. As a second generation builder, Dr. Harmon is well versed in all aspects of the building industry.</p><p>During his career as a dentist, he remodeled numerous offices and built a high tech dental facility in conjunction with a ten thousand square foot multi-complex business office...</p>',
		style: { 
			tip: 'bottomLeft',
			//Decoration
			width: 440,
			padding: 20,
			color: 'black',
			border: {
				color: '#fddc41'
			},
			background: '#fddc41'
		},
		position: {
			corner: {
				target: 'topLeft',
				tooltip: 'bottomLeft'
			},
			adjust: {
				x:10,
				y:-35
			}
		},
		show: { effect: { length: 300 } },
		hide: { effect: { length: 1000 } }
	});
	
	$('#resTip').qtip(
	{
		content: '<span class="toolTitle">Residential Homes</span><p>Harmon and Holcomb is building gorgeous and energy efficient homes in the North Texas area. Eddie and John are both lifelong residents of Wichita Falls and have extensive experience in the construction field.</p><p>Construction expertise and on-the-job supervision will result in quality homes that will save money on energy costs. Harmon and Holcomb Homes combine energy-efficiency with...</p>',
		style: { 
			tip: 'bottomLeft',
			//Decoration
			width: 430,
			padding: 20,
			color: 'black',
			border: {
				color: '#fddc41'
			},
			background: '#fddc41'
		},
		position: {
			corner: {
				target: 'topLeft',
				tooltip: 'bottomLeft'
			},
			adjust: {
				x:10,
				y:-35
			}
		},
		show: { effect: { length: 300 } },
		hide: { effect: { length: 1000 } }
	});
});


/*
$("#conTip").simpletip({
					   
	//Configuration
	content: '<span class="toolContent"><h2>Construction</h2><p>John Harmon, D.D.S. has over 23 years experience as a General Practice Dentist. He retired from his practice at the end of 2006. As a second generation builder, Dr. Harmon is well versed in all aspects of the building industry.</p><p>During his career as a dentist, he remodeled numerous offices and built a high tech dental facility in conjunction with a ten thousand square foot multi-complex business office...</p></span><span class="tooltail"></span>',
	fixed: true,
	showEffect: 'fade', //option fade,slide,none
	showTime: 300,
	hideEffect: 'fade',
	hideTime: 1000,
	position: ["0", "-245"]
	
});

$("#resTip").simpletip({
					   
	//Configuration
	content: '<span class="toolContent"><h2>Residential Homes</h2><p>armon and Holcomb is building gorgeous and energy efficient homes in the North Texas area. Eddie and John are both lifelong residents of Wichita Falls and have extensive experience in the construction field.</p><p>Construction expertise and on-the-job supervision will result in quality homes that will save money on energy costs. Harmon and Holcomb Homes combine energy-efficiency with...</p></span></span><span class="tooltail"></span>',
	fixed: true,
	showEffect: 'fade', //option fade,slide,none
	showTime: 300,
	hideEffect: 'fade',
	hideTime: 1000,
	position: ["0", "-245"]
});
*/

//====================================

// Auto Clear Search Field
function init(){
	var inp = document.getElementsByTagName('input');
	for(var i = 0; i < inp.length; i++) {
		if(inp[i].type == 'text') {
			inp[i].setAttribute('rel',inp[i].defaultValue)
			inp[i].onfocus = function() {
				if(this.value == this.getAttribute('rel')) {
					this.value = '';
				} else {
					return false;
				}
			}
			inp[i].onblur = function() {
				if(this.value == '') {
					this.value = this.getAttribute('rel');
				} else {
					return false;
				}
			}
			inp[i].ondblclick = function() {
				this.value = this.getAttribute('rel')
			}
		}
	}
}
if(document.childNodes) {
	window.onload = init
}
