function ExpandSlider(Counter,page)
{
    if (!page) page = '';
	if ($('#ExpandContent'+Counter).css('display') != 'none')
	{
		$('#ExpandContent'+Counter).slideUp();
		$('#ExpandLink'+Counter).css('background-image', 'url(/images/bullet-'+page+'r-charcoal.gif)');
		$('#ExpandText'+Counter).text('( + expand )');
		$('#FaqCont'+Counter).css('background-color','#FFFFFF');
		$('#FaqTop'+Counter).css('background-image', 'url(/images/white.gif)');
		$('#FaqBottom'+Counter).css('background-image', 'url(/images/white.gif)');
		
	} else {
		$('#ExpandList h3').each(function (i){
				$(this).css('background-image', 'url(/images/bullet-'+page+'r-charcoal.gif)');
				$('#ExpandText'+i).text('( + expand )');
				$('#FaqCont'+i).css('background-color','#FFFFFF');
				$('#FaqTop'+i).css('background-image', 'url(/images/white.gif)');
				$('#FaqBottom'+i).css('background-image', 'url(/images/white.gif)');
		});
		$('#ExpandLink'+Counter).css('background-image', 'url(/images/bullet-'+page+'d-charcoal.gif)');
		$('#ExpandText'+Counter).text('( + collapse )');
		$('#FaqCont'+Counter).css('background-color','#F2F2F2');
		$('#FaqTop'+Counter).css('background-image', 'url(/images/faqconttop.gif)');
		$('#FaqBottom'+Counter).css('background-image', 'url(/images/faqcontbottom.gif)');
		$('#ExpandList p:not(#ExpandContent'+Counter+')').slideUp('fast', function() {
			$('#ExpandContent'+Counter).slideDown('fast');
		});
	}
	return false;
}

$(document).ready(function() {	
 	iframeLoaded = false;
	//select all the a tag with name equal to modal
	$('a[name=modal]').click(function(e) {
		//Cancel the link behavior
		e.preventDefault();
		
		//Get the A tag
		var id = $(this).attr('href');
	
		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
	
		//Set heigth and width to mask to fill up the whole screen
		$('#fade').css({'width':maskWidth,'height':maskHeight});
		
		//transition effect		
		$('#fade').fadeIn(500);	
		$('#fade').fadeTo("fast",0.7);	
	
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
              
		//Set the popup window to center
		$(id).css('top',  winH/2-$(id).height()/2);
		$(id).css('left', winW/2-$(id).width()/2);
	
		//transition effect
		$(id).fadeIn(500); 
		
		// add Iframe code here
		if (iframeLoaded  == false)
		{
			$(id+' #scoreMsg').append('<iframe SCROLLING="NO" WIDTH="300" HEIGHT="240" FRAMEBORDER="0" ALLOWTRANSPARENCY="yes" src="/career-opportunities/question1.php"></iframe>');
			iframeLoaded  = true;
		} else {
			$(id+' #scoreMsg iframe').attr('src', '/career-opportunities/question1.php');
		}
		
	
	});
	
	//if close button is clicked
	$('.white_content .close').click(function (e) {
		//Cancel the link behavior
		e.preventDefault();
		
		$('#fade').hide();
		$('.white_content').hide();
	});		
});