 $(document).ready(function() {

  var toggleExpand = 'http://images.healthcareerweb.com/imgs/hcw/mooncoat/icons/expandIcon.png'
  var toggleClose = 'http://images.healthcareerweb.com/imgs/hcw/mooncoat/icons/closeIcon.png'
  var toggleExpand2 = 'http://images.healthcareerweb.com/imgs/hcw/mooncoat/icons/expandIcon2.png'
  var toggleClose2 = 'http://images.healthcareerweb.com/imgs/hcw/mooncoat/icons/closeIcon2.png'
  var toggleExpand3 = 'http://images.healthcareerweb.com/imgs/hcw/mooncoat/icons/expandIcon-blue.png'
  var toggleClose3 = 'http://images.healthcareerweb.com/imgs/hcw/mooncoat/icons/closeIcon-blue.png'
  var $toggleBox = $('#resultsBrowseJobsTable tbody div.togglebox')

  $('#resultsBrowseJobsTable tbody').each(function() {
  	var parentClass = $(this).attr('class')
	var $toggleBox = $(this).find('div.togglebox')
	if (parentClass == "evenRow") {
	$toggleBox.prepend('<img src="' + toggleExpand + '"alt="View More Details" width="37px" height="33px" name="'+parentClass+'" />')
		$('img', $toggleBox).addClass('clickable').click(function() {
		 		var toggleBoxSrc = $(this).attr('src')
		 			if ( toggleBoxSrc == toggleClose ) {
		    			$(this).attr('src', toggleExpand).parents('tr').siblings().fadeOut('fast')
		    		} else{
		    			$(this).attr('src', toggleClose).parents('tr').siblings().fadeIn('fast')}
		          })
      }
	  else if(parentClass == "nationalRow"){
		$toggleBox.prepend('<img src="' + toggleExpand3 + '"alt="View More Details" width="37px" height="33px" name="'+parentClass+'" />')
			$('img', $toggleBox).addClass('clickable').click(function() {
			 		var toggleBoxSrc = $(this).attr('src')
			 			if ( toggleBoxSrc == toggleClose3 ) {
			    			$(this).attr('src', toggleExpand3).parents('tr').siblings().fadeOut('fast')
			    		} else{
			    			$(this).attr('src', toggleClose3).parents('tr').siblings().fadeIn('fast')}
			          })
		
	  }
      else{
	$toggleBox.prepend('<img src="' + toggleExpand2 + '"alt="View More Details" width="37px" height="33px" name="'+parentClass+'" />')
		$('img', $toggleBox).addClass('clickable').click(function() {
		 		var toggleBoxSrc = $(this).attr('src')
		 			if ( toggleBoxSrc == toggleClose2 ) {
		    			$(this).attr('src', toggleExpand2).parents('tr').siblings().fadeOut('fast')
		    		} else{
		    			$(this).attr('src', toggleClose2).parents('tr').siblings().fadeIn('fast')}
		          })
     }
     

 });


	
 });