selImg = 1;
function setGalImg(imgId){
	$('#mainimg').attr('src',$('#imgl'+imgId).attr('href'));
	$('#img'+ selImg).removeClass('sel');
	$('#img'+ imgId).addClass('sel');
	selImg = imgId;
	return false;
}

function setYT(youtubeid){
	$('#ytplayer').attr('src','http://www.youtube.com/embed/'+ youtubeid +'?autoplay=1&rel=0');
	$('#ytplayer').attr('width',620);
	$('#ytplayer').attr('height',372);
}

pageopen = '';

function ppg(ppgid){
	if(ppgid != pageopen){
		$('#pfpage'+ pageopen).animate({top: -420});
		$('#pftext'+ pageopen).hide('slow');
		
		if($('#pfpage'+ ppgid).length == 0){
			$('#pfcontent').prepend('<div id="pfpage'+ ppgid +'" class="pfpage" style="top:-420px;"></div>');
			$('#pfpage'+ ppgid).load('/includes/portfoliopage.php?id='+ ppgid);
			$('#pfpage'+ ppgid).animate({top: 0});
		}else{
			$('#pfpage'+ ppgid).animate({top: 0});
		}
		if($('#pftext'+ ppgid).length == 0){
			$('#pftext').prepend('<div id="pftext'+ ppgid +'" class="pftext" style="display:none;"></div>');
			$('#pftext'+ ppgid).load('/includes/portfoliotext.php?id='+ ppgid, function(){$('#pftext'+ ppgid).show('slow');});
		}else{
			$('#pftext'+ ppgid).show('slow');
		}
		$('#pbtn'+ pageopen).removeClass('sel');
		$('#pbtn'+ ppgid).addClass('sel');
		pageopen = ppgid;
	}
	return false;
}
