var stackPulseDuration = 5000;

function stack_pulse(target)
{
	var focus = typeof(target) == 'object' ? target.find('div.focus') : $(this).find('div.focus');

	if ( focus.css('opacity') < 0.1 )
	{
		focus.animate({opacity: 1}, {queue: false, duration: stackPulseDuration * 0.9});
	} else {
		focus.animate({opacity: 0}, {queue: false, duration: stackPulseDuration * 0.9});
	}
};

function getParameterByName( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return decodeURIComponent(results[1].replace(/\+/g, " "));
}

$(function() {
	var stack = $('div.stack.pulse');

	if ( stack.length )
	{
		stack_pulse(stack);

		$('div.stack.pulse').everyTime(stackPulseDuration, 'pulse', stack_pulse);
	}	
});

//$(window).load(function() {

//	if(getParameterByName('m') == ""){
//		if(window.location.href.toLowerCase().indexOf('beehivecommunicationsnyc.com') > -1){
//			$.modal('<div style="float:left;margin-top:80px;margin-left:90px;"><a href="http://beehivemedia.com/?m=off"><img src="/wp-content/themes/BLANK-Theme/images/common/modal_beehivemedia.png" onmouseover="this.src=\'/wp-content/themes/BLANK-Theme/images/common/modal_beehivemedia_over.png\'" onmouseout="this.src=\'/wp-content/themes/BLANK-Theme/images/common/modal_beehivemedia.png\'" /></a></div><div style="float:left;margin-top:80px;margin-left:20px;"><img src="/wp-content/themes/BLANK-Theme/images/common/modal_or.png" /></div><div style="float:left;margin-top:80px;margin-left:20px;"><a href="#" class="simplemodal-close"><img src="/wp-content/themes/BLANK-Theme/images/common/modal_beehivecommunications.png" onmouseover="this.src=\'/wp-content/themes/BLANK-Theme/images/common/modal_beehivecommunications_over.png\'" onmouseout="this.src=\'/wp-content/themes/BLANK-Theme/images/common/modal_beehivecommunications.png\'" /></a></div>');			
//		}
//		else{
//			$.modal('<div style="float:left;margin-top:80px;margin-left:90px;"><a href="#" class="simplemodal-close"><img src="/wp-content/themes/BLANK-Theme/images/common/modal_beehivemedia.png" onmouseover="this.src=\'/wp-content/themes/BLANK-Theme/images/common/modal_beehivemedia_over.png\'" onmouseout="this.src=\'/wp-content/themes/BLANK-Theme/images/common/modal_beehivemedia.png\'" /></a></div><div style="float:left;margin-top:80px;margin-left:20px;"><img src="/wp-content/themes/BLANK-Theme/images/common/modal_or.png" /></div><div style="float:left;margin-top:80px;margin-left:20px;"><a href="http://beehivecommunicationsnyc.com/?m=off"><img src="/wp-content/themes/BLANK-Theme/images/common/modal_beehivecommunications.png" onmouseover="this.src=\'/wp-content/themes/BLANK-Theme/images/common/modal_beehivecommunications_over.png\'" onmouseout="this.src=\'/wp-content/themes/BLANK-Theme/images/common/modal_beehivecommunications.png\'" /></a></div>');			
//		}		
//	}
//});

