if ( gLang == 'en' ) {
	var GALLERY_VIEW_TITLE			= "Jana Strain Gallery";
	var GALLERY_VIEW_SIGNATURE		= "www.janastrain.com";
	var GALLERY_VIEW_EXTERNAL		= "Launch in external player";
	var GALLERY_VIEW_ERROR_SLIDE_SHOW	= "Encountered errors attempting to display slide show";
	var GALLERY_PAUSE 			= "Pause";
	var GALLERY_EXIT 			= "Close";	
	var GALLERY_RESIZE 			= "Resize";
} else if ( gLang == 'es' ) {
	var GALLERY_VIEW_TITLE			= "Jana Strain Gallery";
	var GALLERY_VIEW_SIGNATURE		= "www.janastrain.com";
	var GALLERY_VIEW_EXTERNAL		= "Launch in external player";
	var GALLERY_VIEW_ERROR_SLIDE_SHOW	= "Encountered errors attempting to display slide show";
	var GALLERY_PAUSE 			= "Pause";
	var GALLERY_EXIT 			= "Close";
	var GALLERY_RESIZE 			= "Resize";
}


/* ----------------------------------------- */
function displayGallery( ajaxFile, dir) { 
	var objSubmitted 		= new Object();
	objSubmitted.dir		= dir;

	var theUrl			= ajaxFile + '?at=displayGallery&rnd=' + Math.random();
	var strSubmitted		= 'jstring=' + objSubmitted.toJSONString();
	var callback 			= { success:handleDisplayGallery, failure:handleAjaxError, argument:[] };
	var transaction 		= YAHOO.util.Connect.asyncRequest('POST', theUrl, callback, strSubmitted);
} 



/* ----------------------------------------- */
function handleDisplayGallery(o){
	var response 	= o.responseText.parseJSON();

	if ( response.result == 'success' ) {
	   if ( response.urlDir != "never" ) { 
		document.location = "/p/user/gallery.php?g=" + response.urlDir;
	   } else {
		document.getElementById('breadCrumb').innerHTML  = response.breadCrumbTrail;
		document.getElementById('galleryDirs').innerHTML = response.galleryDirs;
		document.getElementById('viewGallery').innerHTML = response.galleryFiles;
	   }	
	}
	
}

/* ----------------------------------------- */
function displaySlideshow( ajaxFile, dir) { 
	var objSubmitted 		= new Object();
	objSubmitted.dir		= dir;

	var theUrl			= ajaxFile + '?at=displaySlideshow&rnd=' + Math.random();
	var strSubmitted		= 'jstring=' + objSubmitted.toJSONString();
	var callback 			= { success:handleDisplaySlideshow, failure:handleAjaxError, argument:[] };
	var transaction 		= YAHOO.util.Connect.asyncRequest('POST', theUrl, callback, strSubmitted);
} 

/* ----------------------------------------- */
function handleDisplaySlideshow(o){
	var response 	= o.responseText.parseJSON();

	ImageWindow=window.open("", "viewImage");
	ImageWindow.document.write("<html><head>\n")
	ImageWindow.document.write("   <title>Jana Strain Slideshow</title>\n")
	ImageWindow.document.write("</head>\n")
	ImageWindow.document.write("<body bgcolor='white' >\n")
	ImageWindow.document.write("<table bgcolor='#cacaca' border='0' width='100%'>\n")
	ImageWindow.document.write("<tr height='20' style='background-color:#efefef'><td width='100%' align='center' style='font-size:14px; color:blue;font-weight:bold' >"+response.galleryName+"</td>")
	ImageWindow.document.write("<td align='center' width='20' id='slideButton'><a href=\"javascript:playSlides('pause')\"><img border='0' src='/images/pause.png' width='20' title='"+GALLERY_PAUSE+"'></a></td>")
	ImageWindow.document.write("<td align='center' width='20'><a href='javascript:close()'><img border='0' src='/images/smallX.png' width='20' title='"+GALLERY_EXIT+"'></a></td></tr>\n")
	
	if ( response.result == 'success' ) {
		ImageWindow.document.write("<script type='text/javascript' src='/js/slideshow.js'></script>\n")
		ImageWindow.document.write( response.jsString )
		ImageWindow.document.write("<tr><td id='img' colspan='3' align='center' valign='middle'>\n")
		ImageWindow.document.write("<img name='SLIDESIMG' src='' border='0'>\n")
		ImageWindow.document.write("</td></tr>\n")
		ImageWindow.document.write("<tr><td colspan='3' align='center' style='background-color:#efefef;color:brown;font-size:11px;'><div id='SLIDESTEXT'></div></td></tr>\n")
		ImageWindow.document.write( response.jsPlayGallery )
	} else {
		ImageWindow.document.write("<tr><td colspan='3' align='center' style='color:brown;font-size:11px;'>"+GALLERY_VIEW_ERROR_SLIDE_SHOW+"</td></tr>\n")
		
	}
	ImageWindow.document.write("</table>\n")
	ImageWindow.document.write("<table border='0' width='100%'><tr height='5' width='100%'><td height='5' colspan='2' align='center' valign='middle' style='background-color:white;color:gray;font-size:10px;'>"+GALLERY_VIEW_SIGNATURE+"</td></tr></table>\n")
	ImageWindow.document.write("</body></html>\n")
	ImageWindow.document.close()
}




/* ----------------------------------------- */
function playClip( clipType, imgTitle, imgURL, imgText ) {

	/*alert("clipType="+clipType+"\nimgURL="+imgURL+"\nimgTitle="+imgTitle); */
	var platform = navigator.platform;
	
	ClipWindow=window.open("", "viewClip", "height=600,width=600,toolbar=no,scrollbars='auto',menubar=no");
	ClipWindow.document.write("<html><head>")
	ClipWindow.document.write("<title>Jana Strain Video</title>")
	/*ClipWindow.document.write("<script src='/js/utils.js'  type='text/javascript'></script>\n")*/
	ClipWindow.document.write("<script  type='text/javascript'>")
	ClipWindow.document.write("function enLargeMediaPlayer() {")
	ClipWindow.document.write("   document.getElementById('mediaPlayer').style.width = '100%';")
	ClipWindow.document.write("   document.getElementById('mediaPlayer').style.height = '100%';")
	ClipWindow.document.write("}")  
	ClipWindow.document.write("</script>")
	ClipWindow.document.write("</head>")
	ClipWindow.document.write("<body bgcolor='white' onresize='javascript:enLargeMediaPlayer()'>")
	
	ClipWindow.document.write("<table bgcolor='#cacaca' border='0' width='100%' height='98%'>\n")
	ClipWindow.document.write("<tr height='20' width='100%'>")
	ClipWindow.document.write("   <td align='center' style='background-color:#efefef; font-size:14px; color:blue;font-weight:bold' >"+GALLERY_VIEW_TITLE+"</td>")
	ClipWindow.document.write("   <td align='center' width='17' style='background-color:#efefef'><a href='javascript:close()'><img border='0' src='/images/smallX.png' title='"+GALLERY_EXIT+"'></a></td>")
	ClipWindow.document.write("</tr>\n")

	ClipWindow.document.write("<tr><td colspan='2' align='center' valign='middle'>\n")

	if ( clipType == '.mov'  || clipType == '.mp4' || clipType == '.m4v' || clipType == '.m2v' ) { 
	      ClipWindow.document.write("<table bgcolor='#cacaca' border='0' cellpadding='0' align='center'  width='100%' height='100%'>");
	      ClipWindow.document.write("  <tr><td  width='100%' height='100%' align='center' valign='middle'>");
	      ClipWindow.document.write("  <OBJECT id='oMediaPlayer' classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width='100%' height='100%' codebase='http://www.apple.com/qtactivex/qtplugin.cab'>");
	      ClipWindow.document.write("  	<param name='src' value='"+imgURL+"'>");
	      ClipWindow.document.write("  	<param name='autoplay' value='true'>");
	      ClipWindow.document.write("  	<param name='controller' value='true'>");
	      ClipWindow.document.write("  	<param name='loop' value='false'>");
	      ClipWindow.document.write("  	<param name='ShowDisplay' value='true'>");
	      ClipWindow.document.write("  	<param name='ShowControls' value='true'>");
	      ClipWindow.document.write("  	<EMBED id='mediaPlayer' src='"+imgURL+"' height='100%' width='100%' autoplay='true' controller='true' loop='false' pluginspage='http://www.apple.com/quicktime/download/'></EMBED>");
	      ClipWindow.document.write("  </OBJECT>");
	      ClipWindow.document.write("  </td></tr>");
	      ClipWindow.document.write("  </table>");
		

	} else if ( clipType == '.wmv' || clipType == '.wma' ) { 	
	      ClipWindow.document.write("<table bgcolor='#cacaca' border='0' cellpadding='0' align='center' width='100%'>");
	      ClipWindow.document.write("<tr><td width='100%' align='center' valign='middle'>");
	      ClipWindow.document.write("<OBJECT id='oMediaPlayer' width='100%' height='100%'"); 
	      ClipWindow.document.write("   classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' ");
	      ClipWindow.document.write("   codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'");
	      ClipWindow.document.write("   standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>");
	      ClipWindow.document.write("   <param name='fileName' value='"+imgURL+"'>");
	      ClipWindow.document.write("   <param name='animationatStart' value='true'>");
	      ClipWindow.document.write("   <param name='transparentatStart' value='true'>");
	      ClipWindow.document.write("   <param name='autoStart' value='true'>");
	      ClipWindow.document.write("   <param name='showControls' value='true'>");
	      ClipWindow.document.write("   <param name='loop' value='false'>");
	      ClipWindow.document.write("   <param name='ShowDisplay' value='true'>");
	      ClipWindow.document.write("	<EMBED id='mediaPlayer' type='application/x-mplayer2'");
	      ClipWindow.document.write("  		pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'");
	      ClipWindow.document.write("  		displaysize='4' autosize='-1' ");
	      ClipWindow.document.write("  		bgcolor='darkblue' showcontrols='true' showtracker='-1' ");
	      ClipWindow.document.write("  		showdisplay='true' showstatusbar='-1' videoborder3d='-1' width='100%' height='100%'");
	      ClipWindow.document.write("  		src='"+imgURL+"' autostart='true' designtimesp='5311' loop='false'>");
	      ClipWindow.document.write("	</EMBED>");
	      ClipWindow.document.write("</OBJECT>");
	      ClipWindow.document.write("</td></tr>");
	      ClipWindow.document.write("  <tr><td align='center'>");
	      ClipWindow.document.write("  <a href='"+imgURL+"' style='font-size: 85%;' target='_blank'>"+GALLERY_VIEW_EXTERNAL+"</a>");
	      ClipWindow.document.write("  </td></tr>");
	      ClipWindow.document.write("</table>");
		

	} else if ( clipType == '.rm' || clipType == 'ram' ) { 	
	       ClipWindow.document.write("<table bgcolor='#cacaca' border='0' cellpadding='0' align='center' width='100%'>");
	       ClipWindow.document.write("  <tr><td width='100%' align='center' valign='middle'>");
	       ClipWindow.document.write("  <OBJECT id='oMediaPlayer' classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' width='320' height='240'>");
	       ClipWindow.document.write("     <param name='src' value='"+imgURL+"'>");
	       ClipWindow.document.write("     <param name='autostart' value='false'>");
	       ClipWindow.document.write("     <param name='controls' value='imagewindow'>");
	       ClipWindow.document.write("     <param name='console' value='video'>");
	       ClipWindow.document.write("     <param name='loop' value='false'>");
	       ClipWindow.document.write("     <EMBED id='mediaPlayer' src='"+imgURL+"' width='320' height='240' loop='false' type='audio/x-pn-realaudio-plugin' controls='imagewindow' console='video' autostart='false'>");
	       ClipWindow.document.write("     </EMBED>");
	       ClipWindow.document.write("  </OBJECT>");
	       ClipWindow.document.write("  </td></tr>");
	       ClipWindow.document.write("  <tr><td align='center'>");
	       ClipWindow.document.write("  <a href='"+imgURL+"' style='font-size: 85%;' target='_blank'>"+GALLERY_VIEW_EXTERNAL+"</a>");
	       ClipWindow.document.write("  </td></tr>");
	       ClipWindow.document.write("</table>");

	} else if ( clipType == '.swf' ) { 	
	      ClipWindow.document.write("<table bgcolor='#cacaca' border='0' cellpadding='0' align='center' width='100%'>");
	      ClipWindow.document.write("  <tr><td width='100%' align='center' valign='middle'>");
	      ClipWindow.document.write("  <OBJECT id='oMediaPlayer' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'");
	      ClipWindow.document.write("      codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0'");
	      ClipWindow.document.write("      width='320' height='240'>");
	      ClipWindow.document.write("      <param name='movie' value='"+imgURL+"'>");
	      ClipWindow.document.write("      <param name='quality' value='high'>");
	      ClipWindow.document.write("      <param name='bgcolor' value='#FFFFFF'>");
	      ClipWindow.document.write("      <param name='loop' value='false'>");
	      ClipWindow.document.write("      <EMBED id='mediaPlayer' src='"+imgURL+"' quality='high' bgcolor='#FFFFFF' width='320'");
	      ClipWindow.document.write("         height='240' loop='false' type='application/x-shockwave-flash'");
	      ClipWindow.document.write("         pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>");
	      ClipWindow.document.write("      </EMBED>");
	      ClipWindow.document.write("  </OBJECT>");
	      ClipWindow.document.write("  </td></tr>");
	      ClipWindow.document.write("</table>");
			
	} else {
	      ClipWindow.document.write("<table bgcolor='#cacaca' border='0' cellpadding='0' align='center' width='100%'>");
	      ClipWindow.document.write("  <tr><td width='100%' align='center' valign='middle'>");
	      ClipWindow.document.write("     <EMBED id='mediaPlayer' width='320' height='285' ");
	      ClipWindow.document.write("        src='" + imgURL + "' menu='true' quality='high' autostart='true' ");
	      ClipWindow.document.write("        controller='true' showdisplay='0' showstatusbar='-1' videoborder3d='-1' ");
	      ClipWindow.document.write("    </EMBED>");
	      ClipWindow.document.write("  </td></tr>");
	      ClipWindow.document.write("</table>");
      
	}

	ClipWindow.document.write("</td></tr>\n")
	ClipWindow.document.write("<tr><td colspan='2' align='center' style='font-size:11px;'><font color='brown'>"+imgTitle+"</font><div id='ImageText'>"+imgText+"</div></td></tr>\n")
	ClipWindow.document.write("</table>\n")

	ClipWindow.document.write("<table border='0' width='100%'><tr height='5' width='100%'><td height='5' colspan='2' align='center' valign='middle' style='background-color:white;color:gray;font-size:10px;'>"+GALLERY_VIEW_SIGNATURE+"</td></tr></table>\n")

	ClipWindow.document.write("</body></html>")
	ClipWindow.document.close()
	ClipWindow.focus()
	
}




