/*  ================================
     Sitewide JavaScript
    ================================ */

	// Detected and set from HTML
	$(document).ready(function(){
		thunder.client.project.writeJobBoard();
		thunder.client.modify.rollImages();
		thunder.client.modify.linkOptions();
		thunder.client.modify.tabSet();
		thunder.client.modify.selfLabelFields();
		$('.participation-pop-over-holder').mouseover(thunder.client.project.utils.participateOver).mouseout(thunder.client.project.utils.participateOut);
		$('.medcity-paid-spot-link').click(function() { window.location = this.getAttribute('thunder.markup:item'); });
	/*	$('.syndication-partner').mouseover(function() { $(this).children('.syndication-partner-description')[0].style.display = 'block'; }).mouseout(function() { $(this).children('.syndication-partner-description')[0].style.display = 'none'; })*/
		thunder.client.modify.requireFields();		
	});

	thunder.client.project.writeJobBoard = function()
	{
		$.ajax({url: 'http://medcitynews.jobamatic.com/a/jbb/find-jobs-json/jbb_widget_list_jobposts/5?q=hospital%20or%20healthcare%20or%20nurse%20or%20doctor%20or%20physician%20or%20venture%20capital%20', dataType: 'script', success: function(){} });
	}

	thunder.client.project.getNewsletterOptions = function()
	{
		window.open('http://www.feedburner.com/fb/a/emailverifySubmit?feedId=2878923&loc=en_US&email='+$('#newsletter-field')[0].value, 'popupwindow', 'scrollbars=yes,width=550,height=520');

		/* if($('#newsletter-field')[0].value!='' && $('#newsletter-field')[0].value!=$('#newsletter-field')[0].getAttribute('thunder.markup:label'))
		{
			$('#sign-up-address')[0].innerHTML = $('#newsletter-field')[0].value + ',';
			$('#newsletter-options')[0].style.display = 'block';
			$('#newsletter-options')[0].style.zIndex = 4200;
		}*/
	}
	
	thunder.client.project.saveNewsletterOptions = function()
	{
		$('#newsletter-options')[0].style.display = 'none';
		$('#subscribe-heading')[0].innerHTML = 'Change your<br />subscription settings';
	}

/*  ================================
     Utilities
    ================================ */

	thunder.client.project.utils.participateOver = function(e)
	{
		this.style.zIndex = 4100;
		//$(this).find('.participation-pop-over')[0].style.display = 'block';
	}
	
	thunder.client.project.utils.participateOut = function(e)
	{
		this.style.zIndex = 4000;
		//$(this).find('.participation-pop-over')[0].style.display = 'none';
	}
