/* --------------------------------------------
|  COPYRIGHT INFORMATION
| ---------------------------------------------
| 
| Company: New Wave Media 
| Web Developer: Aaron Christian - [aaron@new-wavemedia.com]
| Client: Christian & Christian Signs
| 
| All Rights Reserved.
|							
--------------------------------------------- */

/* --------------------------------------------
|  GLOBAL JAVASCRIPT												
--------------------------------------------- */

// Set Copyright Year
function copyrightYear(){
	if(document.getElementById('setYear')) document.getElementById('setYear').innerHTML = new Date().getFullYear();
	Cufon.replace('#setYear', { fontFamily: 'Pill Gothic', fontWeight: 'bold' });
}

// Set External Links
function externalLinks(){
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		if (anchors[i].getAttribute("href") && anchors[i].getAttribute("rel") == "external") anchors[i].target = "_blank";
	}
}

// On Site Load
function siteOnLoad () {
	copyrightYear();
	externalLinks();
}

// Add Load Event
function addLoadEvent(func){
	var oldOnLoad = window.onload;
	if(typeof window.onload != 'function'){
		window.onload = func;
	}
	else{
		window.onload = function(){
			oldOnLoad();
			func();
		}
	}
}

addLoadEvent(siteOnLoad);

// Clear Search Text
function clearSearch() {
	document.getElementById("searchInput").value="";
}

/* --------------------------------------------
|  PAGE SPECIFIC JAVASCRIPT											
--------------------------------------------- */

jQuery(document).ready(function() {

	$(".fancybox-video").click(function() {
		$.fancybox({
			'padding'		: 7,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'			: 640,
			'height'		: 385,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'				: {
			'wmode'			: 'transparent',
			'allowfullscreen'	: 'true'
			}
		});
		return false;
	});
	
	// grouped fancybox galleries
	$("a[rel=fancybox]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over'
	});
	
});

/* --------------------------------------------
|  CUFON > GLOBAL										
--------------------------------------------- */

/* -- COOLVETICA -- */
Cufon.replace('#contentArea h1', { fontFamily: 'Coolvetica', fontSize: '48px' });
Cufon.replace('#contentArea h3', { fontFamily: 'Coolvetica', fontSize: '28px' });
Cufon.replace('#contentArea h5', { fontFamily: 'Coolvetica', fontSize: '20px' });

// Sidebar
Cufon.replace('.sbBlock h3', { fontFamily: 'Coolvetica', fontSize: '24px' });
Cufon.replace('.sbBlock h5', { fontFamily: 'Coolvetica', fontSize: '18px' });

// Header
Cufon.replace('#headerInfo h1', { fontFamily: 'Coolvetica'});

/* -- PILL GOTHIC -- */
Cufon.replace('#contentArea h2', { fontFamily: 'Pill Gothic', fontSize: '32px' });
Cufon.replace('#contentArea h4', { fontFamily: 'Pill Gothic', fontSize: '18px' });
Cufon.replace('#contentArea h6', { fontFamily: 'Pill Gothic', fontSize: '14px' });

// Navigations
Cufon.replace('#priNav li.active-trail a.active', { fontFamily: 'Pill Gothic', fontWeight: 'bold', hover: { color: '#f1d9b0' }});
Cufon.replace('#priNav li', { fontFamily: 'Pill Gothic', fontWeight: 'bold', hover: { color: '#fff' }});

Cufon.replace('#secNav > li.active-trail > a', { fontFamily: 'Pill Gothic', fontSize: '18px', fontWeight: 'bold', hover: { color: '#fff' }});
Cufon.replace('#secNav > li.active-trail > a.active', { fontFamily: 'Pill Gothic', fontSize: '18px', fontWeight: 'bold', hover: { color: '#fff' }});
Cufon.replace('#secNav > li', { fontFamily: 'Pill Gothic', fontSize: '18px', ignore: { ul: true }, hover: { color: '#152039' }});
Cufon.replace('#secNav > li > a.active', { fontFamily: 'Pill Gothic', fontSize: '18px', fontWeight: 'bold' });

// Header
Cufon.replace('#headerInfo #tagline', { fontFamily: 'Pill Gothic', fontWeight: 'bold'});
Cufon.replace('#sliderWrap #slider .slideDesc', { fontFamily: 'Pill Gothic', fontWeight: 'bold', hover: { color: '#fff' }});

// Links
Cufon.replace('ul.links li a', { fontFamily: 'Pill Gothic', fontWeight: 'bold', hover: { color: '#1f5270' } });
Cufon.replace('.read-more', { fontFamily: 'Pill Gothic', fontWeight: 'bold' });

// Sidebar 
Cufon.replace('.smTitle', { fontFamily: 'Pill Gothic', fontWeight: 'bold' });
Cufon.replace('.sales .videoDesc', { fontFamily: 'Pill Gothic', fontWeight: 'bold' });

// Footer
Cufon.replace('#footerTop h3', { fontFamily: 'Pill Gothic', fontWeight: 'bold' });
Cufon.replace('#footerLinks li a', { fontFamily: 'Pill Gothic', fontWeight: 'bold', hover: { color: '#444343' } });
Cufon.replace('#footerBot', { fontFamily: 'Pill Gothic', fontWeight: 'bold' });
Cufon.replace('#footerQuality div p', { fontFamily: 'Pill Gothic' });
Cufon.replace('#footerLocation table tr td', { fontFamily: 'Pill Gothic' });

/* --------------------------------------------
|  CUFON > PAGES										
--------------------------------------------- */

// Portfolio
Cufon.replace('.portfolio h3', { fontFamily: 'Coolvetica', fontSize: '24px' });
Cufon.replace('.portfolio h5', { fontFamily: 'Pill Gothic' });
