/*
if(location.href.indexOf('ie7update') == -1) {
	if($.browser.msie)
		if(($.browser.version == '7.0')||($.browser.version == '6.0'))
			location.href="ie7update.htm";
}
*/

function showModal(id) {

	var maskHeight = $(document).height() - 10;
    var maskWidth = $(window).width();
            
    //Set height and width to mask to fill up the whole screen
    $('#mask').css({'width':maskWidth,'height':maskHeight});
                
    //transition effect		
    //$('#mask').fadeIn(1000);	
    $('#mask').fadeTo('800',0.7);	

	var winWidth = $(window).width();
	var xPos = winWidth/2 - ($('#'+id).width())/2; //center the modal horizontally
	
	$('#'+id).css('left',xPos);
	$('#'+id).fadeIn(800);
	//$('#'+id).css('display','block');	
}

function showBio(name) {
	$('div.person').css('display','none');
	$('#rightside li.bullet').css('background','none');
	$('#rightside li a').css('color','#C52039');		
	$('#'+name).css('display','block');
	$('#bullet-'+name+' a').css('color','#D47B2D');	
	$('#bullet-'+name).css('background',"url('images/arrow.png') no-repeat scroll 0 0 transparent");
}

function unloadVideo(id) {
	//This function will "unload" a video when it's hidden on a page (home.html) - IE issue
	$("#"+id+"wrapper").css('display','none');
	$('#mask').css('display','none');
	$("#"+id).html();
	if(id == 'vid1') {
		var objStr = "<object id='ytvid1' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'>"
			objStr += "<param name='movie' value='http://www.youtube.com/e/nZR3cjCHcC8?autoplay=1&rel=0&showinfo=0'>";
			objStr += "<!--[if !IE]>-->";
			objStr += "<object id='ytvid1' type='application/x-shockwave-flash' data='http://www.youtube.com/e/nZR3cjCHcC8?autoplay=1&rel=0&showinfo=0'>";
			objStr += "<!--<![endif]-->";
			objStr += "<p>Alternative content</p>";
			objStr += "<!--[if !IE]>-->";
			objStr += "</object>";
			objStr += "<!--<![endif]-->";
			objStr += "</object>";
	} else if(id == 'vid2') {
		var objStr = "<object id='ytvid2' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'>"
			objStr += "<param name='movie' value='http://www.youtube.com/e/Nd6kOTKxyjg?autoplay=1&rel=0&showinfo=0'>";
			objStr += "<!--[if !IE]>-->";
			objStr += "<object id='ytvid2' type='application/x-shockwave-flash' data='http://www.youtube.com/e/Nd6kOTKxyjg?autoplay=1&rel=0&showinfo=0'>";
			objStr += "<!--<![endif]-->";
			objStr += "<p>Alternative content</p>";
			objStr += "<!--[if !IE]>-->";
			objStr += "</object>";
			objStr += "<!--<![endif]-->";
			objStr += "</object>";
	}
	$("#"+id).html(objStr);
}

function popup(URLStr,wname,width,height,sbars,resize,toolbar) {
//This function is used to open a centered, popup window.
//This function's parameters include a URL, position of the window (left,top), the width and height of the window, and whether the window
//is resizeable and allows scrollbars.
	if (!left)
		var left=(screen.width/2) - (width/2);
	if (!top)
		var top=(screen.height/2) - (height/2);
	window.open(URLStr,wname,'toolbar='+toolbar+',location=no,directories=no,status=no,menubar=no,scrollbars='+sbars+',resizable='+resize+',width='+width+',height='+height+',left='+left+', top='+top+'');
}

//these two functions show/hide the form descriptions on the patients page
function showDescrip(id) {
	$('#'+id).css('display','block');
}

function hideDescrip(id) {
	$('#'+id).css('display','none');
}	
