//Video player AUTO PLAY
function presentVideoPlay(thisVideo,instanceName,server){
	if (server){
	}else{
		server = "NO";
	}
	
	if(server == "NO"){ //Progressive video
	
		if(thisVideo.indexOf('http://') == 0){
			thisVideoF = "streamName="+thisVideo;
		}else{
			thisVideoF = "streamName=http://cmsdata.iucn.org/downloads/"+thisVideo;	
		}
		playerName = "Progressive";	
	}else{ //Streaming video
		thisVideoF = "serverName="+server+"&appName=dreamweaver&streamName="+thisVideo+"&isLive=false&bufferTime=5";
		playerName = "Streaming";
	}	
	//OLD SIZE 380x275
	playerObject = 	'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0" width="360" height="260" id="FLVPlayer">'+
 					'<param name="movie" value="http://cmsdata.iucn.org/custom/multimedia_players/FLVPlayer_'+playerName+'.swf" />'+
  					'<param name="salign" value="lt" />'+
  					'<param name="quality" value="high" />'+
  					'<param name="scale" value="noscale" />'+
  					'<param name="FlashVars" value="&MM_ComponentVersion=1&skinName=http://cmsdata.iucn.org/custom/multimedia_players/clear_skin_3&'+thisVideoF+'&autoPlay=true&autoRewind=false" />'+
  					'<embed src="http://cmsdata.iucn.org/custom/multimedia_players/FLVPlayer_'+playerName+'.swf" flashvars="&MM_ComponentVersion=1&skinName=http://cmsdata.iucn.org/custom/multimedia_players/clear_skin_3&'+thisVideoF+'&autoPlay=true&autoRewind=false" quality="high" scale="noscale" width="360" height="260" name="FLVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+					
					'</object>';
	document.write ("<div id='"+instanceName+"' style='margin-bottom:20px; '>"+playerObject+"</div>");
}
//Video player STOP
function presentVideoStop(thisVideo,instanceName,server){
	if (server){
	}else{
		server = "NO";
	}
	
	if(server == "NO"){ //Progressive video
	
		if(thisVideo.indexOf('http://') == 0){
			thisVideoF = "streamName="+thisVideo;
		}else{
			thisVideoF = "streamName=http://cmsdata.iucn.org/downloads/"+thisVideo;	
		}
		playerName = "Progressive";	
	}else{ //Streaming video
		thisVideoF = "serverName="+server+"&appName=dreamweaver&streamName="+thisVideo+"&isLive=false&bufferTime=5";
		playerName = "Streaming";
	}	
	
playerObject = 	'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0" width="360" height="265" id="FLVPlayer">'+
 					'<param name="movie" value="http://cmsdata.iucn.org/custom/multimedia_players/FLVPlayer_'+playerName+'.swf" />'+
  					'<param name="salign" value="lt" />'+
  					'<param name="quality" value="high" />'+
  					'<param name="scale" value="noscale" />'+
  					'<param name="FlashVars" value="&MM_ComponentVersion=1&skinName=http://cmsdata.iucn.org/custom/multimedia_players/clear_skin_3&'+thisVideoF+'&autoPlay=false&autoRewind=false" />'+
  					'<embed src="http://cmsdata.iucn.org/custom/multimedia_players/FLVPlayer_'+playerName+'.swf" flashvars="&MM_ComponentVersion=1&skinName=http://cmsdata.iucn.org/custom/multimedia_players/clear_skin_3&'+thisVideoF+'&autoPlay=false&autoRewind=false" quality="high" scale="noscale" width="360" height="260" name="FLVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+					
					'</object>';
	document.write ("<div id='"+instanceName+"' style='margin-bottom:20px; '>"+playerObject+"</div>");
}

//Audio player
function presentAudio(thisAudio,instanceName) {  		
	if(thisAudio.indexOf('http://') == 0){
		thisAudioF = thisAudio;
	}else{
		thisAudioF = "http://cmsdata.iucn.org/downloads/"+thisAudio;	
	}
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="240" height="15"><param name="movie" value="http://cmsdata.iucn.org/custom/multimedia_players/xspf_player_slim_240.swf?song_url='+thisAudioF+'&song_title='+instanceName+'" /><embed src="http://cmsdata.iucn.org/custom/multimedia_players/xspf_player_slim_240.swf?song_url='+thisAudioF+'&song_title='+instanceName+'" width="240" height="15" loop="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></ embed ></object>');
}	


//Photo gallery
var myImage = new Array();
var myCaption = new Array();
 
function createGallery(){	
	document.write('<table cellpadding="5">');
	odd=1;
	for (key in myImage){
//	for (i=0;i<myImage.length;i++){

/*		newImg = new Image();
		newImg.src = 'http://cmsdata.iucn.org/img/original/'+myImage[key];
		height = newImg.height;
		width = newImg.width;
		if(height < width){
				tall = '135';
				fat = '180';
		}else{
				tall = '135';
				fat = '102';
		}
*/
		if(odd == 1){
			document.write("<tr><td style='border-bottom-style:none' align='center' width='50%'>");
		}
		document.write('<a target="_blank" taget="_blank" href="http://cmsdata.iucn.org/img/original/'+myImage[key]+'"><img height="100" alt="" border="0" src="http://cmsdata.iucn.org/img/normal/'+myImage[key]+'" /></a>');
		document.write("<br />"+myCaption[key]);
		if(odd == 1){
			document.write("</td><td style='border-bottom-style:none' align='center' width='50%'>");
			odd = 0;
		}else{
			document.write("</td></tr>");
			odd=1;
		}
	}
	if(odd==0){
		document.write("</td></tr>");
	}
	document.write('</table><p align="center"> <font color="#999999"><em>Click on the images to enlarge.</em></font></p>');
}

