// Google Analytics
if (window.location.toString().indexOf('empirestaging') < 0) {
    try {
        var pageTracker = _gat._getTracker("UA-0000000-0");
        pageTracker._trackPageview();
    } 
    catch (err) {
    }
}

// Test to see if a selector exists
$.exists = function(selector) {
	return ($(selector).length > 0);
}


// Vertically centers the page margins div in the middle of the window
function vertAlign(){
	
	var innerWindowHeight = document.documentElement.clientHeight;
	var pageHeight = $('.page_margins').height();
	
	if( innerWindowHeight >= pageHeight ){
		heightDiff = ((innerWindowHeight - pageHeight) / 2)
		$('.page_margins').css({'margin-top':heightDiff})
	}
	
}


$(document).ready(function(){

		// Checks for images in the stripView li and if there is one, assign it a class
		$('.stripViewer li').each(function() {
			if($('img', this).length > 0) {
				$(this).addClass('withImage');
			}
		});
		
		// Checks for images classed 'icon' then adds nobullets class to parent li 
		$('.stripViewer li').each(function() {
			if($('img.icon', this).length > 0) {
				$(this).addClass('nobullets');
			}
		});
	
		//This script balances these divs to an equal height.
		if ($('body').hasClass('home')) {
			$('#content .subcl .border, #content .subcr .border').equalHeightColumns();
		}
		
		
	/* fade jquery Cycle plugin (homepage qoute box) */
	if ($('#quote-container').length) {
		$('#quote-container').cycle({
			fx: 'fade',
			speed: 1000,
			timeout: 8000
		});
	}
	
	
	
	// fun with curvy corners for all
  window.onload = function() {
    var settings = {
      tl: { radius: 4 },
      tr: { radius: 4 },
      bl: { radius: 4 },
      br: { radius: 4 },
      antiAlias: false
    }

    // curvyCorners(settings, '.quote-img');
  }

	//document.getElementById('innerquote').innerHTML = str;
	//curvyCorners.redraw();
	
	

	// Superfish Primary Navigation Menu 
	$('.sf-menu').superfish();
	
	// Removes a text inputs value upon click and returns the value for no text is entered by the user
	$(":input").prompt(); 

	if ($('body').hasClass('')) {
		
	} 

}); // End of $(document).ready

$(window).load(function(){

	if ($('body').hasClass('')) {
		
	} 
    
}); // End of $(window).load

$(window).resize(function() {

	if ($('body').hasClass('')) {
		
		
	} 
    
}); // End of $(window).resize
