
	var today = new Date();

	var used = new Array('yearly','monthly','weekly','daily');

	var prog = new Array();
		var d = new Date();
		d.setFullYear(2000,9,1);
		prog.push({'skill':'HTML','year':getYears(d),'used':3});
		prog.push({'skill':'Javascript','year':getYears(d),'used':3});
		prog.push({'skill':'CSS','year':getYears(d),'used':3});
		d.setFullYear(2001,6,1);
		prog.push({'skill':'Actionscript 2&3','year':getYears(d),'used':3});
		d.setFullYear(2002,6,1);
		prog.push({'skill':'XML','year':getYears(d),'used':3});
		d.setFullYear(2003,6,1);
		prog.push({'skill':'PHP','year':getYears(d),'used':3});
		prog.push({'skill':'MySQL','year':getYears(d),'used':3});
		d.setFullYear(2005,3,1);
		prog.push({'skill':'Ajax','year':getYears(d),'used':3});
		d.setFullYear(2006,1,1);
		prog.push({'skill':'Adobe Flex','year':getYears(d),'used':3});
		prog.push({'skill':'Papervision 3D (AS3 3D Engine)','year':getYears(d),'used':2});
		prog.push({'skill':'Sandy 3D (AS3 3D Engine)','year':getYears(d),'used':1});
		d.setFullYear(2008,1,1);
		prog.push({'skill':'DOM','year':getYears(d),'used':1});

	var anim = new Array();
		d.setFullYear(2000,9,1);
		anim.push({'skill':'Adobe Flash','year':getYears(d),'used':2});
		anim.push({'skill':'Adobe Photoshop','year':getYears(d),'used':3});
		d.setFullYear(2002,8,1);
		anim.push({'skill':'3D Modeling (3D Studio Max)','year':getYears(d),'used':1});
		anim.push({'skill':'3D Animation (3D Studio Max)','year':getYears(d),'used':1});
		d.setFullYear(2006,1,1);
		anim.push({'skill':'Adobe Flex','year':getYears(d),'used':3});

	function writeSkills(title,skill) {

		var str = '<table border="0" cellpadding="2" cellspacing="0" width="100%">'+
				'<tr><td align="left" class="tblHead">'+title+'</td><td align="center" class="tblHead">Years</td><td align="center" class="tblHeadEnd">Used</td></tr>';
		for(var i in skill) {
			str += '				<tr><td align="left" class="skill">'+skill[i].skill+'</td><td align="right" class="skill">'+skill[i].year+'</td><td class="skillend" align="center">'+used[skill[i].used]+'</td></tr>';
		}
		str += '</table>';
		return str;
	}

	function getYears(date) {
		return (today.getFullYear()-date.getFullYear())+parseFloat(((today.getMonth()-date.getMonth())/12).toFixed(2));
	}

	function loadPrograms() {
		var obj = new Object();
		obj.rootNodeY = 110;
		obj.distance = 800;
		obj.message = "Welcome to My Programming Portfolio.\nClick on an image to bring it to the front.\nClick on it again to see the movie.";
		obj.messageYOffset = 40; // moves from center 
		obj.messageXOffset = -110;
		obj.messageColor = "0xffffff";
		obj.messageGlowStrength = 2;
		obj.fontSize = 12;
		obj.slideQuality = 2; // increases geomtry for quality, higher quality slower processing
		obj.slideSpacing = 5;
		obj.slidePacking = 5; // higher less packing. lower more packing
		obj.selectedScale = 1;
		obj.unselectedScale = 0.5;
		obj.bgcolor = '0xff0f3774'; // bgcolor must be 16 bit instead of 8. 0xffffffff not 0xffffff.
		obj.slides = new Array();
		obj.slides.push(new SlideshowImage('./images/slideshow/p9.png','javascript:playMovie,/flv/securealert.flv',"Secure Alert\nFlash Builder 4/AS3/Javascript\nClick again to see the video"));
		obj.slides.push(new SlideshowImage('./images/slideshow/p0.png','javascript:playMovie,/flv/formaspace.flv',"Formaspace 3D Bench Builder\nPapervision 3D/AS3/Javascript/Ajax/PHP/MySql\nClick again to see the video"));
		obj.slides.push(new SlideshowImage('./images/slideshow/p8.png','javascript:playMovie,/flv/tisecosystem.flv',"TIS Ecosystem\nRealtime Social Networking Platform.\nAS3/Cairngorm/AMF/FMS"));
		obj.slides.push(new SlideshowImage('./images/slideshow/p1.png','javascript:playMovie,/flv/protonplayer.flv',"Proton Radio Live Player\nAS3/Javascript/Ajax/PHP/MySql\nClick again to see video."));
		obj.slides.push(new SlideshowImage('./images/slideshow/p2.png','javascript:playMovie',"Proton Radio Live Stream Scheduler\nJavascript/Ajax/PHP/MySql/Perl\nVideo Not Yet Avaliable."));
		obj.slides.push(new SlideshowImage('./images/slideshow/p3.png','javascript:playMovie',"Proton Radio Disc Jockey Panel\nJavascript/Ajax/PHP/MySql\nVideo Not Yet Avaliable."));
		obj.slides.push(new SlideshowImage('./images/slideshow/p4.png','javascript:playMovie,/flv/photoshopcs3.flv',"Adobe Photoshop CS3 Simulation\nActionscript 3.0\nClick to see the video"));
		obj.slides.push(new SlideshowImage('./images/slideshow/p5.png','javascript:playMovie,/flv/flashcs3.flv',"Adobe Flash CS3 Simulation\nActionscript 3.0\nClick to see the video"));
		obj.slides.push(new SlideshowImage('./images/slideshow/p6.png','javascript:playMovie,/flv/dreamweavercs3.flv',"Adobe Dreamweaver CS3 Simulation\nActionscript 3.0\nClick to see the video"));
		obj.slides.push(new SlideshowImage('./images/slideshow/p7.png','javascript:playMovie',"Microsoft Vista\nActionscript 3.0\nVideo Not Yet Avaliable."));
		return PO.toString(obj);
	}

	function loadAnimations() {
		var obj = new Object();
		obj.rootNodeY = 110;
		obj.distance = 800;
		obj.message = "Welcome to My Animation Portfolio.\nClick on an image to bring it to the front.\nClick on it again to see the animation.";
		obj.messageYOffset = 40; // moves from center 
		obj.messageXOffset = -110;
		obj.messageColor = "0xffffff";
		obj.messageGlowStrength = 2;
		obj.fontSize = 12;
		obj.slideQuality = 2; // increases geomtry for quality, higher quality slower processing
		obj.slideSpacing = 5;
		obj.slidePacking = 5; // higher less packing. lower more packing
		obj.selectedScale = 1;
		obj.unselectedScale = 0.5;
		obj.bgcolor = '0xff333333'; // bgcolor must be 16 bit instead of 8. 0xffffffff not 0xffffff.
		obj.slides = new Array();
		obj.slides.push(new SlideshowImage('./images/slideshow/a1.png','javascript:showFrame,../codeguyz/',"Codeguyz\nClick to see this flash animation."));
		obj.slides.push(new SlideshowImage('./images/slideshow/a2.png','javascript:showFrame,../../advertisements/',"Music Pipeline Singer\nClick to see this flash animation."));
		obj.slides.push(new SlideshowImage('./images/slideshow/a3.png','javascript:showFrame,../byu_cougars/helmet_explosion/',"Las Vegas Bowl\nClick again to see these helmets crashing."));
		obj.slides.push(new SlideshowImage('./images/slideshow/a4.png','javascript:showFrame,../CMU/',"CMU\nClick to see logo animation"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a5.png','javascript:showFrame,../DayTimerMobile/',"Day Timer Mobile\nClick to see 3D animation in Papervision3D"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a6.png','javascript:showFrame,../GoodYear/',"Good Year\nClick to see flash animation."));
		obj.slides.push(new SlideshowImage('./images/slideshow/a7.png','javascript:showFrame,../jazz/season_tickets/',"Utah Jazz Season Tickets\nClick to see Flash animation"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a8.png','javascript:showFrame,../jazz/travel/',"Utah Jazz Travel With The Jazz\nClick to see Flash animation"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a9.png','javascript:showFrame,../jazz/lockerroom_cleanout/',"Utah Jazz Locker Room Cleanout\nClick to see Flash animation"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a10.png','javascript:showFrame,../jazz/homecourt/',"Utah Jazz Homecourt\nClick to see Flash animation"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a11.png','javascript:showFrame,../Shout119/',"Utah Jazz Season Tickets\nClick to see the Flash Animated Story."));
		obj.slides.push(new SlideshowImage('./images/slideshow/a12.png','javascript:showFrame,../UtahCollege/',"Utah State Aggies\nFlaming Helmet\nClick to see Flash animation"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a13.png','javascript:showFrame,../UtahState/',"Utah State Volleyball\nUse your mouse to hit the volleyball\nClick to see Papervision3D Interactive Animation"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a14.png','javascript:showFrame,../3DPostcard/',"Me-Inc 3DPostcard\nClick to see Papervision3D Animation"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a15.png','javascript:showFrame,../tennis/',"USPTA Tennis\nUse the Racket to hit the tennis ball\nClick to see Flash animation"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a16.png','javascript:showFrame,../bmw/',"BMW Advertisement for BYU\nClick to see Flash animation"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a17.png','javascript:showFrame,../championschallengegolf/',"Nokia Advertisement (Golf)\nClick to see Flash animation"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a18.png','javascript:showFrame,../McDonalds/',"McDonalds\nClick to see Flash animation"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a19.png','javascript:showFrame,../new_jersey_devils/',"New Jersey Devils\nClick to see Flash animation"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a20.png','javascript:showFrame,../palm/',"Palm\nWater Effect\nClick to see Flash animation"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a21.png','javascript:showFrame,../phila_eagles/',"Philidelphia Eagles\nClick to see Flash animation"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a22.png','javascript:showFrame,../product_displays/',"Shopping Cart Displays\nUse Mouse to hover over product\nClick to see interactive demo."));
		obj.slides.push(new SlideshowImage('./images/slideshow/a23.png','javascript:showFrame,../san_diego_chargers/',"San Diego Chargers\nFlash Lightning Effects\nClick to see Flash animation slideshow"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a24.png','javascript:showFrame,../seattle_mariners/',"Seattle Mariners\nClick to see Flash animation slideshow"));
		obj.slides.push(new SlideshowImage('./images/slideshow/a25.png','javascript:showFrame,../taser/',"Tazer International\nClick to see Flash Interactive Demo"));
		
		return PO.toString(obj);
	}


	function loadVideos() {
		var obj = new Object();
		obj.rootNodeY = 110;
		obj.distance = 800;
		obj.message = "Here are some videos of Character Animation.\nIt may take a moment to load.";
		obj.messageYOffset = 40; // moves from center 
		obj.messageXOffset = -110;
		obj.messageColor = "0xffffff";
		obj.messageGlowStrength = 2;
		obj.fontSize = 12;
		obj.slideQuality = 2; // increases geomtry for quality, higher quality slower processing
		obj.slideSpacing = 5;
		obj.slidePacking = 5; // higher less packing. lower more packing
		obj.selectedScale = 1;
		obj.unselectedScale = 0.5;
		obj.bgcolor = '0xff333333'; // bgcolor must be 16 bit instead of 8. 0xffffffff not 0xffffff.
		obj.slides = new Array();
		obj.slides.push(new SlideshowImage('./images/slideshow/v0.png','javascript:showFrame,../iguy/',"Certiport IGUY\nButtons allow you to click and see this character animate.\nThis is a large file and may take a few moments to load."));
		obj.slides.push(new SlideshowImage('./images/slideshow/v1.png','javascript:playMovie,/flv/testosterina.flv',"Music Video For Country Singer Ray Fikes.\n3D Character Animation, Modeling, Compositing, and Directing."));
		obj.slides.push(new SlideshowImage('./images/slideshow/v2.jpg','javascript:playMovie,/flv/wyvern2005.flv',"This is a Demo Reel that my team and I put together. I did all character animations."));
		return PO.toString(obj);
	}

	function loadGames() {
		var obj = new Object();
		obj.rootNodeY = 110;
		obj.distance = 800;
		obj.message = "Heroscape Flash Game\nThis game is in the process of being built. It is therefore exptected to have bugs at this point.\nI have only worked on this for 2.5 weeks. It is a multiplayer game, and the computer player has not yet been developed.\nIf you would like to demo this game, then you can call me at 435.215.1040. Because it will only work with 2 players.";
		obj.messageYOffset = 40; // moves from center 
		obj.messageXOffset = -110;
		obj.messageColor = "0xffffff";
		obj.messageGlowStrength = 2;
		obj.fontSize = 12;
		obj.slideQuality = 2; // increases geomtry for quality, higher quality slower processing
		obj.slideSpacing = 5;
		obj.slidePacking = 5; // higher less packing. lower more packing
		obj.selectedScale = 1;
		obj.unselectedScale = 0.5;
		obj.bgcolor = '0xff333333'; // bgcolor must be 16 bit instead of 8. 0xffffffff not 0xffffff.
		obj.slides = new Array();
		obj.slides.push(new SlideshowImage('./images/slideshow/g0.png','javascript:showFrame,../heroscape/',"Heroscape Flash Game\nThis game is in the process of being built. It is therefore exptected to have bugs at this point.\nI have only worked on this for 2.5 weeks. It is a multiplayer game, and the computer player has not yet been developed.\nIf you would like to demo this game, then you can call me at 435.215.1040. Because it will only work with 2 players."));

		showFrame('../heroscape/');

		return PO.toString(obj);
	}
	
	function SlideshowImage(src,url,title) {
		this.src = src;
		this.url = url;
		this.title = title;
	}

	function writeSWF(name,swf,width,height,fvars) {
		fvars.autoplay="true";
		fvars.controlHeight = 30;
		fvars.loadHit="none";
		fvars.completeHit="getAllVideoSlides";
		fvars.showVideoFunction="showVideo";
		var params = {
			quality:"high",
			align:"middle",
			wmode:"transparent",
			allowScriptAccess:"sameDomain", // must be set to true for the js functions to work
			allowFullScreen:"true" // must be set to true for full screen mode to work.
		};
		swfobject.embedSWF("http://www."+DOMAIN+"/swf/"+swf, name, width, height, "10.0.0", "http://www."+DOMAIN+"/swf/expressInstall.swf", fvars, params);
	}

	function showVideo(url,videoWidth,videoHeight,loadHitFunction,completeHitFunction,autoplay,controlHeight) {
		var flashvars = {
			src:url,
			width:""+videoWidth,
			height:""+videoHeight,
			controlHeight:""+(controlHeight>22?controlHeight:22),
			autoplay:autoplay, // set to true or false
			loadHit:loadHitFunction, // the javascript function to be called when the application loads the movie
			completeHit:completeHitFunction, // the javascript function to be called when the movie finishes playing.
			showVideoFunction:"showVideo" // this is the function that will be called when a thumb is clicked to play.
		};
		writeSWF('fxv',"FXVideo.swf",videoWidth,(parseInt(videoHeight)+parseInt(flashvars.controlHeight))+"", flashvars);
	}

	function playMovie(url) {
		if(!url.length) {
			document.getElementById('movie').innerHTML = '<br><center>Movie Not Avaliable.</center>';
		} else {
			document.getElementById('movie').innerHTML = '<br><div id="fxv"></div>';
			writeSWF('fxv','FXVideo.swf',"700","465",{src:url,width:"700",height:"435",autoplay:"true"});
		}
	}

	function showFrame(url) {
		var urlAry = ['http://www.wyvernmultimedia.com','wyvern','beta','outsourcing','slideShow'];
		var urlR = (url+"").split('/');
		while(urlR[0] == '..') {
			urlR.shift();
			urlAry.pop();
		}
		var finalUrl = urlAry.join('/')+'/'+urlR.join('/')+"";
		document.getElementById('movie').innerHTML = '<iframe id="movieFrame" width="800" height="800"></iframe>';
		document.getElementById('movieFrame').src =  finalUrl;
	}

	function showTab(index,fctn){
		var count = 0;
		var div = document.getElementById("tab"+count);
		while(div) {
			if(count == index) {
				div.className = "tabOpen";
				this[fctn]();
			} else {
				div.className = "tabClosed";
			}
			++count;
			div = document.getElementById("tab"+count);
		}
	}

	function programSlides() {
		writeSWF('innerContent','SlideShow.swf',"100%","210",{loadSlides:"loadPrograms",stagewidth:"1000",stageheight:"220"});
		document.getElementById('sidebar').innerHTML += writeSkills('Programming',prog);
	}

	function animationSlides() {
		writeSWF('innerContent','SlideShow.swf',"100%","210",{loadSlides:"loadAnimations",stagewidth:"1000",stageheight:"220"});
		document.getElementById('sidebar').innerHTML += writeSkills('Animation',anim);
	}

	function videoSlides() {
		writeSWF('innerContent','SlideShow.swf',"100%","210",{loadSlides:"loadVideos",stagewidth:"1000",stageheight:"220"});
		document.getElementById('sidebar').innerHTML += writeSkills('Programming',prog);
	}

	function gameSlides() {
		writeSWF('innerContent','SlideShow.swf',"100%","210",{loadSlides:"loadGames",stagewidth:"1000",stageheight:"220"});
		document.getElementById('sidebar').innerHTML += writeSkills('Programming',prog);
	}

	function showSkills() {
		document.getElementById("tabContent").innerHTML = '';
		document.getElementById("movie").innerHTML = '<table border="0" width="100%" height="220"><tr><td valign="top">'+writeSkills('Programming',prog)+'</td><td valign="top">'+writeSkills('Graphics/Animation',anim)+'</td></tr></table>';
	}

	function showEdu() {
		document.getElementById("tabContent").innerHTML = '';
		document.getElementById("movie").innerHTML = '2005 Bachelor of Arts, Animation, Salutatorian, Collins College, Tempe, AZ	(2nd in Class)<br>2004Associate of Arts, Animation, Valedictorian, Collins College, Tempe, AZ  (Top of Class)<br>2002 Associate of Arts, Engineering and Technology, Brigham Young University Idaho, Rexburg, ID';
	}

	function getAllVideoSlides() {
		// return the list of images to show here
		var ilist = new Array();
		ilist.push({src:'/images/slideshow/p0.png',url:'http://www.codeguyz.com/flv/formaspace.flv',title:'Formaspace 3D Bench Builder',width:700,height:435});
		ilist.push({src:'/images/slideshow/p8.png',url:'http://www.codeguyz.com/flv/tisecosystem.flv',title:'TIS Ecosystem',width:700,height:435});
		ilist.push({src:'/images/slideshow/p1.png',url:'http://www.codeguyz.com/flv/protonplayer.flv',title:'Proton Live Audio Stream Player',width:700,height:435});
		ilist.push({src:'/images/slideshow/p4.png',url:'http://www.codeguyz.com/flv/photoshopcs3.flv',title:'Adobe Photoshop CS3 Flash Simulation',width:700,height:435});
		ilist.push({src:'/images/slideshow/p5.png',url:'http://www.codeguyz.com/flv/flashcs3.flv',title:'Adobe Flash CS3 Flash Simulation',width:700,height:435});
		ilist.push({src:'/images/slideshow/p6.png',url:'http://www.codeguyz.com/flv/dreamweavercs3.flv',title:'Adobe Dreamweaver CS3 Flash Simulation',width:700,height:435});
		ilist.push({src:'/images/slideshow/v1.png',url:'http://www.codeguyz.com/flv/testosterina.flv',title:'Country Music Video',width:700,height:435});
		ilist.push({src:'/images/slideshow/v2.jpg',url:'http://www.codeguyz.com/flv/wyvern2005.flv',title:'3D Team Demo Reel',width:700,height:435});

		return PO.toString({i:ilist});
	}
