// Tab box
	var tabsArray = ['panel_buy','panel_desc', 'panel_script', 'panel_notes', 'panel_mission', 'panel_beliefs', 'panel_contact', 'panel_giving','panel_series','panel_interact'];
	if (default_tab == '') {
		default_tab= 'panel_desc';
	}
	if (self.document.location.hash.search("panel_") != -1) {
		if (self.document.location.hash.search("&") != -1 && self.document.location.hash.search("&") > self.document.location.hash.search("panel_")) {
			var vNamedAnchor = self.document.location.hash.substring(self.document.location.hash.search("panel_"),self.document.location.hash.search("&"));
		} else {
			var vNamedAnchor = self.document.location.hash.substring(self.document.location.hash.search("panel_"));
		}
	} else {
		var vNamedAnchor = '';
	}
	if (vNamedAnchor != '') {
		//alert(vNamedAnchor);
		default_tab = vNamedAnchor;
	}
	
	if (default_tab == 'panel_notes') {
		if ($('div#panel_notes div.wysiwyg').length == 0) {
				$('#wysiwyg').wysiwyg({
					'css' : 'panel_notes.css',
					width: '100%',
					height: 413,
					controls: {
							printSep: { separator: true },
							print: {
								visible: true,
								exec: function() {
									$('#wysiwygIFrame')[0].contentWindow.focus();
									$('#wysiwygIFrame')[0].contentWindow.print();
								},
								className: 'print'
							},
							email: {
								visible: true,
								exec: function()
								{
									var notes_email = $('#notes_email');
									
									if (notes_email.css('display') == 'none')
									{
										$('#notes_email div.msg').remove();
										notes_email.slideDown(300);
									}
									else
									{
										// Close and reset form
										notes_email.slideUp(300, function(){notes_email.find('form')[0].reset();});
									}
								},
								className: 'email'
							}
						}
					});
			} 
	}
	
	$.each(tabsArray, function () {
		if (this != default_tab) {
			$('div#'+this).hide();
			$('a#link-'+this).removeClass('active');
		}
	});

	$('div#dock2 a').click(function() {
		var tabId = $(this).attr('id').replace('link-', '');
		$('div#'+tabId).show();
		$(this).addClass('active');
		
//		hashStringA = tabId;
//		if (window.location.hash != "" && window.location.hash != "#"+hashStringA) {
//			tempHash = tempHash.replace("&"+hashStringA,"");
//			tempHash = tempHash.replace(hashStringA,"");
//			window.location.hash = tempHash +"&"+ hashStringA;
//		} else {
//			tempHash = tempHash.replace(hashStringA,"");
//			window.location.hash = hashStringA;
//		}


		// Hide the other ones
		$.each(tabsArray, function () {
			if (this != tabId) {
				$('div#'+this).hide();
				$('a#link-'+this).removeClass('active');
			}
		});
		// Actions for each tab
		switch (tabId) {
		case 'panel_notes':
			if ($('div#panel_notes div.wysiwyg').length == 0) {
				$('#wysiwyg').wysiwyg({
					'css' : 'panel_notes.css',
					width: '100%',
					height: 413,
					controls: {
			        	printSep: { separator: true },
			        	print: {
			            	visible: true,
			            	exec: function() {
								$('#wysiwygIFrame')[0].contentWindow.focus();
			            		$('#wysiwygIFrame')[0].contentWindow.print();
			            	},
			            	className: 'print'
			        	},
			        	email: {
			            	visible: true,
			            	exec: function()
			            	{
								var notes_email = $('#notes_email');
								
								if (notes_email.css('display') == 'none')
								{
									$(".error").hide();
									notes_email.slideDown(300);
								}
								else
								{
									// Close and reset form
									notes_email.slideUp(300, function(){notes_email.find('form')[0].reset();$(".error").hide();});
									
								}
			            	},
			            	className: 'email'
			        	}
			    	}

				});
			} 
			break;
		}
		
	});
	
	function showRefreshText() {
		$('div#countdown').append("<br />Page Refreshing!");
	}
	function showHighVideo(vServiceLive, vServiceFileName, stream, clicked) {
		var hashStringH = "q=high";
		if (clicked && player && (vServiceLive != 1 && stream == "yes")) {
			savedPosition = currentPosition;
			loadFile(vServiceFileName);
			player.addModelListener("STATE", "stateListener");
		} else {
			//$('div#player').empty();
			var soH = new SWFObject('player.swf','mpl','100%','100%','9');
			soH.addParam('allowscriptaccess','always');
			soH.addParam('allowfullscreen','true');
			soH.addParam("wmode", "opaque");
			if (vServiceLive != 1 && stream != "yes") {
				soH.addParam('flashvars','&file=http://video.calvaryabq.org/videopodcasts/'+vServiceFileName+'&backcolor=000000&frontcolor=FFFFFF&controlbar=over&autostart=true&image=/images/webcastaudio.jpg');
			} else if (vServiceLive != 1 && stream == "yes") {
				soH.addParam('flashvars','&file='+vServiceFileName+'&streamer=rtmp://salemnet.fcod.llnwd.net/a3186/o29/calvaryalbuquerque&backcolor=000000&frontcolor=FFFFFF&controlbar=over&autostart=true&image=/images/webcastaudio.jpg');
			} else {
				//soH.addParam('flashvars','&file=livewebcast&backcolor=000000&frontcolor=FFFFFF&streamer=rtmp://salemnet.fc.llnwd.net/salemnet/calvaryalbuquerque/&subscribe=true&type=flv&controlbar=over&autostart=true&image=/images/webcastaudio.jpg&displayclick=fullscreen');
				soH.addParam('flashvars','&file=livewebcast1&backcolor=000000&frontcolor=FFFFFF&streamer=rtmp://salemnet.fc.llnwd.net/salemnet/calvaryalbuquerque/&subscribe=true&type=flv&controlbar=over&autostart=true&image=/images/webcastaudio.jpg&displayclick=fullscreen');
			}
			soH.write('player');
		}
//		if (window.location.hash != "" && window.location.hash != "#"+hashStringH) {
//			tempHash = tempHash.replace("&"+hashStringH,"");
//			tempHash = tempHash.replace(hashStringH,"");
//			window.location.hash = tempHash +"&"+ hashStringH;
//		} else {
//			tempHash = tempHash.replace(hashStringH,"");
//			window.location.hash = hashStringH;
//		}
	}
	
	function showLowVideo(vServiceFileName, clicked) {
		var hashStringL = "q=low";
		if (clicked && player) {
			savedPosition = currentPosition;
			loadFile(vServiceFileName);
			player.addModelListener("STATE", "stateListener");
		} else {
		//	$('div#player').empty();
			var soL = new SWFObject('player.swf','mpl','100%','100%','9');
			soL.addParam('allowscriptaccess','always');
			soL.addParam('allowfullscreen','true');
			soL.addParam("wmode", "opaque");
			soL.addParam('flashvars','&file='+vServiceFileName+'&streamer=rtmp://salemnet.fcod.llnwd.net/a3186/o29/calvaryalbuquerque&backcolor=666666&frontcolor=FFFFFF&controlbar=over&autostart=true');
			soL.write('player');
		}
//		if (window.location.hash != "" && window.location.hash != "#"+hashStringL) {
//			tempHash = tempHash.replace("&"+hashStringL,"");
//			tempHash = tempHash.replace(hashStringL,"");
//			window.location.hash = tempHash +"&"+ hashStringL;
//		} else {
//			tempHash = tempHash.replace(hashStringL,"");
//			window.location.hash = hashStringL;
//		}
	}

	function showLowVideoLive() {
		var hashStringL = "q=low";
		tempHash = window.location.hash;
		//$('div#player').empty();
//		$('div#player').append('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="720" height="480" id="utv914380"><param name="flashvars" value="viewcount=true&amp;autoplay=true&amp;brand=embed"/><param name="allowfullscreen" value="true"/><param name="allowscriptaccess" value="always"/><param name="wmode" value="opaque"/><param name="movie" value="http://www.ustream.tv/flash/live/1/23802"/><embed flashvars="viewcount=true&amp;autoplay=true&amp;brand=embed" width="720" height="480" allowfullscreen="true" allowscriptaccess="always" id="utv914380" wmode="opaque" name="utv_n_971057" src="http://www.ustream.tv/flash/live/1/23802" type="application/x-shockwave-flash" /></object>');
		var soLL = new SWFObject('player.swf','mpl','100%','100%','9');
		soLL.addParam('allowscriptaccess','always');
		soLL.addParam('allowfullscreen','true');
		soLL.addParam("wmode", "opaque");
		//soLL.addParam('flashvars','&file=livewebcastlow&backcolor=000000&frontcolor=FFFFFF&streamer=rtmp://salemnet.fc.llnwd.net/salemnet/calvaryalbuquerque/&subscribe=true&type=flv&controlbar=over&autostart=true&image=/images/webcastaudio.jpg&displayclick=fullscreen');
		soLL.addParam('flashvars','&file=livewebcast2&backcolor=000000&frontcolor=FFFFFF&streamer=rtmp://salemnet.fc.llnwd.net/salemnet/calvaryalbuquerque/&subscribe=true&type=flv&controlbar=over&autostart=true&image=/images/webcastaudio.jpg&displayclick=fullscreen');
		soLL.write('player');
//		if (window.location.hash != "" && window.location.hash != "#"+hashStringL) {
//			tempHash = tempHash.replace("&"+hashStringL,"");
//			tempHash = tempHash.replace(hashStringL,"");
//			window.location.hash = tempHash +"&"+ hashStringL;
//		} else {
//			tempHash = tempHash.replace(hashStringL,"");
//			window.location.hash = hashStringL;
//		}
	}
	
	function showAudio(vListenPath) {
		var hashStringA = "q=audio";
		$('div#player').empty();
		$('div#player').append('<img src="/images/webcastaudio.jpg" width="100%" /><br /><object classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"  type="application/x-oleobject" width="100%" height="69" hspace="0" vspace="0" standby="Loading Windows Media Player components..." id="MediaPlayer"><param name="filename" value="'+vListenPath+'" /><param name="AnimationatStart" value="0" /><param name="AutoStart" value="-1"><param name="ShowControls" value="1" /><param name="ShowTracker" value="1" /><param name="wmode" value="opaque" /><param name="EnableTracker" value="-1" /><param name="ShowPositionControls" value="-1"><param name="EnableFullScreenControls" value="1"><param name="ShowStatusBar" value="1"><param name="ShowAudioControls" value="1"><param name="ShowPositionControls" value="0"><param name="AudioStream" value="-1"><embed src="'+vListenPath+'" width="100%" height="69" hspace="0" vspace="0" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" showcontrols="1" ShowStatusBar="1" wmode="opaque" type="application/x-mplayer2"></embed></object>');
//		if (window.location.hash != "" && window.location.hash != "#"+hashStringA) {
//			tempHash = tempHash.replace("&"+hashStringA,"");
//			tempHash = tempHash.replace(hashStringA,"");
//			window.location.hash = tempHash +"&"+ hashStringA;
//		} else {
//			tempHash = tempHash.replace(hashStringA,"");
//			window.location.hash = hashStringA;
//		}
	}
	
	function showAudioLive() {
		var hashStringH = "q=lowa";
		//$('div#player').empty();
		var soA = new SWFObject('player.swf','mpl','100%','20','9');
		soA.addParam('allowscriptaccess','always');
		soA.addParam('allowfullscreen','true');
		soA.addParam("wmode", "opaque");
		soA.addParam('flashvars','&file=livewebcastaudio&backcolor=000000&frontcolor=FFFFFF&streamer=rtmp://salemnet.fc.llnwd.net/salemnet/calvaryalbuquerque/&subscribe=true&type=mp3&autostart=true');
		soA.write('player');
		$('div#player').prepend('<img src="/images/webcastaudio.jpg" width="100%" /><br />');
//		if (window.location.hash != "" && window.location.hash != "#"+hashStringH) {
//			tempHash = tempHash.replace("&"+hashStringH,"");
//			tempHash = tempHash.replace(hashStringH,"");
//			window.location.hash = tempHash +"&"+ hashStringH;
//		} else {
//			tempHash = tempHash.replace(hashStringH,"");
//			window.location.hash = hashStringH;
//		}
	}
	
	function addListeners() {
		if (player) { 
//			player.addControllerListener("ITEM", "itemListener");
//			player.addControllerListener("MUTE", "muteListener");
//	
//			player.addModelListener("LOADED", "loadedListener");
//			player.addModelListener("STATE", "stateListener");
			player.addModelListener("ERROR", "errorListener");
			player.addModelListener("TIME", "positionListener");
				
//			player.addViewListener("VOLUME", "volumeListener");
		} else {
			setTimeout("addListeners()",100);
		}
	}
	
	function stateListener(obj) { //IDLE, BUFFERING, PLAYING, PAUSED, COMPLETED
		currentState = obj.newstate; 
		previousState = obj.oldstate; 
		if (currentState == "PLAYING" && currentPosition < savedPosition) {
			player.sendEvent('SEEK', savedPosition);
		}
	}
	
	function positionListener(obj) { 
		currentPosition = obj.position; 
		var tmp = document.getElementById("tim");
		if (tmp) { tmp.innerHTML = "position: " + currentPosition; }
	}
	
	function loadFile(theFile) { currentItem = -1; previousItem = -1; player.sendEvent('LOAD', theFile); };

	function showLLNWVideo(vServiceFileName) {
		$('div#player').empty();
		var soLN = new SWFObject('LLNWPlayer.swf','mpl','100%','100%','9');
		soLN.addParam('allowscriptaccess','always');
		soLN.addParam('allowfullscreen','true');
		soLN.addParam("wmode", "opaque");
		soLN.addParam('flashvars','mediaURL=rtmp://salemnet.fcod.llnwd.net/a3186/o29/calvaryalbuquerque/'+vServiceFileName+'_low.flv,256|'+vServiceFileName+'.flv,512&buffer=2&imageURL=/images/default.jpg&streamType=MBR&autoPlay=true&playerWidth=720&playerHeight=480&autoHideControls=true&autoHideTime=5&initialVolume=75');
		soLN.write('player');
	}
	
	function showWiiVideo(vServiceFileName) {
		$('div#player').empty();
		if (vServiceFileName == 1) {
			$('div#player').append("<embed src='sebplayer.swf' width='720' height='480' bgcolor='#000000' allowscriptaccess='always' allowfullscreen='true' flashvars='file=rtmp://salemnet.fc.llnwd.net/salemnet/calvaryalbuquerque&id=livewebcast2&autostart=true'/>");
		} else {
			$('div#player').append("Playback of our archive videos is currently not supported by the Wii. Please check back later.");
		}
	}
	
	function show46Video() {
		$('div#player').empty();
		var soBP = new SWFObject('player-4.6.swf','mpl','720','480','9');
		soBP.addParam('allowscriptaccess','always');
		soBP.addParam('allowfullscreen','true');
		soBP.addParam("wmode", "opaque");
		soBP.addParam('flashvars','&file=bitrates.xml&plugins=qualitymonitor-1&backcolor=666666&frontcolor=FFFFFF&controlbar=over&autostart=true');
		soBP.write('player');
	}
	function show47Video() {
		$('div#player').empty();
		var soBP = new SWFObject('player-4.7.761.swf','mpl','100%','100%','10');
		soBP.addParam('allowscriptaccess','always');
		soBP.addParam('allowfullscreen','true');
		soBP.addParam("wmode", "opaque");
		soBP.addParam('flashvars','&file=bitrates.xml&plugins=qualitymonitor-1&backcolor=666666&frontcolor=FFFFFF&controlbar=over&autostart=true&stretching=exactfit');
		soBP.write('player');
	}
	function showMBRVideo(vServiceFileName) {
		//$('div#player').empty();
		var versionReq = 10;
		var soMBR = new SWFObject('player-4.7.761.swf','mpl','100%','100%',versionReq);
		var playerVersion = soMBR.installedVer;
		var FilenameNoExt = vServiceFileName.replace(".flv","");
		soMBR.addParam('allowscriptaccess','always');
		soMBR.addParam('allowfullscreen','true');
		soMBR.addParam("wmode", "opaque");
		if (captionExists) {
			soMBR.addParam('flashvars','&file=mbr.asp?f='+vServiceFileName.replace(".flv","")+'&backcolor=000000&frontcolor=FFFFFF&controlbar=over&autostart=true&stretching=exactfit&plugins=captions-1&captions.file=../CalvaryABQ/captions/'+FilenameNoExt.substr(FilenameNoExt.length-8,8)+'.xml&captions.back=true&');			
		} else {
			soMBR.addParam('flashvars','&file=mbr.asp?f='+vServiceFileName.replace(".flv","")+'&backcolor=000000&frontcolor=FFFFFF&controlbar=over&autostart=true&stretching=exactfit');
		}
		if (playerVersion.major < versionReq && playerVersion.major == 9) {
			var soH9 = new SWFObject('player.swf','mpl','100%','100%','9');
			soH9.addParam('allowscriptaccess','always');
			soH9.addParam('allowfullscreen','true');
			soH9.addParam("wmode", "opaque");
			soH9.addParam('flashvars','&file='+vServiceFileName+'.flv&streamer=rtmp://salemnet.fcod.llnwd.net/a3186/o29/calvaryalbuquerque&backcolor=000000&frontcolor=FFFFFF&controlbar=over&autostart=true&image=/images/webcastaudio.jpg');
			soH9.write('player');
			$('div#player').append("Our video player has been enhanced for Flash Player 10, <a href='http://www.adobe.com/go/getflashplayer' target='_blank'>download it now</a>!");
		} else {
			soMBR.write('player');
		}
	}
	function showMBRLive() {
		$('div#player').empty();
		var soMBR = new SWFObject('player-4.7.761.swf','mpl','100%','100%','10');
		soMBR.addParam('allowscriptaccess','always');
		soMBR.addParam('allowfullscreen','true');
		soMBR.addParam("wmode", "opaque");
		soMBR.addParam('flashvars','&file=liveMBR.xml&backcolor=000000&frontcolor=FFFFFF&controlbar=over&autostart=true&stretching=exactfit&rtmp.subscribe=true&plugins=qualitymonitor-1');
//		soMBR.addParam('flashvars','&file=liveMBRLocal.xml&backcolor=000000&frontcolor=FFFFFF&controlbar=over&autostart=true&stretching=exactfit&plugins=qualitymonitor-1');
		soMBR.write('player');
	}
	function showMBRVideoCaptions(vServiceFileName) {
		$('div#player').empty();
		var soMBR = new SWFObject('player-4.7.761.swf','mpl','100%','100%','10');
		var FilenameNoExt = vServiceFileName.replace(".flv","");
		soMBR.addParam('allowscriptaccess','always');
		soMBR.addParam('allowfullscreen','true');
		soMBR.addParam("wmode", "opaque");
		soMBR.addParam('flashvars','&file=mbr.asp?f='+FilenameNoExt+'&backcolor=000000&frontcolor=FFFFFF&controlbar=over&autostart=true&stretching=exactfit&plugins=captions-1&captions.file=../CalvaryABQ/captions/'+FilenameNoExt.substr(FilenameNoExt.length-8,8)+'.xml&captions.back=true&captions.state=true');
		soMBR.write('player');
	}
	
	function showESPAudio(vServiceFileName) {
		var hashStringH = "q=audio_es";
		//$('div#player').empty();
		var soA = new SWFObject('player.swf','mpl','100%','20','9');
		soA.addParam('allowscriptaccess','always');
		soA.addParam('allowfullscreen','true');
		soA.addParam("wmode", "opaque");
		soA.addParam('flashvars','&file=http://audio.calvaryabq.org/podcasts/'+vServiceFileName+'&backcolor=000000&frontcolor=FFFFFF&type=mp3&autostart=true');
		soA.write('player');
		$('div#player').prepend('<img src="/images/webcastaudio.jpg" width="100%" /><br />');
//		if (window.location.hash != "" && window.location.hash != "#"+hashStringH) {
//			tempHash = tempHash.replace("&"+hashStringH,"");
//			tempHash = tempHash.replace(hashStringH,"");
//			window.location.hash = tempHash +"&"+ hashStringH;
//		} else {
//			tempHash = tempHash.replace(hashStringH,"");
//			window.location.hash = hashStringH;
//		}
	}
	function showESPAudioLive() {
		var hashStringH = "q=lowa";
		//$('div#player').empty();
		var soA = new SWFObject('player.swf','mpl','100%','20','9');
		soA.addParam('allowscriptaccess','always');
		soA.addParam('allowfullscreen','true');
		soA.addParam("wmode", "opaque");
		soA.addParam('flashvars','&file=livewebcastaudio_es&backcolor=000000&frontcolor=FFFFFF&streamer=rtmp://salemnet.fc.llnwd.net/salemnet/calvaryalbuquerque/&subscribe=true&type=mp3&autostart=true');
		soA.write('player');
		$('div#player').prepend('<img src="/images/webcastaudio.jpg" width="100%" /><br />');
//		if (window.location.hash != "" && window.location.hash != "#"+hashStringH) {
//			tempHash = tempHash.replace("&"+hashStringH,"");
//			tempHash = tempHash.replace(hashStringH,"");
//			window.location.hash = tempHash +"&"+ hashStringH;
//		} else {
//			tempHash = tempHash.replace(hashStringH,"");
//			window.location.hash = hashStringH;
//		}
	}




	function sizeWrap(theWrapper, theWidth, theHeight, unitStr) { 
		var tmp = document.getElementById(theWrapper);
			if (tmp) { 
				if (! unitStr) { var unitStr = 'px'; }
				tmp.style.width = parseInt(theWidth)+unitStr; 
				tmp.style.height = parseInt(theHeight)+unitStr; 
			}
	}
	var sizeInterval;
	var finalHeight;
	var finalWidth;
	var tempHeight = 0;
	var tempWidth = 0;
	var heightReached = false;
	var widthReached = false;
	var pauseTimer = false;
	function sizeTimed(theWrapper, theWidth, theHeight, unitStr) {
		var tmp = document.getElementById(theWrapper);
		finalHeight = theHeight;
		finalWidth = theWidth;
		tempHeight = tmp.style.height;
		tempWidth = tmp.style.width;
		heightReached = false;
		widthReached = false;
		if (!tempHeight) {
			tempHeight = theHeight*2;
		} else {
			tempHeight = new Number(tempHeight.replace("px",""));
		}
		if (!tempWidth) {
			tempWidth = theWidth*2;
		} else {
			tempWidth = new Number(tempWidth.replace("px",""));
		}
		if (finalHeight > tempHeight) {
			pauseTimer = true;
			sizeNotes();
		}
		//alert(tempHeight+" "+finalHeight);
		sizeInterval = setInterval(timedSizer,.5,theWrapper);
		//sizeWrap(theWrapper, theWidth, theHeight, unitStr);
	}
	function timedSizer(theWrapper) {
		if (!pauseTimer) {
			if ((finalHeight >= tempHeight) && !heightReached) {
				tempHeight = tempHeight + 2;
			} else if (!heightReached) {
				tempHeight = tempHeight - 2;
			}
			if ((finalWidth >= tempWidth) && !widthReached) {
				tempWidth = tempWidth+2.5;
			} else if (!widthReached) {
				tempWidth = tempWidth-2.5;
			}
			if (tempHeight == finalHeight) {
				//alert(tempHeight);
				tempHeight = finalHeight;
				heightReached = true;
			}
			if (tempWidth == finalWidth) {
				tempWidth = finalWidth;
				widthReached = true;
			}
			if (heightReached && widthReached) {
				clearInterval(sizeInterval);
				sizeNotes();
			}
			//alert(theWrapper);
			sizeWrap(theWrapper, tempWidth, tempHeight);
			//alert(tempWidth);
		}
	}
	function sizeElement(elementID,theWidth, unitStr) {
		var tmp = document.getElementById(elementID);
			if (tmp) {
				if (! unitStr) { var unitStr = 'px'; }
				tmp.style.width = parseInt(theWidth)+unitStr; 
			}
	}
var resizedVideo = false;

	function sizeNotes() {
		var notesPane = document.getElementById('wysiwygIFrame');
		if (!resizedVideo) {
			sizeElement('infopanel',245);
			//$('#infopanel').animate({width:'245px'}, 'fast', function() { pauseTimer = false; });
			pauseTimer = false;
			if (notesPane) {
				sizeElement(notesPane.id,220);
				notesPane.parentNode.style.width = '89%';
			}
		} else {
			sizeElement('infopanel',605);
			//$('#infopanel').animate({width:'605px'});
			if (notesPane) {
				sizeElement(notesPane.id,597);
				notesPane.parentNode.style.width = '100%';
			}
		}
	}
	function resizeVideo(theWrapper,imgID) {
		var tmp = document.getElementById(theWrapper);
		var imgID = document.getElementById(imgID);
		var notesPane = document.getElementById('wysiwygIFrame');
		var emailDiv = document.getElementById('notes_email');
		if (tmp) { 
			if (resizedVideo) {
				resizedVideo = false;
//				sizeTimed(theWrapper,720,480);
				sizeWrap(theWrapper,720,480);
				sizeElement('infopanel',245);
				$(document.getElementById('viewOptions').parentNode).animate({right: 0});
				//document.getElementById('viewOptions').parentNode.style.right = "0";
				if (notesPane) {
					sizeElement(notesPane.id,220);
					notesPane.parentNode.style.width = '88%';
					emailDiv.style.width = '220px';
					notesPane.focus();
				}
				imgID.src = imgID.src.replace("-","+");
			} else {
				resizedVideo = true;
//				sizeTimed(theWrapper,360,240);
				sizeWrap(theWrapper,360,240);
				$(document.getElementById('viewOptions').parentNode).animate({right: "360px"});
				//document.getElementById('viewOptions').parentNode.style.right = "360px";
				sizeElement('infopanel',605);
				if (notesPane) {
					sizeElement(notesPane.id,597);
					notesPane.parentNode.style.width = '100%';
					emailDiv.style.width = '605px';
					notesPane.focus();
				}
				imgID.src = imgID.src.replace("+","-");
			}
		}
	}
	
	preloadNotesImg = new Image();
	preloadNotesImg.src = "../images/views_notes-.gif";
