Changeset - 7ec91347b83f
[Not reviewed]
tip default
0 0 135
root@protofusion.org - 17 years ago 2009-02-08 16:19:59
root@protofusion.org
there we go
135 files changed with 24257 insertions and 0 deletions:
0 comments (0 inline, 0 general)
components/com_morfeoshow/gallery.swf
Show inline comments
 
new file 100644
 
binary diff not shown
components/com_morfeoshow/gallery.xml
Show inline comments
 
new file 100644
 
<gallery title="MorfeoShow Gallery" thumbDir="/hot67beta/images/morfeoshow/" imageDir="/hot67beta/images/morfeoshow/" random="true">
 
<category name="Test Gallery">
 
</category>
 
</gallery
components/com_morfeoshow/images/front.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/images/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/images/loading.gif
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/images/no.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/images/overlay-85.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/morfeoshow.html.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
* @package		Joomla
 
* @subpackage	com_morfeoshow
 
* @copyright	Copyright (C) Vamba & Matthew Thomson. All rights reserved.
 
* @license		GNU/GPL.
 
* @author 		Vamba (.joomlaitalia.com) & Matthew Thomson (ignitejoomlaextensions.com)
 
* @based on  	com_ignitiongallery
 
* @author 		Matthew Thomson (ignitejoomlaextensions.com)
 
* Joomla! and com_morfeoshow are free software. This version may have been modified pursuant
 
* to the GNU General Public License, and as distributed they include or
 
* are derivative of works licensed under the GNU General Public License or
 
* other free or open source software licenses.
 
*/
 
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
jimport( 'joomla.application.component.view');
 
class HTML_morfeoshow{
 
 
function mostraFrontend($option, $rows, $pageNav, $limitstart, $limit, $total) {
 
	include_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_morfeoshow'.DS.'settings.php' ); 
 
    global $mainframe;
 
    $params = &$mainframe->getParams();
 
	
 
	if ($params->get('show_page_title', 1)) : 
 
?>
 
<div class="componentheading<?php echo $params->get('pageclass_sfx'); ?>"><?php echo $params->get('page_title'); ?></div>
 
<?php endif; ?>
 
 
<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" class="contentpane<?php echo $params->get( 'pageclass_sfx' ); ?>">
 
 
<?php if ($params_morfeo['frontend'] == 1) { ?>
 
 
<table class="fltable<?php echo $params->get('pageclass_sfx'); ?>" border="0" cellpadding="0" cellspacing="0" width="100%">
 
 
<?php if ($params_morfeo['logo'] == 1) {	?>
 
		<div align="left">
 
			<img src="<?php echo JURI::root()?>components/com_morfeoshow/images/front.png">
 
		</div>
 
<?php }	else {} 
 
				JRequest::setVar('limit', (int) $limit);
 
				$link= JRoute::_('index.php?option=com_morfeoshow&Itemid='.JRequest::getVar('Itemid', NULL));
 
?>				
 
			<form action="<?php echo $link; ?>" method="post" name="Form">
 
			<table>
 
				<tr>
 
					<td align="right" width="100%" nowrap="nowrap">
 
					</td>
 
					<td align="right" width="100%" nowrap="nowrap">
 
					&nbsp;&nbsp;&nbsp; <?php echo JText::_( 'Display' ) ?> &nbsp;#&nbsp;
 
            
 
			<?php $link= JRoute::_('index.php?option=com_morfeoshow&Itemid='.JRequest::getVar('Itemid', NULL));
 
				echo $pageNav->getLimitBox($link);
 
?>					
 
					</td>
 
				</tr>
 
			</table>
 
			<input type="hidden" name="option" value="com_morfeoshow" />
 
		    </form>
 
<table>			
 
	<tr>
 
		<th width="40" align="left" class="toggler" nowrap="nowrap"></th>
 
		<th width="35%" align="left" class="toggler" nowrap="nowrap"><?php echo JText::_( 'Gallery' );?></th>	
 
		<th width="60%" align="left" class="toggler" nowrap="nowrap"><?php echo JText::_( 'Description' );?></th>	
 
	</tr>
 
	<?php	
 
		$tabclass = array("sectiontableentry1".$params->get( 'pageclass_sfx' )."", "sectiontableentry2".$params->get( 'pageclass_sfx' )."");
 
		$k =0;
 
		$j =1;	
 
		
 
		if (sizeof($rows)==0) { 
 
			} else {
 
		foreach ($rows as $row) { 
 
		echo "<tr class='". $tabclass[$k] ."'>";
 
		if ($row->shortcut_filename) {
 
		?>		
 
			<td>
 
				<a href="index.php?option=<?php echo $option; ?>&task=view&gallery=<?php echo $row->id; ?>">
 
				<img width="40" border="0" src="images/morfeoshow/<?php echo $row->folder; ?>/<?php echo $row->shortcut_filename; ?>"/></a>
 
			</td>
 
	<?php } else {	?>
 
			<td>
 
				<a href="index.php?option=<?php echo $option; ?>&task=view&gallery=<?php echo $row->id; ?>">
 
				<img width="40" border="0" src="<?php JURI::root()?>components/com_morfeoshow/images/no.png"/></a>
 
			</td>
 
	<?php }	?>			
 
			<td>
 
				<a href="index.php?option=<?php echo $option; ?>&task=view&gallery=<?php echo $row->id; ?>">
 
				<?php echo $row->name; ?></a>
 
	<?php	
 
			echo '</td>';
 
 
			echo '<td>';
 
			$row->description = stripslashes($row->description);			
 
			echo substr($row->description,0,120); 
 
				if (strlen($row->description)>120) 
 
				echo '...';
 
 
			echo '</td>';
 
			echo '</tr>';
 
				$k = 1 - $k; }}
 
		
 
	
 
			echo '<tr>';
 
			echo '<td colspan=\"4\">&nbsp;</td>';
 
			echo '</tr>';
 
			echo '<tr>';
 
			echo '<td align="center" colspan="4" class="sectiontablefooter'.$params->get( 'pageclass_sfx' ).'">';
 
				$link= JRoute::_('index.php?option=com_morfeoshow&Itemid='.JRequest::getVar('Itemid', NULL));
 
				echo $pageNav->getPagesLinks($link);
 
 
				echo '</td>';
 
			echo '</tr>';
 
			echo '<tr>';
 
			echo '<td colspan="4" align="right">';
 
 
			echo $pageNav->getPagesCounter();
 
				echo '</td>';
 
			echo '<tr>';
 
			
 
			
 
 
}if ($params_morfeo['frontend'] == 0) {
 
?>
 
 
	<tr>
 
		<td>
 
		<div id="flashcontent" align="middle">
 
			<a href="http://www.macromedia.com/go/getflashplayer">
 
				<?php echo JText::_( 'Get the Flash Player' );?></a> 
 
				<?php echo JText::_( 'to see this gallery.' );?>
 
		</div>
 
 
				<script type="text/javascript">
 
					var so = new SWFObject("<?php echo JURI::root()?>components/com_morfeoshow/gallery.swf", "gallery", "745", "700", "8", "#ffffff");
 
					so.addVariable("xmlURL","'.JURI::root().'components/com_morfeoshow/gallery.xml");			
 
					so.addParam("quality", "high");
 
					so.addParam("wmode", "transparent");
 
					so.write("flashcontent");
 
				</script>
 
			</td>
 
		</tr>
 
	
 
<?php
 
	}if ($params_morfeo['frontend'] == 2) {
 
	
 
$result = $total;	
 
if($result > 0) {
 
$x=0;
 
?>
 
<style>
 
a img, img 	{ border: none; text-decoration: none; }
 
.colonne	{padding: 5px;margin: 5px;border: 1px solid #999;display: block;width: <?php echo $params_morfeo['larfront']?>px;text-align:center;font-size:9px;text-decoration: none;}
 
.colonne:hover{border-color: white;text-decoration: none;}
 
</style>
 
<script src="<?php echo JURI::root(true)?>/components/com_morfeoshow/tpl/resources/boxover/boxover.js" type="text/javascript"></script>
 
<tr>
 
<?php
 
foreach ($rows as $row){
 
 
{
 
$x=$x+1;
 
 
if ($x % $params_morfeo['colonnefront'] == 0) { 
 
 
		if ($row->shortcut_filename) {
 
		?>		
 
			<td align="center">
 
				<a  class="colonne" href="index.php?option=<?php echo $option; ?>&task=view&gallery=<?php echo $row->id; ?>">
 
				<img width="<?php echo $params_morfeo['larfront']?>" border="0" src="images/morfeoshow/<?php echo $row->folder; ?>/<?php echo $row->shortcut_filename; ?>" title="header=[<?php echo $row->name?>] body=[<?php echo $row->description ?>]" /></a>
 
			</td></tr><tr>
 
	<?php } else {	?>
 
			<td align="center">
 
				<a  class="colonne" href="index.php?option=<?php echo $option; ?>&task=view&gallery=<?php echo $row->id; ?>">
 
				<img width="<?php echo $params_morfeo['larfront']?>" border="0" src="<?php JURI::root()?>components/com_morfeoshow/images/no.png" title="header=[<?php echo $row->name?>] body=[<?php echo $row->description ?>]"/></a>
 
			</td></tr><tr>
 
	<?php }	?>	
 
<?php				
 
}else{ 		
 
if ($row->shortcut_filename) {
 
		?>		
 
			<td align="center">
 
				<a  class="colonne" href="index.php?option=<?php echo $option; ?>&task=view&gallery=<?php echo $row->id; ?>">
 
				<img width="<?php echo $params_morfeo['larfront']?>" border="0" src="images/morfeoshow/<?php echo $row->folder; ?>/<?php echo $row->shortcut_filename; ?>" title="header=[<?php echo $row->name?>] body=[<?php echo $row->description ?>]"/></a>
 
			</td>
 
	<?php } else {	?>
 
			<td align="center">
 
				<a  class="colonne" href="index.php?option=<?php echo $option; ?>&task=view&gallery=<?php echo $row->id; ?>">
 
				<img width="<?php echo $params_morfeo['larfront']?>" border="0" src="<?php JURI::root()?>components/com_morfeoshow/images/no.png" title="header=[<?php echo $row->name?>] body=[<?php echo $row->description ?>]"/></a>
 
			</td>
 
	<?php }	?>	
 
<?php			
 
}
 
 
}
 
}
 
echo '<tr></tr><tr><br /></tr>';	
 
} 	
 
 }//end else
 
echo '</table>'; 
 
}//end frontend function
 
 
 
function elencafiles($dirname,$row){
 
	$arrayfiles=Array();
 
	if(file_exists($dirname)){
 
		$handle = opendir($dirname);
 
		while (false !== ($file = readdir($handle))) { 
 
			if(is_file($dirname.$file)){
 
				array_push($arrayfiles,$file);
 
			}
 
		}
 
		$handle = closedir($handle);
 
	}
 
	sort($arrayfiles);
 
	return $arrayfiles;
 
}
 
 
	
 
function mostraGalleria($option, $row) {	
 
	jimport('joomla.environment.uri' );
 
	global $params_morfeo, $mainframe;
 
	$db =& JFactory::getDBO();
 
    $param = &$mainframe->getParams();
 
		
 
			$query = 'SELECT COUNT(id)'
 
			. ' FROM #__morfeoshow_img'
 
			. ' WHERE gallery_id ='. (int) @$row->id 			
 
			;
 
			$db->setQuery( $query );
 
			$count 	= $db->loadResult();			
 
			$query = 'SELECT *'
 
			. ' FROM #__morfeoshow_img'
 
			. ' WHERE gallery_id ='. (int) @$row->id 
 
			. ' ORDER BY '. @$row->orderfront 			
 
			;
 
			$db->setQuery($query);
 
			$items = $db->loadObjectList();
 
			
 
	        
 
			//flash gallery params
 
			$params["flashgallery"]		= @$row->flashgallery;
 
			$params["height"]			= @$row->height;
 
			$params["width"]			= @$row->width;
 
			$params["height"]			= @$row->height;
 
			$params["widthsw"]			= @$row->widthsw;
 
			$params["heightsw"]			= @$row->heightsw;
 
			$params["widthpc"]			= @$row->widthpc;
 
			$params["heightpc"]			= @$row->heightpc;
 
			$params["widthpl"]			= @$row->widthpl;
 
			$params["heightpl"]			= @$row->heightpl;
 
			$params["width"]			= @$row->width;
 
			$params["trans"]			= @$row->trans;
 
			$params["navigation"]		= @$row->navigation;
 
			$params["movimento"]		= @$row->movimento;			
 
			$params["tempo"]			= @$row->tempo;
 
			$params["bkgnd"] 			= @$row->bkgnd;
 
			$params["bkgnd1"] 			= @$row->bkgnd1;
 
			$params["bkgnd2"] 			= @$row->bkgnd2;
 
			$params["bkgnd3"] 			= @$row->bkgnd3;
 
			$params["user_id"] 			= @$row->user_id;
 
			$params["group_id"] 		= @$row->group_id; 
 
			$params["text"] 			= @$row->text;
 
			$params["tags"] 			= @$row->tags; 
 
			$params["set_id"] 			= @$row->set_id; 
 
			$params["sort"] 			= @$row->sort;
 
			$params["user"] 			= @$row->pusername;
 
			$params["psingle"] 			= @$row->psingle;
 
			$params["pback"] 			= @$row->pback;
 
			$params["ph"] 				= @$row->paltezza;
 
			$params["pw"] 				= @$row->plarghezza;
 
			$params["overstretch"] 		= @$row->overstretch;
 
			$params["shuffle"] 			= @$row->shuffle;
 
			$params["template"] 		= @$row->tclassic;
 
			$params["colonne"] 			= @$row->tcol;	
 
 
 
echo '<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center"><tr><td>';			
 
 
	if ($params_morfeo['description'] == 1) {			
 
	if (@$row->description1) {
 
	?>
 
	<fieldset class="morfeo">
 
	<table cellpadding="0" cellspacing="0" border="0" class="desctable">
 
		<tr>
 
			<td>
 
				<?php echo @$row->description1; ?>
 
			</td>
 
		</tr>
 
	</table>
 
	</fieldset>
 
<?php		
 
	}else{ }	
 
	}else{ }	
 
 
 
switch ($params["flashgallery"]) {
 
//case 0 Shadowboxgallery
 
case '0':
 
	$image_dir  = JPATH_SITE.DS.'images'.DS.'morfeoshow'.DS. $row->folder .DS.'big';
 
	$path1 		= JURI::root().'images/morfeoshow/'. $row->folder .'/big/';
 
	$path2 		= JURI::root().'images/morfeoshow/'. $row->folder.'/thumbs/';	
 
 
	switch ($params["template"]) {
 
			case '0':
 
			require_once( JPATH_COMPONENT.DS.'tpl'.DS.'classic/shadowbox1.php' );
 
			break;
 
			
 
			case '1':
 
			require_once( JPATH_COMPONENT.DS.'tpl'.DS.'classic/shadowbox2.php' );
 
			break;
 
 
			case '2':
 
			require_once( JPATH_COMPONENT.DS.'tpl'.DS.'classic/shadowbox3.php' );
 
			break;
 
			
 
			case '3':
 
			require_once( JPATH_COMPONENT.DS.'tpl'.DS.'classic/shadowbox4.php' );
 
			break;	
 
 
			case '4':
 
			//fancybox first style
 
			require_once( JPATH_COMPONENT.DS.'tpl'.DS.'classic/fancybox1.php' );
 
			break;	
 
 
			case '5':
 
			//fancybox second style
 
			require_once( JPATH_COMPONENT.DS.'tpl'.DS.'classic/fancybox2.php' );
 
			break;
 
			
 
			case '6':
 
			//fancybox first style
 
			require_once( JPATH_COMPONENT.DS.'tpl'.DS.'classic/fancybox3.php' );
 
			break;	
 
 
			case '7':
 
			//fancybox second style
 
			require_once( JPATH_COMPONENT.DS.'tpl'.DS.'classic/fancybox4.php' );
 
			break;			
 
	
 
		}	
 
	
 
break;
 
//case 1 Imagerotatorgallery
 
case '1':	
 
	
 
				if	 ( $params["trans"] == 0 ) {	$trans = "random";
 
			} elseif ( $params["trans"] == 1 ) {	$trans = "fade"; 
 
			} elseif ( $params["trans"] == 2 ) {	$trans = "blocks"; 
 
			} elseif ( $params["trans"] == 3 ) { 	$trans = "circles"; 
 
			} elseif ( $params["trans"] == 4 ) {	$trans = "bubbles"; 
 
			} elseif ( $params["trans"] == 5 ) {	$trans = "lines"; 
 
			} elseif ( $params["trans"] == 6 ) {	$trans = "slowfade";
 
			} elseif ( $params["trans"] == 7 ) {	$trans = "fluids"; 
 
			} elseif ( $params["trans"] == 8 ) {	$trans = "flash"; 
 
			} elseif ( $params["trans"] == 9 ) {	$trans = "bgfade";			
 
				}
 
 
				if    ( $params['navigation'] == 1 ) { 	$nav = "true";	
 
			} else if ( $params['navigation'] == 0 ) {	$nav = "false"; 
 
				}
 
				
 
				if    ( $params['overstretch'] == 1 ) { $overstretch = "true";	
 
			} else if ( $params['overstretch'] == 0 ) {	$overstretch = "false"; 
 
				}	
 
 
				if    ( $params['shuffle'] == 1 ) { $shuffle = "true";	
 
			} else if ( $params['shuffle'] == 0 ) {	$shuffle = "false"; 
 
				}					
 
 
				if	  ( $params['movimento'] == 1 ) {	$mov = "true";	
 
			} else if ( $params['movimento'] == 0 ) {	$mov = "false"; 		
 
				}	
 
			require_once( JPATH_COMPONENT.DS.'tpl'.DS.'imagerotator/imagerotator.php' );	
 
break;
 
//case 2 Imageviwergallery		
 
case '2':
 
			require_once( JPATH_COMPONENT.DS.'tpl'.DS.'imageviewer/imageviewer.php' );
 
break;
 
//case3 Postcardgallery
 
case '3':
 
			require_once( JPATH_COMPONENT.DS.'tpl'.DS.'postcard/postcard.php' );
 
 
break;
 
//case4 Polaroidgallery
 
case '4':
 
			require_once( JPATH_COMPONENT.DS.'tpl'.DS.'polaroid/polaroid.php' );
 
break;
 
//case5 Flickr
 
case '5':
 
 
					if    ( $params['sort'] == 1 ) { 	$sort = "sort=relevance";	
 
				} else if ( $params["sort"] == 0 ) {	$sort = "sort="; 
 
				} 
 
 
				
 
echo '
 
				<table class="fltable" border="0" cellpadding="0" cellspacing="0" width="100%">
 
					<tr>
 
						<td align="center">
 
							<iframe align="center" src="http://www.flickr.com/slideShow/index.gne?user_id='.$params["user_id"].'&group_id='.$params["group_id"].'&text='.$params["text"].'&tags='.$params["tags"].'&set_id='.$params["set_id"].'&'.$sort.'" frameBorder="0" width="500" scrolling="no" height="500"></iframe>	
 
							</iframe>
 
						</td>
 
					</tr>
 
				</table>
 
';				
 
 
break;
 
//case6 Flickr 2
 
case '6':
 
 
			  		if    ( $params['user_id'] == '' ) { 	$user = "";	
 
						} else {							$user = $params["user_id"]."/"; 
 
				} 
 
			 		if    ( $params['tags'] ) { 			$tags = "tags/".$params["tags"];	
 
						} else {							$tags = ""; 
 
				} 
 
			 		if    ( $params['set_id'] == '') { 		$set = "";	
 
						} else {							$set = "/sets/".$params["set_id"];
 
				} 
 
			 		if    ( $params['sort'] == 1 ) { 		$int = "/interesting";	
 
						} else {							$int = ""; 
 
				} 		
 
			 
 
echo '
 
				<table class="fltable" border="0" cellpadding="0" cellspacing="0" width="100%">
 
					<tr>
 
						<td align="center">
 
							<iframe align="center" src="http://www.flickr.com/photos/'.$user . $tags . $set .$int . '/show" frameBorder="0" width="730" scrolling="no" height="560">
 
							</iframe>
 
						</td>
 
					</tr>
 
				</table>
 
';	
 
 
break;
 
//case7 Flickr Map
 
case '7':
 
			echo '
 
				<table class="fltable" border="0" cellpadding="0" cellspacing="0" width="100%">
 
					<tr>
 
						<td align="center">
 
							<iframe align="center" src="http://flickr.com/map/?&fLat='.$row->glat.'&fLon='.$row->glng.'&zl=5&map_type=hyb&order_by=interestingness" frameBorder="0" width="700" scrolling="no" height="550"></iframe>
 
							</iframe>
 
						</td>
 
					</tr>
 
				</table>
 
			';	
 
break;
 
//case8 Google Map
 
case '8':
 
?>
 
	<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
		<tr>
 
			<td align="center">
 
<?php
 
			//Recupera dati
 
			$latitudine 	= $row->glat;
 
			$longitudine 	= $row->glng;
 
			$zoom 			= $row->gzoom;
 
			$name 			= $row->name;
 
			$name 			= $row->luogo;
 
			$descrizione 	= $row->description;
 
			$gmapkey 		= $row->gmapkey;
 
?>	
 
<meta name="gmapkey" content="<?php echo $gmapkey ;?>" />
 
    <script
 
	  src="<?php echo JURI::root()?>components/com_morfeoshow/src/js/gmapez-2.js"
 
      type="text/javascript"></script>
 
<div id="contenuto" style="padding-left:10px;padding-right:10px;padding-top:10px;">	  
 
<div class="GMapEZ GLargeMapControl GMapTypeControl GScaleControl GOverviewMapControl" style="width: 600px; height: 480px;">
 
  <?php 
 
echo '<a href="' . ('http://maps.google.com/maps?ll=' . $latitudine . ',' . $longitudine . '&amp;spn=0.006130,0.239795&amp;') . '">';
 
	echo 'EXTENT';
 
	echo 'A OPEN';
 
		echo '</a>';
 
		echo '<div title="'.$name.'">';
 
			echo '<table>';		
 
			echo '<tr>';
 
		    echo '<td valign="top">';
 
		    echo '<span style="font-size:14px;font-weight:bold;color:#004080;">';
 
			echo $name;
 
		    echo '</span><br />';
 
			echo $descrizione;
 
		    echo '</tr>';
 
		    echo '</table>';			
 
	echo '</div>';
 
 
?>
 
</div>
 
</div>		
 
		</td>
 
		</tr>
 
		</table>
 
<?php
 
break;
 
//case9 Picasa
 
case '9':
 
	global $mainframe, $params_morfeo;
 
			require_once( JPATH_COMPONENT.DS.'tpl'.DS.'picasa/picasa.php' );
 
break;
 
 
//case10 flickr single gallery
 
case '10':
 
	global $mainframe, $params_morfeo;
 
 
	require_once(JPATH_COMPONENT.DS.'tpl'.DS.'resources'.DS.'phpFlickr'.DS.'phpFlickr.php');
 
	
 
	$f 				= new phpFlickr($params_morfeo['flickrkey']); 
 
	$photoset_id 	= $params['set_id'];
 
	$photos 		= $f->photosets_getPhotos($photoset_id);	
 
	
 
	require_once( JPATH_COMPONENT.DS.'tpl'.DS.'flickrsingle/flickrsingle.php' );
 
break;
 
 
//case10 picasa single gallery
 
case '11':
 
	global $mainframe, $params_morfeo;
 
 
	$userid		 	=  $params['user'];
 
	$gallery 		=  $params['psingle'];
 
	$background		=  $params['pback'];	
 
	$ph				=  $params['ph'];
 
	$pw				=  $params['pw'];
 
?>
 
				<table class="fltable" border="0" cellpadding="0" cellspacing="0" width="100%">
 
					<tr>
 
						<td align="center">
 
<embed pluginspage = "http://www.macromedia.com/go/getflashplayer" src="http://picasaweb.google.com/s/c/bin/slideshow.swf" flashvars="host=picasaweb.google.com&amp;RGB=0x<?php echo $background ?>&amp;feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2F<?php echo $userid ?>%2Falbumid%2F<?php echo $gallery ?>%3Fkind%3Dphoto%26alt%3Drss" wmode="transparent" type ="application/x-shockwave-flash" height ="<?php echo $ph ?>" width="<?php echo $pw ?>"></embed>
 
						</td>
 
					</tr>
 
				</table>
 
<?php	
 
break;
 
					
 
	}
 
	if ($params_morfeo['description'] == 0) {	
 
	if (@$row->description1) {
 
	?>
 
	<fieldset class="morfeo">
 
	<table cellpadding="0" cellspacing="0" border="0" class="desctable">
 
		<tr>
 
			<td>
 
				<?php echo @$row->description1; ?>
 
			</td>
 
		</tr>
 
	</table>
 
	</fieldset>
 
<?php	}else{ } 
 
		}else{ }  ?>
 
<?php
 
		if ($params_morfeo['back'] == 0) { ?>	
 
			<div class="back_button" align="center">
 
			<a href="index.php?option=com_morfeoshow&Itemid=<?php echo JRequest::getVar('Itemid', NULL); ?>">	
 
				<?php echo JText::_( 'Back' ); ?></a>
 
			</div>
 
<?php			
 
		echo '</td></tr></table>';		
 
		} else {
 
		echo '</td></tr></table>';
 
		}		
 
	}
 
}
 
?>
 
\ No newline at end of file
components/com_morfeoshow/morfeoshow.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
* @package		Joomla
 
* @subpackage	com_morfeoshow
 
* @copyright	Copyright (C) Vamba & Matthew Thomson. All rights reserved.
 
* @license		GNU/GPL.
 
* @author 		Vamba (.joomlaitalia.com) & Matthew Thomson (ignitejoomlaextensions.com)
 
* @based on  	com_ignitiongallery
 
* @author 		Matthew Thomson (ignitejoomlaextensions.com)
 
* Joomla! and com_morfeoshow are free software. This version may have been modified pursuant
 
* to the GNU General Public License, and as distributed they include or
 
* are derivative of works licensed under the GNU General Public License or
 
* other free or open source software licenses.
 
*/
 

	
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 

	
 
require_once( JApplicationHelper::getPath( 'html' ) );
 
$task 		= JRequest::getString('task', '');
 
$gallery 	= JRequest::getInt('gallery', 0);
 
// cache activation
 
$cache =& JFactory::getCache( 'com_morfeoshow' );
 

	
 
switch($task) {
 
	case 'view': 	mostraGalleria($option, $gallery);			break;
 
		default:	mostraFrontend($option);					break;
 
}
 

	
 
function mostraFrontend($option){
 
global $mainframe, $header, $params_morfeo;
 
	$db 		=& JFactory::getDBO();	
 
	$result		= JRequest::getVar('result', 0, '', 'int');
 
	$default_limit = '20';
 
	$limit = $mainframe->getUserStateFromRequest('com_morfeoshow', 'limit', $default_limit, 'int');	
 
	$limitstart	= JRequest::getVar('limitstart', 0, '', 'int');	
 
	JRequest::setVar('limit', (int) $limit);
 
	static $HeaderAdded;
 
		if(!$HeaderAdded) {
 
		$HeaderAdded=1;	
 
		$header .= '
 
		<script type="text/javascript" src="'.JURI::root(true).'/components/com_morfeoshow/src/js/swfobject.js"></script>			
 
		<style type="text/css" media="all">	
 
	@import "'.JURI::root(true).'/components/com_morfeoshow/style/style.css"; 	
 
		</style>
 
	';	
 
 
	$mainframe->addCustomHeadTag($header);
 
}
 

	
 
	// get the total number of records
 
	$query = 'SELECT COUNT(id)'
 
	. ' FROM #__morfeoshow'
 
	. ' WHERE published = 1'	
 
	;
 
	$db->setQuery( $query );
 
	$total 	= $db->loadResult();
 
	jimport('joomla.html.pagination');
 
	$pageNav = new JPagination( $total, $limitstart, $limit );
 
	
 
	$query 	= "SELECT * FROM #__morfeoshow WHERE published = 1 ORDER by ordering"
 
	;
 
	$db->setQuery( $query, $pageNav->limitstart, $pageNav->limit );	
 
	$rows = $db->loadObjectList();
 
 
	if ($db->getErrorNum()) {
 
		echo $db->stderr();
 
		return false;
 
	}
 
	
 
	HTML_morfeoshow::mostraFrontend($option, $rows, $pageNav, $limitstart, $limit, $total);
 
}
 

	
 
function mostraGalleria($option, $gallery){
 
	
 
	global $mainframe, $params_morfeo;
 
	$db 		=& JFactory::getDBO();
 
	$task 		= JRequest::getString('task', '');
 
	include_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_morfeoshow'.DS.'settings.php' ); 
 
	
 
	$query = "SELECT * FROM #__morfeoshow WHERE id =" .(int)$gallery;
 
	$db->setQuery($query);
 
	$row = $db->loadObject();
 
    $skin ="classic";
 
	$lang =$params_morfeo['shulang'];
 
	$pla ="img";
 
	$params['template'] = @$row->tclassic;	
 
	
 
	static $HeaderAdded;
 
		if(!$HeaderAdded) {
 
		$HeaderAdded=1;
 
		$header='';		
 
		if (@$row->flashgallery == 0) {
 
 
		if ($params['template'] == 4 || $params['template'] == 5 || $params['template'] == 6|| $params['template'] == 7) 
 
		{	
 
 
	if ($params_morfeo['gapi'] == 0) 
 
	{	
 
		$header .= '
 
	<script src="'.JURI::root(true).'/components/com_morfeoshow/src/js/jquery-1.2.3.pack.js" type="text/javascript"></script>		
 
		';
 
		} else {
 
		$header .= '
 
	<script src="http://www.google.com/jsapi"></script>
 
	<script>
 
	google.load("jquery", "1.2.6");
 
	</script>	
 
		';
 
	}
 
 
		$header .= '
 
		<script src="'.JURI::root(true).'/components/com_morfeoshow/tpl/resources/fancy/jquery.fancybox-1.0.0.js" type="text/javascript"></script>
 
		<script src="'.JURI::root(true).'/components/com_morfeoshow/tpl/resources/fancy/jquery.pngFix.pack.js" type="text/javascript"></script>	
 
		<link rel="stylesheet" href="'.JURI::root(true).'/components/com_morfeoshow/style/style.css" />
 
		<link rel="stylesheet" href="'.JURI::root(true).'/components/com_morfeoshow/tpl/resources/fancy/fancy.css" />
 
	<script type="text/javascript">
 
		$(document).ready(function() {
 
			$(".photo-link").fancybox({ "zoomSpeedIn": 500, "zoomSpeedOut": 500, "overlayShow": true }); 
 
		});
 
	</script>		
 
';
 
	} 
 
	else
 
	{
 
 
	switch ($params_morfeo['shuadat']) {
 
		case 'shadowbox-jquery.js':	
 
	if ($params_morfeo['gapi'] == 0) 
 
	{	
 
		$header .= '
 
	<script src="'.JURI::root(true).'/components/com_morfeoshow/src/js/jquery-1.2.3.pack.js" type="text/javascript"></script>		
 
		';
 
		} else {
 
		$header .= '
 
	<script src="http://www.google.com/jsapi"></script>
 
	<script>
 
	google.load("jquery", "1.2.6");
 
	</script>	
 
		';
 
	}		
 
break;
 
		case 'shadowbox-mootools.js':
 
	if ($params_morfeo['gapi'] == 0) 
 
	{			
 
		$header .= '
 
	<script src="'.JURI::root(true).'/components/com_morfeoshow/src/js/mootools.js" type="text/javascript"></script>		
 
		';
 
		} else {
 
		$header .= '
 
	<script src="http://www.google.com/jsapi"></script>
 
	<script>
 
	google.load("mootools", "1.11");
 
	</script>	
 
		';
 
	}			
 
break;	
 
		case 'shadowbox-prototype.js':
 
	if ($params_morfeo['gapi'] == 0) 
 
	{			
 
		$header .= '
 
	<script src="'.JURI::root(true).'/components/com_morfeoshow/src/js/prototype.js" type="text/javascript"></script>		
 
		';
 
		} else {
 
		$header .= '
 
	<script src="http://www.google.com/jsapi"></script>
 
	<script>
 
	google.load("prototype", "1.6");
 
	</script>	
 
		';
 
	}		
 
break;
 
		case 'shadowbox-yui.js':	
 
		$header .= '
 
	<script src="'.JURI::root(true).'/components/com_morfeoshow/src/js/yui-utilities.js" type="text/javascript"></script>		
 
		';
 
 
break;
 
		case 'shadowbox-dojo.js':
 
	if ($params_morfeo['gapi'] == 0) 
 
	{			
 
		$header .= '
 
	<script src="'.JURI::root(true).'/components/com_morfeoshow/src/js/dojo.js" type="text/javascript"></script>		
 
		';
 
		} else {
 
		$header .= '
 
	<script src="http://www.google.com/jsapi"></script>
 
	<script>
 
	google.load("dojo", "1.1.1");
 
	</script>	
 
		';
 
	}		
 
break;	
 
 
}	
 
		
 
		$header .= '
 
	<script type="text/javascript" src="'.JURI::root(true).'/components/com_morfeoshow/src/adapter/'.$params_morfeo['shuadat'].'"></script>
 
	<script type="text/javascript" src="'.JURI::root(true).'/components/com_morfeoshow/src/shadowbox.js"></script>
 
		<link rel="stylesheet" href="'.JURI::root(true).'/components/com_morfeoshow/style/style.css" />
 
	<script type="text/javascript">
 
Shadowbox.loadSkin("'.$skin.'", "'.JURI::root(true).'/components/com_morfeoshow/src/skin");
 
Shadowbox.loadLanguage("'.$lang.'", "'.JURI::root(true).'/components/com_morfeoshow/src/lang");
 
Shadowbox.loadPlayer(["'.$pla.'"], "'.JURI::root(true).'/components/com_morfeoshow/src/player");
 
window.onload = function(){
 
    Shadowbox.init();
 
};
 

	
 
</script>
 
	';
 
	}	
 
	} else if ($row->flashgallery == 9) {
 
	
 
	if ($params_morfeo['gapi'] == 0) 
 
	{			
 
		$header .= '
 
	<script src="'.JURI::root(true).'/components/com_morfeoshow/src/js/jquery-1.2.3.pack.js" type="text/javascript"></script>		
 
		';
 
		} else {
 
		$header .= '
 
	<script src="http://www.google.com/jsapi"></script>
 
	<script>
 
	google.load("jquery", "1.2.6");
 
	</script>	
 
		';
 
	}		
 
		$header .= '
 
		<script src="'.JURI::root(true).'/components/com_morfeoshow/src/js/jquery.blockUI-1.33.pack.js" type="text/javascript"></script>
 
		<script src="'.JURI::root(true).'/components/com_morfeoshow/src/js/jquery.history.pack.js" type="text/javascript"></script>
 
		<script src="'.JURI::root(true).'/components/com_morfeoshow/tpl/resources/lightbox/lb.js" type="text/javascript"></script>			
 
		<script src="'.JURI::root(true).'/components/com_morfeoshow/src/js/picas.js" type="text/javascript"></script>
 
		<link rel="stylesheet" href="'.JURI::root(true).'/components/com_morfeoshow/style/style.css" />
 
		<link rel="stylesheet" href="'.JURI::root(true).'/components/com_morfeoshow/src/js/css/pic.css" />
 
		<link rel="stylesheet" href="'.JURI::root(true).'/components/com_morfeoshow/tpl/resources/lightbox/lb.css" />		
 
 
';	
 
 
	} else if ($row->flashgallery == 10) {
 
	
 
	if ($params_morfeo['gapi'] == 0) 
 
	{			
 
		$header .= '
 
	<script src="'.JURI::root(true).'/components/com_morfeoshow/src/js/jquery-1.2.3.pack.js" type="text/javascript"></script>		
 
		';
 
		} else {
 
		$header .= '
 
	<script src="http://www.google.com/jsapi"></script>
 
	<script>
 
	google.load("jquery", "1.2.6");
 
	</script>	
 
		';
 
	}		
 
		$header .= '
 
		<script src="'.JURI::root(true).'/components/com_morfeoshow/tpl/resources/fancy/jquery.fancybox-1.0.0.js" type="text/javascript"></script>
 
		<script src="'.JURI::root(true).'/components/com_morfeoshow/tpl/resources/fancy/jquery.pngFix.pack.js" type="text/javascript"></script>	
 
		<link rel="stylesheet" href="'.JURI::root(true).'/components/com_morfeoshow/style/style.css" />
 
		<link rel="stylesheet" href="'.JURI::root(true).'/components/com_morfeoshow/tpl/resources/fancy/fancy.css" />		
 
	<script type="text/javascript">
 
		$(document).ready(function() {
 
			$(".gallflickr").fancybox({ "zoomSpeedIn": 500, "zoomSpeedOut": 500, "overlayShow": true }); 
 
		});
 
	</script>	
 
';	
 
	
 
	}
 
	else
 
	{
 
 
		$header .= '
 
		<script type="text/javascript" src="'.JURI::root(true).'/components/com_morfeoshow/src/js/swfobject.js"></script>		
 
		<link rel="stylesheet" href="'.JURI::root(true).'/components/com_morfeoshow/style/style.css" />
 
	';	
 
	}//end else
 
	
 
	$mainframe->addCustomHeadTag($header);
 
	
 
	}//end of header		
 
	
 
	$mainframe->setPageTitle( stripslashes(@$row->name) );
 
	if (@$row->metadesc == ''){}else{
 
	$mainframe->prependMetaTag('description',$row->metadesc);
 
	}
 
	if (@$row->metakey == ''){}else{
 
	$mainframe->prependMetaTag('keywords',$row->metakey.", ");
 
	}	
 
	jimport('joomla.environment.uri' );
 
	$host = JURI::root();
 
	
 
	HTML_morfeoshow::mostraGalleria($option, $row, $task);
 
}
 
?>
 
\ No newline at end of file
components/com_morfeoshow/myphoto/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/router.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
* @package		Joomla
 
* @subpackage	com_morfeoshow
 
* @copyright	Copyright (C) Vamba & Matthew Thomson. All rights reserved.
 
* @license		GNU/GPL.
 
* @author 		Vamba (.joomlaitalia.com) & Matthew Thomson (ignitejoomlaextensions.com)
 
* @based on  	com_ignitiongallery
 
* @author 		Matthew Thomson (ignitejoomlaextensions.com)
 
* Joomla! and com_morfeoshow are free software. This version may have been modified pursuant
 
* to the GNU General Public License, and as distributed they include or
 
* are derivative of works licensed under the GNU General Public License or
 
* other free or open source software licenses.
 
*/
 
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
 
function morfeoshowBuildRoute(&$query) {
 
	$segments = array();
 
	if (isset($query['task']))	{
 
		$segments[] = $query['task'];
 
		unset($query['task']);
 
	}
 
	if(isset($query['gallery']))	{
 
		$segments[] = $query['gallery'];
 
		unset($query['gallery']);
 
	}
 
	return $segments;
 
}
 
 
function morfeoshowParseRoute($segments) {
 
	$vars = array();
 
	$vars['task'] 		= $segments[0];
 
	$vars['gallery'] 	= $segments[1];
 
	return $vars;
 
}
 
 
?>
 
\ No newline at end of file
components/com_morfeoshow/src/adapter/index.html
Show inline comments
 
new file 100644
 
<html>
 
<body bgcolor="#FFFFFF">
 
</body>
 
</html>
 
\ No newline at end of file
components/com_morfeoshow/src/adapter/shadowbox-base.js
Show inline comments
 
new file 100644
 
/**
 
 * A base library for Shadowbox used as a standalone (without another base
 
 * library/adapter combination).
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: shadowbox-base.js 103 2008-06-27 06:19:21Z mjijackson $
 
 */
 

	
 
// create the Shadowbox object first
 
var Shadowbox = {};
 

	
 
Shadowbox.lib = function(){
 

	
 
    // local style camelizing for speed
 
    var styleCache = {};
 
    var camelRe = /(-[a-z])/gi;
 
    var camelFn = function(m, a){
 
        return a.charAt(1).toUpperCase();
 
    };
 
    var toCamel = function(style){
 
        var camel;
 
        if(!(camel = styleCache[style])){
 
            camel = styleCache[style] = style.replace(camelRe, camelFn);
 
        }
 
        return camel;
 
    };
 

	
 
    var view = document.defaultView;
 
    var alphaRe = /alpha\([^\)]*\)/gi;
 

	
 
    /**
 
     * Sets the opacity of the given element to the specified level.
 
     *
 
     * @param   {HTMLElement}   el          The element
 
     * @param   {Number}        opacity     The opacity to use
 
     * @return  void
 
     * @private
 
     * @static
 
     */
 
    var setOpacity = function(el, opacity){
 
        var s = el.style;
 
        if(window.ActiveXObject){ // IE
 
            s.zoom = 1; // give "layout"
 
            s.filter = (s.filter || '').replace(alphaRe, '') +
 
                (opacity == 1 ? '' : ' alpha(opacity=' + (opacity * 100) + ')');
 
        }else{
 
            s.opacity = opacity;
 
        }
 
    };
 

	
 
    return {
 

	
 
        adapter: 'standalone',
 

	
 
        /**
 
         * Gets the value of the style on the given element. This function
 
         * adapted from Ext.Element.getStyle().
 
         *
 
         * @param   {HTMLElement}   el      The DOM element
 
         * @param   {String}        style   The name of the style (e.g. margin-top)
 
         * @return  {mixed}                 The value of the given style
 
         * @public
 
         * @static
 
         */
 
        getStyle: function(){
 
            return view && view.getComputedStyle
 
                ? function(el, style){
 
                    var v, cs, camel;
 
                    if(style == 'float') style = 'cssFloat';
 
                    if(v = el.style[style]) return v;
 
                    if(cs = view.getComputedStyle(el, '')){
 
                        return cs[toCamel(style)];
 
                    }
 
                    return null;
 
                }
 
                : function(el, style){
 
                    var v, cs, camel;
 
                    if(style == 'opacity'){
 
                        if(typeof el.style.filter == 'string'){
 
                            var m = el.style.filter.match(/alpha\(opacity=(.+)\)/i);
 
                            if(m){
 
                                var fv = parseFloat(m[1]);
 
                                if(!isNaN(fv)) return (fv ? fv / 100 : 0);
 
                            }
 
                        }
 
                        return 1;
 
                    }else if(style == 'float'){
 
                        style = 'styleFloat';
 
                    }
 
                    var camel = toCamel(style);
 
                    if(v = el.style[camel]) return v;
 
                    if(cs = el.currentStyle) return cs[camel];
 
                    return null;
 
                };
 
        }(),
 

	
 
        /**
 
         * Sets the style on the given element to the given value. May be an
 
         * object to specify multiple values. This function adapted from
 
         * Ext.Element.setStyle().
 
         *
 
         * @param   {HTMLElement}   el      The DOM element
 
         * @param   {String/Object} style   The name of the style to set if a
 
         *                                  string, or an object of name =>
 
         *                                  value pairs
 
         * @param   {String}        value   The value to set the given style to
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        setStyle: function(el, style, value){
 
            if(typeof style == 'string'){
 
                var camel = toCamel(style);
 
                if(camel == 'opacity'){
 
                    setOpacity(el, value);
 
                }else{
 
                    el.style[camel] = value;
 
                }
 
            }else{
 
                for(var s in style){
 
                    this.setStyle(el, s, style[s]);
 
                }
 
            }
 
        },
 

	
 
        /**
 
         * Gets a reference to the given element.
 
         *
 
         * @param   {String/HTMLElement}    el      The element to fetch
 
         * @return  {HTMLElement}                   A reference to the element
 
         * @public
 
         * @static
 
         */
 
        get: function(el){
 
            return typeof el == 'string' ? document.getElementById(el) : el;
 
        },
 

	
 
        /**
 
         * Removes an element from the DOM.
 
         *
 
         * @param   {HTMLElement}       el      The element to remove
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        remove: function(el){
 
            el.parentNode.removeChild(el);
 
        },
 

	
 
        /**
 
         * Gets the target of the given event. The event object passed will be
 
         * the same object that is passed to listeners registered with
 
         * addEvent().
 
         *
 
         * @param   {mixed}             e       The event object
 
         * @return  {HTMLElement}               The event's target element
 
         * @public
 
         * @static
 
         */
 
        getTarget: function(e){
 
            var t = e.target ? e.target : e.srcElement;
 
            return t.nodeType == 3 ? t.parentNode : t;
 
        },
 

	
 
        /**
 
         * Gets the page X/Y coordinates of the mouse event in an [x, y] array.
 
         * The page coordinates should be relative to the document, and not the
 
         * viewport. The event object provided here will be the same object that
 
         * is passed to listeners registered with addEvent().
 
         *
 
         * @param   {mixed}         e       The event object
 
         * @return  {Array}                 The page X/Y coordinates
 
         * @public
 
         * @static
 
         */
 
        getPageXY: function(e){
 
            var x = e.pageX || (e.clientX +
 
                (document.documentElement.scrollLeft || document.body.scrollLeft));
 
            var y = e.pageY || (e.clientY +
 
                (document.documentElement.scrollTop || document.body.scrollTop));
 
            return [x, y];
 
        },
 

	
 
        /**
 
         * Prevents the event's default behavior. The event object here will
 
         * be the same object that is passed to listeners registered with
 
         * addEvent().
 
         *
 
         * @param   {mixed}             e       The event object
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        preventDefault: function(e){
 
            if(e.preventDefault){
 
                e.preventDefault();
 
            }else{
 
                e.returnValue = false;
 
            }
 
        },
 

	
 
        /**
 
         * Gets the key code of the given event object (keydown). The event
 
         * object here will be the same object that is passed to listeners
 
         * registered with addEvent().
 
         *
 
         * @param   {mixed}         e       The event object
 
         * @return  {Number}                The key code of the event
 
         * @public
 
         * @static
 
         */
 
        keyCode: function(e){
 
            return e.which ? e.which : e.keyCode;
 
        },
 

	
 
        /**
 
         * Adds an event listener to the given element. It is expected that this
 
         * function will be passed the event as its first argument.
 
         *
 
         * @param   {HTMLElement}   el          The DOM element to listen to
 
         * @param   {String}        name        The name of the event to register
 
         *                                      (i.e. 'click', 'scroll', etc.)
 
         * @param   {Function}      handler     The event handler function
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        addEvent: function(el, name, handler){
 
            if(el.addEventListener){
 
                el.addEventListener(name, handler, false);
 
            }else if(el.attachEvent){
 
                el.attachEvent('on' + name, handler);
 
            }
 
        },
 

	
 
        /**
 
         * Removes an event listener from the given element.
 
         *
 
         * @param   {HTMLElement}   el          The DOM element to stop listening to
 
         * @param   {String}        name        The name of the event to stop
 
         *                                      listening for (i.e. 'click')
 
         * @param   {Function}      handler     The event handler function
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        removeEvent: function(el, name, handler){
 
            if(el.removeEventListener){
 
                el.removeEventListener(name, handler, false);
 
            }else if(el.detachEvent){
 
                el.detachEvent('on' + name, handler);
 
            }
 
        },
 

	
 
        /**
 
         * Appends an HTML fragment to the given element.
 
         *
 
         * @param   {HTMLElement}       el      The element to append to
 
         * @param   {String}            html    The HTML fragment to use
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        append: function(el, html){
 
            if(el.insertAdjacentHTML){
 
                el.insertAdjacentHTML('BeforeEnd', html);
 
            }else if(el.lastChild){
 
                var range = el.ownerDocument.createRange();
 
                range.setStartAfter(el.lastChild);
 
                var frag = range.createContextualFragment(html);
 
                el.appendChild(frag);
 
            }else{
 
                el.innerHTML = html;
 
            }
 
        }
 

	
 
    };
 

	
 
}();
components/com_morfeoshow/src/adapter/shadowbox-dojo.js
Show inline comments
 
new file 100644
 
/**
 
 * An adapter for Shadowbox and the Dojo Toolkit.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Peter Higgins <dante@dojotoolkit.org>
 
 * @copyright   2008 Peter Higgins
 
 * @license     AFL/BSD
 
 * @version     SVN: $Id: shadowbox-dojo.js 103 2008-06-27 06:19:21Z mjijackson $
 
 */
 

	
 
if(typeof dojo == 'undefined'){
 
    throw 'Unable to load Shadowbox, Dojo Toolkit not found';
 
}
 

	
 
// create the Shadowbox object first
 
var Shadowbox = {};
 

	
 
Shadowbox.lib = function(){
 

	
 
    /**
 
     * Holds all registered event handlers.
 
     *
 
     * @property    {Array}     events
 
     * @private
 
     */
 
    var events = [];
 

	
 
    // local style camelizing for speed
 
    var styleCache = {};
 
    var camelRe = /(-[a-z])/gi;
 
    var camelFn = function(m, a){
 
        return a.charAt(1).toUpperCase();
 
    };
 
    var toCamel = function(style){
 
        var camel;
 
        if(!(camel = styleCache[style])){
 
            camel = styleCache[style] = style.replace(camelRe, camelFn);
 
        }
 
        return camel;
 
    };
 

	
 
    return {
 

	
 
        adapter: 'dojo',
 

	
 
        /**
 
         * Gets the value of the style on the given element.
 
         *
 
         * @param   {HTMLElement}   el      The DOM element
 
         * @param   {String}        style   The name of the style (e.g. margin-top)
 
         * @return  {mixed}                 The value of the given style
 
         * @public
 
         * @static
 
         */
 
        getStyle: function(el, style){
 
            return dojo.style(el, toCamel(style));
 
        },
 

	
 
        /**
 
         * Sets the style on the given element to the given value. May be an
 
         * object to specify multiple values.
 
         *
 
         * @param   {HTMLElement}   el      The DOM element
 
         * @param   {String/Object} style   The name of the style to set if a
 
         *                                  string, or an object of name =>
 
         *                                  value pairs
 
         * @param   {String}        value   The value to set the given style to
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        setStyle: function(el, style, value){
 
            if(typeof style == 'string'){
 
                dojo.style(el, toCamel(style), value);
 
            }else{
 
                for(var i in style){
 
                    dojo.style(el, i, style[i]);
 
                }
 
            }
 
        },
 

	
 
        /**
 
         * Gets a reference to the given element.
 
         *
 
         * @param   {String/HTMLElement}    el      The element to fetch
 
         * @return  {HTMLElement}                   A reference to the element
 
         * @public
 
         * @static
 
         */
 
        get: function(el){
 
            return dojo.byId(el);
 
        },
 

	
 
        /**
 
         * Removes an element from the DOM.
 
         *
 
         * @param   {HTMLElement}           el      The element to remove
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        remove: function(el){
 
            dojo._destroyElement(el);
 
        },
 

	
 
        /**
 
         * Gets the target of the given event. The event object passed will be
 
         * the same object that is passed to listeners registered with
 
         * addEvent().
 
         *
 
         * @param   {mixed}                 e       The event object
 
         * @return  {HTMLElement}                   The event's target element
 
         * @public
 
         * @static
 
         */
 
        getTarget: function(e){
 
            return e.target;
 
        },
 

	
 
        /**
 
         * Gets the client X/Y coordinates of the mouse event. The event object
 
         * provided here will be the same object that is passed to listeners
 
         * registered with addEvent(). The return array will contain the [x, y]
 
         * coordinates.
 
         *
 
         * @param   {mixed}         e       The event object
 
         * @return  {Array}                 The client X/Y coordinates
 
         * @public
 
         * @static
 
         */
 
        getPageXY: function(e){
 
            return [e.pageX, e.pageY];
 
        },
 

	
 
        /**
 
         * Prevents the event's default behavior. The event object passed will
 
         * be the same object that is passed to listeners registered with
 
         * addEvent().
 
         *
 
         * @param   {mixed}                 e       The event object
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        preventDefault: function(e){
 
            e.preventDefault();
 
        },
 

	
 
        /**
 
         * Gets the key code of the given event object (keydown). The event
 
         * object here will be the same object that is passed to listeners
 
         * registered with addEvent().
 
         *
 
         * @param   {mixed}         e       The event object
 
         * @return  {Number}                The key code of the event
 
         * @public
 
         * @static
 
         */
 
        keyCode: function(e){
 
            return e.keyCode;
 
        },
 

	
 
        /**
 
         * Adds an event listener to the given element. It is expected that this
 
         * function will be passed the event as its first argument.
 
         *
 
         * @param   {HTMLElement}   el          The DOM element to listen to
 
         * @param   {String}        name        The name of the event to register
 
         *                                      (i.e. 'click', 'scroll', etc.)
 
         * @param   {Function}      handler     The event handler function
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        addEvent: function(el, name, handler){
 
            var t = dojo.connect(el, name, handler);
 
            // we need to store a handle to later disconnect
 
            events.push({
 
                el: el,
 
                name: name,
 
                handle: t
 
            });
 
        },
 

	
 
        /**
 
         * Removes an event listener from the given element.
 
         *
 
         * @param   {HTMLElement}   el          The DOM element to stop listening to
 
         * @param   {String}        name        The name of the event to stop
 
         *                                      listening for (i.e. 'click')
 
         * @param   {Function}      handler     The event handler function
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        removeEvent: function(el, name, handler){
 
            // probably a quicker way to match this
 
            dojo.forEach(events, function(ev, idx){
 
                if(ev && ev.el == el && ev.name == name){
 
                    dojo.disconnect(ev.handle);
 
                    events[idx] = null;
 
                }
 
            });
 
        },
 

	
 
        /**
 
         * Appends an HTML fragment to the given element.
 
         *
 
         * @param   {HTMLElement}       el      The element to append to
 
         * @param   {String}            html    The HTML fragment to use
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        append: function(el, html){
 
            if(el.insertAdjacentHTML){
 
                el.insertAdjacentHTML('BeforeEnd', html);
 
            }else if(el.lastChild){
 
                var range = el.ownerDocument.createRange();
 
                range.setStartAfter(el.lastChild);
 
                var frag = range.createContextualFragment(html);
 
                el.appendChild(frag);
 
            }else{
 
                el.innerHTML = html;
 
            }
 
        }
 

	
 
    };
 

	
 
}();
components/com_morfeoshow/src/adapter/shadowbox-jquery.js
Show inline comments
 
new file 100644
 
/**
 
 * An adapter for Shadowbox and the jQuery JavaScript library.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: shadowbox-jquery.js 103 2008-06-27 06:19:21Z mjijackson $
 
 */
 

	
 
if(typeof jQuery == 'undefined'){
 
    throw 'Unable to load Shadowbox, jQuery library not found';
 
}
 

	
 
// create the Shadowbox object first
 
var Shadowbox = {};
 

	
 
Shadowbox.lib = {
 

	
 
    adapter: 'jquery',
 

	
 
    /**
 
     * Gets the value of the style on the given element.
 
     *
 
     * @param   {HTMLElement}   el      The DOM element
 
     * @param   {String}        style   The name of the style (e.g. margin-top)
 
     * @return  {mixed}                 The value of the given style
 
     * @public
 
     */
 
    getStyle: function(el, style){
 
        return jQuery(el).css(style);
 
    },
 

	
 
    /**
 
     * Sets the style on the given element to the given value. May be an
 
     * object to specify multiple values.
 
     *
 
     * @param   {HTMLElement}   el      The DOM element
 
     * @param   {String/Object} style   The name of the style to set if a
 
     *                                  string, or an object of name =>
 
     *                                  value pairs
 
     * @param   {String}        value   The value to set the given style to
 
     * @return  void
 
     * @public
 
     */
 
    setStyle: function(el, style, value){
 
        if(typeof style != 'object'){
 
            var temp = {};
 
            temp[style] = value;
 
            style = temp;
 
        }
 
        jQuery(el).css(style);
 
    },
 

	
 
    /**
 
     * Gets a reference to the given element.
 
     *
 
     * @param   {String/HTMLElement}    el      The element to fetch
 
     * @return  {HTMLElement}                   A reference to the element
 
     * @public
 
     */
 
    get: function(el){
 
        return (typeof el == 'string') ? document.getElementById(el) : el;
 
    },
 

	
 
    /**
 
     * Removes an element from the DOM.
 
     *
 
     * @param   {HTMLElement}           el      The element to remove
 
     * @return  void
 
     * @public
 
     */
 
    remove: function(el){
 
        jQuery(el).remove();
 
    },
 

	
 
    /**
 
     * Gets the target of the given event. The event object passed will be
 
     * the same object that is passed to listeners registered with
 
     * addEvent().
 
     *
 
     * @param   {mixed}                 e       The event object
 
     * @return  {HTMLElement}                   The event's target element
 
     * @public
 
     */
 
    getTarget: function(e){
 
        return e.target;
 
    },
 

	
 
    /**
 
     * Gets the page X/Y coordinates of the mouse event in an [x, y] array.
 
     * The page coordinates should be relative to the document, and not the
 
     * viewport. The event object provided here will be the same object that
 
     * is passed to listeners registered with addEvent().
 
     *
 
     * @param   {mixed}         e       The event object
 
     * @return  {Array}                 The page X/Y coordinates
 
     * @public
 
     * @static
 
     */
 
    getPageXY: function(e){
 
        return [e.pageX, e.pageY];
 
    },
 

	
 
    /**
 
     * Prevents the event's default behavior. The event object passed will
 
     * be the same object that is passed to listeners registered with
 
     * addEvent().
 
     *
 
     * @param   {mixed}                 e       The event object
 
     * @return  void
 
     * @public
 
     */
 
    preventDefault: function(e){
 
        e.preventDefault();
 
    },
 

	
 
    /**
 
     * Gets the key code of the given event object (keydown). The event
 
     * object here will be the same object that is passed to listeners
 
     * registered with addEvent().
 
     *
 
     * @param   {mixed}         e       The event object
 
     * @return  {Number}                The key code of the event
 
     * @public
 
     * @static
 
     */
 
    keyCode: function(e){
 
        return e.keyCode;
 
    },
 

	
 
    /**
 
     * Adds an event listener to the given element. It is expected that this
 
     * function will be passed the event as its first argument.
 
     *
 
     * @param   {HTMLElement}   el          The DOM element to listen to
 
     * @param   {String}        name        The name of the event to register
 
     *                                      (i.e. 'click', 'scroll', etc.)
 
     * @param   {Function}      handler     The event handler function
 
     * @return  void
 
     * @public
 
     */
 
    addEvent: function(el, name, handler){
 
        jQuery(el).bind(name, handler);
 
    },
 

	
 
    /**
 
     * Removes an event listener from the given element.
 
     *
 
     * @param   {HTMLElement}   el          The DOM element to stop listening to
 
     * @param   {String}        name        The name of the event to stop
 
     *                                      listening for (i.e. 'click')
 
     * @param   {Function}      handler     The event handler function
 
     * @return  void
 
     * @public
 
     */
 
    removeEvent: function(el, name, handler){
 
        jQuery(el).unbind(name, handler);
 
    },
 

	
 
    /**
 
     * Appends an HTML fragment to the given element.
 
     *
 
     * @param   {HTMLElement}       el      The element to append to
 
     * @param   {String}            html    The HTML fragment to use
 
     * @return  void
 
     * @public
 
     */
 
    append: function(el, html){
 
        jQuery(el).append(html);
 
    }
 

	
 
};
 

	
 
/**
 
 * Passes the selected elements to the Shadowbox.setup() function. Supports
 
 * embedded height and width attributes within the class attribute.
 
 *
 
 * @param   {Object}    options     The options to pass to setup() for all
 
 *                                  selected elements
 
 * @public
 
 * @author  Mike Alsup
 
 * @author  Roger Barrett
 
 */
 
(function($){
 
$.fn.shadowbox = function(options){
 
    return this.each(function(){
 
        var $this = $(this);
 
        // support jQuery metadata plugin
 
        var opts = $.extend({}, options || {}, $.metadata ? $this.metadata() : $.meta ? $this.data() : {});
 
        // support embedded opts (for w/h) within the class attr
 
        var cls = this.className || '';
 
        opts.width  = parseInt((cls.match(/w:(\d+)/)||[])[1]) || opts.width;
 
        opts.height = parseInt((cls.match(/h:(\d+)/)||[])[1]) || opts.height;
 
        Shadowbox.setup($this, opts);
 
    });
 
};
 
})(jQuery);
components/com_morfeoshow/src/adapter/shadowbox-mootools.js
Show inline comments
 
new file 100644
 
/**
 
 * An adapter for Shadowbox and the MooTools JavaScript framework.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: shadowbox-mootools.js 110 2008-07-11 04:42:10Z mjijackson $
 
 */
 

	
 
if(typeof MooTools == 'undefined'){
 
    // Note: requires MooTools 1.2 Core
 
    throw 'Unable to load Shadowbox, MooTools library not found';
 
}
 

	
 
// create the Shadowbox object first
 
var Shadowbox = {};
 

	
 
Shadowbox.lib = function(){
 

	
 
    var alphaRe = /alpha\([^\)]*\)/gi;
 

	
 
    /**
 
     * Sets the opacity of the given element to the specified level. Necessary
 
     * in the MooTools adapter to prevent MooTools from messing with the
 
     * element's visibility.
 
     *
 
     * @param   {HTMLElement}   el          The element
 
     * @param   {Number}        opacity     The opacity to use
 
     * @return  void
 
     * @private
 
     * @static
 
     */
 
    var setOpacity = function(el, opacity){
 
        var s = el.style;
 
        if(window.ActiveXObject){ // IE
 
            s.zoom = 1;
 
            s.filter = (s.filter || '').replace(alphaRe, '') +
 
                       (opacity == 1 ? '' : ' alpha(opacity=' + opacity * 100 + ')');
 
        }else{
 
            s.opacity = opacity;
 
        }
 
    };
 

	
 
    return {
 

	
 
        adapter: 'mootools',
 

	
 
        /**
 
         * Gets the value of the style on the given element.
 
         *
 
         * @param   {HTMLElement}   el      The DOM element
 
         * @param   {String}        style   The name of the style (e.g. margin-top)
 
         * @return  {mixed}                 The value of the given style
 
         * @public
 
         * @static
 
         */
 
        getStyle: function(el, style){
 
            return $(el).getStyle(style);
 
        },
 

	
 
        /**
 
         * Sets the style on the given element to the given value. May be an
 
         * object to specify multiple values.
 
         *
 
         * @param   {HTMLElement}   el      The DOM element
 
         * @param   {String/Object} style   The name of the style to set if a
 
         *                                  string, or an object of name =>
 
         *                                  value pairs
 
         * @param   {String}        value   The value to set the given style to
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        setStyle: function(el, style, value){
 
            el = $(el);
 
            if(typeof style != 'object'){
 
                var o = {};
 
                o[style] = value;
 
                style = o;
 
            }
 
            for(var s in style){
 
                if(s == 'opacity'){
 
                    setOpacity(el, style[s]);
 
                }else{
 
                    el.setStyle(s, style[s]);
 
                }
 
            }
 
        },
 

	
 
        /**
 
         * Gets a reference to the given element.
 
         *
 
         * @param   {String/HTMLElement}    el      The element to fetch
 
         * @return  {HTMLElement}                   A reference to the element
 
         * @public
 
         * @static
 
         */
 
        get: function(el){
 
            return $(el);
 
        },
 

	
 
        /**
 
         * Removes an element from the DOM.
 
         *
 
         * @param   {HTMLElement}           el      The element to remove
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        remove: function(el){
 
            el.parentNode.removeChild(el);
 
        },
 

	
 
        /**
 
         * Gets the target of the given event. The event object passed will be
 
         * the same object that is passed to listeners registered with
 
         * addEvent().
 
         *
 
         * @param   {mixed}         e       The event object
 
         * @return  {HTMLElement}           The event's target element
 
         * @public
 
         * @static
 
         */
 
        getTarget: function(e){
 
            return e.target;
 
        },
 

	
 
        /**
 
         * Gets the page X/Y coordinates of the mouse event in an [x, y] array.
 
         * The page coordinates should be relative to the document, and not the
 
         * viewport. The event object provided here will be the same object that
 
         * is passed to listeners registered with addEvent().
 
         *
 
         * @param   {mixed}         e       The event object
 
         * @return  {Array}                 The page X/Y coordinates
 
         * @public
 
         * @static
 
         */
 
        getPageXY: function(e){
 
            return [e.page.x, e.page.y];
 
        },
 

	
 
        /**
 
         * Prevents the event's default behavior. The event object passed will
 
         * be the same object that is passed to listeners registered with
 
         * addEvent().
 
         *
 
         * @param   {mixed}         e       The event object
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        preventDefault: function(e){
 
            e.preventDefault();
 
        },
 

	
 
        /**
 
         * Gets the key code of the given event object (keydown). The event
 
         * object here will be the same object that is passed to listeners
 
         * registered with addEvent().
 
         *
 
         * @param   {mixed}         e       The event object
 
         * @return  {Number}                The key code of the event
 
         * @public
 
         * @static
 
         */
 
        keyCode: function(e){
 
            return e.code;
 
        },
 

	
 
        /**
 
         * Adds an event listener to the given element. It is expected that this
 
         * function will be passed the event as its first argument.
 
         *
 
         * @param   {HTMLElement}   el          The DOM element to listen to
 
         * @param   {String}        name        The name of the event to register
 
         *                                      (i.e. 'click', 'scroll', etc.)
 
         * @param   {Function}      handler     The event handler function
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        addEvent: function(el, name, handler){
 
            $(el).addEvent(name, handler);
 
        },
 

	
 
        /**
 
         * Removes an event listener from the given element.
 
         *
 
         * @param   {HTMLElement}   el          The DOM element to stop listening to
 
         * @param   {String}        name        The name of the event to stop
 
         *                                      listening for (i.e. 'click')
 
         * @param   {Function}      handler     The event handler function
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        removeEvent: function(el, name, handler){
 
            $(el).removeEvent(name, handler);
 
        },
 

	
 
        /**
 
         * Appends an HTML fragment to the given element.
 
         *
 
         * @param   {HTMLElement}       el      The element to append to
 
         * @param   {String}            html    The HTML fragment to use
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        append: function(el, html){
 
            if(el.insertAdjacentHTML){
 
                el.insertAdjacentHTML('BeforeEnd', html);
 
            }else if(el.lastChild){
 
                var range = el.ownerDocument.createRange();
 
                range.setStartAfter(el.lastChild);
 
                var frag = range.createContextualFragment(html);
 
                el.appendChild(frag);
 
            }else{
 
                el.innerHTML = html;
 
            }
 
        }
 

	
 
    };
 

	
 
}();
components/com_morfeoshow/src/adapter/shadowbox-prototype.js
Show inline comments
 
new file 100644
 
/**
 
 * An adapter for Shadowbox and the Prototpe JavaScript library.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: shadowbox-prototype.js 103 2008-06-27 06:19:21Z mjijackson $
 
 */
 

	
 
if(typeof Prototype == 'undefined'){
 
    throw 'Unable to load Shadowbox, Prototype framework not found';
 
}
 

	
 
// create the Shadowbox object first
 
var Shadowbox = {};
 

	
 
Shadowbox.lib = function(){
 

	
 
    // local style camelizing for speed
 
    var styleCache = {};
 
    var camelRe = /(-[a-z])/gi;
 
    var camelFn = function(m, a){
 
        return a.charAt(1).toUpperCase();
 
    };
 
    var toCamel = function(style){
 
        var camel;
 
        if(!(camel = styleCache[style])){
 
            camel = styleCache[style] = style.replace(camelRe, camelFn);
 
        }
 
        return camel;
 
    };
 

	
 
    return {
 

	
 
        adapter: 'prototype',
 

	
 
        /**
 
         * Gets the value of the style on the given element.
 
         *
 
         * @param   {HTMLElement}   el      The DOM element
 
         * @param   {String}        style   The name of the style (e.g. margin-top)
 
         * @return  {mixed}                 The value of the given style
 
         * @public
 
         */
 
        getStyle: function(el, style){
 
            return Element.getStyle(el, style);
 
        },
 

	
 
        /**
 
         * Sets the style on the given element to the given value. May be an
 
         * object to specify multiple values.
 
         *
 
         * @param   {HTMLElement}   el      The DOM element
 
         * @param   {String/Object} style   The name of the style to set if a
 
         *                                  string, or an object of name =>
 
         *                                  value pairs
 
         * @param   {String}        value   The value to set the given style to
 
         * @return  void
 
         * @public
 
         */
 
        setStyle: function(el, style, value){
 
            if(typeof style == 'string'){
 
                var temp = {};
 
                temp[toCamel(style)] = value;
 
                style = temp;
 
            }
 
            Element.setStyle(el, style);
 
        },
 

	
 
        /**
 
         * Gets a reference to the given element.
 
         *
 
         * @param   {String/HTMLElement}    el      The element to fetch
 
         * @return  {HTMLElement}                   A reference to the element
 
         * @public
 
         */
 
        get: function(el){
 
            return $(el);
 
        },
 

	
 
        /**
 
         * Removes an element from the DOM.
 
         *
 
         * @param   {HTMLElement}           el      The element to remove
 
         * @return  void
 
         * @public
 
         */
 
        remove: function(el){
 
            Element.remove(el);
 
        },
 

	
 
        /**
 
         * Gets the target of the given event. The event object passed will be
 
         * the same object that is passed to listeners registered with
 
         * addEvent().
 
         *
 
         * @param   {mixed}                 e       The event object
 
         * @return  {HTMLElement}                   The event's target element
 
         * @public
 
         */
 
        getTarget: function(e){
 
            return Event.element(e);
 
        },
 

	
 
        /**
 
         * Prevents the event's default behavior. The event object passed will
 
         * be the same object that is passed to listeners registered with
 
         * addEvent().
 
         *
 
         * @param   {mixed}                 e       The event object
 
         * @return  void
 
         * @public
 
         */
 
        preventDefault: function(e){
 
            Event.stop(e);
 
        },
 

	
 
        /**
 
         * Gets the page X/Y coordinates of the mouse event in an [x, y] array.
 
         * The page coordinates should be relative to the document, and not the
 
         * viewport. The event object provided here will be the same object that
 
         * is passed to listeners registered with addEvent().
 
         *
 
         * @param   {mixed}         e       The event object
 
         * @return  {Array}                 The page X/Y coordinates
 
         * @public
 
         * @static
 
         */
 
        getPageXY: function(e){
 
            var p = Event.pointer(e);
 
            return [p.x, p.y];
 
        },
 

	
 
        /**
 
         * Gets the key code of the given event object (keydown). The event
 
         * object here will be the same object that is passed to listeners
 
         * registered with addEvent().
 
         *
 
         * @param   {mixed}         e       The event object
 
         * @return  {Number}                The key code of the event
 
         * @public
 
         * @static
 
         */
 
        keyCode: function(e){
 
            return e.keyCode;
 
        },
 

	
 
        /**
 
         * Adds an event listener to the given element. It is expected that this
 
         * function will be passed the event as its first argument.
 
         *
 
         * @param   {HTMLElement}   el          The DOM element to listen to
 
         * @param   {String}        name        The name of the event to register
 
         *                                      (i.e. 'click', 'scroll', etc.)
 
         * @param   {Function}      handler     The event handler function
 
         * @return  void
 
         * @public
 
         */
 
        addEvent: function(el, name, handler){
 
            Event.observe(el, name, handler);
 
        },
 

	
 
        /**
 
         * Removes an event listener from the given element.
 
         *
 
         * @param   {HTMLElement}   el          The DOM element to stop listening to
 
         * @param   {String}        name        The name of the event to stop
 
         *                                      listening for (i.e. 'click')
 
         * @param   {Function}      handler     The event handler function
 
         * @return  void
 
         * @public
 
         */
 
        removeEvent: function(el, name, handler){
 
            Event.stopObserving(el, name, handler);
 
        },
 

	
 
        /**
 
         * Appends an HTML fragment to the given element.
 
         *
 
         * @param   {HTMLElement}       el      The element to append to
 
         * @param   {String}            html    The HTML fragment to use
 
         * @return  void
 
         * @public
 
         */
 
        append: function(el, html){
 
            Element.insert(el, html);
 
        }
 

	
 
    };
 

	
 
}();
components/com_morfeoshow/src/adapter/shadowbox-yui.js
Show inline comments
 
new file 100644
 
/**
 
 * An adapter for Shadowbox and the Yahoo! User Interface (YUI) library.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: shadowbox-yui.js 103 2008-06-27 06:19:21Z mjijackson $
 
 */
 

	
 
if(typeof YAHOO == 'undefined'){
 
    // Note: requires yahoo-dom-event.js
 
    throw 'Unable to load Shadowbox, core YUI utilities (yahoo, dom, event) not found';
 
}
 

	
 
// create the Shadowbox object first
 
var Shadowbox = {};
 

	
 
Shadowbox.lib = function(){
 

	
 
    // shorthand
 
    var E = YAHOO.util.Event;
 
    var D = YAHOO.util.Dom;
 

	
 
    return {
 

	
 
        adapter: 'yui',
 

	
 
        /**
 
         * Gets the value of the style on the given element.
 
         *
 
         * @param   {HTMLElement}   el      The DOM element
 
         * @param   {String}        style   The name of the style (e.g. margin-top)
 
         * @return  {mixed}                 The value of the given style
 
         * @public
 
         * @static
 
         */
 
        getStyle: function(el, style){
 
            return D.getStyle(el, style);
 
        },
 

	
 
        /**
 
         * Sets the style on the given element to the given value. May be an
 
         * object to specify multiple values.
 
         *
 
         * @param   {HTMLElement}   el      The DOM element
 
         * @param   {String/Object} style   The name of the style to set if a
 
         *                                  string, or an object of name =>
 
         *                                  value pairs
 
         * @param   {String}        value   The value to set the given style to
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        setStyle: function(el, style, value){
 
            if(typeof style != 'object'){
 
                var temp = {};
 
                temp[style] = value;
 
                style = temp;
 
            }
 
            for(var s in style){
 
                D.setStyle(el, s, style[s]);
 
            }
 
        },
 

	
 
        /**
 
         * Gets a reference to the given element.
 
         *
 
         * @param   {String/HTMLElement}    el      The element to fetch
 
         * @return  {HTMLElement}                   A reference to the element
 
         * @public
 
         * @static
 
         */
 
        get: function(el){
 
            return D.get(el);
 
        },
 

	
 
        /**
 
         * Removes an element from the DOM.
 
         *
 
         * @param   {HTMLElement}           el      The element to remove
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        remove: function(el){
 
            el.parentNode.removeChild(el);
 
        },
 

	
 
        /**
 
         * Gets the target of the given event. The event object passed will be
 
         * the same object that is passed to listeners registered with
 
         * addEvent().
 
         *
 
         * @param   {mixed}                 e       The event object
 
         * @return  {HTMLElement}                   The event's target element
 
         * @public
 
         * @static
 
         */
 
        getTarget: function(e){
 
            return E.getTarget(e);
 
        },
 

	
 
        /**
 
         * Gets the page X/Y coordinates of the mouse event in an [x, y] array.
 
         * The page coordinates should be relative to the document, and not the
 
         * viewport. The event object provided here will be the same object that
 
         * is passed to listeners registered with addEvent().
 
         *
 
         * @param   {mixed}         e       The event object
 
         * @return  {Array}                 The page X/Y coordinates
 
         * @public
 
         * @static
 
         */
 
        getPageXY: function(e){
 
            return [E.getPageX(e), E.getPageY(e)];
 
        },
 

	
 
        /**
 
         * Prevents the event's default behavior. The event object passed will
 
         * be the same object that is passed to listeners registered with
 
         * addEvent().
 
         *
 
         * @param   {mixed}                 e       The event object
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        preventDefault: function(e){
 
            E.preventDefault(e);
 
        },
 

	
 
        /**
 
         * Gets the key code of the given event object (keydown). The event
 
         * object here will be the same object that is passed to listeners
 
         * registered with addEvent().
 
         *
 
         * @param   {mixed}         e       The event object
 
         * @return  {Number}                The key code of the event
 
         * @public
 
         * @static
 
         */
 
        keyCode: function(e){
 
            return e.keyCode;
 
        },
 

	
 
        /**
 
         * Adds an event listener to the given element. It is expected that this
 
         * function will be passed the event as its first argument.
 
         *
 
         * @param   {HTMLElement}   el          The DOM element to listen to
 
         * @param   {String}        name        The name of the event to register
 
         *                                      (i.e. 'click', 'scroll', etc.)
 
         * @param   {Function}      handler     The event handler function
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        addEvent: function(el, name, handler){
 
            E.addListener(el, name, handler);
 
        },
 

	
 
        /**
 
         * Removes an event listener from the given element.
 
         *
 
         * @param   {HTMLElement}   el          The DOM element to stop listening to
 
         * @param   {String}        name        The name of the event to stop
 
         *                                      listening for (i.e. 'click')
 
         * @param   {Function}      handler     The event handler function
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        removeEvent: function(el, name, handler){
 
            E.removeListener(el, name, handler);
 
        },
 

	
 
        /**
 
         * Appends an HTML fragment to the given element.
 
         *
 
         * @param   {HTMLElement}       el      The element to append to
 
         * @param   {String}            html    The HTML fragment to use
 
         * @return  void
 
         * @public
 
         * @static
 
         */
 
        append: function(el, html){
 
            if(el.insertAdjacentHTML){
 
                el.insertAdjacentHTML('BeforeEnd', html);
 
            }else if(el.lastChild){
 
                var range = el.ownerDocument.createRange();
 
                range.setStartAfter(el.lastChild);
 
                var frag = range.createContextualFragment(html);
 
                el.appendChild(frag);
 
            }else{
 
                el.innerHTML = html;
 
            }
 
        }
 

	
 
    };
 

	
 
}();
components/com_morfeoshow/src/imagerotator.swf
Show inline comments
 
new file 100644
 
binary diff not shown
components/com_morfeoshow/src/index.html
Show inline comments
 
new file 100644
 
<html>
 
<body bgcolor="#FFFFFF">
 
</body>
 
</html>
 
\ No newline at end of file
components/com_morfeoshow/src/js/css/index.html
Show inline comments
 
new file 100644
 
<html>
 
<body bgcolor="#FFFFFF">
 
</body>
 
</html>
 
\ No newline at end of file
components/com_morfeoshow/src/js/css/pic.css
Show inline comments
 
new file 100644
 
#maintable{
 
	border: 1px solid #CCCCCC;
 
}
 
 
 
#headerpic{}
 
 
#maincontent
 
{
 
	margin: 0;
 
	padding: 20px;
 
}
 
 
#piccontainer
 
{
 
}
 
 
h1, h2, h3, h4, h5, h6{
 
 
}
 
 
h1{	font-size: 20px;
 
font-weight: bold;
 
}
 
h2{	font-size: 18px;}
 
h3{	font-size: 16px;}
 
h4{	font-size: 14px;}
 
h5{	font-size: 12px;}
 
h6{	font-size: 10px;}
 
 
blockquote {
 
	font-style: italic;
 
	font-size: 100%;
 
	line-height: 150%;
 
	width: auto;
 
	padding: 0px 0px 5px 30px;
 
	margin: 15px 0;
 
}
 
 
 
img{}
 
 
img.pwimages{
 
	border: solid 2px #ccc;
 
	margin: 3px;
 
}
 
 
.standard   {
 
}
 
 
.pwalbums{
 
	border: 1px solid #ccc;
 
}
 
 
#img_float_left
 
{
 
	/* Used in the [img] tag when float=left */
 
	float: left;
 
	margin: 2px 8px 4px 2px;
 
}
 
 
#img_float_right
 
{
 
	/* Used in the [img] tag when float=right */
 
	float: right;
 
	margin: 2px 2px 4px 8px;
 
}
 
 
#footerpic{clear: both;}
 
 
.divider { margin: 20px 0px 15px 0px; }
 
\ No newline at end of file
components/com_morfeoshow/src/js/dojo.js
Show inline comments
 
new file 100644
 
/*
 
	Copyright (c) 2004-2008, The Dojo Foundation
 
	All Rights Reserved.
 

	
 
	Licensed under the Academic Free License version 2.1 or above OR the
 
	modified BSD license. For more information on Dojo licensing, see:
 

	
 
		http://dojotoolkit.org/book/dojo-book-0-9/introduction/licensing
 
*/
 

	
 
/*
 
	This is a compiled version of Dojo, built for deployment and not for
 
	development. To get an editable version, please visit:
 

	
 
		http://dojotoolkit.org
 

	
 
	for documentation and information on getting the source.
 
*/
 

	
 
(function(){var _1=null;if((_1||(typeof djConfig!="undefined"&&djConfig.scopeMap))&&(typeof window!="undefined")){var _2="",_3="",_4="",_5={},_6={};_1=_1||djConfig.scopeMap;for(var i=0;i<_1.length;i++){var _8=_1[i];_2+="var "+_8[0]+" = {}; "+_8[1]+" = "+_8[0]+";"+_8[1]+"._scopeName = '"+_8[1]+"';";_3+=(i==0?"":",")+_8[0];_4+=(i==0?"":",")+_8[1];_5[_8[0]]=_8[1];_6[_8[1]]=_8[0];}eval(_2+"dojo._scopeArgs = ["+_4+"];");dojo._scopePrefixArgs=_3;dojo._scopePrefix="(function("+_3+"){";dojo._scopeSuffix="})("+_4+")";dojo._scopeMap=_5;dojo._scopeMapRev=_6;}(function(){if(!this["console"]){this.console={log:function(){}};}var cn=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"];var i=0,tn;while((tn=cn[i++])){if(!console[tn]){(function(){var _c=tn+"";console[_c]=function(){var a=Array.apply({},arguments);a.unshift(_c+":");console.log(a.join(" "));};})();}}if(typeof dojo=="undefined"){this.dojo={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}};}var d=dojo;if(typeof dijit=="undefined"){this.dijit={_scopeName:"dijit"};}if(typeof dojox=="undefined"){this.dojox={_scopeName:"dojox"};}if(!d._scopeArgs){d._scopeArgs=[dojo,dijit,dojox];}d.global=this;d.config={isDebug:false,debugAtAllCosts:false};if(typeof djConfig!="undefined"){for(var _f in djConfig){d.config[_f]=djConfig[_f];}}var _10=["Browser","Rhino","Spidermonkey","Mobile"];var t;while((t=_10.shift())){d["is"+t]=false;}dojo.locale=d.config.locale;var rev="$Rev: 13707 $".match(/\d+/);dojo.version={major:1,minor:1,patch:1,flag:"",revision:rev?+rev[0]:999999,toString:function(){with(d.version){return major+"."+minor+"."+patch+flag+" ("+revision+")";}}};if(typeof OpenAjax!="undefined"){OpenAjax.hub.registerLibrary(dojo._scopeName,"http://dojotoolkit.org",d.version.toString());}dojo._mixin=function(obj,_14){var _15={};for(var x in _14){if(_15[x]===undefined||_15[x]!=_14[x]){obj[x]=_14[x];}}if(d["isIE"]&&_14){var p=_14.toString;if(typeof p=="function"&&p!=obj.toString&&p!=_15.toString&&p!="\nfunction toString() {\n    [native code]\n}\n"){obj.toString=_14.toString;}}return obj;};dojo.mixin=function(obj,_19){for(var i=1,l=arguments.length;i<l;i++){d._mixin(obj,arguments[i]);}return obj;};dojo._getProp=function(_1c,_1d,_1e){var obj=_1e||d.global;for(var i=0,p;obj&&(p=_1c[i]);i++){if(i==0&&this._scopeMap[p]){p=this._scopeMap[p];}obj=(p in obj?obj[p]:(_1d?obj[p]={}:undefined));}return obj;};dojo.setObject=function(_22,_23,_24){var _25=_22.split("."),p=_25.pop(),obj=d._getProp(_25,true,_24);return obj&&p?(obj[p]=_23):undefined;};dojo.getObject=function(_28,_29,_2a){return d._getProp(_28.split("."),_29,_2a);};dojo.exists=function(_2b,obj){return !!d.getObject(_2b,false,obj);};dojo["eval"]=function(_2d){return d.global.eval?d.global.eval(_2d):eval(_2d);};d.deprecated=d.experimental=function(){};})();(function(){var d=dojo;d.mixin(d,{_loadedModules:{},_inFlightCount:0,_hasResource:{},_modulePrefixes:{dojo:{name:"dojo",value:"."},doh:{name:"doh",value:"../util/doh"},tests:{name:"tests",value:"tests"}},_moduleHasPrefix:function(_2f){var mp=this._modulePrefixes;return !!(mp[_2f]&&mp[_2f].value);},_getModulePrefix:function(_31){var mp=this._modulePrefixes;if(this._moduleHasPrefix(_31)){return mp[_31].value;}return _31;},_loadedUrls:[],_postLoad:false,_loaders:[],_unloaders:[],_loadNotifying:false});dojo._loadPath=function(_33,_34,cb){var uri=((_33.charAt(0)=="/"||_33.match(/^\w+:/))?"":this.baseUrl)+_33;try{return !_34?this._loadUri(uri,cb):this._loadUriAndCheck(uri,_34,cb);}catch(e){console.error(e);return false;}};dojo._loadUri=function(uri,cb){if(this._loadedUrls[uri]){return true;}var _39=this._getText(uri,true);if(!_39){return false;}this._loadedUrls[uri]=true;this._loadedUrls.push(uri);if(cb){_39="("+_39+")";}else{_39=this._scopePrefix+_39+this._scopeSuffix;}if(d.isMoz){_39+="\r\n//@ sourceURL="+uri;}var _3a=d["eval"](_39);if(cb){cb(_3a);}return true;};dojo._loadUriAndCheck=function(uri,_3c,cb){var ok=false;try{ok=this._loadUri(uri,cb);}catch(e){console.error("failed loading "+uri+" with error: "+e);}return !!(ok&&this._loadedModules[_3c]);};dojo.loaded=function(){this._loadNotifying=true;this._postLoad=true;var mll=d._loaders;this._loaders=[];for(var x=0;x<mll.length;x++){try{mll[x]();}catch(e){throw e;console.error("dojo.addOnLoad callback failed: "+e,e);}}this._loadNotifying=false;if(d._postLoad&&d._inFlightCount==0&&mll.length){d._callLoaded();}};dojo.unloaded=function(){var mll=this._unloaders;while(mll.length){(mll.pop())();}};var _42=function(arr,obj,fn){if(!fn){arr.push(obj);}else{if(fn){var _46=(typeof fn=="string")?obj[fn]:fn;arr.push(function(){_46.call(obj);});}}};dojo.addOnLoad=function(obj,_48){_42(d._loaders,obj,_48);if(d._postLoad&&d._inFlightCount==0&&!d._loadNotifying){d._callLoaded();}};dojo.addOnUnload=function(obj,_4a){_42(d._unloaders,obj,_4a);};dojo._modulesLoaded=function(){if(d._postLoad){return;}if(d._inFlightCount>0){console.warn("files still in flight!");return;}d._callLoaded();};dojo._callLoaded=function(){if(typeof setTimeout=="object"||(dojo.config.useXDomain&&d.isOpera)){if(dojo.isAIR){setTimeout(function(){dojo.loaded();},0);}else{setTimeout(dojo._scopeName+".loaded();",0);}}else{d.loaded();}};dojo._getModuleSymbols=function(_4b){var _4c=_4b.split(".");for(var i=_4c.length;i>0;i--){var _4e=_4c.slice(0,i).join(".");if((i==1)&&!this._moduleHasPrefix(_4e)){_4c[0]="../"+_4c[0];}else{var _4f=this._getModulePrefix(_4e);if(_4f!=_4e){_4c.splice(0,i,_4f);break;}}}return _4c;};dojo._global_omit_module_check=false;dojo._loadModule=dojo.require=function(_50,_51){_51=this._global_omit_module_check||_51;var _52=this._loadedModules[_50];if(_52){return _52;}var _53=this._getModuleSymbols(_50).join("/")+".js";var _54=(!_51)?_50:null;var ok=this._loadPath(_53,_54);if(!ok&&!_51){throw new Error("Could not load '"+_50+"'; last tried '"+_53+"'");}if(!_51&&!this._isXDomain){_52=this._loadedModules[_50];if(!_52){throw new Error("symbol '"+_50+"' is not defined after loading '"+_53+"'");}}return _52;};dojo.provide=function(_56){_56=_56+"";return (d._loadedModules[_56]=d.getObject(_56,true));};dojo.platformRequire=function(_57){var _58=_57.common||[];var _59=_58.concat(_57[d._name]||_57["default"]||[]);for(var x=0;x<_59.length;x++){var _5b=_59[x];if(_5b.constructor==Array){d._loadModule.apply(d,_5b);}else{d._loadModule(_5b);}}};dojo.requireIf=function(_5c,_5d){if(_5c===true){var _5e=[];for(var i=1;i<arguments.length;i++){_5e.push(arguments[i]);}d.require.apply(d,_5e);}};dojo.requireAfterIf=d.requireIf;dojo.registerModulePath=function(_60,_61){d._modulePrefixes[_60]={name:_60,value:_61};};dojo.requireLocalization=function(_62,_63,_64,_65){d.require("dojo.i18n");d.i18n._requireLocalization.apply(d.hostenv,arguments);};var ore=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$");var ire=new RegExp("^((([^:]+:)?([^@]+))@)?([^:]*)(:([0-9]+))?$");dojo._Url=function(){var n=null;var _a=arguments;var uri=[_a[0]];for(var i=1;i<_a.length;i++){if(!_a[i]){continue;}var _6c=new d._Url(_a[i]+"");var _6d=new d._Url(uri[0]+"");if(_6c.path==""&&!_6c.scheme&&!_6c.authority&&!_6c.query){if(_6c.fragment!=n){_6d.fragment=_6c.fragment;}_6c=_6d;}else{if(!_6c.scheme){_6c.scheme=_6d.scheme;if(!_6c.authority){_6c.authority=_6d.authority;if(_6c.path.charAt(0)!="/"){var _6e=_6d.path.substring(0,_6d.path.lastIndexOf("/")+1)+_6c.path;var _6f=_6e.split("/");for(var j=0;j<_6f.length;j++){if(_6f[j]=="."){if(j==_6f.length-1){_6f[j]="";}else{_6f.splice(j,1);j--;}}else{if(j>0&&!(j==1&&_6f[0]=="")&&_6f[j]==".."&&_6f[j-1]!=".."){if(j==(_6f.length-1)){_6f.splice(j,1);_6f[j-1]="";}else{_6f.splice(j-1,2);j-=2;}}}}_6c.path=_6f.join("/");}}}}uri=[];if(_6c.scheme){uri.push(_6c.scheme,":");}if(_6c.authority){uri.push("//",_6c.authority);}uri.push(_6c.path);if(_6c.query){uri.push("?",_6c.query);}if(_6c.fragment){uri.push("#",_6c.fragment);}}this.uri=uri.join("");var r=this.uri.match(ore);this.scheme=r[2]||(r[1]?"":n);this.authority=r[4]||(r[3]?"":n);this.path=r[5];this.query=r[7]||(r[6]?"":n);this.fragment=r[9]||(r[8]?"":n);if(this.authority!=n){r=this.authority.match(ire);this.user=r[3]||n;this.password=r[4]||n;this.host=r[5];this.port=r[7]||n;}};dojo._Url.prototype.toString=function(){return this.uri;};dojo.moduleUrl=function(_72,url){var loc=d._getModuleSymbols(_72).join("/");if(!loc){return null;}if(loc.lastIndexOf("/")!=loc.length-1){loc+="/";}var _75=loc.indexOf(":");if(loc.charAt(0)!="/"&&(_75==-1||_75>loc.indexOf("/"))){loc=d.baseUrl+loc;}return new d._Url(loc,url);};})();if(typeof window!="undefined"){dojo.isBrowser=true;dojo._name="browser";(function(){var d=dojo;if(document&&document.getElementsByTagName){var _77=document.getElementsByTagName("script");var _78=/dojo(\.xd)?\.js(\W|$)/i;for(var i=0;i<_77.length;i++){var src=_77[i].getAttribute("src");if(!src){continue;}var m=src.match(_78);if(m){if(!d.config.baseUrl){d.config.baseUrl=src.substring(0,m.index);}var cfg=_77[i].getAttribute("djConfig");if(cfg){var _7d=eval("({ "+cfg+" })");for(var x in _7d){dojo.config[x]=_7d[x];}}break;}}}d.baseUrl=d.config.baseUrl;var n=navigator;var dua=n.userAgent;var dav=n.appVersion;var tv=parseFloat(dav);d.isOpera=(dua.indexOf("Opera")>=0)?tv:0;var idx=Math.max(dav.indexOf("WebKit"),dav.indexOf("Safari"),0);if(idx){d.isSafari=parseFloat(dav.split("Version/")[1])||((parseFloat(dav.substr(idx+7))>=419.3)?3:2)||2;}d.isAIR=(dua.indexOf("AdobeAIR")>=0)?1:0;d.isKhtml=(dav.indexOf("Konqueror")>=0||d.isSafari)?tv:0;d.isMozilla=d.isMoz=(dua.indexOf("Gecko")>=0&&!d.isKhtml)?tv:0;d.isFF=d.isIE=0;if(d.isMoz){d.isFF=parseFloat(dua.split("Firefox/")[1])||0;}if(document.all&&!d.isOpera){d.isIE=parseFloat(dav.split("MSIE ")[1])||0;}if(dojo.isIE&&window.location.protocol==="file:"){dojo.config.ieForceActiveXXhr=true;}var cm=document.compatMode;d.isQuirks=cm=="BackCompat"||cm=="QuirksMode"||d.isIE<6;d.locale=dojo.config.locale||(d.isIE?n.userLanguage:n.language).toLowerCase();d._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];d._xhrObj=function(){var _85=null;var _86=null;if(!dojo.isIE||!dojo.config.ieForceActiveXXhr){try{_85=new XMLHttpRequest();}catch(e){}}if(!_85){for(var i=0;i<3;++i){var _88=d._XMLHTTP_PROGIDS[i];try{_85=new ActiveXObject(_88);}catch(e){_86=e;}if(_85){d._XMLHTTP_PROGIDS=[_88];break;}}}if(!_85){throw new Error("XMLHTTP not available: "+_86);}return _85;};d._isDocumentOk=function(_89){var _8a=_89.status||0;return (_8a>=200&&_8a<300)||_8a==304||_8a==1223||(!_8a&&(location.protocol=="file:"||location.protocol=="chrome:"));};var _8b=window.location+"";var _8c=document.getElementsByTagName("base");var _8d=(_8c&&_8c.length>0);d._getText=function(uri,_8f){var _90=this._xhrObj();if(!_8d&&dojo._Url){uri=(new dojo._Url(_8b,uri)).toString();}if(d.config.cacheBust){uri+=(uri.indexOf("?")==-1?"?":"&")+String(d.config.cacheBust).replace(/\W+/g,"");}_90.open("GET",uri,false);try{_90.send(null);if(!d._isDocumentOk(_90)){var err=Error("Unable to load "+uri+" status:"+_90.status);err.status=_90.status;err.responseText=_90.responseText;throw err;}}catch(e){if(_8f){return null;}throw e;}return _90.responseText;};})();dojo._initFired=false;dojo._loadInit=function(e){dojo._initFired=true;var _93=(e&&e.type)?e.type.toLowerCase():"load";if(arguments.callee.initialized||(_93!="domcontentloaded"&&_93!="load")){return;}arguments.callee.initialized=true;if("_khtmlTimer" in dojo){clearInterval(dojo._khtmlTimer);delete dojo._khtmlTimer;}if(dojo._inFlightCount==0){dojo._modulesLoaded();}};dojo._fakeLoadInit=function(){dojo._loadInit({type:"load"});};if(!dojo.config.afterOnLoad){if(document.addEventListener){if(dojo.isOpera||dojo.isFF>=3||(dojo.isMoz&&dojo.config.enableMozDomContentLoaded===true)){document.addEventListener("DOMContentLoaded",dojo._loadInit,null);}window.addEventListener("load",dojo._loadInit,null);}if(dojo.isAIR){window.addEventListener("load",dojo._loadInit,null);}else{if(/(WebKit|khtml)/i.test(navigator.userAgent)){dojo._khtmlTimer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){dojo._loadInit();}},10);}}}(function(){var _w=window;var _95=function(_96,fp){var _98=_w[_96]||function(){};_w[_96]=function(){fp.apply(_w,arguments);_98.apply(_w,arguments);};};if(dojo.isIE){if(!dojo.config.afterOnLoad){document.write("<scr"+"ipt defer src=\"//:\" "+"onreadystatechange=\"if(this.readyState=='complete'){"+dojo._scopeName+"._loadInit();}\">"+"</scr"+"ipt>");}var _99=true;_95("onbeforeunload",function(){_w.setTimeout(function(){_99=false;},0);});_95("onunload",function(){if(_99){dojo.unloaded();}});try{document.namespaces.add("v","urn:schemas-microsoft-com:vml");document.createStyleSheet().addRule("v\\:*","behavior:url(#default#VML)");}catch(e){}}else{_95("onbeforeunload",function(){dojo.unloaded();});}})();}(function(){var mp=dojo.config["modulePaths"];if(mp){for(var _9b in mp){dojo.registerModulePath(_9b,mp[_9b]);}}})();if(dojo.config.isDebug){dojo.require("dojo._firebug.firebug");}if(dojo.config.debugAtAllCosts){dojo.config.useXDomain=true;dojo.require("dojo._base._loader.loader_xd");dojo.require("dojo._base._loader.loader_debug");dojo.require("dojo.i18n");}if(!dojo._hasResource["dojo._base.lang"]){dojo._hasResource["dojo._base.lang"]=true;dojo.provide("dojo._base.lang");dojo.isString=function(it){return !!arguments.length&&it!=null&&(typeof it=="string"||it instanceof String);};dojo.isArray=function(it){return it&&(it instanceof Array||typeof it=="array");};dojo.isFunction=(function(){var _9e=function(it){return it&&(typeof it=="function"||it instanceof Function);};return dojo.isSafari?function(it){if(typeof it=="function"&&it=="[object NodeList]"){return false;}return _9e(it);}:_9e;})();dojo.isObject=function(it){return it!==undefined&&(it===null||typeof it=="object"||dojo.isArray(it)||dojo.isFunction(it));};dojo.isArrayLike=function(it){var d=dojo;return it&&it!==undefined&&!d.isString(it)&&!d.isFunction(it)&&!(it.tagName&&it.tagName.toLowerCase()=="form")&&(d.isArray(it)||isFinite(it.length));};dojo.isAlien=function(it){return it&&!dojo.isFunction(it)&&/\{\s*\[native code\]\s*\}/.test(String(it));};dojo.extend=function(_a5,_a6){for(var i=1,l=arguments.length;i<l;i++){dojo._mixin(_a5.prototype,arguments[i]);}return _a5;};dojo._hitchArgs=function(_a9,_aa){var pre=dojo._toArray(arguments,2);var _ac=dojo.isString(_aa);return function(){var _ad=dojo._toArray(arguments);var f=_ac?(_a9||dojo.global)[_aa]:_aa;return f&&f.apply(_a9||this,pre.concat(_ad));};};dojo.hitch=function(_af,_b0){if(arguments.length>2){return dojo._hitchArgs.apply(dojo,arguments);}if(!_b0){_b0=_af;_af=null;}if(dojo.isString(_b0)){_af=_af||dojo.global;if(!_af[_b0]){throw (["dojo.hitch: scope[\"",_b0,"\"] is null (scope=\"",_af,"\")"].join(""));}return function(){return _af[_b0].apply(_af,arguments||[]);};}return !_af?_b0:function(){return _b0.apply(_af,arguments||[]);};};dojo.delegate=dojo._delegate=function(obj,_b2){function TMP(){};TMP.prototype=obj;var tmp=new TMP();if(_b2){dojo.mixin(tmp,_b2);}return tmp;};dojo.partial=function(_b4){var arr=[null];return dojo.hitch.apply(dojo,arr.concat(dojo._toArray(arguments)));};dojo._toArray=function(obj,_b7,_b8){var arr=_b8||[];for(var x=_b7||0;x<obj.length;x++){arr.push(obj[x]);}return arr;};dojo.clone=function(o){if(!o){return o;}if(dojo.isArray(o)){var r=[];for(var i=0;i<o.length;++i){r.push(dojo.clone(o[i]));}return r;}if(!dojo.isObject(o)){return o;}if(o.nodeType&&o.cloneNode){return o.cloneNode(true);}if(o instanceof Date){return new Date(o.getTime());}var r=new o.constructor();for(var i in o){if(!(i in r)||r[i]!=o[i]){r[i]=dojo.clone(o[i]);}}return r;};dojo.trim=function(str){return str.replace(/^\s\s*/,"").replace(/\s\s*$/,"");};}if(!dojo._hasResource["dojo._base.declare"]){dojo._hasResource["dojo._base.declare"]=true;dojo.provide("dojo._base.declare");dojo.declare=function(_bf,_c0,_c1){var dd=arguments.callee,_c3;if(dojo.isArray(_c0)){_c3=_c0;_c0=_c3.shift();}if(_c3){dojo.forEach(_c3,function(m){if(!m){throw (_bf+": mixin #"+i+" is null");}_c0=dd._delegate(_c0,m);});}var _c5=(_c1||0).constructor,_c6=dd._delegate(_c0),fn;for(var i in _c1){if(dojo.isFunction(fn=_c1[i])&&!0[i]){fn.nom=i;}}dojo.extend(_c6,{declaredClass:_bf,_constructor:_c5,preamble:null},_c1||0);_c6.prototype.constructor=_c6;return dojo.setObject(_bf,_c6);};dojo.mixin(dojo.declare,{_delegate:function(_c9,_ca){var bp=(_c9||0).prototype,mp=(_ca||0).prototype;var _cd=dojo.declare._makeCtor();dojo.mixin(_cd,{superclass:bp,mixin:mp,extend:dojo.declare._extend});if(_c9){_cd.prototype=dojo._delegate(bp);}dojo.extend(_cd,dojo.declare._core,mp||0,{_constructor:null,preamble:null});_cd.prototype.constructor=_cd;_cd.prototype.declaredClass=(bp||0).declaredClass+"_"+(mp||0).declaredClass;return _cd;},_extend:function(_ce){for(var i in _ce){if(dojo.isFunction(fn=_ce[i])&&!0[i]){fn.nom=i;}}dojo.extend(this,_ce);},_makeCtor:function(){return function(){this._construct(arguments);};},_core:{_construct:function(_d0){var c=_d0.callee,s=c.superclass,ct=s&&s.constructor,m=c.mixin,mct=m&&m.constructor,a=_d0,ii,fn;if(a[0]){if(((fn=a[0].preamble))){a=fn.apply(this,a)||a;}}if((fn=c.prototype.preamble)){a=fn.apply(this,a)||a;}if(ct&&ct.apply){ct.apply(this,a);}if(mct&&mct.apply){mct.apply(this,a);}if((ii=c.prototype._constructor)){ii.apply(this,_d0);}if(this.constructor.prototype==c.prototype&&(ct=this.postscript)){ct.apply(this,_d0);}},_findMixin:function(_d9){var c=this.constructor,p,m;while(c){p=c.superclass;m=c.mixin;if(m==_d9||(m instanceof _d9.constructor)){return p;}if(m&&(m=m._findMixin(_d9))){return m;}c=p&&p.constructor;}},_findMethod:function(_dd,_de,_df,has){var p=_df,c,m,f;do{c=p.constructor;m=c.mixin;if(m&&(m=this._findMethod(_dd,_de,m,has))){return m;}if((f=p[_dd])&&(has==(f==_de))){return p;}p=c.superclass;}while(p);return !has&&(p=this._findMixin(_df))&&this._findMethod(_dd,_de,p,has);},inherited:function(_e5,_e6,_e7){var a=arguments;if(!dojo.isString(a[0])){_e7=_e6;_e6=_e5;_e5=_e6.callee.nom;}a=_e7||_e6;var c=_e6.callee,p=this.constructor.prototype,fn,mp;if(this[_e5]!=c||p[_e5]==c){mp=this._findMethod(_e5,c,p,true);if(!mp){throw (this.declaredClass+": inherited method \""+_e5+"\" mismatch");}p=this._findMethod(_e5,c,mp,false);}fn=p&&p[_e5];if(!fn){throw (mp.declaredClass+": inherited method \""+_e5+"\" not found");}return fn.apply(this,a);}}});}if(!dojo._hasResource["dojo._base.connect"]){dojo._hasResource["dojo._base.connect"]=true;dojo.provide("dojo._base.connect");dojo._listener={getDispatcher:function(){return function(){var ap=Array.prototype,c=arguments.callee,ls=c._listeners,t=c.target;var r=t&&t.apply(this,arguments);for(var i in ls){if(!(i in ap)){ls[i].apply(this,arguments);}}return r;};},add:function(_f3,_f4,_f5){_f3=_f3||dojo.global;var f=_f3[_f4];if(!f||!f._listeners){var d=dojo._listener.getDispatcher();d.target=f;d._listeners=[];f=_f3[_f4]=d;}return f._listeners.push(_f5);},remove:function(_f8,_f9,_fa){var f=(_f8||dojo.global)[_f9];if(f&&f._listeners&&_fa--){delete f._listeners[_fa];}}};dojo.connect=function(obj,_fd,_fe,_ff,_100){var a=arguments,args=[],i=0;args.push(dojo.isString(a[0])?null:a[i++],a[i++]);var a1=a[i+1];args.push(dojo.isString(a1)||dojo.isFunction(a1)?a[i++]:null,a[i++]);for(var l=a.length;i<l;i++){args.push(a[i]);}return dojo._connect.apply(this,args);};dojo._connect=function(obj,_106,_107,_108){var l=dojo._listener,h=l.add(obj,_106,dojo.hitch(_107,_108));return [obj,_106,h,l];};dojo.disconnect=function(_10b){if(_10b&&_10b[0]!==undefined){dojo._disconnect.apply(this,_10b);delete _10b[0];}};dojo._disconnect=function(obj,_10d,_10e,_10f){_10f.remove(obj,_10d,_10e);};dojo._topics={};dojo.subscribe=function(_110,_111,_112){return [_110,dojo._listener.add(dojo._topics,_110,dojo.hitch(_111,_112))];};dojo.unsubscribe=function(_113){if(_113){dojo._listener.remove(dojo._topics,_113[0],_113[1]);}};dojo.publish=function(_114,args){var f=dojo._topics[_114];if(f){f.apply(this,args||[]);}};dojo.connectPublisher=function(_117,obj,_119){var pf=function(){dojo.publish(_117,arguments);};return (_119)?dojo.connect(obj,_119,pf):dojo.connect(obj,pf);};}if(!dojo._hasResource["dojo._base.Deferred"]){dojo._hasResource["dojo._base.Deferred"]=true;dojo.provide("dojo._base.Deferred");dojo.Deferred=function(_11b){this.chain=[];this.id=this._nextId();this.fired=-1;this.paused=0;this.results=[null,null];this.canceller=_11b;this.silentlyCancelled=false;};dojo.extend(dojo.Deferred,{_nextId:(function(){var n=1;return function(){return n++;};})(),cancel:function(){var err;if(this.fired==-1){if(this.canceller){err=this.canceller(this);}else{this.silentlyCancelled=true;}if(this.fired==-1){if(!(err instanceof Error)){var res=err;err=new Error("Deferred Cancelled");err.dojoType="cancel";err.cancelResult=res;}this.errback(err);}}else{if((this.fired==0)&&(this.results[0] instanceof dojo.Deferred)){this.results[0].cancel();}}},_resback:function(res){this.fired=((res instanceof Error)?1:0);this.results[this.fired]=res;this._fire();},_check:function(){if(this.fired!=-1){if(!this.silentlyCancelled){throw new Error("already called!");}this.silentlyCancelled=false;return;}},callback:function(res){this._check();this._resback(res);},errback:function(res){this._check();if(!(res instanceof Error)){res=new Error(res);}this._resback(res);},addBoth:function(cb,cbfn){var _124=dojo.hitch.apply(dojo,arguments);return this.addCallbacks(_124,_124);},addCallback:function(cb,cbfn){return this.addCallbacks(dojo.hitch.apply(dojo,arguments));},addErrback:function(cb,cbfn){return this.addCallbacks(null,dojo.hitch.apply(dojo,arguments));},addCallbacks:function(cb,eb){this.chain.push([cb,eb]);if(this.fired>=0){this._fire();}return this;},_fire:function(){var _12b=this.chain;var _12c=this.fired;var res=this.results[_12c];var self=this;var cb=null;while((_12b.length>0)&&(this.paused==0)){var f=_12b.shift()[_12c];if(!f){continue;}try{res=f(res);_12c=((res instanceof Error)?1:0);if(res instanceof dojo.Deferred){cb=function(res){self._resback(res);self.paused--;if((self.paused==0)&&(self.fired>=0)){self._fire();}};this.paused++;}}catch(err){console.debug(err);_12c=1;res=err;}}this.fired=_12c;this.results[_12c]=res;if((cb)&&(this.paused)){res.addBoth(cb);}}});}if(!dojo._hasResource["dojo._base.json"]){dojo._hasResource["dojo._base.json"]=true;dojo.provide("dojo._base.json");dojo.fromJson=function(json){return eval("("+json+")");};dojo._escapeString=function(str){return ("\""+str.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r");};dojo.toJsonIndentStr="\t";dojo.toJson=function(it,_135,_136){if(it===undefined){return "undefined";}var _137=typeof it;if(_137=="number"||_137=="boolean"){return it+"";}if(it===null){return "null";}if(dojo.isString(it)){return dojo._escapeString(it);}if(it.nodeType&&it.cloneNode){return "";}var _138=arguments.callee;var _139;_136=_136||"";var _13a=_135?_136+dojo.toJsonIndentStr:"";if(typeof it.__json__=="function"){_139=it.__json__();if(it!==_139){return _138(_139,_135,_13a);}}if(typeof it.json=="function"){_139=it.json();if(it!==_139){return _138(_139,_135,_13a);}}var sep=_135?" ":"";var _13c=_135?"\n":"";if(dojo.isArray(it)){var res=dojo.map(it,function(obj){var val=_138(obj,_135,_13a);if(typeof val!="string"){val="undefined";}return _13c+_13a+val;});return "["+res.join(","+sep)+_13c+_136+"]";}if(_137=="function"){return null;}var _140=[];for(var key in it){var _142;if(typeof key=="number"){_142="\""+key+"\"";}else{if(typeof key=="string"){_142=dojo._escapeString(key);}else{continue;}}val=_138(it[key],_135,_13a);if(typeof val!="string"){continue;}_140.push(_13c+_13a+_142+":"+sep+val);}return "{"+_140.join(","+sep)+_13c+_136+"}";};}if(!dojo._hasResource["dojo._base.array"]){dojo._hasResource["dojo._base.array"]=true;dojo.provide("dojo._base.array");(function(){var _143=function(arr,obj,cb){return [dojo.isString(arr)?arr.split(""):arr,obj||dojo.global,dojo.isString(cb)?new Function("item","index","array",cb):cb];};dojo.mixin(dojo,{indexOf:function(_147,_148,_149,_14a){var step=1,end=_147.length||0,i=0;if(_14a){i=end-1;step=end=-1;}if(_149!=undefined){i=_149;}if((_14a&&i>end)||i<end){for(;i!=end;i+=step){if(_147[i]==_148){return i;}}}return -1;},lastIndexOf:function(_14d,_14e,_14f){return dojo.indexOf(_14d,_14e,_14f,true);},forEach:function(arr,_151,_152){if(!arr||!arr.length){return;}var _p=_143(arr,_152,_151);arr=_p[0];for(var i=0,l=_p[0].length;i<l;i++){_p[2].call(_p[1],arr[i],i,arr);}},_everyOrSome:function(_156,arr,_158,_159){var _p=_143(arr,_159,_158);arr=_p[0];for(var i=0,l=arr.length;i<l;i++){var _15d=!!_p[2].call(_p[1],arr[i],i,arr);if(_156^_15d){return _15d;}}return _156;},every:function(arr,_15f,_160){return this._everyOrSome(true,arr,_15f,_160);},some:function(arr,_162,_163){return this._everyOrSome(false,arr,_162,_163);},map:function(arr,_165,_166){var _p=_143(arr,_166,_165);arr=_p[0];var _168=(arguments[3]?(new arguments[3]()):[]);for(var i=0;i<arr.length;++i){_168.push(_p[2].call(_p[1],arr[i],i,arr));}return _168;},filter:function(arr,_16b,_16c){var _p=_143(arr,_16c,_16b);arr=_p[0];var _16e=[];for(var i=0;i<arr.length;i++){if(_p[2].call(_p[1],arr[i],i,arr)){_16e.push(arr[i]);}}return _16e;}});})();}if(!dojo._hasResource["dojo._base.Color"]){dojo._hasResource["dojo._base.Color"]=true;dojo.provide("dojo._base.Color");dojo.Color=function(_170){if(_170){this.setColor(_170);}};dojo.Color.named={black:[0,0,0],silver:[192,192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255]};dojo.extend(dojo.Color,{r:255,g:255,b:255,a:1,_set:function(r,g,b,a){var t=this;t.r=r;t.g=g;t.b=b;t.a=a;},setColor:function(_176){var d=dojo;if(d.isString(_176)){d.colorFromString(_176,this);}else{if(d.isArray(_176)){d.colorFromArray(_176,this);}else{this._set(_176.r,_176.g,_176.b,_176.a);if(!(_176 instanceof d.Color)){this.sanitize();}}}return this;},sanitize:function(){return this;},toRgb:function(){var t=this;return [t.r,t.g,t.b];},toRgba:function(){var t=this;return [t.r,t.g,t.b,t.a];},toHex:function(){var arr=dojo.map(["r","g","b"],function(x){var s=this[x].toString(16);return s.length<2?"0"+s:s;},this);return "#"+arr.join("");},toCss:function(_17d){var t=this,rgb=t.r+", "+t.g+", "+t.b;return (_17d?"rgba("+rgb+", "+t.a:"rgb("+rgb)+")";},toString:function(){return this.toCss(true);}});dojo.blendColors=function(_180,end,_182,obj){var d=dojo,t=obj||new dojo.Color();d.forEach(["r","g","b","a"],function(x){t[x]=_180[x]+(end[x]-_180[x])*_182;if(x!="a"){t[x]=Math.round(t[x]);}});return t.sanitize();};dojo.colorFromRgb=function(_187,obj){var m=_187.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/);return m&&dojo.colorFromArray(m[1].split(/\s*,\s*/),obj);};dojo.colorFromHex=function(_18a,obj){var d=dojo,t=obj||new d.Color(),bits=(_18a.length==4)?4:8,mask=(1<<bits)-1;_18a=Number("0x"+_18a.substr(1));if(isNaN(_18a)){return null;}d.forEach(["b","g","r"],function(x){var c=_18a&mask;_18a>>=bits;t[x]=bits==4?17*c:c;});t.a=1;return t;};dojo.colorFromArray=function(a,obj){var t=obj||new dojo.Color();t._set(Number(a[0]),Number(a[1]),Number(a[2]),Number(a[3]));if(isNaN(t.a)){t.a=1;}return t.sanitize();};dojo.colorFromString=function(str,obj){var a=dojo.Color.named[str];return a&&dojo.colorFromArray(a,obj)||dojo.colorFromRgb(str,obj)||dojo.colorFromHex(str,obj);};}if(!dojo._hasResource["dojo._base"]){dojo._hasResource["dojo._base"]=true;dojo.provide("dojo._base");}if(!dojo._hasResource["dojo._base.window"]){dojo._hasResource["dojo._base.window"]=true;dojo.provide("dojo._base.window");dojo._gearsObject=function(){var _198;var _199;var _19a=dojo.getObject("google.gears");if(_19a){return _19a;}if(typeof GearsFactory!="undefined"){_198=new GearsFactory();}else{if(dojo.isIE){try{_198=new ActiveXObject("Gears.Factory");}catch(e){}}else{if(navigator.mimeTypes["application/x-googlegears"]){_198=document.createElement("object");_198.setAttribute("type","application/x-googlegears");_198.setAttribute("width",0);_198.setAttribute("height",0);_198.style.display="none";document.documentElement.appendChild(_198);}}}if(!_198){return null;}dojo.setObject("google.gears.factory",_198);return dojo.getObject("google.gears");};dojo.isGears=(!!dojo._gearsObject())||0;dojo.doc=window["document"]||null;dojo.body=function(){return dojo.doc.body||dojo.doc.getElementsByTagName("body")[0];};dojo.setContext=function(_19b,_19c){dojo.global=_19b;dojo.doc=_19c;};dojo._fireCallback=function(_19d,_19e,_19f){if(_19e&&dojo.isString(_19d)){_19d=_19e[_19d];}return _19d.apply(_19e,_19f||[]);};dojo.withGlobal=function(_1a0,_1a1,_1a2,_1a3){var rval;var _1a5=dojo.global;var _1a6=dojo.doc;try{dojo.setContext(_1a0,_1a0.document);rval=dojo._fireCallback(_1a1,_1a2,_1a3);}finally{dojo.setContext(_1a5,_1a6);}return rval;};dojo.withDoc=function(_1a7,_1a8,_1a9,_1aa){var rval;var _1ac=dojo.doc;try{dojo.doc=_1a7;rval=dojo._fireCallback(_1a8,_1a9,_1aa);}finally{dojo.doc=_1ac;}return rval;};}if(!dojo._hasResource["dojo._base.event"]){dojo._hasResource["dojo._base.event"]=true;dojo.provide("dojo._base.event");(function(){var del=(dojo._event_listener={add:function(node,name,fp){if(!node){return;}name=del._normalizeEventName(name);fp=del._fixCallback(name,fp);var _1b1=name;if(!dojo.isIE&&(name=="mouseenter"||name=="mouseleave")){var ofp=fp;name=(name=="mouseenter")?"mouseover":"mouseout";fp=function(e){if(!dojo.isDescendant(e.relatedTarget,node)){return ofp.call(this,e);}};}node.addEventListener(name,fp,false);return fp;},remove:function(node,_1b5,_1b6){if(node){node.removeEventListener(del._normalizeEventName(_1b5),_1b6,false);}},_normalizeEventName:function(name){return name.slice(0,2)=="on"?name.slice(2):name;},_fixCallback:function(name,fp){return name!="keypress"?fp:function(e){return fp.call(this,del._fixEvent(e,this));};},_fixEvent:function(evt,_1bc){switch(evt.type){case "keypress":del._setKeyChar(evt);break;}return evt;},_setKeyChar:function(evt){evt.keyChar=evt.charCode?String.fromCharCode(evt.charCode):"";}});dojo.fixEvent=function(evt,_1bf){return del._fixEvent(evt,_1bf);};dojo.stopEvent=function(evt){evt.preventDefault();evt.stopPropagation();};var _1c1=dojo._listener;dojo._connect=function(obj,_1c3,_1c4,_1c5,_1c6){var _1c7=obj&&(obj.nodeType||obj.attachEvent||obj.addEventListener);var lid=!_1c7?0:(!_1c6?1:2),l=[dojo._listener,del,_1c1][lid];var h=l.add(obj,_1c3,dojo.hitch(_1c4,_1c5));return [obj,_1c3,h,lid];};dojo._disconnect=function(obj,_1cc,_1cd,_1ce){([dojo._listener,del,_1c1][_1ce]).remove(obj,_1cc,_1cd);};dojo.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145};if(dojo.isIE){var _1cf=function(e,code){try{return (e.keyCode=code);}catch(e){return 0;}};var iel=dojo._listener;if(!dojo.config._allow_leaks){_1c1=iel=dojo._ie_listener={handlers:[],add:function(_1d3,_1d4,_1d5){_1d3=_1d3||dojo.global;var f=_1d3[_1d4];if(!f||!f._listeners){var d=dojo._getIeDispatcher();d.target=f&&(ieh.push(f)-1);d._listeners=[];f=_1d3[_1d4]=d;}return f._listeners.push(ieh.push(_1d5)-1);},remove:function(_1d9,_1da,_1db){var f=(_1d9||dojo.global)[_1da],l=f&&f._listeners;if(f&&l&&_1db--){delete ieh[l[_1db]];delete l[_1db];}}};var ieh=iel.handlers;}dojo.mixin(del,{add:function(node,_1df,fp){if(!node){return;}_1df=del._normalizeEventName(_1df);if(_1df=="onkeypress"){var kd=node.onkeydown;if(!kd||!kd._listeners||!kd._stealthKeydownHandle){var h=del.add(node,"onkeydown",del._stealthKeyDown);kd=node.onkeydown;kd._stealthKeydownHandle=h;kd._stealthKeydownRefs=1;}else{kd._stealthKeydownRefs++;}}return iel.add(node,_1df,del._fixCallback(fp));},remove:function(node,_1e4,_1e5){_1e4=del._normalizeEventName(_1e4);iel.remove(node,_1e4,_1e5);if(_1e4=="onkeypress"){var kd=node.onkeydown;if(--kd._stealthKeydownRefs<=0){iel.remove(node,"onkeydown",kd._stealthKeydownHandle);delete kd._stealthKeydownHandle;}}},_normalizeEventName:function(_1e7){return _1e7.slice(0,2)!="on"?"on"+_1e7:_1e7;},_nop:function(){},_fixEvent:function(evt,_1e9){if(!evt){var w=_1e9&&(_1e9.ownerDocument||_1e9.document||_1e9).parentWindow||window;evt=w.event;}if(!evt){return (evt);}evt.target=evt.srcElement;evt.currentTarget=(_1e9||evt.srcElement);evt.layerX=evt.offsetX;evt.layerY=evt.offsetY;var se=evt.srcElement,doc=(se&&se.ownerDocument)||document;var _1ed=((dojo.isIE<6)||(doc["compatMode"]=="BackCompat"))?doc.body:doc.documentElement;var _1ee=dojo._getIeDocumentElementOffset();evt.pageX=evt.clientX+dojo._fixIeBiDiScrollLeft(_1ed.scrollLeft||0)-_1ee.x;evt.pageY=evt.clientY+(_1ed.scrollTop||0)-_1ee.y;if(evt.type=="mouseover"){evt.relatedTarget=evt.fromElement;}if(evt.type=="mouseout"){evt.relatedTarget=evt.toElement;}evt.stopPropagation=del._stopPropagation;evt.preventDefault=del._preventDefault;return del._fixKeys(evt);},_fixKeys:function(evt){switch(evt.type){case "keypress":var c=("charCode" in evt?evt.charCode:evt.keyCode);if(c==10){c=0;evt.keyCode=13;}else{if(c==13||c==27){c=0;}else{if(c==3){c=99;}}}evt.charCode=c;del._setKeyChar(evt);break;}return evt;},_punctMap:{106:42,111:47,186:59,187:43,188:44,189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39},_stealthKeyDown:function(evt){var kp=evt.currentTarget.onkeypress;if(!kp||!kp._listeners){return;}var k=evt.keyCode;var _1f4=(k!=13)&&(k!=32)&&(k!=27)&&(k<48||k>90)&&(k<96||k>111)&&(k<186||k>192)&&(k<219||k>222);if(_1f4||evt.ctrlKey){var c=_1f4?0:k;if(evt.ctrlKey){if(k==3||k==13){return;}else{if(c>95&&c<106){c-=48;}else{if((!evt.shiftKey)&&(c>=65&&c<=90)){c+=32;}else{c=del._punctMap[c]||c;}}}}var faux=del._synthesizeEvent(evt,{type:"keypress",faux:true,charCode:c});kp.call(evt.currentTarget,faux);evt.cancelBubble=faux.cancelBubble;evt.returnValue=faux.returnValue;_1cf(evt,faux.keyCode);}},_stopPropagation:function(){this.cancelBubble=true;},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;if(this.ctrlKey){_1cf(this,0);}this.returnValue=false;}});dojo.stopEvent=function(evt){evt=evt||window.event;del._stopPropagation.call(evt);del._preventDefault.call(evt);};}del._synthesizeEvent=function(evt,_1f9){var faux=dojo.mixin({},evt,_1f9);del._setKeyChar(faux);faux.preventDefault=function(){evt.preventDefault();};faux.stopPropagation=function(){evt.stopPropagation();};return faux;};if(dojo.isOpera){dojo.mixin(del,{_fixEvent:function(evt,_1fc){switch(evt.type){case "keypress":var c=evt.which;if(c==3){c=99;}c=((c<41)&&(!evt.shiftKey)?0:c);if((evt.ctrlKey)&&(!evt.shiftKey)&&(c>=65)&&(c<=90)){c+=32;}return del._synthesizeEvent(evt,{charCode:c});}return evt;}});}if(dojo.isSafari){dojo.mixin(del,{_fixEvent:function(evt,_1ff){switch(evt.type){case "keypress":var c=evt.charCode,s=evt.shiftKey,k=evt.keyCode;k=k||_203[evt.keyIdentifier]||0;if(evt.keyIdentifier=="Enter"){c=0;}else{if((evt.ctrlKey)&&(c>0)&&(c<27)){c+=96;}else{if(c==dojo.keys.SHIFT_TAB){c=dojo.keys.TAB;s=true;}else{c=(c>=32&&c<63232?c:0);}}}return del._synthesizeEvent(evt,{charCode:c,shiftKey:s,keyCode:k});}return evt;}});dojo.mixin(dojo.keys,{SHIFT_TAB:25,UP_ARROW:63232,DOWN_ARROW:63233,LEFT_ARROW:63234,RIGHT_ARROW:63235,F1:63236,F2:63237,F3:63238,F4:63239,F5:63240,F6:63241,F7:63242,F8:63243,F9:63244,F10:63245,F11:63246,F12:63247,PAUSE:63250,DELETE:63272,HOME:63273,END:63275,PAGE_UP:63276,PAGE_DOWN:63277,INSERT:63302,PRINT_SCREEN:63248,SCROLL_LOCK:63249,NUM_LOCK:63289});var dk=dojo.keys,_203={"Up":dk.UP_ARROW,"Down":dk.DOWN_ARROW,"Left":dk.LEFT_ARROW,"Right":dk.RIGHT_ARROW,"PageUp":dk.PAGE_UP,"PageDown":dk.PAGE_DOWN};}})();if(dojo.isIE){dojo._ieDispatcher=function(args,_206){var ap=Array.prototype,h=dojo._ie_listener.handlers,c=args.callee,ls=c._listeners,t=h[c.target];var r=t&&t.apply(_206,args);for(var i in ls){if(!(i in ap)){h[ls[i]].apply(_206,args);}}return r;};dojo._getIeDispatcher=function(){return new Function(dojo._scopeName+"._ieDispatcher(arguments, this)");};dojo._event_listener._fixCallback=function(fp){var f=dojo._event_listener._fixEvent;return function(e){return fp.call(this,f(e,this));};};}}if(!dojo._hasResource["dojo._base.html"]){dojo._hasResource["dojo._base.html"]=true;dojo.provide("dojo._base.html");try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}if(dojo.isIE||dojo.isOpera){dojo.byId=function(id,doc){if(dojo.isString(id)){var _d=doc||dojo.doc;var te=_d.getElementById(id);if(te&&te.attributes.id.value==id){return te;}else{var eles=_d.all[id];if(!eles||!eles.length){return eles;}var i=0;while((te=eles[i++])){if(te.attributes.id.value==id){return te;}}}}else{return id;}};}else{dojo.byId=function(id,doc){return dojo.isString(id)?(doc||dojo.doc).getElementById(id):id;};}(function(){var d=dojo;var _21a=null;dojo.addOnUnload(function(){_21a=null;});dojo._destroyElement=function(node){node=d.byId(node);try{if(!_21a){_21a=document.createElement("div");}_21a.appendChild(node.parentNode?node.parentNode.removeChild(node):node);_21a.innerHTML="";}catch(e){}};dojo.isDescendant=function(node,_21d){try{node=d.byId(node);_21d=d.byId(_21d);while(node){if(node===_21d){return true;}node=node.parentNode;}}catch(e){}return false;};dojo.setSelectable=function(node,_21f){node=d.byId(node);if(d.isMozilla){node.style.MozUserSelect=_21f?"":"none";}else{if(d.isKhtml){node.style.KhtmlUserSelect=_21f?"auto":"none";}else{if(d.isIE){node.unselectable=_21f?"":"on";d.query("*",node).forEach(function(_220){_220.unselectable=_21f?"":"on";});}}}};var _221=function(node,ref){ref.parentNode.insertBefore(node,ref);return true;};var _224=function(node,ref){var pn=ref.parentNode;if(ref==pn.lastChild){pn.appendChild(node);}else{return _221(node,ref.nextSibling);}return true;};dojo.place=function(node,_229,_22a){if(!node||!_229||_22a===undefined){return false;}node=d.byId(node);_229=d.byId(_229);if(typeof _22a=="number"){var cn=_229.childNodes;if((_22a==0&&cn.length==0)||cn.length==_22a){_229.appendChild(node);return true;}if(_22a==0){return _221(node,_229.firstChild);}return _224(node,cn[_22a-1]);}switch(_22a.toLowerCase()){case "before":return _221(node,_229);case "after":return _224(node,_229);case "first":if(_229.firstChild){return _221(node,_229.firstChild);}default:_229.appendChild(node);return true;}};dojo.boxModel="content-box";if(d.isIE){var _dcm=document.compatMode;d.boxModel=_dcm=="BackCompat"||_dcm=="QuirksMode"||d.isIE<6?"border-box":"content-box";}var gcs,dv=document.defaultView;if(d.isSafari){gcs=function(node){var s=dv.getComputedStyle(node,null);if(!s&&node.style){node.style.display="";s=dv.getComputedStyle(node,null);}return s||{};};}else{if(d.isIE){gcs=function(node){return node.currentStyle;};}else{gcs=function(node){return dv.getComputedStyle(node,null);};}}dojo.getComputedStyle=gcs;if(!d.isIE){dojo._toPixelValue=function(_233,_234){return parseFloat(_234)||0;};}else{dojo._toPixelValue=function(_235,_236){if(!_236){return 0;}if(_236=="medium"){return 4;}if(_236.slice&&(_236.slice(-2)=="px")){return parseFloat(_236);}with(_235){var _237=style.left;var _238=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=_236;_236=style.pixelLeft;}catch(e){_236=0;}style.left=_237;runtimeStyle.left=_238;}return _236;};}var px=d._toPixelValue;dojo._getOpacity=d.isIE?function(node){try{return node.filters.alpha.opacity/100;}catch(e){return 1;}}:function(node){return gcs(node).opacity;};dojo._setOpacity=d.isIE?function(node,_23d){if(_23d==1){var _23e=/FILTER:[^;]*;?/i;node.style.cssText=node.style.cssText.replace(_23e,"");if(node.nodeName.toLowerCase()=="tr"){d.query("> td",node).forEach(function(i){i.style.cssText=i.style.cssText.replace(_23e,"");});}}else{var o="Alpha(Opacity="+_23d*100+")";node.style.filter=o;}if(node.nodeName.toLowerCase()=="tr"){d.query("> td",node).forEach(function(i){i.style.filter=o;});}return _23d;}:function(node,_243){return node.style.opacity=_243;};var _244={left:true,top:true};var _245=/margin|padding|width|height|max|min|offset/;var _246=function(node,type,_249){type=type.toLowerCase();if(d.isIE&&_249=="auto"){if(type=="height"){return node.offsetHeight;}if(type=="width"){return node.offsetWidth;}}if(!(type in _244)){_244[type]=_245.test(type);}return _244[type]?px(node,_249):_249;};var _24a=d.isIE?"styleFloat":"cssFloat";var _24b={"cssFloat":_24a,"styleFloat":_24a,"float":_24a};dojo.style=function(node,_24d,_24e){var n=d.byId(node),args=arguments.length,op=(_24d=="opacity");_24d=_24b[_24d]||_24d;if(args==3){return op?d._setOpacity(n,_24e):n.style[_24d]=_24e;}if(args==2&&op){return d._getOpacity(n);}var s=gcs(n);if(args==2&&!d.isString(_24d)){for(var x in _24d){d.style(node,x,_24d[x]);}return s;}return (args==1)?s:_246(n,_24d,s[_24d]);};dojo._getPadExtents=function(n,_255){var s=_255||gcs(n),l=px(n,s.paddingLeft),t=px(n,s.paddingTop);return {l:l,t:t,w:l+px(n,s.paddingRight),h:t+px(n,s.paddingBottom)};};dojo._getBorderExtents=function(n,_25a){var ne="none",s=_25a||gcs(n),bl=(s.borderLeftStyle!=ne?px(n,s.borderLeftWidth):0),bt=(s.borderTopStyle!=ne?px(n,s.borderTopWidth):0);return {l:bl,t:bt,w:bl+(s.borderRightStyle!=ne?px(n,s.borderRightWidth):0),h:bt+(s.borderBottomStyle!=ne?px(n,s.borderBottomWidth):0)};};dojo._getPadBorderExtents=function(n,_260){var s=_260||gcs(n),p=d._getPadExtents(n,s),b=d._getBorderExtents(n,s);return {l:p.l+b.l,t:p.t+b.t,w:p.w+b.w,h:p.h+b.h};};dojo._getMarginExtents=function(n,_265){var s=_265||gcs(n),l=px(n,s.marginLeft),t=px(n,s.marginTop),r=px(n,s.marginRight),b=px(n,s.marginBottom);if(d.isSafari&&(s.position!="absolute")){r=l;}return {l:l,t:t,w:l+r,h:t+b};};dojo._getMarginBox=function(node,_26c){var s=_26c||gcs(node),me=d._getMarginExtents(node,s);var l=node.offsetLeft-me.l,t=node.offsetTop-me.t;if(d.isMoz){var sl=parseFloat(s.left),st=parseFloat(s.top);if(!isNaN(sl)&&!isNaN(st)){l=sl,t=st;}else{var p=node.parentNode;if(p&&p.style){var pcs=gcs(p);if(pcs.overflow!="visible"){var be=d._getBorderExtents(p,pcs);l+=be.l,t+=be.t;}}}}else{if(d.isOpera){var p=node.parentNode;if(p){var be=d._getBorderExtents(p);l-=be.l,t-=be.t;}}}return {l:l,t:t,w:node.offsetWidth+me.w,h:node.offsetHeight+me.h};};dojo._getContentBox=function(node,_277){var s=_277||gcs(node),pe=d._getPadExtents(node,s),be=d._getBorderExtents(node,s),w=node.clientWidth,h;if(!w){w=node.offsetWidth,h=node.offsetHeight;}else{h=node.clientHeight,be.w=be.h=0;}if(d.isOpera){pe.l+=be.l;pe.t+=be.t;}return {l:pe.l,t:pe.t,w:w-pe.w-be.w,h:h-pe.h-be.h};};dojo._getBorderBox=function(node,_27e){var s=_27e||gcs(node),pe=d._getPadExtents(node,s),cb=d._getContentBox(node,s);return {l:cb.l-pe.l,t:cb.t-pe.t,w:cb.w+pe.w,h:cb.h+pe.h};};dojo._setBox=function(node,l,t,w,h,u){u=u||"px";var s=node.style;if(!isNaN(l)){s.left=l+u;}if(!isNaN(t)){s.top=t+u;}if(w>=0){s.width=w+u;}if(h>=0){s.height=h+u;}};dojo._usesBorderBox=function(node){var n=node.tagName;return d.boxModel=="border-box"||n=="TABLE"||n=="BUTTON";};dojo._setContentSize=function(node,_28c,_28d,_28e){if(d._usesBorderBox(node)){var pb=d._getPadBorderExtents(node,_28e);if(_28c>=0){_28c+=pb.w;}if(_28d>=0){_28d+=pb.h;}}d._setBox(node,NaN,NaN,_28c,_28d);};dojo._setMarginBox=function(node,_291,_292,_293,_294,_295){var s=_295||gcs(node);var bb=d._usesBorderBox(node),pb=bb?_299:d._getPadBorderExtents(node,s),mb=d._getMarginExtents(node,s);if(_293>=0){_293=Math.max(_293-pb.w-mb.w,0);}if(_294>=0){_294=Math.max(_294-pb.h-mb.h,0);}d._setBox(node,_291,_292,_293,_294);};var _299={l:0,t:0,w:0,h:0};dojo.marginBox=function(node,box){var n=d.byId(node),s=gcs(n),b=box;return !b?d._getMarginBox(n,s):d._setMarginBox(n,b.l,b.t,b.w,b.h,s);};dojo.contentBox=function(node,box){var n=dojo.byId(node),s=gcs(n),b=box;return !b?d._getContentBox(n,s):d._setContentSize(n,b.w,b.h,s);};var _2a5=function(node,prop){if(!(node=(node||0).parentNode)){return 0;}var val,_2a9=0,_b=d.body();while(node&&node.style){if(gcs(node).position=="fixed"){return 0;}val=node[prop];if(val){_2a9+=val-0;if(node==_b){break;}}node=node.parentNode;}return _2a9;};dojo._docScroll=function(){var _b=d.body(),_w=d.global,de=d.doc.documentElement;return {y:(_w.pageYOffset||de.scrollTop||_b.scrollTop||0),x:(_w.pageXOffset||d._fixIeBiDiScrollLeft(de.scrollLeft)||_b.scrollLeft||0)};};dojo._isBodyLtr=function(){return !("_bodyLtr" in d)?d._bodyLtr=gcs(d.body()).direction=="ltr":d._bodyLtr;};dojo._getIeDocumentElementOffset=function(){var de=d.doc.documentElement;return (d.isIE>=7)?{x:de.getBoundingClientRect().left,y:de.getBoundingClientRect().top}:{x:d._isBodyLtr()||window.parent==window?de.clientLeft:de.offsetWidth-de.clientWidth-de.clientLeft,y:de.clientTop};};dojo._fixIeBiDiScrollLeft=function(_2af){var dd=d.doc;if(d.isIE&&!dojo._isBodyLtr()){var de=dd.compatMode=="BackCompat"?dd.body:dd.documentElement;return _2af+de.clientWidth-de.scrollWidth;}return _2af;};dojo._abs=function(node,_2b3){var _2b4=node.ownerDocument;var ret={x:0,y:0};var db=d.body();if(d.isIE||(d.isFF>=3)){var _2b7=node.getBoundingClientRect();var _2b8=(d.isIE)?d._getIeDocumentElementOffset():{x:0,y:0};ret.x=_2b7.left-_2b8.x;ret.y=_2b7.top-_2b8.y;}else{if(_2b4["getBoxObjectFor"]){var bo=_2b4.getBoxObjectFor(node),b=d._getBorderExtents(node);ret.x=bo.x-b.l-_2a5(node,"scrollLeft");ret.y=bo.y-b.t-_2a5(node,"scrollTop");}else{if(node["offsetParent"]){var _2bb;if(d.isSafari&&(gcs(node).position=="absolute")&&(node.parentNode==db)){_2bb=db;}else{_2bb=db.parentNode;}if(node.parentNode!=db){var nd=node;if(d.isOpera){nd=db;}ret.x-=_2a5(nd,"scrollLeft");ret.y-=_2a5(nd,"scrollTop");}var _2bd=node;do{var n=_2bd.offsetLeft;if(!d.isOpera||n>0){ret.x+=isNaN(n)?0:n;}var t=_2bd.offsetTop;ret.y+=isNaN(t)?0:t;if(d.isSafari&&_2bd!=node){var cs=gcs(_2bd);ret.x+=px(_2bd,cs.borderLeftWidth);ret.y+=px(_2bd,cs.borderTopWidth);}_2bd=_2bd.offsetParent;}while((_2bd!=_2bb)&&_2bd);}else{if(node.x&&node.y){ret.x+=isNaN(node.x)?0:node.x;ret.y+=isNaN(node.y)?0:node.y;}}}}if(_2b3){var _2c1=d._docScroll();ret.y+=_2c1.y;ret.x+=_2c1.x;}return ret;};dojo.coords=function(node,_2c3){var n=d.byId(node),s=gcs(n),mb=d._getMarginBox(n,s);var abs=d._abs(n,_2c3);mb.x=abs.x;mb.y=abs.y;return mb;};var _2c8=function(name){switch(name.toLowerCase()){case "tabindex":return (d.isIE&&d.isIE<8)?"tabIndex":"tabindex";default:return name;}};var _2ca={colspan:"colSpan",enctype:"enctype",frameborder:"frameborder",method:"method",rowspan:"rowSpan",scrolling:"scrolling",shape:"shape",span:"span",type:"type",valuetype:"valueType"};dojo.hasAttr=function(node,name){var attr=d.byId(node).getAttributeNode(_2c8(name));return attr?attr.specified:false;};var _2ce={};var _ctr=0;var _2d0=dojo._scopeName+"attrid";dojo.attr=function(node,name,_2d3){var args=arguments.length;if(args==2&&!d.isString(name)){for(var x in name){d.attr(node,x,name[x]);}return;}node=d.byId(node);name=_2c8(name);if(args==3){if(d.isFunction(_2d3)){var _2d6=d.attr(node,_2d0);if(!_2d6){_2d6=_ctr++;d.attr(node,_2d0,_2d6);}if(!_2ce[_2d6]){_2ce[_2d6]={};}var h=_2ce[_2d6][name];if(h){d.disconnect(h);}else{try{delete node[name];}catch(e){}}_2ce[_2d6][name]=d.connect(node,name,_2d3);}else{if(typeof _2d3=="boolean"){node[name]=_2d3;}else{node.setAttribute(name,_2d3);}}return;}else{var prop=_2ca[name.toLowerCase()];if(prop){return node[prop];}else{var _2d3=node[name];return (typeof _2d3=="boolean"||typeof _2d3=="function")?_2d3:(d.hasAttr(node,name)?node.getAttribute(name):null);}}};dojo.removeAttr=function(node,name){d.byId(node).removeAttribute(_2c8(name));};})();dojo.hasClass=function(node,_2dc){return ((" "+dojo.byId(node).className+" ").indexOf(" "+_2dc+" ")>=0);};dojo.addClass=function(node,_2de){node=dojo.byId(node);var cls=node.className;if((" "+cls+" ").indexOf(" "+_2de+" ")<0){node.className=cls+(cls?" ":"")+_2de;}};dojo.removeClass=function(node,_2e1){node=dojo.byId(node);var t=dojo.trim((" "+node.className+" ").replace(" "+_2e1+" "," "));if(node.className!=t){node.className=t;}};dojo.toggleClass=function(node,_2e4,_2e5){if(_2e5===undefined){_2e5=!dojo.hasClass(node,_2e4);}dojo[_2e5?"addClass":"removeClass"](node,_2e4);};}if(!dojo._hasResource["dojo._base.NodeList"]){dojo._hasResource["dojo._base.NodeList"]=true;dojo.provide("dojo._base.NodeList");(function(){var d=dojo;var tnl=function(arr){arr.constructor=dojo.NodeList;dojo._mixin(arr,dojo.NodeList.prototype);return arr;};var _2e9=function(func,_2eb){return function(){var _a=arguments;var aa=d._toArray(_a,0,[null]);var s=this.map(function(i){aa[0]=i;return d[func].apply(d,aa);});return (_2eb||((_a.length>1)||!d.isString(_a[0])))?this:s;};};dojo.NodeList=function(){return tnl(Array.apply(null,arguments));};dojo.NodeList._wrap=tnl;dojo.extend(dojo.NodeList,{slice:function(){var a=dojo._toArray(arguments);return tnl(a.slice.apply(this,a));},splice:function(){var a=dojo._toArray(arguments);return tnl(a.splice.apply(this,a));},concat:function(){var a=dojo._toArray(arguments,0,[this]);return tnl(a.concat.apply([],a));},indexOf:function(_2f3,_2f4){return d.indexOf(this,_2f3,_2f4);},lastIndexOf:function(){return d.lastIndexOf.apply(d,d._toArray(arguments,0,[this]));},every:function(_2f5,_2f6){return d.every(this,_2f5,_2f6);},some:function(_2f7,_2f8){return d.some(this,_2f7,_2f8);},map:function(func,obj){return d.map(this,func,obj,d.NodeList);},forEach:function(_2fb,_2fc){d.forEach(this,_2fb,_2fc);return this;},coords:function(){return d.map(this,d.coords);},attr:_2e9("attr"),style:_2e9("style"),addClass:_2e9("addClass",true),removeClass:_2e9("removeClass",true),toggleClass:_2e9("toggleClass",true),connect:_2e9("connect",true),place:function(_2fd,_2fe){var item=d.query(_2fd)[0];return this.forEach(function(i){d.place(i,item,(_2fe||"last"));});},orphan:function(_301){var _302=_301?d._filterQueryResult(this,_301):this;_302.forEach(function(item){if(item.parentNode){item.parentNode.removeChild(item);}});return _302;},adopt:function(_304,_305){var item=this[0];return d.query(_304).forEach(function(ai){d.place(ai,item,_305||"last");});},query:function(_308){if(!_308){return this;}var ret=d.NodeList();this.forEach(function(item){d.query(_308,item).forEach(function(_30b){if(_30b!==undefined){ret.push(_30b);}});});return ret;},filter:function(_30c){var _30d=this;var _a=arguments;var r=d.NodeList();var rp=function(t){if(t!==undefined){r.push(t);}};if(d.isString(_30c)){_30d=d._filterQueryResult(this,_a[0]);if(_a.length==1){return _30d;}_a.shift();}d.forEach(d.filter(_30d,_a[0],_a[1]),rp);return r;},addContent:function(_312,_313){var ta=d.doc.createElement("span");if(d.isString(_312)){ta.innerHTML=_312;}else{ta.appendChild(_312);}if(_313===undefined){_313="last";}var ct=(_313=="first"||_313=="after")?"lastChild":"firstChild";this.forEach(function(item){var tn=ta.cloneNode(true);while(tn[ct]){d.place(tn[ct],item,_313);}});return this;},empty:function(){return this.forEach("item.innerHTML='';");},instantiate:function(_318,_319){var c=d.isFunction(_318)?_318:d.getObject(_318);return this.forEach(function(i){new c(_319||{},i);});}});d.forEach(["blur","focus","click","keydown","keypress","keyup","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup"],function(evt){var _oe="on"+evt;dojo.NodeList.prototype[_oe]=function(a,b){return this.connect(_oe,a,b);};});})();}if(!dojo._hasResource["dojo._base.query"]){dojo._hasResource["dojo._base.query"]=true;dojo.provide("dojo._base.query");(function(){var d=dojo;var _321=dojo.isIE?"children":"childNodes";var _322=false;var _323=function(_324){if(">~+".indexOf(_324.charAt(_324.length-1))>=0){_324+=" *";}_324+=" ";var ts=function(s,e){return d.trim(_324.slice(s,e));};var _328=[];var _329=-1;var _32a=-1;var _32b=-1;var _32c=-1;var _32d=-1;var inId=-1;var _32f=-1;var lc="";var cc="";var _332;var x=0;var ql=_324.length;var _335=null;var _cp=null;var _337=function(){if(_32f>=0){var tv=(_32f==x)?null:ts(_32f,x).toLowerCase();_335[(">~+".indexOf(tv)<0)?"tag":"oper"]=tv;_32f=-1;}};var _339=function(){if(inId>=0){_335.id=ts(inId,x).replace(/\\/g,"");inId=-1;}};var _33a=function(){if(_32d>=0){_335.classes.push(ts(_32d+1,x).replace(/\\/g,""));_32d=-1;}};var _33b=function(){_339();_337();_33a();};for(;lc=cc,cc=_324.charAt(x),x<ql;x++){if(lc=="\\"){continue;}if(!_335){_332=x;_335={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null};_32f=x;}if(_329>=0){if(cc=="]"){if(!_cp.attr){_cp.attr=ts(_329+1,x);}else{_cp.matchFor=ts((_32b||_329+1),x);}var cmf=_cp.matchFor;if(cmf){if((cmf.charAt(0)=="\"")||(cmf.charAt(0)=="'")){_cp.matchFor=cmf.substring(1,cmf.length-1);}}_335.attrs.push(_cp);_cp=null;_329=_32b=-1;}else{if(cc=="="){var _33d=("|~^$*".indexOf(lc)>=0)?lc:"";_cp.type=_33d+cc;_cp.attr=ts(_329+1,x-_33d.length);_32b=x+1;}}}else{if(_32a>=0){if(cc==")"){if(_32c>=0){_cp.value=ts(_32a+1,x);}_32c=_32a=-1;}}else{if(cc=="#"){_33b();inId=x+1;}else{if(cc=="."){_33b();_32d=x;}else{if(cc==":"){_33b();_32c=x;}else{if(cc=="["){_33b();_329=x;_cp={};}else{if(cc=="("){if(_32c>=0){_cp={name:ts(_32c+1,x),value:null};_335.pseudos.push(_cp);}_32a=x;}else{if(cc==" "&&lc!=cc){_33b();if(_32c>=0){_335.pseudos.push({name:ts(_32c+1,x)});}_335.hasLoops=(_335.pseudos.length||_335.attrs.length||_335.classes.length);_335.query=ts(_332,x);_335.tag=(_335["oper"])?null:(_335.tag||"*");_328.push(_335);_335=null;}}}}}}}}}return _328;};var _33e={"*=":function(attr,_340){return "[contains(@"+attr+", '"+_340+"')]";},"^=":function(attr,_342){return "[starts-with(@"+attr+", '"+_342+"')]";},"$=":function(attr,_344){return "[substring(@"+attr+", string-length(@"+attr+")-"+(_344.length-1)+")='"+_344+"']";},"~=":function(attr,_346){return "[contains(concat(' ',@"+attr+",' '), ' "+_346+" ')]";},"|=":function(attr,_348){return "[contains(concat(' ',@"+attr+",' '), ' "+_348+"-')]";},"=":function(attr,_34a){return "[@"+attr+"='"+_34a+"']";}};var _34b=function(_34c,_34d,_34e,_34f){d.forEach(_34d.attrs,function(attr){var _351;if(attr.type&&_34c[attr.type]){_351=_34c[attr.type](attr.attr,attr.matchFor);}else{if(attr.attr.length){_351=_34e(attr.attr);}}if(_351){_34f(_351);}});};var _352=function(_353){var _354=".";var _355=_323(d.trim(_353));while(_355.length){var tqp=_355.shift();var _357;var _358="";if(tqp.oper==">"){_357="/";tqp=_355.shift();}else{if(tqp.oper=="~"){_357="/following-sibling::";tqp=_355.shift();}else{if(tqp.oper=="+"){_357="/following-sibling::";_358="[position()=1]";tqp=_355.shift();}else{_357="//";}}}_354+=_357+tqp.tag+_358;if(tqp.id){_354+="[@id='"+tqp.id+"'][1]";}d.forEach(tqp.classes,function(cn){var cnl=cn.length;var _35b=" ";if(cn.charAt(cnl-1)=="*"){_35b="";cn=cn.substr(0,cnl-1);}_354+="[contains(concat(' ',@class,' '), ' "+cn+_35b+"')]";});_34b(_33e,tqp,function(_35c){return "[@"+_35c+"]";},function(_35d){_354+=_35d;});}return _354;};var _35e={};var _35f=function(path){if(_35e[path]){return _35e[path];}var doc=d.doc;var _362=_352(path);var tf=function(_364){var ret=[];var _366;try{_366=doc.evaluate(_362,_364,null,XPathResult.ANY_TYPE,null);}catch(e){console.debug("failure in exprssion:",_362,"under:",_364);console.debug(e);}var _367=_366.iterateNext();while(_367){ret.push(_367);_367=_366.iterateNext();}return ret;};return _35e[path]=tf;};var _368={};var _369={};var _36a=function(_36b,_36c){if(!_36b){return _36c;}if(!_36c){return _36b;}return function(){return _36b.apply(window,arguments)&&_36c.apply(window,arguments);};};var _36d=function(root){var ret=[];var te,x=0,tret=root[_321];while(te=tret[x++]){if(te.nodeType==1){ret.push(te);}}return ret;};var _373=function(root,_375){var ret=[];var te=root;while(te=te.nextSibling){if(te.nodeType==1){ret.push(te);if(_375){break;}}}return ret;};var _378=function(_379,_37a,_37b,idx){var nidx=idx+1;var _37e=(_37a.length==nidx);var tqp=_37a[idx];if(tqp.oper){var ecn=(tqp.oper==">")?_36d(_379):_373(_379,(tqp.oper=="+"));if(!ecn||!ecn.length){return;}nidx++;_37e=(_37a.length==nidx);var tf=_382(_37a[idx+1]);for(var x=0,ecnl=ecn.length,te;x<ecnl,te=ecn[x];x++){if(tf(te)){if(_37e){_37b.push(te);}else{_378(te,_37a,_37b,nidx);}}}}var _386=_387(tqp)(_379);if(_37e){while(_386.length){_37b.push(_386.shift());}}else{while(_386.length){_378(_386.shift(),_37a,_37b,nidx);}}};var _388=function(_389,_38a){var ret=[];var x=_389.length-1,te;while(te=_389[x--]){_378(te,_38a,ret,0);}return ret;};var _382=function(q){if(_368[q.query]){return _368[q.query];}var ff=null;if(q.tag){if(q.tag=="*"){ff=_36a(ff,function(elem){return (elem.nodeType==1);});}else{ff=_36a(ff,function(elem){return ((elem.nodeType==1)&&(q.tag==elem.tagName.toLowerCase()));});}}if(q.id){ff=_36a(ff,function(elem){return ((elem.nodeType==1)&&(elem.id==q.id));});}if(q.hasLoops){ff=_36a(ff,_393(q));}return _368[q.query]=ff;};var _394=function(node){var pn=node.parentNode;var pnc=pn.childNodes;var nidx=-1;var _399=pn.firstChild;if(!_399){return nidx;}var ci=node["__cachedIndex"];var cl=pn["__cachedLength"];if(((typeof cl=="number")&&(cl!=pnc.length))||(typeof ci!="number")){pn["__cachedLength"]=pnc.length;var idx=1;do{if(_399===node){nidx=idx;}if(_399.nodeType==1){_399["__cachedIndex"]=idx;idx++;}_399=_399.nextSibling;}while(_399);}else{nidx=ci;}return nidx;};var _39d=0;var _39e="";var _39f=function(elem,attr){if(attr=="class"){return elem.className||_39e;}if(attr=="for"){return elem.htmlFor||_39e;}return elem.getAttribute(attr,2)||_39e;};var _3a2={"*=":function(attr,_3a4){return function(elem){return (_39f(elem,attr).indexOf(_3a4)>=0);};},"^=":function(attr,_3a7){return function(elem){return (_39f(elem,attr).indexOf(_3a7)==0);};},"$=":function(attr,_3aa){var tval=" "+_3aa;return function(elem){var ea=" "+_39f(elem,attr);return (ea.lastIndexOf(_3aa)==(ea.length-_3aa.length));};},"~=":function(attr,_3af){var tval=" "+_3af+" ";return function(elem){var ea=" "+_39f(elem,attr)+" ";return (ea.indexOf(tval)>=0);};},"|=":function(attr,_3b4){var _3b5=" "+_3b4+"-";return function(elem){var ea=" "+(elem.getAttribute(attr,2)||"");return ((ea==_3b4)||(ea.indexOf(_3b5)==0));};},"=":function(attr,_3b9){return function(elem){return (_39f(elem,attr)==_3b9);};}};var _3bb={"first-child":function(name,_3bd){return function(elem){if(elem.nodeType!=1){return false;}var fc=elem.previousSibling;while(fc&&(fc.nodeType!=1)){fc=fc.previousSibling;}return (!fc);};},"last-child":function(name,_3c1){return function(elem){if(elem.nodeType!=1){return false;}var nc=elem.nextSibling;while(nc&&(nc.nodeType!=1)){nc=nc.nextSibling;}return (!nc);};},"empty":function(name,_3c5){return function(elem){var cn=elem.childNodes;var cnl=elem.childNodes.length;for(var x=cnl-1;x>=0;x--){var nt=cn[x].nodeType;if((nt==1)||(nt==3)){return false;}}return true;};},"contains":function(name,_3cc){return function(elem){return (elem.innerHTML.indexOf(_3cc)>=0);};},"not":function(name,_3cf){var ntf=_382(_323(_3cf)[0]);return function(elem){return (!ntf(elem));};},"nth-child":function(name,_3d3){var pi=parseInt;if(_3d3=="odd"){return function(elem){return (((_394(elem))%2)==1);};}else{if((_3d3=="2n")||(_3d3=="even")){return function(elem){return ((_394(elem)%2)==0);};}else{if(_3d3.indexOf("0n+")==0){var _3d7=pi(_3d3.substr(3));return function(elem){return (elem.parentNode[_321][_3d7-1]===elem);};}else{if((_3d3.indexOf("n+")>0)&&(_3d3.length>3)){var _3d9=_3d3.split("n+",2);var pred=pi(_3d9[0]);var idx=pi(_3d9[1]);return function(elem){return ((_394(elem)%pred)==idx);};}else{if(_3d3.indexOf("n")==-1){var _3d7=pi(_3d3);return function(elem){return (_394(elem)==_3d7);};}}}}}}};var _3de=(d.isIE)?function(cond){var clc=cond.toLowerCase();return function(elem){return elem[cond]||elem[clc];};}:function(cond){return function(elem){return (elem&&elem.getAttribute&&elem.hasAttribute(cond));};};var _393=function(_3e4){var _3e5=(_369[_3e4.query]||_368[_3e4.query]);if(_3e5){return _3e5;}var ff=null;if(_3e4.id){if(_3e4.tag!="*"){ff=_36a(ff,function(elem){return (elem.tagName.toLowerCase()==_3e4.tag);});}}d.forEach(_3e4.classes,function(_3e8,idx,arr){var _3eb=_3e8.charAt(_3e8.length-1)=="*";if(_3eb){_3e8=_3e8.substr(0,_3e8.length-1);}var re=new RegExp("(?:^|\\s)"+_3e8+(_3eb?".*":"")+"(?:\\s|$)");ff=_36a(ff,function(elem){return re.test(elem.className);});ff.count=idx;});d.forEach(_3e4.pseudos,function(_3ee){if(_3bb[_3ee.name]){ff=_36a(ff,_3bb[_3ee.name](_3ee.name,_3ee.value));}});_34b(_3a2,_3e4,_3de,function(_3ef){ff=_36a(ff,_3ef);});if(!ff){ff=function(){return true;};}return _369[_3e4.query]=ff;};var _3f0={};var _387=function(_3f1,root){var fHit=_3f0[_3f1.query];if(fHit){return fHit;}if(_3f1.id&&!_3f1.hasLoops&&!_3f1.tag){return _3f0[_3f1.query]=function(root){return [d.byId(_3f1.id)];};}var _3f5=_393(_3f1);var _3f6;if(_3f1.tag&&_3f1.id&&!_3f1.hasLoops){_3f6=function(root){var te=d.byId(_3f1.id);if(_3f5(te)){return [te];}};}else{var tret;if(!_3f1.hasLoops){_3f6=function(root){var ret=[];var te,x=0,tret=root.getElementsByTagName(_3f1.tag);while(te=tret[x++]){ret.push(te);}return ret;};}else{_3f6=function(root){var ret=[];var te,x=0,tret=root.getElementsByTagName(_3f1.tag);while(te=tret[x++]){if(_3f5(te)){ret.push(te);}}return ret;};}}return _3f0[_3f1.query]=_3f6;};var _402={};var _403={"*":d.isIE?function(root){return root.all;}:function(root){return root.getElementsByTagName("*");},"~":_373,"+":function(root){return _373(root,true);},">":_36d};var _407=function(_408){var _409=_323(d.trim(_408));if(_409.length==1){var tt=_387(_409[0]);tt.nozip=true;return tt;}var sqf=function(root){var _40d=_409.slice(0);var _40e;if(_40d[0].oper==">"){_40e=[root];}else{_40e=_387(_40d.shift())(root);}return _388(_40e,_40d);};return sqf;};var _40f=((document["evaluate"]&&!d.isSafari)?function(_410){var _411=_410.split(" ");if((document["evaluate"])&&(_410.indexOf(":")==-1)&&(_410.indexOf("+")==-1)){if(((_411.length>2)&&(_410.indexOf(">")==-1))||(_411.length>3)||(_410.indexOf("[")>=0)||((1==_411.length)&&(0<=_410.indexOf(".")))){return _35f(_410);}}return _407(_410);}:_407);var _412=function(_413){var qcz=_413.charAt(0);if(d.doc["querySelectorAll"]&&((!d.isSafari)||(d.isSafari>3.1))&&(">+~".indexOf(qcz)==-1)){return function(root){var r=root.querySelectorAll(_413);r.nozip=true;return r;};}if(_403[_413]){return _403[_413];}if(0>_413.indexOf(",")){return _403[_413]=_40f(_413);}else{var _417=_413.split(/\s*,\s*/);var tf=function(root){var _41a=0;var ret=[];var tp;while(tp=_417[_41a++]){ret=ret.concat(_40f(tp,tp.indexOf(" "))(root));}return ret;};return _403[_413]=tf;}};var _41d=0;var _zip=function(arr){if(arr&&arr.nozip){return d.NodeList._wrap(arr);}var ret=new d.NodeList();if(!arr){return ret;}if(arr[0]){ret.push(arr[0]);}if(arr.length<2){return ret;}_41d++;arr[0]["_zipIdx"]=_41d;for(var x=1,te;te=arr[x];x++){if(arr[x]["_zipIdx"]!=_41d){ret.push(te);}te["_zipIdx"]=_41d;}return ret;};d.query=function(_423,root){if(_423.constructor==d.NodeList){return _423;}if(!d.isString(_423)){return new d.NodeList(_423);}if(d.isString(root)){root=d.byId(root);}return _zip(_412(_423)(root||d.doc));};d.query.pseudos=_3bb;d._filterQueryResult=function(_425,_426){var tnl=new d.NodeList();var ff=(_426)?_382(_323(_426)[0]):function(){return true;};for(var x=0,te;te=_425[x];x++){if(ff(te)){tnl.push(te);}}return tnl;};})();}if(!dojo._hasResource["dojo._base.xhr"]){dojo._hasResource["dojo._base.xhr"]=true;dojo.provide("dojo._base.xhr");(function(){var _d=dojo;function setValue(obj,name,_42e){var val=obj[name];if(_d.isString(val)){obj[name]=[val,_42e];}else{if(_d.isArray(val)){val.push(_42e);}else{obj[name]=_42e;}}};dojo.formToObject=function(_430){var ret={};var iq="input:not([type=file]):not([type=submit]):not([type=image]):not([type=reset]):not([type=button]), select, textarea";_d.query(iq,_430).filter(function(node){return !node.disabled&&node.name;}).forEach(function(item){var _in=item.name;var type=(item.type||"").toLowerCase();if(type=="radio"||type=="checkbox"){if(item.checked){setValue(ret,_in,item.value);}}else{if(item.multiple){ret[_in]=[];_d.query("option",item).forEach(function(opt){if(opt.selected){setValue(ret,_in,opt.value);}});}else{setValue(ret,_in,item.value);if(type=="image"){ret[_in+".x"]=ret[_in+".y"]=ret[_in].x=ret[_in].y=0;}}}});return ret;};dojo.objectToQuery=function(map){var enc=encodeURIComponent;var _43a=[];var _43b={};for(var name in map){var _43d=map[name];if(_43d!=_43b[name]){var _43e=enc(name)+"=";if(_d.isArray(_43d)){for(var i=0;i<_43d.length;i++){_43a.push(_43e+enc(_43d[i]));}}else{_43a.push(_43e+enc(_43d));}}}return _43a.join("&");};dojo.formToQuery=function(_440){return _d.objectToQuery(_d.formToObject(_440));};dojo.formToJson=function(_441,_442){return _d.toJson(_d.formToObject(_441),_442);};dojo.queryToObject=function(str){var ret={};var qp=str.split("&");var dec=decodeURIComponent;_d.forEach(qp,function(item){if(item.length){var _448=item.split("=");var name=dec(_448.shift());var val=dec(_448.join("="));if(_d.isString(ret[name])){ret[name]=[ret[name]];}if(_d.isArray(ret[name])){ret[name].push(val);}else{ret[name]=val;}}});return ret;};dojo._blockAsync=false;dojo._contentHandlers={"text":function(xhr){return xhr.responseText;},"json":function(xhr){if(!dojo.config.usePlainJson){console.warn("Consider using mimetype:text/json-comment-filtered"+" to avoid potential security issues with JSON endpoints"+" (use djConfig.usePlainJson=true to turn off this message)");}return (xhr.status==204)?undefined:_d.fromJson(xhr.responseText);},"json-comment-filtered":function(xhr){var _44e=xhr.responseText;var _44f=_44e.indexOf("/*");var _450=_44e.lastIndexOf("*/");if(_44f==-1||_450==-1){throw new Error("JSON was not comment filtered");}return (xhr.status==204)?undefined:_d.fromJson(_44e.substring(_44f+2,_450));},"javascript":function(xhr){return _d.eval(xhr.responseText);},"xml":function(xhr){var _453=xhr.responseXML;if(_d.isIE&&(!_453||window.location.protocol=="file:")){_d.forEach(["MSXML2","Microsoft","MSXML","MSXML3"],function(_454){try{var dom=new ActiveXObject(_454+".XMLDOM");dom.async=false;dom.loadXML(xhr.responseText);_453=dom;}catch(e){}});}return _453;}};dojo._contentHandlers["json-comment-optional"]=function(xhr){var _457=_d._contentHandlers;try{return _457["json-comment-filtered"](xhr);}catch(e){return _457["json"](xhr);}};dojo._ioSetArgs=function(args,_459,_45a,_45b){var _45c={args:args,url:args.url};var _45d=null;if(args.form){var form=_d.byId(args.form);var _45f=form.getAttributeNode("action");_45c.url=_45c.url||(_45f?_45f.value:null);_45d=_d.formToObject(form);}var _460=[{}];if(_45d){_460.push(_45d);}if(args.content){_460.push(args.content);}if(args.preventCache){_460.push({"dojo.preventCache":new Date().valueOf()});}_45c.query=_d.objectToQuery(_d.mixin.apply(null,_460));_45c.handleAs=args.handleAs||"text";var d=new _d.Deferred(_459);d.addCallbacks(_45a,function(_462){return _45b(_462,d);});var ld=args.load;if(ld&&_d.isFunction(ld)){d.addCallback(function(_464){return ld.call(args,_464,_45c);});}var err=args.error;if(err&&_d.isFunction(err)){d.addErrback(function(_466){return err.call(args,_466,_45c);});}var _467=args.handle;if(_467&&_d.isFunction(_467)){d.addBoth(function(_468){return _467.call(args,_468,_45c);});}d.ioArgs=_45c;return d;};var _469=function(dfd){dfd.canceled=true;var xhr=dfd.ioArgs.xhr;var _at=typeof xhr.abort;if(_at=="function"||_at=="unknown"){xhr.abort();}var err=new Error("xhr cancelled");err.dojoType="cancel";return err;};var _46e=function(dfd){return _d._contentHandlers[dfd.ioArgs.handleAs](dfd.ioArgs.xhr);};var _470=function(_471,dfd){console.debug(_471);return _471;};var _473=function(args){var dfd=_d._ioSetArgs(args,_469,_46e,_470);dfd.ioArgs.xhr=_d._xhrObj(dfd.ioArgs.args);return dfd;};var _476=null;var _477=[];var _478=function(){var now=(new Date()).getTime();if(!_d._blockAsync){for(var i=0,tif;i<_477.length&&(tif=_477[i]);i++){var dfd=tif.dfd;try{if(!dfd||dfd.canceled||!tif.validCheck(dfd)){_477.splice(i--,1);}else{if(tif.ioCheck(dfd)){_477.splice(i--,1);tif.resHandle(dfd);}else{if(dfd.startTime){if(dfd.startTime+(dfd.ioArgs.args.timeout||0)<now){_477.splice(i--,1);var err=new Error("timeout exceeded");err.dojoType="timeout";dfd.errback(err);dfd.cancel();}}}}}catch(e){console.debug(e);dfd.errback(new Error("_watchInFlightError!"));}}}if(!_477.length){clearInterval(_476);_476=null;return;}};dojo._ioCancelAll=function(){try{_d.forEach(_477,function(i){i.dfd.cancel();});}catch(e){}};if(_d.isIE){_d.addOnUnload(_d._ioCancelAll);}_d._ioWatch=function(dfd,_480,_481,_482){if(dfd.ioArgs.args.timeout){dfd.startTime=(new Date()).getTime();}_477.push({dfd:dfd,validCheck:_480,ioCheck:_481,resHandle:_482});if(!_476){_476=setInterval(_478,50);}_478();};var _483="application/x-www-form-urlencoded";var _484=function(dfd){return dfd.ioArgs.xhr.readyState;};var _486=function(dfd){return 4==dfd.ioArgs.xhr.readyState;};var _488=function(dfd){var xhr=dfd.ioArgs.xhr;if(_d._isDocumentOk(xhr)){dfd.callback(dfd);}else{var err=new Error("Unable to load "+dfd.ioArgs.url+" status:"+xhr.status);err.status=xhr.status;err.responseText=xhr.responseText;dfd.errback(err);}};var _48c=function(type,dfd){var _48f=dfd.ioArgs;var args=_48f.args;var xhr=_48f.xhr;xhr.open(type,_48f.url,args.sync!==true,args.user||undefined,args.password||undefined);if(args.headers){for(var hdr in args.headers){if(hdr.toLowerCase()==="content-type"&&!args.contentType){args.contentType=args.headers[hdr];}else{xhr.setRequestHeader(hdr,args.headers[hdr]);}}}xhr.setRequestHeader("Content-Type",args.contentType||_483);if(!args.headers||!args.headers["X-Requested-With"]){xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");}try{xhr.send(_48f.query);}catch(e){dfd.cancel();}_d._ioWatch(dfd,_484,_486,_488);xhr=null;return dfd;};dojo._ioAddQueryToUrl=function(_493){if(_493.query.length){_493.url+=(_493.url.indexOf("?")==-1?"?":"&")+_493.query;_493.query=null;}};dojo.xhr=function(_494,args,_496){var dfd=_473(args);if(!_496){_d._ioAddQueryToUrl(dfd.ioArgs);}return _48c(_494,dfd);};dojo.xhrGet=function(args){return _d.xhr("GET",args);};dojo.xhrPost=function(args){return _d.xhr("POST",args,true);};dojo.rawXhrPost=function(args){var dfd=_473(args);dfd.ioArgs.query=args.postData;return _48c("POST",dfd);};dojo.xhrPut=function(args){return _d.xhr("PUT",args,true);};dojo.rawXhrPut=function(args){var dfd=_473(args);var _49f=dfd.ioArgs;if(args.putData){_49f.query=args.putData;args.putData=null;}return _48c("PUT",dfd);};dojo.xhrDelete=function(args){return _d.xhr("DELETE",args);};})();}if(!dojo._hasResource["dojo._base.fx"]){dojo._hasResource["dojo._base.fx"]=true;dojo.provide("dojo._base.fx");(function(){var d=dojo;dojo._Line=function(_4a2,end){this.start=_4a2;this.end=end;this.getValue=function(n){return ((this.end-this.start)*n)+this.start;};};d.declare("dojo._Animation",null,{constructor:function(args){d.mixin(this,args);if(d.isArray(this.curve)){this.curve=new d._Line(this.curve[0],this.curve[1]);}},duration:350,repeat:0,rate:10,_percent:0,_startRepeatCount:0,_fire:function(evt,args){try{if(this[evt]){this[evt].apply(this,args||[]);}}catch(e){console.error("exception in animation handler for:",evt);console.error(e);}return this;},play:function(_4a8,_4a9){var _t=this;if(_4a9){_t._stopTimer();_t._active=_t._paused=false;_t._percent=0;}else{if(_t._active&&!_t._paused){return _t;}}_t._fire("beforeBegin");var de=_4a8||_t.delay;var _p=dojo.hitch(_t,"_play",_4a9);if(de>0){setTimeout(_p,de);return _t;}_p();return _t;},_play:function(_4ad){var _t=this;_t._startTime=new Date().valueOf();if(_t._paused){_t._startTime-=_t.duration*_t._percent;}_t._endTime=_t._startTime+_t.duration;_t._active=true;_t._paused=false;var _4af=_t.curve.getValue(_t._percent);if(!_t._percent){if(!_t._startRepeatCount){_t._startRepeatCount=_t.repeat;}_t._fire("onBegin",[_4af]);}_t._fire("onPlay",[_4af]);_t._cycle();return _t;},pause:function(){this._stopTimer();if(!this._active){return this;}this._paused=true;this._fire("onPause",[this.curve.getValue(this._percent)]);return this;},gotoPercent:function(_4b0,_4b1){this._stopTimer();this._active=this._paused=true;this._percent=_4b0;if(_4b1){this.play();}return this;},stop:function(_4b2){if(!this._timer){return this;}this._stopTimer();if(_4b2){this._percent=1;}this._fire("onStop",[this.curve.getValue(this._percent)]);this._active=this._paused=false;return this;},status:function(){if(this._active){return this._paused?"paused":"playing";}return "stopped";},_cycle:function(){var _t=this;if(_t._active){var curr=new Date().valueOf();var step=(curr-_t._startTime)/(_t._endTime-_t._startTime);if(step>=1){step=1;}_t._percent=step;if(_t.easing){step=_t.easing(step);}_t._fire("onAnimate",[_t.curve.getValue(step)]);if(_t._percent<1){_t._startTimer();}else{_t._active=false;if(_t.repeat>0){_t.repeat--;_t.play(null,true);}else{if(_t.repeat==-1){_t.play(null,true);}else{if(_t._startRepeatCount){_t.repeat=_t._startRepeatCount;_t._startRepeatCount=0;}}}_t._percent=0;_t._fire("onEnd");_t._stopTimer();}}return _t;}});var ctr=0;var _4b7=[];var _4b8={run:function(){}};var _4b9=null;dojo._Animation.prototype._startTimer=function(){if(!this._timer){this._timer=d.connect(_4b8,"run",this,"_cycle");ctr++;}if(!_4b9){_4b9=setInterval(d.hitch(_4b8,"run"),this.rate);}};dojo._Animation.prototype._stopTimer=function(){if(this._timer){d.disconnect(this._timer);this._timer=null;ctr--;}if(ctr<=0){clearInterval(_4b9);_4b9=null;ctr=0;}};var _4ba=(d.isIE)?function(node){var ns=node.style;if(!ns.zoom.length&&d.style(node,"zoom")=="normal"){ns.zoom="1";}if(!ns.width.length&&d.style(node,"width")=="auto"){ns.width="auto";}}:function(){};dojo._fade=function(args){args.node=d.byId(args.node);var _4be=d.mixin({properties:{}},args);var _4bf=(_4be.properties.opacity={});_4bf.start=!("start" in _4be)?function(){return Number(d.style(_4be.node,"opacity"));}:_4be.start;_4bf.end=_4be.end;var anim=d.animateProperty(_4be);d.connect(anim,"beforeBegin",d.partial(_4ba,_4be.node));return anim;};dojo.fadeIn=function(args){return d._fade(d.mixin({end:1},args));};dojo.fadeOut=function(args){return d._fade(d.mixin({end:0},args));};dojo._defaultEasing=function(n){return 0.5+((Math.sin((n+1.5)*Math.PI))/2);};var _4c4=function(_4c5){this._properties=_4c5;for(var p in _4c5){var prop=_4c5[p];if(prop.start instanceof d.Color){prop.tempColor=new d.Color();}}this.getValue=function(r){var ret={};for(var p in this._properties){var prop=this._properties[p];var _4cc=prop.start;if(_4cc instanceof d.Color){ret[p]=d.blendColors(_4cc,prop.end,r,prop.tempColor).toCss();}else{if(!d.isArray(_4cc)){ret[p]=((prop.end-_4cc)*r)+_4cc+(p!="opacity"?prop.units||"px":"");}}}return ret;};};dojo.animateProperty=function(args){args.node=d.byId(args.node);if(!args.easing){args.easing=d._defaultEasing;}var anim=new d._Animation(args);d.connect(anim,"beforeBegin",anim,function(){var pm={};for(var p in this.properties){if(p=="width"||p=="height"){this.node.display="block";}var prop=this.properties[p];prop=pm[p]=d.mixin({},(d.isObject(prop)?prop:{end:prop}));if(d.isFunction(prop.start)){prop.start=prop.start();}if(d.isFunction(prop.end)){prop.end=prop.end();}var _4d2=(p.toLowerCase().indexOf("color")>=0);function getStyle(node,p){var v=({height:node.offsetHeight,width:node.offsetWidth})[p];if(v!==undefined){return v;}v=d.style(node,p);return (p=="opacity")?Number(v):(_4d2?v:parseFloat(v));};if(!("end" in prop)){prop.end=getStyle(this.node,p);}else{if(!("start" in prop)){prop.start=getStyle(this.node,p);}}if(_4d2){prop.start=new d.Color(prop.start);prop.end=new d.Color(prop.end);}else{prop.start=(p=="opacity")?Number(prop.start):parseFloat(prop.start);}}this.curve=new _4c4(pm);});d.connect(anim,"onAnimate",anim,function(_4d6){for(var s in _4d6){d.style(this.node,s,_4d6[s]);}});return anim;};dojo.anim=function(node,_4d9,_4da,_4db,_4dc,_4dd){return d.animateProperty({node:node,duration:_4da||d._Animation.prototype.duration,properties:_4d9,easing:_4db,onEnd:_4dc}).play(_4dd||0);};})();}if(!dojo._hasResource["dojo._base.browser"]){dojo._hasResource["dojo._base.browser"]=true;dojo.provide("dojo._base.browser");if(dojo.config.require){dojo.forEach(dojo.config.require,"dojo['require'](item);");}}if(dojo.config.afterOnLoad&&dojo.isBrowser){window.setTimeout(dojo._fakeLoadInit,1000);}})();
components/com_morfeoshow/src/js/gmapez-2.js
Show inline comments
 
new file 100644
 
/*
 
 * GMapEZ -- Turn specially-marked HTML into Google Maps
 
 * Copyright (C) July 2005 - Oct 2006 by Chris Houser <chouser@bluweb.com>
 
 *
 
 * This code is licensed under the GNU General Public License (GPL)
 
 *
 
 * If you use this code on a web page, please include on that page a
 
 * link to http://n01se.net/chouser/gmapez/ -- this is a request, not
 
 * a requirement.  Thanks.
 
 */
 

	
 
(function(){
 
  var startdate = new Date();
 

	
 
  // configuration -- if you're using your own copy of gmapez.js, you
 
  // may want to modify these:
 
  var overlaysPerStep = 25;
 
  var imgBase = 'http://n01se.net/chouser/gmapez/';
 
  var shadowServer = 'http://n01se.net/shadow.cgi?src=';
 

	
 
  if( window.ez_preload ) {
 
    // we're already loaded
 
    return;
 
  }
 

	
 
  var _lastId = 0;
 
  function newId() {
 
    return 'ez_' + (++_lastId);
 
  }
 

	
 
  function loadfunc() {
 
    if( ! GBrowserIsCompatible() ) {
 
      if( document.getElementsByTagName ) {
 
        // Find all divs marked as GMapEZ
 
        var divs = document.getElementsByTagName( 'div' );
 
        for( var i = 0; i < divs.length; ++i ) {
 
          var div = divs[ i ];
 
          if( div.className.indexOf( 'GMapEZ' ) > -1 ) {
 
            div.innerHTML =  [
 
              "<div>This map cannot be displayed.  The site's key may be ",
 
              "incorrect, or your browser may not compatible (see if ",
 
              "your browser is listed ",
 
              '<a href="http://maps.google.com/support/bin/answer.py?answer=16532">here</a>).</div>',
 
              '<div class="firefoxref"><iframe src="http://pagead2.googlesyndication.com/cpa/ads?client=ca-pub-1237864095616304&amp;cpa_choice=CAAQyaj8zwEaCIwcWMzeycafKMu293M&amp;oe=UTF-8&amp;dt=1148266564041&amp;lmt=1148266562&amp;format=180x60_as_rimg&amp;output=html&amp;region=_google_cpa_region_&amp;cc=100&amp;u_h=1024&amp;u_w=1280&amp;u_ah=1050&amp;u_aw=1400&amp;u_cd=24&amp;u_tz=-240&amp;u_his=1&amp;u_java=true&amp;u_nplug=11&amp;u_nmime=133" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" frameborder="0" height="60" scrolling="no" width="180"></iframe></div>'
 
              ].join('\n');
 
            div.style.visibility = 'visible';
 
            div.style.padding = '0.3em';
 
            div.style.background = '#eee';
 
            div.style.overflow = 'auto';
 
          }
 
        }
 
      }
 
      else {
 
        alert( [
 
          'Your browser is not capable of displaying',
 
          'Google Maps on this page. Try using Firefox:',
 
          'http://getfirefox.com/' ].join('\n') );
 
      }
 
      return;
 
    }
 

	
 
    addOnUnload( GUnload );
 

	
 
    function getTotalOffset( elem ) {
 
      point = new GPoint( 0, 0 );
 
      while( elem ) {
 
        point.x += elem.offsetLeft;
 
        point.y += elem.offsetTop;
 
        //alert( elem.offsetTop + ' = ' + point.y );
 
        elem = elem.offsetParent;
 
      }
 
      return point;
 
    }
 

	
 
    function GSmallMapTypeControl() {
 
      GMapTypeControl.call( this, true );
 
    }
 
    GSmallMapTypeControl.prototype = new GMapTypeControl();
 
    GSmallMapTypeControl.prototype.constructor = GSmallMapTypeControl;
 
    window.GSmallMapTypeControl = GSmallMapTypeControl;
 

	
 
    var CtrlTable = {
 
      'GOverviewMapControl': true,
 
      'GLargeMapControl': true,
 
      'GSmallMapControl': true,
 
      'GSmallZoomControl': true,
 
      'GSmallMapTypeControl': true,
 
      'GMapTypeControl': true,
 
      'GScaleControl': true
 
    };
 

	
 
    var MapTypeTable = {
 
      'G_MAP_TYPE' : true,
 
      'G_SATELLITE_TYPE' : true,
 
      'G_HYBRID_TYPE' : true
 
    };
 

	
 
    var idmarkers = {};
 
    function markerForUrl( url ) {
 
      var matcha = /#(.*)/.exec( url );
 
      if( matcha )
 
        return idmarkers[ matcha[ 1 ] ];
 
      else
 
        return null;
 
    }
 

	
 
    // For this event handler, "this" is the clicked anchor
 
    function anchorClick() {
 
      var marker = markerForUrl( this.href );
 
      if( marker ) {
 
        if( /\bZOOM\b/.exec( this.className ) ) {
 
          var mapType = marker.mapType || marker.ezmap.map.getCurrentMapType();
 
          var zoomLevel;
 
          if( marker.span ) {
 
            zoomLevel = mapType.getSpanZoomLevel(
 
              marker.point, marker.span, marker.ezmap.viewsize );
 
          }
 
          else {
 
            zoomLevel = marker.ezmap.map.getZoom();
 
          }
 
          marker.ezmap.map.setCenter( marker.point, zoomLevel, mapType );
 
        }
 
        marker.doOpen();
 
        return false;
 
      }
 
      else {
 
        return true;
 
      }
 
    }
 

	
 
    function wordMap( str ) {
 
      var wmap = {};
 
      var list = str.split(' ');
 
      for( var j = 0; j < list.length; ++j ) {
 
        wmap[ list[ j ] ] = true;
 
      }
 
      return wmap;
 
    }
 

	
 
    function parseParams( str, params ) {
 
      var matchparam;
 
      for( var word in wordMap( str ) ) {
 
        matchparam = /^(\w+):(.*)$/.exec( word );
 
        if( matchparam && matchparam[1] in params ) {
 
          params[ matchparam[1] ] = matchparam[2];
 
        }
 
      }
 
      return params;
 
    }
 

	
 
    var markerOpener = {
 
      markers: [],
 
      addMarker: function( marker ) {
 
        this.markers.push( marker );
 
      },
 
      chainOpen: function( i ) {
 
        /*
 
         * This is a work-around for a Google Maps bug.  If I try to open
 
         * all the info windows at once, only the last one succeeds.
 
         *
 
         * Otherwise, it is equivalent to:
 
         *   for( i = 0; i < this.markers.length; ++i )
 
         *     this.markers[ i ].doOpen();
 
         */
 
        i = i || 0;
 
        if( i < this.markers.length ) {
 
          var onOpen = GEvent.bind(
 
              this.markers[ i ].ezmap.map,
 
              "infowindowopen",
 
              this,
 
              function(){
 
                GEvent.removeListener( onOpen );
 
                this.chainOpen( i + 1 );
 
              });
 
          this.markers[ i ].doOpen( true );
 
        }
 
        else {
 
          //alert('GMapEZ loadtime: ' + ( new Date() - startdate ) );
 
        }
 
      }
 
    };
 

	
 
    var laterFuncs = [];
 
    var lastFunc = null;
 
    function doNow() {
 
      if( laterFuncs.length > 0 ) {
 
        laterFuncs.shift().call();
 
        setTimeout( doNow, 1 );
 
      }
 
      else {
 
        if( lastFunc ) {
 
          lastFunc.call();
 
        }
 
      }
 
    }
 
    function doLater( obj, func ) {
 
      laterFuncs.push( function() { func.call( obj ); } );
 
    }
 

	
 
    var MiniIcon = new GIcon();
 
    MiniIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
 
    MiniIcon.iconSize = new GSize(12, 20);
 
    MiniIcon.shadowSize = new GSize(22, 20);
 
    MiniIcon.iconAnchor = new GPoint(6, 20);
 
    MiniIcon.infoWindowAnchor = new GPoint(5, 1);
 

	
 
    function EZInfoMarker( ezmap ) {
 
      this.ezmap = ezmap;
 
      this.icon = G_DEFAULT_ICON;
 

	
 
      this.point = null;
 
      this.title = null;
 

	
 
      this.blowup = false;
 
      this.tabs = [];
 

	
 
      this.infoZoomOffset = undefined;
 
      this.infoZoomLevel = undefined;
 
      this.infoMapType = null;
 
    }
 
    EZInfoMarker.prototype = new GMarker( new GLatLng( 0, 0 ) );
 
    EZInfoMarker.prototype.constructor = EZInfoMarker;
 

	
 
    EZInfoMarker.prototype.initialize = function( map ) {
 
      GMarker.call(
 
          this,
 
          this.point,
 
          {
 
            icon: this.icon,
 
            clickable: ( this.tabs.length > 0 || this.blowup ),
 
            title: this.title
 
          });
 
      GMarker.prototype.initialize.call( this, map );
 
    };
 

	
 
    EZInfoMarker.prototype.doOpen = function( autoopen ) {
 
      if( ! autoopen ) {
 
        var body = document.body || document.getElementsByTagName('body')[0];
 
        if( 'scrollLeft' in body ) {
 
          // http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
 
          var myWidth = 0, myHeight = 0;
 
          if( typeof( window.innerWidth ) == 'number' ) {
 
            //Non-IE
 
            myWidth = window.innerWidth;
 
            myHeight = window.innerHeight;
 
          } else if( document.documentElement &&
 
              ( document.documentElement.clientWidth ||
 
              document.documentElement.clientHeight ) )
 
          {
 
            //IE 6+ in 'standards compliant mode'
 
            myWidth = document.documentElement.clientWidth;
 
            myHeight = document.documentElement.clientHeight;
 
          } else if( document.body &&
 
              ( document.body.clientWidth || document.body.clientHeight ) )
 
          {
 
            //IE 4 compatible
 
            myWidth = document.body.clientWidth;
 
            myHeight = document.body.clientHeight;
 
          }
 

	
 
          var mapdiv = this.ezmap.div;
 
          var totalOffset = getTotalOffset( mapdiv );
 
          if( totalOffset.x < body.scrollLeft ||
 
              totalOffset.x + mapdiv.offsetWidth > body.scrollLeft+myWidth ||
 
              totalOffset.y < body.scrollTop ||
 
              totalOffset.y + mapdiv.offsetHeight > body.scrollTop+myHeight)
 
          {
 
            //alert( totalOffset.x + ', ' + totalOffset.y );
 
            scrollTo( totalOffset.x, totalOffset.y );
 
          }
 
        }
 
      }
 

	
 
      var zoom = null;
 
      if( this.tabs.length > 0 ) {
 
        var opts = { maxWidth: this.ezmap.div.offsetWidth - 100 };
 
        if( this.icon ) {
 
          this.openInfoWindowTabs( this.tabs, opts );
 
        }
 
        else {
 
          // "INVISIBLE" markers are never added as overlays -- GMap2
 
          // knows nothing about them.
 
          this.ezmap.map.openInfoWindowTabs( this.point, this.tabs, opts );
 
        }
 
        for( var i = 0; i < this.tabs.length; ++i ) {
 
          this.setupInfoForm( this.tabs[ i ] );
 
        }
 
      }
 
      else if( this.blowup ) {
 
        if( this.infoZoomOffset != undefined )
 
          zoom = this.ezmap.map.getZoom() + this.infoZoomOffset;
 
        else if( this.infoZoomLevel != undefined )
 
          zoom = this.infoZoomLevel;
 

	
 
        if( zoom >= this.ezmap.map.getCurrentMapType().numZoomLevels )
 
          zoom = this.ezmap.map.getCurrentMapType().numZoomLevels - 1;
 
        else if( zoom < 0 )
 
          zoom = 0;
 

	
 
        this.showMapBlowup( { zoomLevel: zoom, mapType: this.infoMapType } );
 
      }
 
      else {
 
        this.ezmap.map.closeInfoWindow();
 
      }
 
    };
 

	
 
    EZInfoMarker.prototype.setupInfoForm = function( tab ) {
 
      var div, a;
 
      var tabElem = tab.contentElem;
 
      var classes = tabElem.className ? wordMap( tabElem.className ) : {};
 
      if( classes.DirectionsToHere ||
 
          classes.DirectionsFromHere ||
 
          classes.SearchNearby )
 
      {
 
        if( tab.infoFormId ) {
 
          div = document.getElementById( tab.infoFormId );
 
          div.innerHTML = '';
 
        }
 
        else {
 
          div = document.createElement('div');
 
          div.className = 'ez_infoForm';
 
          tab.infoFormId = div.id = newId();
 
          tabElem.appendChild( div );
 
        }
 
        var _this = this;
 
        if( classes.DirectionsToHere || classes.DirectionsFromHere ) {
 
          div.appendChild( document.createTextNode( 'Get directions: ' ) );
 
          if( classes.DirectionsToHere ) {
 
            a = document.createElement('a');
 
            a.innerHTML = 'To here';
 
            a.onclick = function() { _this.showForm( tab ); };
 
            a.href = 'javascript:void(null)';
 
            div.appendChild( a );
 
          }
 
          if( classes.DirectionsToHere && classes.DirectionsFromHere ) {
 
            div.appendChild( document.createTextNode( ' - ' ) );
 
          }
 
          if( classes.DirectionsFromHere ) {
 
            a = document.createElement('a');
 
            a.innerHTML = 'From here';
 
            a.onclick = function() {};
 
            a.href = 'javascript:void(null)';
 
            div.appendChild( a );
 
          }
 
          div.appendChild( document.createElement('br') );
 
        }
 
        if( classes.SearchNearby ) {
 
          a = document.createElement('a');
 
          a.innerHTML = 'Search nearby';
 
          a.onclick = function() {};
 
          a.href = 'javascript:void(null)';
 
          div.appendChild( a );
 
        }
 
      }
 
    };
 

	
 
    EZInfoMarker.prototype.showForm = function( tab ) {
 
      var div = document.getElementById( tab.infoFormId );
 
      div.innerHTML = '<b>Get directions:</b> To here - ';
 
      var a = document.createElement('a');
 
      a.innerHTML = 'From here';
 
      a.onclick = function() {};
 
      a.href = 'javascript:void(null)';
 
      div.appendChild( a );
 
      var x = document.createElement('div');
 
      x.innerHTML = 'Start address';
 
      div.appendChild( x );
 
      this.ezmap.map.getInfoWindow().reset();
 
    };
 

	
 
    function EZPolyline( color, weight, opacity ) {
 
      this.points = [];
 
      this.initialize = function( map ) {
 
        GPolyline.call( this, this.points, color, weight, opacity );
 
        GPolyline.prototype.initialize.call( this, map );
 
      };
 
    };
 
    EZPolyline.prototype = new GPolyline();
 
    EZPolyline.prototype.constructor = EZPolyline;
 

	
 

	
 
    function EZMap( div, classes ) {
 
      this.div = div;
 
      this.classes = classes;
 
      this.divData = null;
 

	
 
      this.map = undefined;
 
      this.viewsize = null;
 
      this.extentMarker = null;
 

	
 
      this.overlayList = [];
 

	
 
      this.loading = null;
 
      this.bar = null;
 
      this.maxstep = 0;
 
      this.step = 0;
 
      this.oi = 0;
 
      this.initFrame();
 
    }
 

	
 
    EZMap.prototype.logWarning = function( str ) {
 
      if( ! this.warningNode ) {
 
        this.warningVis = false;
 
        this.warningNode = document.createElement('ul');
 
        this.warningNode.className = 'warnings';
 
        this.div.appendChild( this.warningNode );
 

	
 
        var warnBtn = document.createElement('button');
 
        warnBtn.className = 'warnings';
 
        warnBtn.innerHTML = 'Warnings...';
 
        this.div.appendChild( warnBtn );
 
        var ezmap = this;
 
        warnBtn.onclick = function() { ezmap.toggleWarnings(); };
 
      }
 
      var li = document.createElement('li');
 
      li.innerHTML = str;
 
      this.warningNode.appendChild( li );
 
    };
 

	
 
    EZMap.prototype.toggleWarnings = function() {
 
      this.warningVis = ! this.warningVis;
 
      this.warningNode.style.display = this.warningVis ? 'block' : 'none';
 
    };
 

	
 
    EZMap.prototype.processMarkers = function( parentNode, polyline ) {
 
      var lastOverlay, marker, textContent, imgs;
 
      var matchll, matchspn, matchtype;
 
      for( var node = parentNode.firstChild; node; node = node.nextSibling){
 
        lastOverlay = this.overlayList[ this.overlayList.length - 1 ];
 
        switch( node.nodeName ) {
 
        case 'A':
 
          matchll = /\Wll=([-.\d]*),([-.\d]*)/.exec( node.href );
 
          if( matchll ) {
 

	
 
            marker = new EZInfoMarker( this );
 
            marker.title = node.getAttribute('title');
 
            this.overlayList.push( marker );
 

	
 
            if( node.id || node.name )
 
              idmarkers[ node.id || node.name ] = marker;
 

	
 
            textContent = node.innerHTML.replace( /<[^>]*>/g, '' );
 

	
 
            if( /\bOPEN\b/.exec( textContent ) )
 
              markerOpener.addMarker( marker );
 

	
 
            if( /\bEXTENT\b/.exec( textContent ) ) {
 
              marker.icon = null;
 
              this.extentMarker = marker;
 
            }
 

	
 
            if( /\bINVISIBLE\b/.exec( textContent ) ) {
 
              marker.icon = null;
 
            }
 

	
 
            marker.point = new GLatLng(
 
                parseFloat( matchll[1] ),
 
                parseFloat( matchll[2] ) );
 

	
 
            if( polyline ) {
 
              marker.icon = null;
 
              polyline.points.push( marker.point );
 
            }
 

	
 
            matchspn = /\Wspn=([-.\d]*),([-.\d]*)/.exec( node.href );
 
            if( matchspn ) {
 
              marker.span = new GLatLng(
 
                  parseFloat( matchspn[1] ),
 
                  parseFloat( matchspn[2] ) );
 
            }
 

	
 
            matchtype = /\Wt=(.)/.exec( node.href );
 
            if( matchtype ) {
 
              switch( matchtype[1] ) {
 
                case 'k': marker.mapType = G_SATELLITE_TYPE; break;
 
                case 'h': marker.mapType = G_HYBRID_TYPE; break;
 
                // XXX need a G_MAP_TYPE letter for use by ZOOM links
 
              }
 
            }
 

	
 
            // build icon
 
            imgs = node.getElementsByTagName('img')
 
            if( imgs.length < 1 ) {
 
              var matchcolor =
 
                  /\b(ORANGE|PURPLE|YELLOW|GREEN|BLUE|RED|AQUA|WHITE|GRAY)\b/
 
                  .exec( textContent );
 
              var matchsym =
 
                  /\b([0-9A-Za-z]|BLANK|HASH|DOLLAR|DOT|START|END)\b/
 
                  .exec( textContent );
 
              var matchmini = /\bMINI\b/.exec( textContent );
 

	
 
              if( matchcolor || matchsym || matchmini ) {
 
                marker.icon = new GIcon( matchmini ? MiniIcon : G_DEFAULT_ICON );
 
                marker.icon.image = [
 
                  imgBase,
 
                  'iconEZ2/',
 
                  matchmini ? 'mini' : 'marker',
 
                  '-',
 
                  matchcolor ? matchcolor[0] : 'ORANGE',
 
                  '-',
 
                  matchmini ? 'BLANK' : ( matchsym ? matchsym[0] : 'DOT' ),
 
                  '.png' ].join('');
 

	
 
                marker.icon.printImage    = marker.icon.image;
 
                marker.icon.mozPrintImage = marker.icon.image;
 
              }
 
            }
 
            else {
 
              marker.icon = new GIcon( G_DEFAULT_ICON, imgs[ 0 ].src );
 
              marker.icon.printImage    = imgs[ 0 ].src;
 
              marker.icon.mozPrintImage = imgs[ 0 ].src;
 
              marker.icon.transparent = null;
 
              marker.icon.iconAnchor = null;
 
              marker.icon.infoWindowAnchor = null;
 

	
 
              var params = parseParams( imgs[ 0 ].className, {
 
                width: null, height: null,
 
                iconAnchor: null, infoWindowAnchor: null, imageMap: null } );
 

	
 
              var match;
 
              var width = parseInt( params.width );
 
              var height = parseInt( params.height );
 
              marker.icon.iconSize = new GSize( width, height );
 

	
 
              if( params.iconAnchor ) {
 
                match = /(\d+),(\d+)/.exec( params.iconAnchor );
 
                if( match ) {
 
                  marker.icon.iconAnchor = new GPoint(
 
                    parseInt( match[1] ),
 
                    parseInt( match[2] ) );
 
                }
 
              }
 
              if( marker.icon.iconAnchor === null ) {
 
                marker.icon.iconAnchor = new GPoint(
 
                  Math.round( width / 2 ),
 
                  Math.max( 1, height - 2 ) );
 
              }
 

	
 
              if( params.infoWindowAnchor ) {
 
                match = /(\d+),(\d+)/.exec( params.infoWindowAnchor );
 
                if( match ) {
 
                  marker.icon.infoWindowAnchor = new GPoint(
 
                    parseInt( match[1] ),
 
                    parseInt( match[2] ) );
 
                }
 
              }
 
              if( marker.icon.infoWindowAnchor === null ) {
 
                marker.icon.infoWindowAnchor = new GPoint(
 
                  Math.round( width / 2 ),
 
                  0 );
 
              }
 

	
 
              if( params.imageMap ) {
 
                marker.icon.imageMap = [];
 
                var parts = params.imageMap.split(/\s*,\s*/);
 
                for( var i = 0; i < parts.length; ++i ) {
 
                  marker.icon.imageMap.push( parseInt( parts[ i ] ) );
 
                }
 
                //alert( marker.icon.imageMap );
 
              }
 

	
 
              if( imgs.length > 1 ) {
 
                marker.icon.shadow = imgs[ 1 ].src;
 
                params = parseParams( imgs[ 1 ].className, { width:0, height:0 });
 
                marker.icon.shadowSize = new GSize( params.width, params.height);
 
              }
 
              else {
 
                marker.icon.shadow = shadowServer + imgs[ 0 ].src;
 
                marker.icon.shadowSize = new GSize(
 
                    Math.floor( width + height * 0.55 ), height );
 
              }
 

	
 
              if( imgs.length > 2 ) {
 
                marker.icon.transparent = imgs[ 2 ].src;
 
              }
 
              if( imgs.length > 3 ) {
 
                marker.icon.printImage = imgs[ 3 ].src;
 
              }
 
              if( imgs.length > 4 ) {
 
                marker.icon.printShadow = imgs[ 4 ].src;
 
              }
 
              if( imgs.length > 5 ) {
 
                marker.icon.mozPrintShadow = imgs[ 5 ].src;
 
              }
 
            }
 
          }
 
          else {
 
            this.logWarning( "No ll param for marker [" + node.innerHTML +
 
              ":" + (node.id || node.name) + "]" );
 
          }
 
          break;
 

	
 
        case 'DIV':
 
          if( ! lastOverlay ) {
 
            this.logWarning( "div block given before any markers" );
 
            continue;
 
          }
 
          else {
 
            var infoClasses = wordMap( node.className );
 
            if( 'GMapEZ' in infoClasses ) {
 
              // infoWindow blowup
 
              // XXX replace this with a nested map to allow for use
 
              // in tabs?
 
              lastOverlay.blowup = true;
 
              var matchzoom = /ZOOMLEVEL([-+=]?)(\d+)/.exec( node.innerHTML );
 
              if( matchzoom ) {
 
                var num = parseInt( matchzoom[ 2 ] );
 
                if( matchzoom[ 1 ] == '-' )
 
                  lastOverlay.infoZoomOffset = num;
 
                else if( matchzoom[ 1 ] == '+' )
 
                  lastOverlay.infoZoomOffset = - num;
 
                else
 
                  lastOverlay.infoZoomLevel = num;
 
              }
 

	
 
              for( typeName in MapTypeTable ) {
 
                if( typeName in infoClasses ) {
 
                  lastOverlay.infoMapType = window[ typeName ];
 
                  break;
 
                }
 
              }
 
            }
 
            else {
 
              // XXX remove title attribute from div node?
 
              lastOverlay.tabs.push(
 
                  new GInfoWindowTab( node.getAttribute('title'), node ));
 
            }
 
          }
 
          break;
 

	
 
        case 'LI':
 
          this.processMarkers( node, polyline );
 
          break;
 

	
 
        case 'OL':
 
          var params = parseParams( node.className,
 
              { color: null, weight: null, opacity: null } );
 
          if( params.color && ! /^#[0-9a-zA-Z]{6}$/.exec( params.color ) )
 
            this.logWarning( 'Polyline color should be a 6-digit' +
 
                ' hex color like "#123abc", not "' + params.color + '"' );
 
          if( params.weight != null ) {
 
            var w = parseInt( params.weight );
 
            if( w < 1 || isNaN( w ) )
 
              this.logWarning( 'Polyline weight should be an' +
 
                  ' interger above 0, not "' + params.weight + '"' );
 
            params.weight = w;
 
          }
 
          if( params.opacity ) {
 
            var o = parseFloat( params.opacity );
 
            if( o < 0 || o > 1 || isNaN( o ) )
 
              this.logWarning( 'Polyline opacity should be ' +
 
                  ' between 0 and 1, not "' + params.opacity + '"' );
 
            params.opacity = o;
 
          }
 
          var newline = new EZPolyline(
 
              params.color,
 
              params.weight,
 
              params.opacity );
 
          this.overlayList.push( newline );
 
          this.processMarkers( node, newline );
 
          break;
 

	
 
        case '#text':
 
        case '#comment':
 
          // ignore text and comments
 
          break;
 

	
 
        default:
 
          this.logWarning( "Unknown or misplaced node " + node.nodeName );
 
          break;
 
        }
 
      }
 
    };
 

	
 
    EZMap.prototype.onClick = function( overlay, point ) {
 
      if( overlay && overlay.doOpen ) {
 
        overlay.doOpen();
 
      }
 
      else if( point ) {
 
        this.map.closeInfoWindow();
 
      }
 
    };
 

	
 
    EZMap.prototype.nextStep = function( func ) {
 
      if( this.maxstep > 0 ) {
 
        this.bar.style.width = Math.round( this.step / this.maxstep * 100 ) + '%';
 
      }
 
      this.step += 1;
 
      doLater( this, func );
 
    };
 

	
 
    EZMap.prototype.initFrame = function() {
 
      this.divData = this.div;
 
      this.div = this.div.cloneNode( false );
 
      this.divData.parentNode.insertBefore( this.div, this.divData );
 
      this.divData.parentNode.removeChild( this.divData );
 
      this.div.style.visibility = 'visible';
 

	
 
      this.loading = document.createElement('div');
 
      this.loading.className = 'loadprogress';
 
      this.loading.style.marginTop = ( this.div.offsetHeight / 3 ) + 'px';
 
      this.loading.innerHTML = '<div class="box"><div class="logo"></div><div class="trough"><div class="bar"></div></div></div>';
 
      this.bar = this.loading.getElementsByTagName('div')[3];
 
      this.div.appendChild( this.loading );
 

	
 
      this.nextStep( this.initParse );
 
    };
 

	
 
    var mouselat, mouselng;
 
    function onmousemove( point ) {
 
      mouselat = point.y.toFixed(6);
 
      mouselng = point.x.toFixed(6);
 
    }
 

	
 
    EZMap.prototype.onScroll = function( scrollEvent ) {
 
      var zoom = 0;
 
      if( scrollEvent.cancelable ) {
 
        scrollEvent.preventDefault();
 
      }
 
      if( scrollEvent.detail ) {
 
        zoom = scrollEvent.detail;
 
      }
 
      else if( scrollEvent.wheelDelta ) {
 
        zoom = -scrollEvent.wheelDelta;
 
      }
 
      if( zoom ) {
 
        var m = this.map.fromLatLngToDivPixel( new GLatLng(mouselat,mouselng) );
 
        var c = this.map.fromLatLngToDivPixel( this.map.getCenter() );
 
        if( zoom < 0 ) {
 
          var x = c.x - ((m.x - c.x) * -.5);
 
          var y = c.y - ((m.y - c.y) * -.5);
 
          var n = this.map.fromDivPixelToLatLng(new GPoint(x,y));
 
          this.map.setCenter(n);
 
          this.map.zoomIn();
 
        }
 
        if( zoom > 0 ) {
 
          var x = c.x - (m.x - c.x);
 
          var y = c.y - (m.y - c.y);
 
          var n = this.map.fromDivPixelToLatLng(new GPoint(x,y));
 
          this.map.setCenter(n);
 
          this.map.zoomOut();
 
        }
 
      }
 
    };
 

	
 
    EZMap.prototype.initParse = function() {
 
      this.processMarkers( this.divData );
 
      this.divData = null;
 

	
 
      this.map = new GMap2( this.div );
 
      this.map.getContainer().appendChild( this.loading );
 

	
 
      GEvent.addListener( this.map, 'mousemove', onmousemove );
 
      GEvent.bindDom(this.div, 'DOMMouseScroll', this, this.onScroll); //Firefox
 
      GEvent.bindDom(this.div, 'mousewheel', this, this.onScroll); // IE + Opera
 

	
 
      GEvent.bind( this.map, 'click', this, this.onClick );
 

	
 
      if( ! this.extentMarker && this.overlayList.length == 1 )
 
        this.extentMarker = this.overlayList[ 0 ];
 

	
 
      // map type
 
      var mapType = G_MAP_TYPE;
 
      if( this.extentMarker && this.extentMarker.mapType ) {
 
        mapType = this.extentMarker.mapType;
 
      }
 
      for( typeName in MapTypeTable ) {
 
        if( typeName in this.classes ) {
 
          mapType = window[ typeName ];
 
          break;
 
        }
 
      }
 

	
 
      // center and zoom
 
      this.viewsize = new GSize( this.div.offsetWidth, this.div.offsetHeight );
 
      var center, zoomLevel;
 
      if( this.extentMarker ) {
 
        center = this.extentMarker.point;
 
        if( this.extentMarker.span ) {
 
          zoomLevel = mapType.getSpanZoomLevel(
 
              center, this.extentMarker.span, this.viewsize );
 
        }
 
        else {
 
          zoomLevel = 10;
 
        }
 
      }
 
      else if( this.overlayList.length > 1 ) {
 
        var autoBounds;
 
        for( var i = 0; i < this.overlayList.length; ++i ) {
 
          if( this.overlayList[ i ].point ) {
 
            if( ! autoBounds ) {
 
              autoBounds = new GLatLngBounds(
 
                  this.overlayList[ i ].point,
 
                  this.overlayList[ i ].point );
 
            }
 
            else {
 
              autoBounds.extend( this.overlayList[ i ].point );
 
            }
 
          }
 
        }
 
        var sw = autoBounds.getSouthWest();
 
        var ne = autoBounds.getNorthEast();
 
        center = new GLatLng(
 
          ( sw.lat() + ne.lat() ) / 2,
 
          ( sw.lng() + ne.lng() ) / 2 );
 
        zoomLevel = mapType.getBoundsZoomLevel( autoBounds, this.viewsize);
 
      }
 
      else {
 
        center = new GLatLng( 41.075210, -85.130310 );
 
        zoomLevel = 10;
 
      }
 

	
 
      // apply center, zoom, and map type
 
      this.map.setCenter( center, zoomLevel, mapType );
 

	
 
      this.maxstep = Math.floor( this.overlayList.length / overlaysPerStep ) + 2;
 
      this.initOverlays();
 
    };
 

	
 
    EZMap.prototype.initOverlays = function() {
 
      var overlay;
 
      var steplimit = Math.min(this.overlayList.length, this.oi+overlaysPerStep);
 
      for( ; this.oi < steplimit; ++this.oi ) {
 
        overlay = this.overlayList[ this.oi ];
 
        if( overlay.points || overlay.icon )
 
          this.map.addOverlay( overlay );
 
        this.overlayList[ this.oi ] = null;
 
      }
 
      if( this.oi < this.overlayList.length )
 
        this.nextStep( this.initOverlays );
 
      else
 
        this.nextStep( this.initControls );
 
    };
 

	
 
    EZMap.prototype.initControls = function() {
 
      for( var ctrl in CtrlTable ) {
 
        if( ctrl in this.classes ) {
 
          this.map.addControl( new window[ ctrl ]() );
 
        }
 
      }
 

	
 
      this.nextStep( this.initLoading );
 
    };
 

	
 
    EZMap.prototype.initLoading = function() {
 
      this.loading.parentNode.removeChild( this.loading );
 
      this.loading = null;
 
    };
 

	
 
    // Find all anchor tags linking to GMapEZ markers
 
    var anchors = document.getElementsByTagName( 'a' );
 
    for( var mi = 0; mi < anchors.length; ++mi ) {
 
      if( ! anchors[ mi ].onclick ) {
 
        anchors[ mi ].onclick = anchorClick;
 
      }
 
    }
 

	
 
    // Find all divs marked as GMapEZ
 
    var divs = document.getElementsByTagName( 'div' );
 
    for( var i = 0; i < divs.length; ++i ) {
 
      var div = divs[ i ];
 
      var classes = wordMap( div.className );
 
      if( 'GMapEZ' in classes ) {
 
        new EZMap( div, classes );
 
      }
 
    }
 

	
 
    lastFunc = function() {
 
      // Examine current page location for a reference to a GMapEZ marker
 
      var marker = markerForUrl( document.location );
 
      if( marker )
 
        markerOpener.addMarker( marker );
 

	
 
      // Open all the markers we need to
 
      markerOpener.chainOpen();
 
    };
 

	
 
    doNow();
 
  }
 

	
 
  function chainWindowFunc( funcname, newfunc ) {
 
    var oldfunc = window[ funcname ];
 
    if( oldfunc ) {
 
      window[ funcname ] = function() { oldfunc(); newfunc(); };
 
    }
 
    else {
 
      window[ funcname ] = newfunc;
 
    }
 
  }
 

	
 
  window.addOnLoad   = function( func ) { chainWindowFunc( "onload",   func );};
 
  window.addOnUnload = function( func ) { chainWindowFunc( "onunload", func );};
 

	
 
  window.ez_preload = function() {
 
    if( window.G_INCOMPAT ) {
 
      // If the key failed to validate, cause all keys to appear valid
 
      // and try again.
 
      window.G_INCOMPAT = false;
 
      window.GValidateKey = function(){ return true; }
 
      GLoad();
 
    }
 
    addOnLoad( loadfunc );
 
  }
 

	
 
  var key = '';
 
  var gmapversion = '2';
 
  (function(){
 
    var metas = document.getElementsByTagName( 'meta' );
 
    var match;
 
    for( var i = 0; i < metas.length; ++i ) {
 
      match = /gmapkey:?(.*)/.exec( metas[ i ].name );
 
      if( match ) {
 
        if( ! match[ 1 ] ) {
 
          key = metas[ i ].content;
 
        }
 
        else if( (new RegExp( match[ 1 ] )).exec( window.location.href ) ) {
 
          key = metas[ i ].content;
 
          break;
 
        }
 
      }
 
      else if( metas[ i ].name == 'gmapversion' ) {
 
        gmapversion = metas[ i ].content;
 
      }
 
    }
 
  })();
 

	
 
  if( ! window.GMap2 ) {
 
    document.write( [
 
      '<script src="http://maps.google.com/maps?file=api&v='
 
      + gmapversion + '&key=' + key
 
      + '" type="text/javascript"></script>' ].join('\n') );
 
  }
 

	
 
  document.write( [
 
    '<script type="text/javascript">',
 
    '  ez_preload();',
 
    '</script>',
 

	
 
    '<style type="text/css">',
 
    'div.GMapEZ {',
 
    '  visibility: hidden;',
 
    '  border: 1px #888 solid;',
 
    '}',
 

	
 
    'div.GMapEZ ul.warnings {',
 
    '  position: absolute;',
 
    '  top: 0;',
 
    '  left: 0;',
 
    '  margin: 0;',
 
    '  padding-right: 0.5em;',
 
    '  padding-left: 1.5em;',
 
    '  display: none;',
 
    '  border: 1px #888 solid;',
 
    '  background: #fff;',
 
    '  z-index: 100000000;',
 
    '  text-align: left;',
 
    '  font-family: Arial;',
 
    '  font-size: 9pt;',
 
    '  overflow: auto;',
 
    '}',
 

	
 
    'div.GMapEZ button.warnings {',
 
    '  display: block;',
 
    '  position: absolute;',
 
    '  z-index: 100000000;',
 
    '  bottom: 20px;',
 
    '  right: 0;',
 
    '  color: #f00;',
 
    '}',
 

	
 
    'div.GMapEZ .firefoxref {',
 
    '  text-align: center;',
 
    '  margin: 1em;',
 
    '}',
 

	
 
    'div.GMapEZ .loadprogress {',
 
    '  position: relative;',
 
    '  z-index: 100000000;',
 
    '  text-align: center;',
 
    '}',
 

	
 
    'div.GMapEZ .loadprogress .box {',
 
    '  font-family: Arial, sans-serif;',
 
    '  background: #fff;',
 
    '  border: 1px #bbb inset;',
 
    '  width: 136px;',
 
    '  height: 45px;',
 
    '  margin: auto;',
 
    '}',
 

	
 
    'div.GMapEZ .loadprogress .logo {',
 
    '  margin: 8px;',
 
    '  margin-bottom: 0;',
 
    '  width: 120px;',
 
    '  height: 28px;',
 
    "  filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
 
        imgBase + "logo3.png',sizingMethod='scale');",
 
    '}',
 
    'div.GMapEZ .loadprogress .box > .logo {',
 
    '  position: relative;',
 
    '  background: url(' + imgBase + 'logo3.png) no-repeat;',
 
    '}',
 

	
 
    'div.GMapEZ .loadprogress .trough {',
 
    '  margin: 8px;',
 
    '  margin-top: -5px;',
 
    '  background: #ccc;',
 
    '  font-size: 1px;',
 
    '  height: 8px;',
 
    '  text-align: left;',
 
    '}',
 

	
 
    'div.GMapEZ .loadprogress .bar {',
 
    '  height: 8px;',
 
    '  width: 0px;',
 
    '  background: #55a url(' + imgBase + 'progressbar.png);',
 
    '}',
 

	
 
    'v\\:* {',
 
    '  behavior:url(#default#VML);',
 
    '}',
 
    '</style>'
 
  ].join('\n'));
 
})();
 

	
components/com_morfeoshow/src/js/index.html
Show inline comments
 
new file 100644
 
<html>
 
<body bgcolor="#FFFFFF">
 
</body>
 
</html>
 
\ No newline at end of file
components/com_morfeoshow/src/js/jquery-1.2.3.pack.js
Show inline comments
 
new file 100644
 
/*
 
 * jQuery 1.2.3 - New Wave Javascript
 
 *
 
 * Copyright (c) 2008 John Resig (jquery.com)
 
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 
 * and GPL (GPL-LICENSE.txt) licenses.
 
 *
 
 * $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $
 
 * $Rev: 4663 $
 
 */
 
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(J(){7(1e.3N)L w=1e.3N;L E=1e.3N=J(a,b){K 1B E.2l.4T(a,b)};7(1e.$)L D=1e.$;1e.$=E;L u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;L G=/^.[^:#\\[\\.]*$/;E.1n=E.2l={4T:J(d,b){d=d||T;7(d.15){6[0]=d;6.M=1;K 6}N 7(1o d=="25"){L c=u.2O(d);7(c&&(c[1]||!b)){7(c[1])d=E.4a([c[1]],b);N{L a=T.5J(c[3]);7(a)7(a.2w!=c[3])K E().2s(d);N{6[0]=a;6.M=1;K 6}N d=[]}}N K 1B E(b).2s(d)}N 7(E.1q(d))K 1B E(T)[E.1n.21?"21":"3U"](d);K 6.6E(d.1k==1M&&d||(d.5h||d.M&&d!=1e&&!d.15&&d[0]!=10&&d[0].15)&&E.2I(d)||[d])},5h:"1.2.3",87:J(){K 6.M},M:0,22:J(a){K a==10?E.2I(6):6[a]},2F:J(b){L a=E(b);a.54=6;K a},6E:J(a){6.M=0;1M.2l.1g.1i(6,a);K 6},R:J(a,b){K E.R(6,a,b)},4X:J(b){L a=-1;6.R(J(i){7(6==b)a=i});K a},1J:J(c,a,b){L d=c;7(c.1k==4e)7(a==10)K 6.M&&E[b||"1J"](6[0],c)||10;N{d={};d[c]=a}K 6.R(J(i){Q(c 1p d)E.1J(b?6.W:6,c,E.1l(6,d[c],b,i,c))})},1j:J(b,a){7((b==\'27\'||b==\'1R\')&&2M(a)<0)a=10;K 6.1J(b,a,"2o")},1u:J(b){7(1o b!="3V"&&b!=V)K 6.4x().3t((6[0]&&6[0].2i||T).5r(b));L a="";E.R(b||6,J(){E.R(6.3p,J(){7(6.15!=8)a+=6.15!=1?6.6K:E.1n.1u([6])})});K a},5m:J(b){7(6[0])E(b,6[0].2i).5k().3o(6[0]).2c(J(){L a=6;2b(a.1C)a=a.1C;K a}).3t(6);K 6},8w:J(a){K 6.R(J(){E(6).6z().5m(a)})},8p:J(a){K 6.R(J(){E(6).5m(a)})},3t:J(){K 6.3O(18,P,S,J(a){7(6.15==1)6.38(a)})},6q:J(){K 6.3O(18,P,P,J(a){7(6.15==1)6.3o(a,6.1C)})},6o:J(){K 6.3O(18,S,S,J(a){6.1a.3o(a,6)})},5a:J(){K 6.3O(18,S,P,J(a){6.1a.3o(a,6.2B)})},3h:J(){K 6.54||E([])},2s:J(b){L c=E.2c(6,J(a){K E.2s(b,a)});K 6.2F(/[^+>] [^+>]/.17(b)||b.1f("..")>-1?E.57(c):c)},5k:J(e){L f=6.2c(J(){7(E.14.1d&&!E.3E(6)){L a=6.69(P),4Y=T.3s("1x");4Y.38(a);K E.4a([4Y.3d])[0]}N K 6.69(P)});L d=f.2s("*").4R().R(J(){7(6[F]!=10)6[F]=V});7(e===P)6.2s("*").4R().R(J(i){7(6.15==3)K;L c=E.O(6,"2R");Q(L a 1p c)Q(L b 1p c[a])E.16.1b(d[i],a,c[a][b],c[a][b].O)});K f},1E:J(b){K 6.2F(E.1q(b)&&E.3y(6,J(a,i){K b.1P(a,i)})||E.3e(b,6))},56:J(b){7(b.1k==4e)7(G.17(b))K 6.2F(E.3e(b,6,P));N b=E.3e(b,6);L a=b.M&&b[b.M-1]!==10&&!b.15;K 6.1E(J(){K a?E.33(6,b)<0:6!=b})},1b:J(a){K!a?6:6.2F(E.37(6.22(),a.1k==4e?E(a).22():a.M!=10&&(!a.12||E.12(a,"3u"))?a:[a]))},3H:J(a){K a?E.3e(a,6).M>0:S},7j:J(a){K 6.3H("."+a)},5O:J(b){7(b==10){7(6.M){L c=6[0];7(E.12(c,"2k")){L e=c.3T,5I=[],11=c.11,2X=c.U=="2k-2X";7(e<0)K V;Q(L i=2X?e:0,2f=2X?e+1:11.M;i<2f;i++){L d=11[i];7(d.2p){b=E.14.1d&&!d.9J.1A.9y?d.1u:d.1A;7(2X)K b;5I.1g(b)}}K 5I}N K(6[0].1A||"").1r(/\\r/g,"")}K 10}K 6.R(J(){7(6.15!=1)K;7(b.1k==1M&&/5u|5t/.17(6.U))6.3k=(E.33(6.1A,b)>=0||E.33(6.31,b)>=0);N 7(E.12(6,"2k")){L a=b.1k==1M?b:[b];E("98",6).R(J(){6.2p=(E.33(6.1A,a)>=0||E.33(6.1u,a)>=0)});7(!a.M)6.3T=-1}N 6.1A=b})},3q:J(a){K a==10?(6.M?6[0].3d:V):6.4x().3t(a)},6S:J(a){K 6.5a(a).1V()},6Z:J(i){K 6.2K(i,i+1)},2K:J(){K 6.2F(1M.2l.2K.1i(6,18))},2c:J(b){K 6.2F(E.2c(6,J(a,i){K b.1P(a,i,a)}))},4R:J(){K 6.1b(6.54)},O:J(d,b){L a=d.23(".");a[1]=a[1]?"."+a[1]:"";7(b==V){L c=6.5n("8P"+a[1]+"!",[a[0]]);7(c==10&&6.M)c=E.O(6[0],d);K c==V&&a[1]?6.O(a[0]):c}N K 6.1N("8K"+a[1]+"!",[a[0],b]).R(J(){E.O(6,d,b)})},35:J(a){K 6.R(J(){E.35(6,a)})},3O:J(g,f,h,d){L e=6.M>1,3n;K 6.R(J(){7(!3n){3n=E.4a(g,6.2i);7(h)3n.8D()}L b=6;7(f&&E.12(6,"1O")&&E.12(3n[0],"4v"))b=6.3S("1U")[0]||6.38(6.2i.3s("1U"));L c=E([]);E.R(3n,J(){L a=e?E(6).5k(P)[0]:6;7(E.12(a,"1m")){c=c.1b(a)}N{7(a.15==1)c=c.1b(E("1m",a).1V());d.1P(b,a)}});c.R(6A)})}};E.2l.4T.2l=E.2l;J 6A(i,a){7(a.3Q)E.3P({1c:a.3Q,3l:S,1H:"1m"});N E.5g(a.1u||a.6x||a.3d||"");7(a.1a)a.1a.34(a)}E.1s=E.1n.1s=J(){L b=18[0]||{},i=1,M=18.M,5c=S,11;7(b.1k==8d){5c=b;b=18[1]||{};i=2}7(1o b!="3V"&&1o b!="J")b={};7(M==1){b=6;i=0}Q(;i<M;i++)7((11=18[i])!=V)Q(L a 1p 11){7(b===11[a])6w;7(5c&&11[a]&&1o 11[a]=="3V"&&b[a]&&!11[a].15)b[a]=E.1s(b[a],11[a]);N 7(11[a]!=10)b[a]=11[a]}K b};L F="3N"+(1B 3v()).3L(),6t=0,5b={};L H=/z-?4X|86-?84|1w|6k|7Z-?1R/i;E.1s({7Y:J(a){1e.$=D;7(a)1e.3N=w;K E},1q:J(a){K!!a&&1o a!="25"&&!a.12&&a.1k!=1M&&/J/i.17(a+"")},3E:J(a){K a.1F&&!a.1h||a.28&&a.2i&&!a.2i.1h},5g:J(a){a=E.3g(a);7(a){L b=T.3S("6f")[0]||T.1F,1m=T.3s("1m");1m.U="1u/4m";7(E.14.1d)1m.1u=a;N 1m.38(T.5r(a));b.38(1m);b.34(1m)}},12:J(b,a){K b.12&&b.12.2E()==a.2E()},1T:{},O:J(c,d,b){c=c==1e?5b:c;L a=c[F];7(!a)a=c[F]=++6t;7(d&&!E.1T[a])E.1T[a]={};7(b!=10)E.1T[a][d]=b;K d?E.1T[a][d]:a},35:J(c,b){c=c==1e?5b:c;L a=c[F];7(b){7(E.1T[a]){2V E.1T[a][b];b="";Q(b 1p E.1T[a])1Q;7(!b)E.35(c)}}N{1S{2V c[F]}1X(e){7(c.52)c.52(F)}2V E.1T[a]}},R:J(c,a,b){7(b){7(c.M==10){Q(L d 1p c)7(a.1i(c[d],b)===S)1Q}N Q(L i=0,M=c.M;i<M;i++)7(a.1i(c[i],b)===S)1Q}N{7(c.M==10){Q(L d 1p c)7(a.1P(c[d],d,c[d])===S)1Q}N Q(L i=0,M=c.M,1A=c[0];i<M&&a.1P(1A,i,1A)!==S;1A=c[++i]){}}K c},1l:J(b,a,c,i,d){7(E.1q(a))a=a.1P(b,i);K a&&a.1k==51&&c=="2o"&&!H.17(d)?a+"2S":a},1t:{1b:J(c,b){E.R((b||"").23(/\\s+/),J(i,a){7(c.15==1&&!E.1t.3Y(c.1t,a))c.1t+=(c.1t?" ":"")+a})},1V:J(c,b){7(c.15==1)c.1t=b!=10?E.3y(c.1t.23(/\\s+/),J(a){K!E.1t.3Y(b,a)}).6a(" "):""},3Y:J(b,a){K E.33(a,(b.1t||b).3X().23(/\\s+/))>-1}},68:J(b,c,a){L e={};Q(L d 1p c){e[d]=b.W[d];b.W[d]=c[d]}a.1P(b);Q(L d 1p c)b.W[d]=e[d]},1j:J(d,e,c){7(e=="27"||e=="1R"){L b,46={43:"4W",4U:"1Z",19:"3D"},3c=e=="27"?["7O","7M"]:["7J","7I"];J 5E(){b=e=="27"?d.7H:d.7F;L a=0,2N=0;E.R(3c,J(){a+=2M(E.2o(d,"7E"+6,P))||0;2N+=2M(E.2o(d,"2N"+6+"5X",P))||0});b-=24.7C(a+2N)}7(E(d).3H(":4d"))5E();N E.68(d,46,5E);K 24.2f(0,b)}K E.2o(d,e,c)},2o:J(e,k,j){L d;J 3x(b){7(!E.14.2d)K S;L a=T.4c.4K(b,V);K!a||a.4M("3x")==""}7(k=="1w"&&E.14.1d){d=E.1J(e.W,"1w");K d==""?"1":d}7(E.14.2z&&k=="19"){L c=e.W.50;e.W.50="0 7r 7o";e.W.50=c}7(k.1D(/4g/i))k=y;7(!j&&e.W&&e.W[k])d=e.W[k];N 7(T.4c&&T.4c.4K){7(k.1D(/4g/i))k="4g";k=k.1r(/([A-Z])/g,"-$1").2h();L h=T.4c.4K(e,V);7(h&&!3x(e))d=h.4M(k);N{L f=[],2C=[];Q(L a=e;a&&3x(a);a=a.1a)2C.4J(a);Q(L i=0;i<2C.M;i++)7(3x(2C[i])){f[i]=2C[i].W.19;2C[i].W.19="3D"}d=k=="19"&&f[2C.M-1]!=V?"2H":(h&&h.4M(k))||"";Q(L i=0;i<f.M;i++)7(f[i]!=V)2C[i].W.19=f[i]}7(k=="1w"&&d=="")d="1"}N 7(e.4n){L g=k.1r(/\\-(\\w)/g,J(a,b){K b.2E()});d=e.4n[k]||e.4n[g];7(!/^\\d+(2S)?$/i.17(d)&&/^\\d/.17(d)){L l=e.W.26,3K=e.3K.26;e.3K.26=e.4n.26;e.W.26=d||0;d=e.W.7f+"2S";e.W.26=l;e.3K.26=3K}}K d},4a:J(l,h){L k=[];h=h||T;7(1o h.3s==\'10\')h=h.2i||h[0]&&h[0].2i||T;E.R(l,J(i,d){7(!d)K;7(d.1k==51)d=d.3X();7(1o d=="25"){d=d.1r(/(<(\\w+)[^>]*?)\\/>/g,J(b,a,c){K c.1D(/^(aa|a6|7e|a5|4D|7a|a0|3m|9W|9U|9S)$/i)?b:a+"></"+c+">"});L f=E.3g(d).2h(),1x=h.3s("1x");L e=!f.1f("<9P")&&[1,"<2k 74=\'74\'>","</2k>"]||!f.1f("<9M")&&[1,"<73>","</73>"]||f.1D(/^<(9G|1U|9E|9B|9x)/)&&[1,"<1O>","</1O>"]||!f.1f("<4v")&&[2,"<1O><1U>","</1U></1O>"]||(!f.1f("<9w")||!f.1f("<9v"))&&[3,"<1O><1U><4v>","</4v></1U></1O>"]||!f.1f("<7e")&&[2,"<1O><1U></1U><6V>","</6V></1O>"]||E.14.1d&&[1,"1x<1x>","</1x>"]||[0,"",""];1x.3d=e[1]+d+e[2];2b(e[0]--)1x=1x.5o;7(E.14.1d){L g=!f.1f("<1O")&&f.1f("<1U")<0?1x.1C&&1x.1C.3p:e[1]=="<1O>"&&f.1f("<1U")<0?1x.3p:[];Q(L j=g.M-1;j>=0;--j)7(E.12(g[j],"1U")&&!g[j].3p.M)g[j].1a.34(g[j]);7(/^\\s/.17(d))1x.3o(h.5r(d.1D(/^\\s*/)[0]),1x.1C)}d=E.2I(1x.3p)}7(d.M===0&&(!E.12(d,"3u")&&!E.12(d,"2k")))K;7(d[0]==10||E.12(d,"3u")||d.11)k.1g(d);N k=E.37(k,d)});K k},1J:J(d,e,c){7(!d||d.15==3||d.15==8)K 10;L f=E.3E(d)?{}:E.46;7(e=="2p"&&E.14.2d)d.1a.3T;7(f[e]){7(c!=10)d[f[e]]=c;K d[f[e]]}N 7(E.14.1d&&e=="W")K E.1J(d.W,"9u",c);N 7(c==10&&E.14.1d&&E.12(d,"3u")&&(e=="9r"||e=="9o"))K d.9m(e).6K;N 7(d.28){7(c!=10){7(e=="U"&&E.12(d,"4D")&&d.1a)6Q"U 9i 9h\'t 9g 9e";d.9b(e,""+c)}7(E.14.1d&&/6O|3Q/.17(e)&&!E.3E(d))K d.4z(e,2);K d.4z(e)}N{7(e=="1w"&&E.14.1d){7(c!=10){d.6k=1;d.1E=(d.1E||"").1r(/6M\\([^)]*\\)/,"")+(2M(c).3X()=="96"?"":"6M(1w="+c*6L+")")}K d.1E&&d.1E.1f("1w=")>=0?(2M(d.1E.1D(/1w=([^)]*)/)[1])/6L).3X():""}e=e.1r(/-([a-z])/95,J(a,b){K b.2E()});7(c!=10)d[e]=c;K d[e]}},3g:J(a){K(a||"").1r(/^\\s+|\\s+$/g,"")},2I:J(b){L a=[];7(1o b!="93")Q(L i=0,M=b.M;i<M;i++)a.1g(b[i]);N a=b.2K(0);K a},33:J(b,a){Q(L i=0,M=a.M;i<M;i++)7(a[i]==b)K i;K-1},37:J(a,b){7(E.14.1d){Q(L i=0;b[i];i++)7(b[i].15!=8)a.1g(b[i])}N Q(L i=0;b[i];i++)a.1g(b[i]);K a},57:J(a){L c=[],2r={};1S{Q(L i=0,M=a.M;i<M;i++){L b=E.O(a[i]);7(!2r[b]){2r[b]=P;c.1g(a[i])}}}1X(e){c=a}K c},3y:J(c,a,d){L b=[];Q(L i=0,M=c.M;i<M;i++)7(!d&&a(c[i],i)||d&&!a(c[i],i))b.1g(c[i]);K b},2c:J(d,a){L c=[];Q(L i=0,M=d.M;i<M;i++){L b=a(d[i],i);7(b!==V&&b!=10){7(b.1k!=1M)b=[b];c=c.71(b)}}K c}});L v=8Y.8W.2h();E.14={5K:(v.1D(/.+(?:8T|8S|8R|8O)[\\/: ]([\\d.]+)/)||[])[1],2d:/77/.17(v),2z:/2z/.17(v),1d:/1d/.17(v)&&!/2z/.17(v),48:/48/.17(v)&&!/(8L|77)/.17(v)};L y=E.14.1d?"6H":"75";E.1s({8I:!E.14.1d||T.6F=="79",46:{"Q":"8F","8E":"1t","4g":y,75:y,6H:y,3d:"3d",1t:"1t",1A:"1A",2Y:"2Y",3k:"3k",8C:"8B",2p:"2p",8A:"8z",3T:"3T",6C:"6C",28:"28",12:"12"}});E.R({6B:J(a){K a.1a},8y:J(a){K E.4u(a,"1a")},8x:J(a){K E.2Z(a,2,"2B")},8v:J(a){K E.2Z(a,2,"4t")},8u:J(a){K E.4u(a,"2B")},8t:J(a){K E.4u(a,"4t")},8s:J(a){K E.5i(a.1a.1C,a)},8r:J(a){K E.5i(a.1C)},6z:J(a){K E.12(a,"8q")?a.8o||a.8n.T:E.2I(a.3p)}},J(c,d){E.1n[c]=J(b){L a=E.2c(6,d);7(b&&1o b=="25")a=E.3e(b,a);K 6.2F(E.57(a))}});E.R({6y:"3t",8m:"6q",3o:"6o",8l:"5a",8k:"6S"},J(c,b){E.1n[c]=J(){L a=18;K 6.R(J(){Q(L i=0,M=a.M;i<M;i++)E(a[i])[b](6)})}});E.R({8j:J(a){E.1J(6,a,"");7(6.15==1)6.52(a)},8i:J(a){E.1t.1b(6,a)},8h:J(a){E.1t.1V(6,a)},8g:J(a){E.1t[E.1t.3Y(6,a)?"1V":"1b"](6,a)},1V:J(a){7(!a||E.1E(a,[6]).r.M){E("*",6).1b(6).R(J(){E.16.1V(6);E.35(6)});7(6.1a)6.1a.34(6)}},4x:J(){E(">*",6).1V();2b(6.1C)6.34(6.1C)}},J(a,b){E.1n[a]=J(){K 6.R(b,18)}});E.R(["8f","5X"],J(i,c){L b=c.2h();E.1n[b]=J(a){K 6[0]==1e?E.14.2z&&T.1h["5e"+c]||E.14.2d&&1e["8e"+c]||T.6F=="79"&&T.1F["5e"+c]||T.1h["5e"+c]:6[0]==T?24.2f(24.2f(T.1h["5d"+c],T.1F["5d"+c]),24.2f(T.1h["5L"+c],T.1F["5L"+c])):a==10?(6.M?E.1j(6[0],b):V):6.1j(b,a.1k==4e?a:a+"2S")}});L C=E.14.2d&&4s(E.14.5K)<8c?"(?:[\\\\w*4r-]|\\\\\\\\.)":"(?:[\\\\w\\8b-\\8a*4r-]|\\\\\\\\.)",6v=1B 4q("^>\\\\s*("+C+"+)"),6u=1B 4q("^("+C+"+)(#)("+C+"+)"),6s=1B 4q("^([#.]?)("+C+"*)");E.1s({6r:{"":J(a,i,m){K m[2]=="*"||E.12(a,m[2])},"#":J(a,i,m){K a.4z("2w")==m[2]},":":{89:J(a,i,m){K i<m[3]-0},88:J(a,i,m){K i>m[3]-0},2Z:J(a,i,m){K m[3]-0==i},6Z:J(a,i,m){K m[3]-0==i},3j:J(a,i){K i==0},3J:J(a,i,m,r){K i==r.M-1},6n:J(a,i){K i%2==0},6l:J(a,i){K i%2},"3j-4p":J(a){K a.1a.3S("*")[0]==a},"3J-4p":J(a){K E.2Z(a.1a.5o,1,"4t")==a},"83-4p":J(a){K!E.2Z(a.1a.5o,2,"4t")},6B:J(a){K a.1C},4x:J(a){K!a.1C},82:J(a,i,m){K(a.6x||a.81||E(a).1u()||"").1f(m[3])>=0},4d:J(a){K"1Z"!=a.U&&E.1j(a,"19")!="2H"&&E.1j(a,"4U")!="1Z"},1Z:J(a){K"1Z"==a.U||E.1j(a,"19")=="2H"||E.1j(a,"4U")=="1Z"},80:J(a){K!a.2Y},2Y:J(a){K a.2Y},3k:J(a){K a.3k},2p:J(a){K a.2p||E.1J(a,"2p")},1u:J(a){K"1u"==a.U},5u:J(a){K"5u"==a.U},5t:J(a){K"5t"==a.U},59:J(a){K"59"==a.U},3I:J(a){K"3I"==a.U},58:J(a){K"58"==a.U},6j:J(a){K"6j"==a.U},6i:J(a){K"6i"==a.U},2G:J(a){K"2G"==a.U||E.12(a,"2G")},4D:J(a){K/4D|2k|6h|2G/i.17(a.12)},3Y:J(a,i,m){K E.2s(m[3],a).M},7X:J(a){K/h\\d/i.17(a.12)},7W:J(a){K E.3y(E.3G,J(b){K a==b.Y}).M}}},6g:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1B 4q("^([:.#]*)("+C+"+)")],3e:J(a,c,b){L d,2m=[];2b(a&&a!=d){d=a;L f=E.1E(a,c,b);a=f.t.1r(/^\\s*,\\s*/,"");2m=b?c=f.r:E.37(2m,f.r)}K 2m},2s:J(t,p){7(1o t!="25")K[t];7(p&&p.15!=1&&p.15!=9)K[];p=p||T;L d=[p],2r=[],3J,12;2b(t&&3J!=t){L r=[];3J=t;t=E.3g(t);L o=S;L g=6v;L m=g.2O(t);7(m){12=m[1].2E();Q(L i=0;d[i];i++)Q(L c=d[i].1C;c;c=c.2B)7(c.15==1&&(12=="*"||c.12.2E()==12))r.1g(c);d=r;t=t.1r(g,"");7(t.1f(" ")==0)6w;o=P}N{g=/^([>+~])\\s*(\\w*)/i;7((m=g.2O(t))!=V){r=[];L l={};12=m[2].2E();m=m[1];Q(L j=0,3f=d.M;j<3f;j++){L n=m=="~"||m=="+"?d[j].2B:d[j].1C;Q(;n;n=n.2B)7(n.15==1){L h=E.O(n);7(m=="~"&&l[h])1Q;7(!12||n.12.2E()==12){7(m=="~")l[h]=P;r.1g(n)}7(m=="+")1Q}}d=r;t=E.3g(t.1r(g,""));o=P}}7(t&&!o){7(!t.1f(",")){7(p==d[0])d.4l();2r=E.37(2r,d);r=d=[p];t=" "+t.6e(1,t.M)}N{L k=6u;L m=k.2O(t);7(m){m=[0,m[2],m[3],m[1]]}N{k=6s;m=k.2O(t)}m[2]=m[2].1r(/\\\\/g,"");L f=d[d.M-1];7(m[1]=="#"&&f&&f.5J&&!E.3E(f)){L q=f.5J(m[2]);7((E.14.1d||E.14.2z)&&q&&1o q.2w=="25"&&q.2w!=m[2])q=E(\'[@2w="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.12(q,m[3]))?[q]:[]}N{Q(L i=0;d[i];i++){L a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];7(a=="*"&&d[i].12.2h()=="3V")a="3m";r=E.37(r,d[i].3S(a))}7(m[1]==".")r=E.55(r,m[2]);7(m[1]=="#"){L e=[];Q(L i=0;r[i];i++)7(r[i].4z("2w")==m[2]){e=[r[i]];1Q}r=e}d=r}t=t.1r(k,"")}}7(t){L b=E.1E(t,r);d=r=b.r;t=E.3g(b.t)}}7(t)d=[];7(d&&p==d[0])d.4l();2r=E.37(2r,d);K 2r},55:J(r,m,a){m=" "+m+" ";L c=[];Q(L i=0;r[i];i++){L b=(" "+r[i].1t+" ").1f(m)>=0;7(!a&&b||a&&!b)c.1g(r[i])}K c},1E:J(t,r,h){L d;2b(t&&t!=d){d=t;L p=E.6g,m;Q(L i=0;p[i];i++){m=p[i].2O(t);7(m){t=t.7V(m[0].M);m[2]=m[2].1r(/\\\\/g,"");1Q}}7(!m)1Q;7(m[1]==":"&&m[2]=="56")r=G.17(m[3])?E.1E(m[3],r,P).r:E(r).56(m[3]);N 7(m[1]==".")r=E.55(r,m[2],h);N 7(m[1]=="["){L g=[],U=m[3];Q(L i=0,3f=r.M;i<3f;i++){L a=r[i],z=a[E.46[m[2]]||m[2]];7(z==V||/6O|3Q|2p/.17(m[2]))z=E.1J(a,m[2])||\'\';7((U==""&&!!z||U=="="&&z==m[5]||U=="!="&&z!=m[5]||U=="^="&&z&&!z.1f(m[5])||U=="$="&&z.6e(z.M-m[5].M)==m[5]||(U=="*="||U=="~=")&&z.1f(m[5])>=0)^h)g.1g(a)}r=g}N 7(m[1]==":"&&m[2]=="2Z-4p"){L e={},g=[],17=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2O(m[3]=="6n"&&"2n"||m[3]=="6l"&&"2n+1"||!/\\D/.17(m[3])&&"7U+"+m[3]||m[3]),3j=(17[1]+(17[2]||1))-0,d=17[3]-0;Q(L i=0,3f=r.M;i<3f;i++){L j=r[i],1a=j.1a,2w=E.O(1a);7(!e[2w]){L c=1;Q(L n=1a.1C;n;n=n.2B)7(n.15==1)n.4k=c++;e[2w]=P}L b=S;7(3j==0){7(j.4k==d)b=P}N 7((j.4k-d)%3j==0&&(j.4k-d)/3j>=0)b=P;7(b^h)g.1g(j)}r=g}N{L f=E.6r[m[1]];7(1o f=="3V")f=f[m[2]];7(1o f=="25")f=6c("S||J(a,i){K "+f+";}");r=E.3y(r,J(a,i){K f(a,i,m,r)},h)}}K{r:r,t:t}},4u:J(b,c){L d=[];L a=b[c];2b(a&&a!=T){7(a.15==1)d.1g(a);a=a[c]}K d},2Z:J(a,e,c,b){e=e||1;L d=0;Q(;a;a=a[c])7(a.15==1&&++d==e)1Q;K a},5i:J(n,a){L r=[];Q(;n;n=n.2B){7(n.15==1&&(!a||n!=a))r.1g(n)}K r}});E.16={1b:J(f,i,g,e){7(f.15==3||f.15==8)K;7(E.14.1d&&f.53!=10)f=1e;7(!g.2D)g.2D=6.2D++;7(e!=10){L h=g;g=J(){K h.1i(6,18)};g.O=e;g.2D=h.2D}L j=E.O(f,"2R")||E.O(f,"2R",{}),1v=E.O(f,"1v")||E.O(f,"1v",J(){L a;7(1o E=="10"||E.16.5f)K a;a=E.16.1v.1i(18.3R.Y,18);K a});1v.Y=f;E.R(i.23(/\\s+/),J(c,b){L a=b.23(".");b=a[0];g.U=a[1];L d=j[b];7(!d){d=j[b]={};7(!E.16.2y[b]||E.16.2y[b].4j.1P(f)===S){7(f.3F)f.3F(b,1v,S);N 7(f.6b)f.6b("4i"+b,1v)}}d[g.2D]=g;E.16.2a[b]=P});f=V},2D:1,2a:{},1V:J(e,h,f){7(e.15==3||e.15==8)K;L i=E.O(e,"2R"),29,4X;7(i){7(h==10||(1o h=="25"&&h.7T(0)=="."))Q(L g 1p i)6.1V(e,g+(h||""));N{7(h.U){f=h.2q;h=h.U}E.R(h.23(/\\s+/),J(b,a){L c=a.23(".");a=c[0];7(i[a]){7(f)2V i[a][f.2D];N Q(f 1p i[a])7(!c[1]||i[a][f].U==c[1])2V i[a][f];Q(29 1p i[a])1Q;7(!29){7(!E.16.2y[a]||E.16.2y[a].4h.1P(e)===S){7(e.67)e.67(a,E.O(e,"1v"),S);N 7(e.66)e.66("4i"+a,E.O(e,"1v"))}29=V;2V i[a]}}})}Q(29 1p i)1Q;7(!29){L d=E.O(e,"1v");7(d)d.Y=V;E.35(e,"2R");E.35(e,"1v")}}},1N:J(g,c,d,f,h){c=E.2I(c||[]);7(g.1f("!")>=0){g=g.2K(0,-1);L a=P}7(!d){7(6.2a[g])E("*").1b([1e,T]).1N(g,c)}N{7(d.15==3||d.15==8)K 10;L b,29,1n=E.1q(d[g]||V),16=!c[0]||!c[0].36;7(16)c.4J(6.4Z({U:g,2L:d}));c[0].U=g;7(a)c[0].65=P;7(E.1q(E.O(d,"1v")))b=E.O(d,"1v").1i(d,c);7(!1n&&d["4i"+g]&&d["4i"+g].1i(d,c)===S)b=S;7(16)c.4l();7(h&&E.1q(h)){29=h.1i(d,b==V?c:c.71(b));7(29!==10)b=29}7(1n&&f!==S&&b!==S&&!(E.12(d,\'a\')&&g=="4V")){6.5f=P;1S{d[g]()}1X(e){}}6.5f=S}K b},1v:J(c){L a;c=E.16.4Z(c||1e.16||{});L b=c.U.23(".");c.U=b[0];L f=E.O(6,"2R")&&E.O(6,"2R")[c.U],42=1M.2l.2K.1P(18,1);42.4J(c);Q(L j 1p f){L d=f[j];42[0].2q=d;42[0].O=d.O;7(!b[1]&&!c.65||d.U==b[1]){L e=d.1i(6,42);7(a!==S)a=e;7(e===S){c.36();c.44()}}}7(E.14.1d)c.2L=c.36=c.44=c.2q=c.O=V;K a},4Z:J(c){L a=c;c=E.1s({},a);c.36=J(){7(a.36)a.36();a.7S=S};c.44=J(){7(a.44)a.44();a.7R=P};7(!c.2L)c.2L=c.7Q||T;7(c.2L.15==3)c.2L=a.2L.1a;7(!c.4S&&c.5w)c.4S=c.5w==c.2L?c.7P:c.5w;7(c.64==V&&c.63!=V){L b=T.1F,1h=T.1h;c.64=c.63+(b&&b.2v||1h&&1h.2v||0)-(b.62||0);c.7N=c.7L+(b&&b.2x||1h&&1h.2x||0)-(b.60||0)}7(!c.3c&&((c.4f||c.4f===0)?c.4f:c.5Z))c.3c=c.4f||c.5Z;7(!c.7b&&c.5Y)c.7b=c.5Y;7(!c.3c&&c.2G)c.3c=(c.2G&1?1:(c.2G&2?3:(c.2G&4?2:0)));K c},2y:{21:{4j:J(){5M();K},4h:J(){K}},3C:{4j:J(){7(E.14.1d)K S;E(6).2j("4P",E.16.2y.3C.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4P",E.16.2y.3C.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3C";K E.16.1v.1i(6,18)}},3B:{4j:J(){7(E.14.1d)K S;E(6).2j("4O",E.16.2y.3B.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4O",E.16.2y.3B.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3B";K E.16.1v.1i(6,18)}}}};E.1n.1s({2j:J(c,a,b){K c=="4H"?6.2X(c,a,b):6.R(J(){E.16.1b(6,c,b||a,b&&a)})},2X:J(d,b,c){K 6.R(J(){E.16.1b(6,d,J(a){E(6).3w(a);K(c||b).1i(6,18)},c&&b)})},3w:J(a,b){K 6.R(J(){E.16.1V(6,a,b)})},1N:J(c,a,b){K 6.R(J(){E.16.1N(c,a,6,P,b)})},5n:J(c,a,b){7(6[0])K E.16.1N(c,a,6[0],S,b);K 10},2g:J(){L b=18;K 6.4V(J(a){6.4N=0==6.4N?1:0;a.36();K b[6.4N].1i(6,18)||S})},7D:J(a,b){K 6.2j(\'3C\',a).2j(\'3B\',b)},21:J(a){5M();7(E.2Q)a.1P(T,E);N E.3A.1g(J(){K a.1P(6,E)});K 6}});E.1s({2Q:S,3A:[],21:J(){7(!E.2Q){E.2Q=P;7(E.3A){E.R(E.3A,J(){6.1i(T)});E.3A=V}E(T).5n("21")}}});L x=S;J 5M(){7(x)K;x=P;7(T.3F&&!E.14.2z)T.3F("5W",E.21,S);7(E.14.1d&&1e==3b)(J(){7(E.2Q)K;1S{T.1F.7B("26")}1X(3a){3z(18.3R,0);K}E.21()})();7(E.14.2z)T.3F("5W",J(){7(E.2Q)K;Q(L i=0;i<T.4L.M;i++)7(T.4L[i].2Y){3z(18.3R,0);K}E.21()},S);7(E.14.2d){L a;(J(){7(E.2Q)K;7(T.39!="5V"&&T.39!="1y"){3z(18.3R,0);K}7(a===10)a=E("W, 7a[7A=7z]").M;7(T.4L.M!=a){3z(18.3R,0);K}E.21()})()}E.16.1b(1e,"3U",E.21)}E.R(("7y,7x,3U,7w,5d,4H,4V,7v,"+"7G,7u,7t,4P,4O,7s,2k,"+"58,7K,7q,7p,3a").23(","),J(i,b){E.1n[b]=J(a){K a?6.2j(b,a):6.1N(b)}});L I=J(a,c){L b=a.4S;2b(b&&b!=c)1S{b=b.1a}1X(3a){b=c}K b==c};E(1e).2j("4H",J(){E("*").1b(T).3w()});E.1n.1s({3U:J(g,d,c){7(E.1q(g))K 6.2j("3U",g);L e=g.1f(" ");7(e>=0){L i=g.2K(e,g.M);g=g.2K(0,e)}c=c||J(){};L f="4Q";7(d)7(E.1q(d)){c=d;d=V}N{d=E.3m(d);f="61"}L h=6;E.3P({1c:g,U:f,1H:"3q",O:d,1y:J(a,b){7(b=="1W"||b=="5U")h.3q(i?E("<1x/>").3t(a.4b.1r(/<1m(.|\\s)*?\\/1m>/g,"")).2s(i):a.4b);h.R(c,[a.4b,b,a])}});K 6},7n:J(){K E.3m(6.5T())},5T:J(){K 6.2c(J(){K E.12(6,"3u")?E.2I(6.7m):6}).1E(J(){K 6.31&&!6.2Y&&(6.3k||/2k|6h/i.17(6.12)||/1u|1Z|3I/i.17(6.U))}).2c(J(i,c){L b=E(6).5O();K b==V?V:b.1k==1M?E.2c(b,J(a,i){K{31:c.31,1A:a}}):{31:c.31,1A:b}}).22()}});E.R("5S,6d,5R,6D,5Q,6m".23(","),J(i,o){E.1n[o]=J(f){K 6.2j(o,f)}});L B=(1B 3v).3L();E.1s({22:J(d,b,a,c){7(E.1q(b)){a=b;b=V}K E.3P({U:"4Q",1c:d,O:b,1W:a,1H:c})},7l:J(b,a){K E.22(b,V,a,"1m")},7k:J(c,b,a){K E.22(c,b,a,"3i")},7i:J(d,b,a,c){7(E.1q(b)){a=b;b={}}K E.3P({U:"61",1c:d,O:b,1W:a,1H:c})},85:J(a){E.1s(E.4I,a)},4I:{2a:P,U:"4Q",2U:0,5P:"4o/x-7h-3u-7g",5N:P,3l:P,O:V,6p:V,3I:V,49:{3M:"4o/3M, 1u/3M",3q:"1u/3q",1m:"1u/4m, 4o/4m",3i:"4o/3i, 1u/4m",1u:"1u/a7",4G:"*/*"}},4F:{},3P:J(s){L f,2W=/=\\?(&|$)/g,1z,O;s=E.1s(P,s,E.1s(P,{},E.4I,s));7(s.O&&s.5N&&1o s.O!="25")s.O=E.3m(s.O);7(s.1H=="4E"){7(s.U.2h()=="22"){7(!s.1c.1D(2W))s.1c+=(s.1c.1D(/\\?/)?"&":"?")+(s.4E||"7d")+"=?"}N 7(!s.O||!s.O.1D(2W))s.O=(s.O?s.O+"&":"")+(s.4E||"7d")+"=?";s.1H="3i"}7(s.1H=="3i"&&(s.O&&s.O.1D(2W)||s.1c.1D(2W))){f="4E"+B++;7(s.O)s.O=(s.O+"").1r(2W,"="+f+"$1");s.1c=s.1c.1r(2W,"="+f+"$1");s.1H="1m";1e[f]=J(a){O=a;1W();1y();1e[f]=10;1S{2V 1e[f]}1X(e){}7(h)h.34(g)}}7(s.1H=="1m"&&s.1T==V)s.1T=S;7(s.1T===S&&s.U.2h()=="22"){L i=(1B 3v()).3L();L j=s.1c.1r(/(\\?|&)4r=.*?(&|$)/,"$a4="+i+"$2");s.1c=j+((j==s.1c)?(s.1c.1D(/\\?/)?"&":"?")+"4r="+i:"")}7(s.O&&s.U.2h()=="22"){s.1c+=(s.1c.1D(/\\?/)?"&":"?")+s.O;s.O=V}7(s.2a&&!E.5H++)E.16.1N("5S");7((!s.1c.1f("a3")||!s.1c.1f("//"))&&s.1H=="1m"&&s.U.2h()=="22"){L h=T.3S("6f")[0];L g=T.3s("1m");g.3Q=s.1c;7(s.7c)g.a2=s.7c;7(!f){L l=S;g.9Z=g.9Y=J(){7(!l&&(!6.39||6.39=="5V"||6.39=="1y")){l=P;1W();1y();h.34(g)}}}h.38(g);K 10}L m=S;L k=1e.78?1B 78("9X.9V"):1B 76();k.9T(s.U,s.1c,s.3l,s.6p,s.3I);1S{7(s.O)k.4C("9R-9Q",s.5P);7(s.5C)k.4C("9O-5A-9N",E.4F[s.1c]||"9L, 9K 9I 9H 5z:5z:5z 9F");k.4C("X-9C-9A","76");k.4C("9z",s.1H&&s.49[s.1H]?s.49[s.1H]+", */*":s.49.4G)}1X(e){}7(s.6Y)s.6Y(k);7(s.2a)E.16.1N("6m",[k,s]);L c=J(a){7(!m&&k&&(k.39==4||a=="2U")){m=P;7(d){6I(d);d=V}1z=a=="2U"&&"2U"||!E.6X(k)&&"3a"||s.5C&&E.6J(k,s.1c)&&"5U"||"1W";7(1z=="1W"){1S{O=E.6W(k,s.1H)}1X(e){1z="5x"}}7(1z=="1W"){L b;1S{b=k.5q("6U-5A")}1X(e){}7(s.5C&&b)E.4F[s.1c]=b;7(!f)1W()}N E.5v(s,k,1z);1y();7(s.3l)k=V}};7(s.3l){L d=53(c,13);7(s.2U>0)3z(J(){7(k){k.9t();7(!m)c("2U")}},s.2U)}1S{k.9s(s.O)}1X(e){E.5v(s,k,V,e)}7(!s.3l)c();J 1W(){7(s.1W)s.1W(O,1z);7(s.2a)E.16.1N("5Q",[k,s])}J 1y(){7(s.1y)s.1y(k,1z);7(s.2a)E.16.1N("5R",[k,s]);7(s.2a&&!--E.5H)E.16.1N("6d")}K k},5v:J(s,a,b,e){7(s.3a)s.3a(a,b,e);7(s.2a)E.16.1N("6D",[a,s,e])},5H:0,6X:J(r){1S{K!r.1z&&9q.9p=="59:"||(r.1z>=6T&&r.1z<9n)||r.1z==6R||r.1z==9l||E.14.2d&&r.1z==10}1X(e){}K S},6J:J(a,c){1S{L b=a.5q("6U-5A");K a.1z==6R||b==E.4F[c]||E.14.2d&&a.1z==10}1X(e){}K S},6W:J(r,b){L c=r.5q("9k-U");L d=b=="3M"||!b&&c&&c.1f("3M")>=0;L a=d?r.9j:r.4b;7(d&&a.1F.28=="5x")6Q"5x";7(b=="1m")E.5g(a);7(b=="3i")a=6c("("+a+")");K a},3m:J(a){L s=[];7(a.1k==1M||a.5h)E.R(a,J(){s.1g(3r(6.31)+"="+3r(6.1A))});N Q(L j 1p a)7(a[j]&&a[j].1k==1M)E.R(a[j],J(){s.1g(3r(j)+"="+3r(6))});N s.1g(3r(j)+"="+3r(a[j]));K s.6a("&").1r(/%20/g,"+")}});E.1n.1s({1G:J(c,b){K c?6.2e({1R:"1G",27:"1G",1w:"1G"},c,b):6.1E(":1Z").R(J(){6.W.19=6.5s||"";7(E.1j(6,"19")=="2H"){L a=E("<"+6.28+" />").6y("1h");6.W.19=a.1j("19");7(6.W.19=="2H")6.W.19="3D";a.1V()}}).3h()},1I:J(b,a){K b?6.2e({1R:"1I",27:"1I",1w:"1I"},b,a):6.1E(":4d").R(J(){6.5s=6.5s||E.1j(6,"19");6.W.19="2H"}).3h()},6N:E.1n.2g,2g:J(a,b){K E.1q(a)&&E.1q(b)?6.6N(a,b):a?6.2e({1R:"2g",27:"2g",1w:"2g"},a,b):6.R(J(){E(6)[E(6).3H(":1Z")?"1G":"1I"]()})},9f:J(b,a){K 6.2e({1R:"1G"},b,a)},9d:J(b,a){K 6.2e({1R:"1I"},b,a)},9c:J(b,a){K 6.2e({1R:"2g"},b,a)},9a:J(b,a){K 6.2e({1w:"1G"},b,a)},99:J(b,a){K 6.2e({1w:"1I"},b,a)},97:J(c,a,b){K 6.2e({1w:a},c,b)},2e:J(l,k,j,h){L i=E.6P(k,j,h);K 6[i.2P===S?"R":"2P"](J(){7(6.15!=1)K S;L g=E.1s({},i);L f=E(6).3H(":1Z"),4A=6;Q(L p 1p l){7(l[p]=="1I"&&f||l[p]=="1G"&&!f)K E.1q(g.1y)&&g.1y.1i(6);7(p=="1R"||p=="27"){g.19=E.1j(6,"19");g.32=6.W.32}}7(g.32!=V)6.W.32="1Z";g.40=E.1s({},l);E.R(l,J(c,a){L e=1B E.2t(4A,g,c);7(/2g|1G|1I/.17(a))e[a=="2g"?f?"1G":"1I":a](l);N{L b=a.3X().1D(/^([+-]=)?([\\d+-.]+)(.*)$/),1Y=e.2m(P)||0;7(b){L d=2M(b[2]),2A=b[3]||"2S";7(2A!="2S"){4A.W[c]=(d||1)+2A;1Y=((d||1)/e.2m(P))*1Y;4A.W[c]=1Y+2A}7(b[1])d=((b[1]=="-="?-1:1)*d)+1Y;e.45(1Y,d,2A)}N e.45(1Y,a,"")}});K P})},2P:J(a,b){7(E.1q(a)||(a&&a.1k==1M)){b=a;a="2t"}7(!a||(1o a=="25"&&!b))K A(6[0],a);K 6.R(J(){7(b.1k==1M)A(6,a,b);N{A(6,a).1g(b);7(A(6,a).M==1)b.1i(6)}})},94:J(b,c){L a=E.3G;7(b)6.2P([]);6.R(J(){Q(L i=a.M-1;i>=0;i--)7(a[i].Y==6){7(c)a[i](P);a.72(i,1)}});7(!c)6.5p();K 6}});L A=J(b,c,a){7(!b)K 10;c=c||"2t";L q=E.O(b,c+"2P");7(!q||a)q=E.O(b,c+"2P",a?E.2I(a):[]);K q};E.1n.5p=J(a){a=a||"2t";K 6.R(J(){L q=A(6,a);q.4l();7(q.M)q[0].1i(6)})};E.1s({6P:J(b,a,c){L d=b&&b.1k==92?b:{1y:c||!c&&a||E.1q(b)&&b,2u:b,3Z:c&&a||a&&a.1k!=91&&a};d.2u=(d.2u&&d.2u.1k==51?d.2u:{90:8Z,9D:6T}[d.2u])||8X;d.5y=d.1y;d.1y=J(){7(d.2P!==S)E(6).5p();7(E.1q(d.5y))d.5y.1i(6)};K d},3Z:{70:J(p,n,b,a){K b+a*p},5j:J(p,n,b,a){K((-24.8V(p*24.8U)/2)+0.5)*a+b}},3G:[],3W:V,2t:J(b,c,a){6.11=c;6.Y=b;6.1l=a;7(!c.47)c.47={}}});E.2t.2l={4y:J(){7(6.11.30)6.11.30.1i(6.Y,[6.2J,6]);(E.2t.30[6.1l]||E.2t.30.4G)(6);7(6.1l=="1R"||6.1l=="27")6.Y.W.19="3D"},2m:J(a){7(6.Y[6.1l]!=V&&6.Y.W[6.1l]==V)K 6.Y[6.1l];L r=2M(E.1j(6.Y,6.1l,a));K r&&r>-8Q?r:2M(E.2o(6.Y,6.1l))||0},45:J(c,b,d){6.5B=(1B 3v()).3L();6.1Y=c;6.3h=b;6.2A=d||6.2A||"2S";6.2J=6.1Y;6.4B=6.4w=0;6.4y();L e=6;J t(a){K e.30(a)}t.Y=6.Y;E.3G.1g(t);7(E.3W==V){E.3W=53(J(){L a=E.3G;Q(L i=0;i<a.M;i++)7(!a[i]())a.72(i--,1);7(!a.M){6I(E.3W);E.3W=V}},13)}},1G:J(){6.11.47[6.1l]=E.1J(6.Y.W,6.1l);6.11.1G=P;6.45(0,6.2m());7(6.1l=="27"||6.1l=="1R")6.Y.W[6.1l]="8N";E(6.Y).1G()},1I:J(){6.11.47[6.1l]=E.1J(6.Y.W,6.1l);6.11.1I=P;6.45(6.2m(),0)},30:J(a){L t=(1B 3v()).3L();7(a||t>6.11.2u+6.5B){6.2J=6.3h;6.4B=6.4w=1;6.4y();6.11.40[6.1l]=P;L b=P;Q(L i 1p 6.11.40)7(6.11.40[i]!==P)b=S;7(b){7(6.11.19!=V){6.Y.W.32=6.11.32;6.Y.W.19=6.11.19;7(E.1j(6.Y,"19")=="2H")6.Y.W.19="3D"}7(6.11.1I)6.Y.W.19="2H";7(6.11.1I||6.11.1G)Q(L p 1p 6.11.40)E.1J(6.Y.W,p,6.11.47[p])}7(b&&E.1q(6.11.1y))6.11.1y.1i(6.Y);K S}N{L n=t-6.5B;6.4w=n/6.11.2u;6.4B=E.3Z[6.11.3Z||(E.3Z.5j?"5j":"70")](6.4w,n,0,1,6.11.2u);6.2J=6.1Y+((6.3h-6.1Y)*6.4B);6.4y()}K P}};E.2t.30={2v:J(a){a.Y.2v=a.2J},2x:J(a){a.Y.2x=a.2J},1w:J(a){E.1J(a.Y.W,"1w",a.2J)},4G:J(a){a.Y.W[a.1l]=a.2J+a.2A}};E.1n.5L=J(){L b=0,3b=0,Y=6[0],5l;7(Y)8M(E.14){L d=Y.1a,41=Y,1K=Y.1K,1L=Y.2i,5D=2d&&4s(5K)<8J&&!/a1/i.17(v),2T=E.1j(Y,"43")=="2T";7(Y.6G){L c=Y.6G();1b(c.26+24.2f(1L.1F.2v,1L.1h.2v),c.3b+24.2f(1L.1F.2x,1L.1h.2x));1b(-1L.1F.62,-1L.1F.60)}N{1b(Y.5G,Y.5F);2b(1K){1b(1K.5G,1K.5F);7(48&&!/^t(8H|d|h)$/i.17(1K.28)||2d&&!5D)2N(1K);7(!2T&&E.1j(1K,"43")=="2T")2T=P;41=/^1h$/i.17(1K.28)?41:1K;1K=1K.1K}2b(d&&d.28&&!/^1h|3q$/i.17(d.28)){7(!/^8G|1O.*$/i.17(E.1j(d,"19")))1b(-d.2v,-d.2x);7(48&&E.1j(d,"32")!="4d")2N(d);d=d.1a}7((5D&&(2T||E.1j(41,"43")=="4W"))||(48&&E.1j(41,"43")!="4W"))1b(-1L.1h.5G,-1L.1h.5F);7(2T)1b(24.2f(1L.1F.2v,1L.1h.2v),24.2f(1L.1F.2x,1L.1h.2x))}5l={3b:3b,26:b}}J 2N(a){1b(E.2o(a,"a8",P),E.2o(a,"a9",P))}J 1b(l,t){b+=4s(l)||0;3b+=4s(t)||0}K 5l}})();',62,631,'||||||this|if||||||||||||||||||||||||||||||||||||||function|return|var|length|else|data|true|for|each|false|document|type|null|style||elem||undefined|options|nodeName||browser|nodeType|event|test|arguments|display|parentNode|add|url|msie|window|indexOf|push|body|apply|css|constructor|prop|script|fn|typeof|in|isFunction|replace|extend|className|text|handle|opacity|div|complete|status|value|new|firstChild|match|filter|documentElement|show|dataType|hide|attr|offsetParent|doc|Array|trigger|table|call|break|height|try|cache|tbody|remove|success|catch|start|hidden||ready|get|split|Math|string|left|width|tagName|ret|global|while|map|safari|animate|max|toggle|toLowerCase|ownerDocument|bind|select|prototype|cur||curCSS|selected|handler|done|find|fx|duration|scrollLeft|id|scrollTop|special|opera|unit|nextSibling|stack|guid|toUpperCase|pushStack|button|none|makeArray|now|slice|target|parseFloat|border|exec|queue|isReady|events|px|fixed|timeout|delete|jsre|one|disabled|nth|step|name|overflow|inArray|removeChild|removeData|preventDefault|merge|appendChild|readyState|error|top|which|innerHTML|multiFilter|rl|trim|end|json|first|checked|async|param|elems|insertBefore|childNodes|html|encodeURIComponent|createElement|append|form|Date|unbind|color|grep|setTimeout|readyList|mouseleave|mouseenter|block|isXMLDoc|addEventListener|timers|is|password|last|runtimeStyle|getTime|xml|jQuery|domManip|ajax|src|callee|getElementsByTagName|selectedIndex|load|object|timerId|toString|has|easing|curAnim|offsetChild|args|position|stopPropagation|custom|props|orig|mozilla|accepts|clean|responseText|defaultView|visible|String|charCode|float|teardown|on|setup|nodeIndex|shift|javascript|currentStyle|application|child|RegExp|_|parseInt|previousSibling|dir|tr|state|empty|update|getAttribute|self|pos|setRequestHeader|input|jsonp|lastModified|_default|unload|ajaxSettings|unshift|getComputedStyle|styleSheets|getPropertyValue|lastToggle|mouseout|mouseover|GET|andSelf|relatedTarget|init|visibility|click|absolute|index|container|fix|outline|Number|removeAttribute|setInterval|prevObject|classFilter|not|unique|submit|file|after|windowData|deep|scroll|client|triggered|globalEval|jquery|sibling|swing|clone|results|wrapAll|triggerHandler|lastChild|dequeue|getResponseHeader|createTextNode|oldblock|checkbox|radio|handleError|fromElement|parsererror|old|00|Modified|startTime|ifModified|safari2|getWH|offsetTop|offsetLeft|active|values|getElementById|version|offset|bindReady|processData|val|contentType|ajaxSuccess|ajaxComplete|ajaxStart|serializeArray|notmodified|loaded|DOMContentLoaded|Width|ctrlKey|keyCode|clientTop|POST|clientLeft|clientX|pageX|exclusive|detachEvent|removeEventListener|swap|cloneNode|join|attachEvent|eval|ajaxStop|substr|head|parse|textarea|reset|image|zoom|odd|ajaxSend|even|before|username|prepend|expr|quickClass|uuid|quickID|quickChild|continue|textContent|appendTo|contents|evalScript|parent|defaultValue|ajaxError|setArray|compatMode|getBoundingClientRect|styleFloat|clearInterval|httpNotModified|nodeValue|100|alpha|_toggle|href|speed|throw|304|replaceWith|200|Last|colgroup|httpData|httpSuccess|beforeSend|eq|linear|concat|splice|fieldset|multiple|cssFloat|XMLHttpRequest|webkit|ActiveXObject|CSS1Compat|link|metaKey|scriptCharset|callback|col|pixelLeft|urlencoded|www|post|hasClass|getJSON|getScript|elements|serialize|black|keyup|keypress|solid|change|mousemove|mouseup|dblclick|resize|focus|blur|stylesheet|rel|doScroll|round|hover|padding|offsetHeight|mousedown|offsetWidth|Bottom|Top|keydown|clientY|Right|pageY|Left|toElement|srcElement|cancelBubble|returnValue|charAt|0n|substring|animated|header|noConflict|line|enabled|innerText|contains|only|weight|ajaxSetup|font|size|gt|lt|uFFFF|u0128|417|Boolean|inner|Height|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|contentWindow|contentDocument|wrap|iframe|children|siblings|prevAll|nextAll|prev|wrapInner|next|parents|maxLength|maxlength|readOnly|readonly|reverse|class|htmlFor|inline|able|boxModel|522|setData|compatible|with|1px|ie|getData|10000|ra|it|rv|PI|cos|userAgent|400|navigator|600|slow|Function|Object|array|stop|ig|NaN|fadeTo|option|fadeOut|fadeIn|setAttribute|slideToggle|slideUp|changed|slideDown|be|can|property|responseXML|content|1223|getAttributeNode|300|method|protocol|location|action|send|abort|cssText|th|td|cap|specified|Accept|With|colg|Requested|fast|tfoot|GMT|thead|1970|Jan|attributes|01|Thu|leg|Since|If|opt|Type|Content|embed|open|area|XMLHTTP|hr|Microsoft|onreadystatechange|onload|meta|adobeair|charset|http|1_|img|br|plain|borderLeftWidth|borderTopWidth|abbr'.split('|'),0,{}))
 
\ No newline at end of file
components/com_morfeoshow/src/js/jquery.blockUI-1.33.pack.js
Show inline comments
 
new file 100644
 
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(q($){$.3=q(a,b,c){$.3.r.1p(F,a,b,c)};$.3.22=1.33;$.2D=q(a){$.3.r.T(F,a)};$.1s.3f=q(a,b,c){B 4.1j(q(){7(!4.$1Y){7($.D(4,"M")==\'2M\')4.E.M=\'2C\';7($.Q.W)4.E.2z=1;4.$1Y=1}$.3.r.1p(4,a,b,c)})};$.1s.2x=q(a){B 4.1j(q(){$.3.r.T(4,a)})};$.1s.1r=q(a,b,c){8 d=4[0];7(!d)B;8 e=$(d);a=a||{};8 w=e.x()||e.1H(\'x\')||a.x||$.3.v.1i.x;8 h=e.A()||e.1H(\'A\')||a.A||$.3.v.1i.A;7(w[w.I-1]==\'%\'){8 f=u.S.15||u.y.15;w=16(w)||G;w=(w*f)/G}7(h[h.I-1]==\'%\'){8 g=u.S.X||u.y.X;h=16(h)||G;h=(h*g)/G}8 i=\'-\'+16(w)/2+\'H\';8 j=\'-\'+16(h)/2+\'H\';8 k=1A.1N.2w();8 l={O:b||1,2r:c&&/3e/.1o(k)&&/3d/.1o(k)};$.3.r.1p(F,d,{x:w,A:h,2p:j,3b:i},l)};$.3.v={2m:\'<2k>38 1k...</2k>\',2g:\'\',2d:{1I:\'#1G\',2c:\'0.5\'},29:{x:\'25\',1F:\'-32 0 0 -30\',N:\'1d%\',U:\'1d%\',1X:\'1g\',2V:\'#2S\',1I:\'#1G\',1B:\'2R 2P #2O\'},1R:{x:\'25\',1e:\'2L\',1X:\'1g\',1I:\'#1G\'},1i:{x:\'2h\',A:\'2h\',N:\'1d%\',U:\'1d%\'},2l:1,1Q:0,2n:\'2F 2E 2B\',1b:1,1P:2A};$.3.r={1w:J,1a:J,L:J,K:[],1v:F.1O&&F.1O.22()<9,1u:$.Q.W&&/2y 6.0/.1o(1A.1N),1p:q(a,b,c,d){d=d||{};4.1a=1t d.O==\'q\'?d.O:J;4.1w=d.O?b:J;8 e=(a==F);8 g=4.1v||$.Q.2v&&/2u/.1o(1A.2t);7(1t d.1M!=\'2s\')g=d.1M==0?1:0;7(e&&4.L)4.T(F,{1b:0});7(b&&1t b==\'1L\'&&!b.1K&&!b.24){c=b;b=J}b=b?(b.24?$(b):b):e?$.3.v.2m:$.3.v.2g;7(d.O)8 h=18.1q({},$.3.v.1i);17 8 h=18.1q({},e?$.3.v.29:$.3.v.1R);c=18.1q(h,c||{});8 f=($.Q.W)?$(\'<2q 12="3" E="z-1n:3c;1B:1m;1F:0;1e:0;M:1l;x:G%;A:G%;N:0;U:0" 3a="39:2j;"></2q>\'):$(\'<C 12="3" E="2i:1m"></C>\');8 w=$(\'<C 12="3" E="z-1n:37;14:1k;1B:1m;1F:0;1e:0;x:G%;A:G%;N:0;U:0"></C>\');8 m=e?$(\'<C 12="3 1J" E="z-1n:2f;14:1k;1e:0;M:2e"></C>\'):$(\'<C 12="3" E="2i:1m;z-1n:2f;14:1k;M:1l"></C>\');w.D(\'M\',e?\'2e\':\'1l\');7(b)m.D(c);7(!g)w.D($.3.v.2d);7(4.1v)w.D({x:\'\'+a.15,A:\'\'+a.X});7($.Q.W)f.D(\'2c\',\'0.0\');$([f[0],w[0],m[0]]).36(e?\'y\':a);8 j=$.Q.W&&(!$.19||$(\'1L,35\',e?J:a).I>0);7(4.1u||j){7(e&&$.3.v.2l&&$.19)$(\'34,y\').D(\'A\',\'G%\');7((4.1u||!$.19)&&!e){8 t=4.V(a,\'2b\'),l=4.V(a,\'2a\');8 k=t?\'(0 - \'+t+\')\':0;8 n=l?\'(0 - \'+l+\')\':0}$.1j([f,w,m],q(i,o){8 s=o[0].E;s.M=\'1l\';7(i<2){e?s.P(\'A\',\'u.y.23 > u.y.R ? u.y.23 : u.y.R + "H"\'):s.P(\'A\',\'4.11.R + "H"\');e?s.P(\'x\',\'18.19 && u.S.15 || u.y.15 + "H"\'):s.P(\'x\',\'4.11.1E + "H"\');7(n)s.P(\'U\',n);7(k)s.P(\'N\',k)}17{7(e)s.P(\'N\',\'(u.S.X || u.y.X) / 2 - (4.R / 2) + (31 = u.S.1x ? u.S.1x : u.y.1x) + "H"\');s.2p=0}})}7(d.O){w.D(\'14\',\'21\').1H(\'2Z\',$.3.v.2n);m.D(\'14\',\'21\');$([f[0],w[0],m[0]]).2Y(\'3\').2X(\'1r\');$().1c($.3.r.Z).Y(\'1C\',$.3.r.Z)}17 4.Y(1,a);m.2W(b).1W();7(b.1K)b.1W();7(d.O)B;7(e){4.L=m[0];4.K=$(\':1V:2U:2T\',4.L);1U(4.1f,20)}17 4.1g(m[0])},T:q(a,b){8 o=$.1q({},$.3.v,b);4.Y(0,a);8 c=a==F;8 d=c?$(\'y\').1T().1S(\'.3\'):$(\'.3\',a);7(c)4.L=4.K=J;7(o.1b){d.1b(o.1P,q(){7(4.11)4.11.2Q(4)})}17 d.T()},28:q(a){$().1D(\'1c\',$.3.r.Z).1D(\'1C\',$.3.r.Z);7(4.1a)4.1a(4.1w);$(\'y .1r\').2N().T()},1Z:q(e){7(e.1h&&e.1h==9){7($.3.r.L&&!$.3.v.1Q){8 a=$.3.r.K;8 b=!e.26&&e.13==a[a.I-1];8 c=e.26&&e.13==a[0];7(b||c){1U(q(){$.3.r.1f(c)},10);B 2j}}}7($(e.13).1z(\'C.1J\').I>0)B 1y;B $(e.13).1z().1T().1S(\'C.3\').I==0},Z:q(e){7((e.1h&&e.1h==27)||(e.2K==\'1c\'&&$(e.13).1z(\'C.1J\').I==0))$.3.r.28();B 1y},Y:q(b,a){8 c=a==F;7(!b&&(c&&!4.L||!c&&!a.$2o))B;7(!c)a.$2o=b;8 d=$(a).2J(\'a,:1V\');$.1j([\'2I\',\'2H\',\'2G\',\'1C\',\'1c\'],q(i,o){d[b?\'Y\':\'1D\'](o,$.3.r.1Z)})},1f:q(a){7(!$.3.r.K)B;8 e=$.3.r.K[a===1y?$.3.r.K.I-1:0];7(e)e.1f()},1g:q(a){8 p=a.11,s=a.E;8 l=((p.1E-a.1E)/2)-4.V(p,\'2a\');8 t=((p.R-a.R)/2)-4.V(p,\'2b\');s.U=l>0?(l+\'H\'):\'0\';s.N=t>0?(t+\'H\'):\'0\'},V:q(a,p){B 16($.D(a,p))||0}}})(18);',62,202,'|||blockUI|this|||if|var||||||||||||||||||function|impl|||document|defaults||width|body||height|return|div|css|style|window|100|px|length|null|pageBlockEls|pageBlock|position|top|displayMode|setExpression|browser|offsetHeight|documentElement|remove|left|sz|msie|clientHeight|bind|boxHandler||parentNode|class|target|cursor|clientWidth|parseInt|else|jQuery|boxModel|boxCallback|fadeOut|click|50|padding|focus|center|keyCode|displayBoxCSS|each|wait|absolute|none|index|test|install|extend|displayBox|fn|typeof|ie6|op8|box|scrollTop|true|parents|navigator|border|keypress|unbind|offsetWidth|margin|fff|attr|backgroundColor|blockMsg|jquery|object|alphaOverride|userAgent|opera|fadeTime|allowTabToLeave|elementMessageCSS|filter|children|setTimeout|input|show|textAlign|pos_checked|handler||default|version|scrollHeight|nodeType|250px|shiftKey||boxRemove|pageMessageCSS|borderLeftWidth|borderTopWidth|opacity|overlayCSS|fixed|1002|elementMessage|400px|display|false|h1|ie6Stretch|pageMessage|closeMessage|blocked|marginTop|iframe|noalpha|undefined|platform|Linux|mozilla|toLowerCase|unblock|MSIE|zoom|400|close|relative|unblockUI|to|Click|keydown|mouseup|mousedown|find|type|10px|static|hide|aaa|solid|removeChild|3px|000|visible|enabled|color|append|addClass|removeClass|title|125px|blah|50px||html|embed|appendTo|1001|Please|javascript|src|marginLeft|1000|firefox|mac|block'.split('|'),0,{}))
 
\ No newline at end of file
components/com_morfeoshow/src/js/jquery.history.pack.js
Show inline comments
 
new file 100644
 
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('2.P({8:n,5:n,K:l(a){2.5=a;3 b=9.7;2.8=b;4(2.h.u){4(2.8==\'\'){2.8=\'#\'}$("Z").X(\'<D W="m" T="S: O;"></D>\');3 c=$("#m")[0];3 d=c.r.k;d.C();d.F();d.9.7=b}f 4($.h.q){2.6=[];2.6.g=E.g;2.p=[];2.j=o}2.5(b.t(/^#/,\'\'));V(2.B,U)},A:l(a){2.6.z(a);2.p.g=0;y.j=o},B:l(){4(2.h.u){3 a=$("#m")[0];3 b=a.R||a.r.k;3 c=b.9.7;4(c!=2.8){9.7=c;2.8=c;2.5(c.t(/^#/,\'\'))}}f 4($.h.q){4(!2.s){3 d=E.g-2.6.g;4(d){2.j=x;4(d<0){w(3 i=0;i<N.M(d);i++)2.p.L(2.6.Q())}f{w(3 i=0;i<d;i++)2.6.z(2.p.J())}3 e=2.6[2.6.g-1];4(e!=n){2.8=9.7;2.5(e)}}f 4(2.6[2.6.g-1]==n&&!2.j){4(k.v.I(\'#\')>=0){2.5(k.v.H(\'#\')[1])}f{3 c=9.7;2.5(\'\')}2.j=o}}}f{3 c=9.7;4(c!=2.8){2.8=c;2.5(c.t(/^#/,\'\'))}}},G:l(a){3 b;4(2.h.q){b=a}f{b=\'#\'+a;9.7=b}2.8=b;4(2.h.u){3 c=$("#m")[0];3 d=c.r.k;d.C();d.F();d.9.7=b;2.5(a)}f 4(2.h.q){2.s=o;y.A(a);3 e=l(){2.s=x};Y.10(e,11);2.5(a);9.7=b}f{2.5(a)}}});',62,64,'||jQuery|var|if|historyCallback|historyBackStack|hash|historyCurrentHash|location||||||else|length|browser||isFirst|document|function|jQuery_history|undefined|true|historyForwardStack|safari|contentWindow|dontCheck|replace|msie|URL|for|false|this|push|historyAddHistory|historyCheck|open|iframe|history|close|historyLoad|split|indexOf|shift|historyInit|unshift|abs|Math|none|extend|pop|contentDocument|display|style|100|setInterval|id|prepend|window|body|setTimeout|200'.split('|'),0,{}))
 
\ No newline at end of file
components/com_morfeoshow/src/js/mootools.js
Show inline comments
 
new file 100644
 
//MooTools, My Object Oriented Javascript Tools. Copyright (c) 2006 Valerio Proietti, <http://mad4milk.net>, MIT Style License.
 

	
 
var MooTools={version:'1.11'};function $defined(obj){return(obj!=undefined);};function $type(obj){if(!$defined(obj))return false;if(obj.htmlElement)return'element';var type=typeof obj;if(type=='object'&&obj.nodeName){switch(obj.nodeType){case 1:return'element';case 3:return(/\S/).test(obj.nodeValue)?'textnode':'whitespace';}}
 
if(type=='object'||type=='function'){switch(obj.constructor){case Array:return'array';case RegExp:return'regexp';case Class:return'class';}
 
if(typeof obj.length=='number'){if(obj.item)return'collection';if(obj.callee)return'arguments';}}
 
return type;};function $merge(){var mix={};for(var i=0;i<arguments.length;i++){for(var property in arguments[i]){var ap=arguments[i][property];var mp=mix[property];if(mp&&$type(ap)=='object'&&$type(mp)=='object')mix[property]=$merge(mp,ap);else mix[property]=ap;}}
 
return mix;};var $extend=function(){var args=arguments;if(!args[1])args=[this,args[0]];for(var property in args[1])args[0][property]=args[1][property];return args[0];};var $native=function(){for(var i=0,l=arguments.length;i<l;i++){arguments[i].extend=function(props){for(var prop in props){if(!this.prototype[prop])this.prototype[prop]=props[prop];if(!this[prop])this[prop]=$native.generic(prop);}};}};$native.generic=function(prop){return function(bind){return this.prototype[prop].apply(bind,Array.prototype.slice.call(arguments,1));};};$native(Function,Array,String,Number);function $chk(obj){return!!(obj||obj===0);};function $pick(obj,picked){return $defined(obj)?obj:picked;};function $random(min,max){return Math.floor(Math.random()*(max-min+1)+min);};function $time(){return new Date().getTime();};function $clear(timer){clearTimeout(timer);clearInterval(timer);return null;};var Abstract=function(obj){obj=obj||{};obj.extend=$extend;return obj;};var Window=new Abstract(window);var Document=new Abstract(document);document.head=document.getElementsByTagName('head')[0];window.xpath=!!(document.evaluate);if(window.ActiveXObject)window.ie=window[window.XMLHttpRequest?'ie7':'ie6']=true;else if(document.childNodes&&!document.all&&!navigator.taintEnabled)window.webkit=window[window.xpath?'webkit420':'webkit419']=true;else if(document.getBoxObjectFor!=null)window.gecko=true;window.khtml=window.webkit;Object.extend=$extend;if(typeof HTMLElement=='undefined'){var HTMLElement=function(){};if(window.webkit)document.createElement("iframe");HTMLElement.prototype=(window.webkit)?window["[[DOMElement.prototype]]"]:{};}
 
HTMLElement.prototype.htmlElement=function(){};if(window.ie6)try{document.execCommand("BackgroundImageCache",false,true);}catch(e){};var Class=function(properties){var klass=function(){return(arguments[0]!==null&&this.initialize&&$type(this.initialize)=='function')?this.initialize.apply(this,arguments):this;};$extend(klass,this);klass.prototype=properties;klass.constructor=Class;return klass;};Class.empty=function(){};Class.prototype={extend:function(properties){var proto=new this(null);for(var property in properties){var pp=proto[property];proto[property]=Class.Merge(pp,properties[property]);}
 
return new Class(proto);},implement:function(){for(var i=0,l=arguments.length;i<l;i++)$extend(this.prototype,arguments[i]);}};Class.Merge=function(previous,current){if(previous&&previous!=current){var type=$type(current);if(type!=$type(previous))return current;switch(type){case'function':var merged=function(){this.parent=arguments.callee.parent;return current.apply(this,arguments);};merged.parent=previous;return merged;case'object':return $merge(previous,current);}}
 
return current;};var Chain=new Class({chain:function(fn){this.chains=this.chains||[];this.chains.push(fn);return this;},callChain:function(){if(this.chains&&this.chains.length)this.chains.shift().delay(10,this);},clearChain:function(){this.chains=[];}});var Events=new Class({addEvent:function(type,fn){if(fn!=Class.empty){this.$events=this.$events||{};this.$events[type]=this.$events[type]||[];this.$events[type].include(fn);}
 
return this;},fireEvent:function(type,args,delay){if(this.$events&&this.$events[type]){this.$events[type].each(function(fn){fn.create({'bind':this,'delay':delay,'arguments':args})();},this);}
 
return this;},removeEvent:function(type,fn){if(this.$events&&this.$events[type])this.$events[type].remove(fn);return this;}});var Options=new Class({setOptions:function(){this.options=$merge.apply(null,[this.options].extend(arguments));if(this.addEvent){for(var option in this.options){if($type(this.options[option]=='function')&&(/^on[A-Z]/).test(option))this.addEvent(option,this.options[option]);}}
 
return this;}});Array.extend({forEach:function(fn,bind){for(var i=0,j=this.length;i<j;i++)fn.call(bind,this[i],i,this);},filter:function(fn,bind){var results=[];for(var i=0,j=this.length;i<j;i++){if(fn.call(bind,this[i],i,this))results.push(this[i]);}
 
return results;},map:function(fn,bind){var results=[];for(var i=0,j=this.length;i<j;i++)results[i]=fn.call(bind,this[i],i,this);return results;},every:function(fn,bind){for(var i=0,j=this.length;i<j;i++){if(!fn.call(bind,this[i],i,this))return false;}
 
return true;},some:function(fn,bind){for(var i=0,j=this.length;i<j;i++){if(fn.call(bind,this[i],i,this))return true;}
 
return false;},indexOf:function(item,from){var len=this.length;for(var i=(from<0)?Math.max(0,len+from):from||0;i<len;i++){if(this[i]===item)return i;}
 
return-1;},copy:function(start,length){start=start||0;if(start<0)start=this.length+start;length=length||(this.length-start);var newArray=[];for(var i=0;i<length;i++)newArray[i]=this[start++];return newArray;},remove:function(item){var i=0;var len=this.length;while(i<len){if(this[i]===item){this.splice(i,1);len--;}else{i++;}}
 
return this;},contains:function(item,from){return this.indexOf(item,from)!=-1;},associate:function(keys){var obj={},length=Math.min(this.length,keys.length);for(var i=0;i<length;i++)obj[keys[i]]=this[i];return obj;},extend:function(array){for(var i=0,j=array.length;i<j;i++)this.push(array[i]);return this;},merge:function(array){for(var i=0,l=array.length;i<l;i++)this.include(array[i]);return this;},include:function(item){if(!this.contains(item))this.push(item);return this;},getRandom:function(){return this[$random(0,this.length-1)]||null;},getLast:function(){return this[this.length-1]||null;}});Array.prototype.each=Array.prototype.forEach;Array.each=Array.forEach;function $A(array){return Array.copy(array);};function $each(iterable,fn,bind){if(iterable&&typeof iterable.length=='number'&&$type(iterable)!='object'){Array.forEach(iterable,fn,bind);}else{for(var name in iterable)fn.call(bind||iterable,iterable[name],name);}};Array.prototype.test=Array.prototype.contains;String.extend({test:function(regex,params){return(($type(regex)=='string')?new RegExp(regex,params):regex).test(this);},toInt:function(){return parseInt(this,10);},toFloat:function(){return parseFloat(this);},camelCase:function(){return this.replace(/-\D/g,function(match){return match.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/\w[A-Z]/g,function(match){return(match.charAt(0)+'-'+match.charAt(1).toLowerCase());});},capitalize:function(){return this.replace(/\b[a-z]/g,function(match){return match.toUpperCase();});},trim:function(){return this.replace(/^\s+|\s+$/g,'');},clean:function(){return this.replace(/\s{2,}/g,' ').trim();},rgbToHex:function(array){var rgb=this.match(/\d{1,3}/g);return(rgb)?rgb.rgbToHex(array):false;},hexToRgb:function(array){var hex=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(hex)?hex.slice(1).hexToRgb(array):false;},contains:function(string,s){return(s)?(s+this+s).indexOf(s+string+s)>-1:this.indexOf(string)>-1;},escapeRegExp:function(){return this.replace(/([.*+?^${}()|[\]\/\\])/g,'\\$1');}});Array.extend({rgbToHex:function(array){if(this.length<3)return false;if(this.length==4&&this[3]==0&&!array)return'transparent';var hex=[];for(var i=0;i<3;i++){var bit=(this[i]-0).toString(16);hex.push((bit.length==1)?'0'+bit:bit);}
 
return array?hex:'#'+hex.join('');},hexToRgb:function(array){if(this.length!=3)return false;var rgb=[];for(var i=0;i<3;i++){rgb.push(parseInt((this[i].length==1)?this[i]+this[i]:this[i],16));}
 
return array?rgb:'rgb('+rgb.join(',')+')';}});Function.extend({create:function(options){var fn=this;options=$merge({'bind':fn,'event':false,'arguments':null,'delay':false,'periodical':false,'attempt':false},options);if($chk(options.arguments)&&$type(options.arguments)!='array')options.arguments=[options.arguments];return function(event){var args;if(options.event){event=event||window.event;args=[(options.event===true)?event:new options.event(event)];if(options.arguments)args.extend(options.arguments);}
 
else args=options.arguments||arguments;var returns=function(){return fn.apply($pick(options.bind,fn),args);};if(options.delay)return setTimeout(returns,options.delay);if(options.periodical)return setInterval(returns,options.periodical);if(options.attempt)try{return returns();}catch(err){return false;};return returns();};},pass:function(args,bind){return this.create({'arguments':args,'bind':bind});},attempt:function(args,bind){return this.create({'arguments':args,'bind':bind,'attempt':true})();},bind:function(bind,args){return this.create({'bind':bind,'arguments':args});},bindAsEventListener:function(bind,args){return this.create({'bind':bind,'event':true,'arguments':args});},delay:function(delay,bind,args){return this.create({'delay':delay,'bind':bind,'arguments':args})();},periodical:function(interval,bind,args){return this.create({'periodical':interval,'bind':bind,'arguments':args})();}});Number.extend({toInt:function(){return parseInt(this);},toFloat:function(){return parseFloat(this);},limit:function(min,max){return Math.min(max,Math.max(min,this));},round:function(precision){precision=Math.pow(10,precision||0);return Math.round(this*precision)/precision;},times:function(fn){for(var i=0;i<this;i++)fn(i);}});var Element=new Class({initialize:function(el,props){if($type(el)=='string'){if(window.ie&&props&&(props.name||props.type)){var name=(props.name)?' name="'+props.name+'"':'';var type=(props.type)?' type="'+props.type+'"':'';delete props.name;delete props.type;el='<'+el+name+type+'>';}
 
el=document.createElement(el);}
 
el=$(el);return(!props||!el)?el:el.set(props);}});var Elements=new Class({initialize:function(elements){return(elements)?$extend(elements,this):this;}});Elements.extend=function(props){for(var prop in props){this.prototype[prop]=props[prop];this[prop]=$native.generic(prop);}};function $(el){if(!el)return null;if(el.htmlElement)return Garbage.collect(el);if([window,document].contains(el))return el;var type=$type(el);if(type=='string'){el=document.getElementById(el);type=(el)?'element':false;}
 
if(type!='element')return null;if(el.htmlElement)return Garbage.collect(el);if(['object','embed'].contains(el.tagName.toLowerCase()))return el;$extend(el,Element.prototype);el.htmlElement=function(){};return Garbage.collect(el);};document.getElementsBySelector=document.getElementsByTagName;function $$(){var elements=[];for(var i=0,j=arguments.length;i<j;i++){var selector=arguments[i];switch($type(selector)){case'element':elements.push(selector);case'boolean':break;case false:break;case'string':selector=document.getElementsBySelector(selector,true);default:elements.extend(selector);}}
 
return $$.unique(elements);};$$.unique=function(array){var elements=[];for(var i=0,l=array.length;i<l;i++){if(array[i].$included)continue;var element=$(array[i]);if(element&&!element.$included){element.$included=true;elements.push(element);}}
 
for(var n=0,d=elements.length;n<d;n++)elements[n].$included=null;return new Elements(elements);};Elements.Multi=function(property){return function(){var args=arguments;var items=[];var elements=true;for(var i=0,j=this.length,returns;i<j;i++){returns=this[i][property].apply(this[i],args);if($type(returns)!='element')elements=false;items.push(returns);};return(elements)?$$.unique(items):items;};};Element.extend=function(properties){for(var property in properties){HTMLElement.prototype[property]=properties[property];Element.prototype[property]=properties[property];Element[property]=$native.generic(property);var elementsProperty=(Array.prototype[property])?property+'Elements':property;Elements.prototype[elementsProperty]=Elements.Multi(property);}};Element.extend({set:function(props){for(var prop in props){var val=props[prop];switch(prop){case'styles':this.setStyles(val);break;case'events':if(this.addEvents)this.addEvents(val);break;case'properties':this.setProperties(val);break;default:this.setProperty(prop,val);}}
 
return this;},inject:function(el,where){el=$(el);switch(where){case'before':el.parentNode.insertBefore(this,el);break;case'after':var next=el.getNext();if(!next)el.parentNode.appendChild(this);else el.parentNode.insertBefore(this,next);break;case'top':var first=el.firstChild;if(first){el.insertBefore(this,first);break;}
 
default:el.appendChild(this);}
 
return this;},injectBefore:function(el){return this.inject(el,'before');},injectAfter:function(el){return this.inject(el,'after');},injectInside:function(el){return this.inject(el,'bottom');},injectTop:function(el){return this.inject(el,'top');},adopt:function(){var elements=[];$each(arguments,function(argument){elements=elements.concat(argument);});$$(elements).inject(this);return this;},remove:function(){return this.parentNode.removeChild(this);},clone:function(contents){var el=$(this.cloneNode(contents!==false));if(!el.$events)return el;el.$events={};for(var type in this.$events)el.$events[type]={'keys':$A(this.$events[type].keys),'values':$A(this.$events[type].values)};return el.removeEvents();},replaceWith:function(el){el=$(el);this.parentNode.replaceChild(el,this);return el;},appendText:function(text){this.appendChild(document.createTextNode(text));return this;},hasClass:function(className){return this.className.contains(className,' ');},addClass:function(className){if(!this.hasClass(className))this.className=(this.className+' '+className).clean();return this;},removeClass:function(className){this.className=this.className.replace(new RegExp('(^|\\s)'+className+'(?:\\s|$)'),'$1').clean();return this;},toggleClass:function(className){return this.hasClass(className)?this.removeClass(className):this.addClass(className);},setStyle:function(property,value){switch(property){case'opacity':return this.setOpacity(parseFloat(value));case'float':property=(window.ie)?'styleFloat':'cssFloat';}
 
property=property.camelCase();switch($type(value)){case'number':if(!['zIndex','zoom'].contains(property))value+='px';break;case'array':value='rgb('+value.join(',')+')';}
 
this.style[property]=value;return this;},setStyles:function(source){switch($type(source)){case'object':Element.setMany(this,'setStyle',source);break;case'string':this.style.cssText=source;}
 
return this;},setOpacity:function(opacity){if(opacity==0){if(this.style.visibility!="hidden")this.style.visibility="hidden";}else{if(this.style.visibility!="visible")this.style.visibility="visible";}
 
if(!this.currentStyle||!this.currentStyle.hasLayout)this.style.zoom=1;if(window.ie)this.style.filter=(opacity==1)?'':"alpha(opacity="+opacity*100+")";this.style.opacity=this.$tmp.opacity=opacity;return this;},getStyle:function(property){property=property.camelCase();var result=this.style[property];if(!$chk(result)){if(property=='opacity')return this.$tmp.opacity;result=[];for(var style in Element.Styles){if(property==style){Element.Styles[style].each(function(s){var style=this.getStyle(s);result.push(parseInt(style)?style:'0px');},this);if(property=='border'){var every=result.every(function(bit){return(bit==result[0]);});return(every)?result[0]:false;}
 
return result.join(' ');}}
 
if(property.contains('border')){if(Element.Styles.border.contains(property)){return['Width','Style','Color'].map(function(p){return this.getStyle(property+p);},this).join(' ');}else if(Element.borderShort.contains(property)){return['Top','Right','Bottom','Left'].map(function(p){return this.getStyle('border'+p+property.replace('border',''));},this).join(' ');}}
 
if(document.defaultView)result=document.defaultView.getComputedStyle(this,null).getPropertyValue(property.hyphenate());else if(this.currentStyle)result=this.currentStyle[property];}
 
if(window.ie)result=Element.fixStyle(property,result,this);if(result&&property.test(/color/i)&&result.contains('rgb')){return result.split('rgb').splice(1,4).map(function(color){return color.rgbToHex();}).join(' ');}
 
return result;},getStyles:function(){return Element.getMany(this,'getStyle',arguments);},walk:function(brother,start){brother+='Sibling';var el=(start)?this[start]:this[brother];while(el&&$type(el)!='element')el=el[brother];return $(el);},getPrevious:function(){return this.walk('previous');},getNext:function(){return this.walk('next');},getFirst:function(){return this.walk('next','firstChild');},getLast:function(){return this.walk('previous','lastChild');},getParent:function(){return $(this.parentNode);},getChildren:function(){return $$(this.childNodes);},hasChild:function(el){return!!$A(this.getElementsByTagName('*')).contains(el);},getProperty:function(property){var index=Element.Properties[property];if(index)return this[index];var flag=Element.PropertiesIFlag[property]||0;if(!window.ie||flag)return this.getAttribute(property,flag);var node=this.attributes[property];return(node)?node.nodeValue:null;},removeProperty:function(property){var index=Element.Properties[property];if(index)this[index]='';else this.removeAttribute(property);return this;},getProperties:function(){return Element.getMany(this,'getProperty',arguments);},setProperty:function(property,value){var index=Element.Properties[property];if(index)this[index]=value;else this.setAttribute(property,value);return this;},setProperties:function(source){return Element.setMany(this,'setProperty',source);},setHTML:function(){this.innerHTML=$A(arguments).join('');return this;},setText:function(text){var tag=this.getTag();if(['style','script'].contains(tag)){if(window.ie){if(tag=='style')this.styleSheet.cssText=text;else if(tag=='script')this.setProperty('text',text);return this;}else{this.removeChild(this.firstChild);return this.appendText(text);}}
 
this[$defined(this.innerText)?'innerText':'textContent']=text;return this;},getText:function(){var tag=this.getTag();if(['style','script'].contains(tag)){if(window.ie){if(tag=='style')return this.styleSheet.cssText;else if(tag=='script')return this.getProperty('text');}else{return this.innerHTML;}}
 
return($pick(this.innerText,this.textContent));},getTag:function(){return this.tagName.toLowerCase();},empty:function(){Garbage.trash(this.getElementsByTagName('*'));return this.setHTML('');}});Element.fixStyle=function(property,result,element){if($chk(parseInt(result)))return result;if(['height','width'].contains(property)){var values=(property=='width')?['left','right']:['top','bottom'];var size=0;values.each(function(value){size+=element.getStyle('border-'+value+'-width').toInt()+element.getStyle('padding-'+value).toInt();});return element['offset'+property.capitalize()]-size+'px';}else if(property.test(/border(.+)Width|margin|padding/)){return'0px';}
 
return result;};Element.Styles={'border':[],'padding':[],'margin':[]};['Top','Right','Bottom','Left'].each(function(direction){for(var style in Element.Styles)Element.Styles[style].push(style+direction);});Element.borderShort=['borderWidth','borderStyle','borderColor'];Element.getMany=function(el,method,keys){var result={};$each(keys,function(key){result[key]=el[method](key);});return result;};Element.setMany=function(el,method,pairs){for(var key in pairs)el[method](key,pairs[key]);return el;};Element.Properties=new Abstract({'class':'className','for':'htmlFor','colspan':'colSpan','rowspan':'rowSpan','accesskey':'accessKey','tabindex':'tabIndex','maxlength':'maxLength','readonly':'readOnly','frameborder':'frameBorder','value':'value','disabled':'disabled','checked':'checked','multiple':'multiple','selected':'selected'});Element.PropertiesIFlag={'href':2,'src':2};Element.Methods={Listeners:{addListener:function(type,fn){if(this.addEventListener)this.addEventListener(type,fn,false);else this.attachEvent('on'+type,fn);return this;},removeListener:function(type,fn){if(this.removeEventListener)this.removeEventListener(type,fn,false);else this.detachEvent('on'+type,fn);return this;}}};window.extend(Element.Methods.Listeners);document.extend(Element.Methods.Listeners);Element.extend(Element.Methods.Listeners);var Garbage={elements:[],collect:function(el){if(!el.$tmp){Garbage.elements.push(el);el.$tmp={'opacity':1};}
 
return el;},trash:function(elements){for(var i=0,j=elements.length,el;i<j;i++){if(!(el=elements[i])||!el.$tmp)continue;if(el.$events)el.fireEvent('trash').removeEvents();for(var p in el.$tmp)el.$tmp[p]=null;for(var d in Element.prototype)el[d]=null;Garbage.elements[Garbage.elements.indexOf(el)]=null;el.htmlElement=el.$tmp=el=null;}
 
Garbage.elements.remove(null);},empty:function(){Garbage.collect(window);Garbage.collect(document);Garbage.trash(Garbage.elements);}};window.addListener('beforeunload',function(){window.addListener('unload',Garbage.empty);if(window.ie)window.addListener('unload',CollectGarbage);});var Event=new Class({initialize:function(event){if(event&&event.$extended)return event;this.$extended=true;event=event||window.event;this.event=event;this.type=event.type;this.target=event.target||event.srcElement;if(this.target.nodeType==3)this.target=this.target.parentNode;this.shift=event.shiftKey;this.control=event.ctrlKey;this.alt=event.altKey;this.meta=event.metaKey;if(['DOMMouseScroll','mousewheel'].contains(this.type)){this.wheel=(event.wheelDelta)?event.wheelDelta/120:-(event.detail||0)/3;}else if(this.type.contains('key')){this.code=event.which||event.keyCode;for(var name in Event.keys){if(Event.keys[name]==this.code){this.key=name;break;}}
 
if(this.type=='keydown'){var fKey=this.code-111;if(fKey>0&&fKey<13)this.key='f'+fKey;}
 
this.key=this.key||String.fromCharCode(this.code).toLowerCase();}else if(this.type.test(/(click|mouse|menu)/)){this.page={'x':event.pageX||event.clientX+document.documentElement.scrollLeft,'y':event.pageY||event.clientY+document.documentElement.scrollTop};this.client={'x':event.pageX?event.pageX-window.pageXOffset:event.clientX,'y':event.pageY?event.pageY-window.pageYOffset:event.clientY};this.rightClick=(event.which==3)||(event.button==2);switch(this.type){case'mouseover':this.relatedTarget=event.relatedTarget||event.fromElement;break;case'mouseout':this.relatedTarget=event.relatedTarget||event.toElement;}
 
this.fixRelatedTarget();}
 
return this;},stop:function(){return this.stopPropagation().preventDefault();},stopPropagation:function(){if(this.event.stopPropagation)this.event.stopPropagation();else this.event.cancelBubble=true;return this;},preventDefault:function(){if(this.event.preventDefault)this.event.preventDefault();else this.event.returnValue=false;return this;}});Event.fix={relatedTarget:function(){if(this.relatedTarget&&this.relatedTarget.nodeType==3)this.relatedTarget=this.relatedTarget.parentNode;},relatedTargetGecko:function(){try{Event.fix.relatedTarget.call(this);}catch(e){this.relatedTarget=this.target;}}};Event.prototype.fixRelatedTarget=(window.gecko)?Event.fix.relatedTargetGecko:Event.fix.relatedTarget;Event.keys=new Abstract({'enter':13,'up':38,'down':40,'left':37,'right':39,'esc':27,'space':32,'backspace':8,'tab':9,'delete':46});Element.Methods.Events={addEvent:function(type,fn){this.$events=this.$events||{};this.$events[type]=this.$events[type]||{'keys':[],'values':[]};if(this.$events[type].keys.contains(fn))return this;this.$events[type].keys.push(fn);var realType=type;var custom=Element.Events[type];if(custom){if(custom.add)custom.add.call(this,fn);if(custom.map)fn=custom.map;if(custom.type)realType=custom.type;}
 
if(!this.addEventListener)fn=fn.create({'bind':this,'event':true});this.$events[type].values.push(fn);return(Element.NativeEvents.contains(realType))?this.addListener(realType,fn):this;},removeEvent:function(type,fn){if(!this.$events||!this.$events[type])return this;var pos=this.$events[type].keys.indexOf(fn);if(pos==-1)return this;var key=this.$events[type].keys.splice(pos,1)[0];var value=this.$events[type].values.splice(pos,1)[0];var custom=Element.Events[type];if(custom){if(custom.remove)custom.remove.call(this,fn);if(custom.type)type=custom.type;}
 
return(Element.NativeEvents.contains(type))?this.removeListener(type,value):this;},addEvents:function(source){return Element.setMany(this,'addEvent',source);},removeEvents:function(type){if(!this.$events)return this;if(!type){for(var evType in this.$events)this.removeEvents(evType);this.$events=null;}else if(this.$events[type]){this.$events[type].keys.each(function(fn){this.removeEvent(type,fn);},this);this.$events[type]=null;}
 
return this;},fireEvent:function(type,args,delay){if(this.$events&&this.$events[type]){this.$events[type].keys.each(function(fn){fn.create({'bind':this,'delay':delay,'arguments':args})();},this);}
 
return this;},cloneEvents:function(from,type){if(!from.$events)return this;if(!type){for(var evType in from.$events)this.cloneEvents(from,evType);}else if(from.$events[type]){from.$events[type].keys.each(function(fn){this.addEvent(type,fn);},this);}
 
return this;}};window.extend(Element.Methods.Events);document.extend(Element.Methods.Events);Element.extend(Element.Methods.Events);Element.Events=new Abstract({'mouseenter':{type:'mouseover',map:function(event){event=new Event(event);if(event.relatedTarget!=this&&!this.hasChild(event.relatedTarget))this.fireEvent('mouseenter',event);}},'mouseleave':{type:'mouseout',map:function(event){event=new Event(event);if(event.relatedTarget!=this&&!this.hasChild(event.relatedTarget))this.fireEvent('mouseleave',event);}},'mousewheel':{type:(window.gecko)?'DOMMouseScroll':'mousewheel'}});Element.NativeEvents=['click','dblclick','mouseup','mousedown','mousewheel','DOMMouseScroll','mouseover','mouseout','mousemove','keydown','keypress','keyup','load','unload','beforeunload','resize','move','focus','blur','change','submit','reset','select','error','abort','contextmenu','scroll'];Function.extend({bindWithEvent:function(bind,args){return this.create({'bind':bind,'arguments':args,'event':Event});}});Elements.extend({filterByTag:function(tag){return new Elements(this.filter(function(el){return(Element.getTag(el)==tag);}));},filterByClass:function(className,nocash){var elements=this.filter(function(el){return(el.className&&el.className.contains(className,' '));});return(nocash)?elements:new Elements(elements);},filterById:function(id,nocash){var elements=this.filter(function(el){return(el.id==id);});return(nocash)?elements:new Elements(elements);},filterByAttribute:function(name,operator,value,nocash){var elements=this.filter(function(el){var current=Element.getProperty(el,name);if(!current)return false;if(!operator)return true;switch(operator){case'=':return(current==value);case'*=':return(current.contains(value));case'^=':return(current.substr(0,value.length)==value);case'$=':return(current.substr(current.length-value.length)==value);case'!=':return(current!=value);case'~=':return current.contains(value,' ');}
 
return false;});return(nocash)?elements:new Elements(elements);}});function $E(selector,filter){return($(filter)||document).getElement(selector);};function $ES(selector,filter){return($(filter)||document).getElementsBySelector(selector);};$$.shared={'regexp':/^(\w*|\*)(?:#([\w-]+)|\.([\w-]+))?(?:\[(\w+)(?:([!*^$]?=)["']?([^"'\]]*)["']?)?])?$/,'xpath':{getParam:function(items,context,param,i){var temp=[context.namespaceURI?'xhtml:':'',param[1]];if(param[2])temp.push('[@id="',param[2],'"]');if(param[3])temp.push('[contains(concat(" ", @class, " "), " ',param[3],' ")]');if(param[4]){if(param[5]&&param[6]){switch(param[5]){case'*=':temp.push('[contains(@',param[4],', "',param[6],'")]');break;case'^=':temp.push('[starts-with(@',param[4],', "',param[6],'")]');break;case'$=':temp.push('[substring(@',param[4],', string-length(@',param[4],') - ',param[6].length,' + 1) = "',param[6],'"]');break;case'=':temp.push('[@',param[4],'="',param[6],'"]');break;case'!=':temp.push('[@',param[4],'!="',param[6],'"]');}}else{temp.push('[@',param[4],']');}}
 
items.push(temp.join(''));return items;},getItems:function(items,context,nocash){var elements=[];var xpath=document.evaluate('.//'+items.join('//'),context,$$.shared.resolver,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for(var i=0,j=xpath.snapshotLength;i<j;i++)elements.push(xpath.snapshotItem(i));return(nocash)?elements:new Elements(elements.map($));}},'normal':{getParam:function(items,context,param,i){if(i==0){if(param[2]){var el=context.getElementById(param[2]);if(!el||((param[1]!='*')&&(Element.getTag(el)!=param[1])))return false;items=[el];}else{items=$A(context.getElementsByTagName(param[1]));}}else{items=$$.shared.getElementsByTagName(items,param[1]);if(param[2])items=Elements.filterById(items,param[2],true);}
 
if(param[3])items=Elements.filterByClass(items,param[3],true);if(param[4])items=Elements.filterByAttribute(items,param[4],param[5],param[6],true);return items;},getItems:function(items,context,nocash){return(nocash)?items:$$.unique(items);}},resolver:function(prefix){return(prefix=='xhtml')?'http://www.w3.org/1999/xhtml':false;},getElementsByTagName:function(context,tagName){var found=[];for(var i=0,j=context.length;i<j;i++)found.extend(context[i].getElementsByTagName(tagName));return found;}};$$.shared.method=(window.xpath)?'xpath':'normal';Element.Methods.Dom={getElements:function(selector,nocash){var items=[];selector=selector.trim().split(' ');for(var i=0,j=selector.length;i<j;i++){var sel=selector[i];var param=sel.match($$.shared.regexp);if(!param)break;param[1]=param[1]||'*';var temp=$$.shared[$$.shared.method].getParam(items,this,param,i);if(!temp)break;items=temp;}
 
return $$.shared[$$.shared.method].getItems(items,this,nocash);},getElement:function(selector){return $(this.getElements(selector,true)[0]||false);},getElementsBySelector:function(selector,nocash){var elements=[];selector=selector.split(',');for(var i=0,j=selector.length;i<j;i++)elements=elements.concat(this.getElements(selector[i],true));return(nocash)?elements:$$.unique(elements);}};Element.extend({getElementById:function(id){var el=document.getElementById(id);if(!el)return false;for(var parent=el.parentNode;parent!=this;parent=parent.parentNode){if(!parent)return false;}
 
return el;},getElementsByClassName:function(className){return this.getElements('.'+className);}});document.extend(Element.Methods.Dom);Element.extend(Element.Methods.Dom);Element.extend({getValue:function(){switch(this.getTag()){case'select':var values=[];$each(this.options,function(option){if(option.selected)values.push($pick(option.value,option.text));});return(this.multiple)?values:values[0];case'input':if(!(this.checked&&['checkbox','radio'].contains(this.type))&&!['hidden','text','password'].contains(this.type))break;case'textarea':return this.value;}
 
return false;},getFormElements:function(){return $$(this.getElementsByTagName('input'),this.getElementsByTagName('select'),this.getElementsByTagName('textarea'));},toQueryString:function(){var queryString=[];this.getFormElements().each(function(el){var name=el.name;var value=el.getValue();if(value===false||!name||el.disabled)return;var qs=function(val){queryString.push(name+'='+encodeURIComponent(val));};if($type(value)=='array')value.each(qs);else qs(value);});return queryString.join('&');}});Element.extend({scrollTo:function(x,y){this.scrollLeft=x;this.scrollTop=y;},getSize:function(){return{'scroll':{'x':this.scrollLeft,'y':this.scrollTop},'size':{'x':this.offsetWidth,'y':this.offsetHeight},'scrollSize':{'x':this.scrollWidth,'y':this.scrollHeight}};},getPosition:function(overflown){overflown=overflown||[];var el=this,left=0,top=0;do{left+=el.offsetLeft||0;top+=el.offsetTop||0;el=el.offsetParent;}while(el);overflown.each(function(element){left-=element.scrollLeft||0;top-=element.scrollTop||0;});return{'x':left,'y':top};},getTop:function(overflown){return this.getPosition(overflown).y;},getLeft:function(overflown){return this.getPosition(overflown).x;},getCoordinates:function(overflown){var position=this.getPosition(overflown);var obj={'width':this.offsetWidth,'height':this.offsetHeight,'left':position.x,'top':position.y};obj.right=obj.left+obj.width;obj.bottom=obj.top+obj.height;return obj;}});Element.Events.domready={add:function(fn){if(window.loaded){fn.call(this);return;}
 
var domReady=function(){if(window.loaded)return;window.loaded=true;window.timer=$clear(window.timer);this.fireEvent('domready');}.bind(this);if(document.readyState&&window.webkit){window.timer=function(){if(['loaded','complete'].contains(document.readyState))domReady();}.periodical(50);}else if(document.readyState&&window.ie){if(!$('ie_ready')){var src=(window.location.protocol=='https:')?'://0':'javascript:void(0)';document.write('<script id="ie_ready" defer src="'+src+'"><\/script>');$('ie_ready').onreadystatechange=function(){if(this.readyState=='complete')domReady();};}}else{window.addListener("load",domReady);document.addListener("DOMContentLoaded",domReady);}}};window.onDomReady=function(fn){return this.addEvent('domready',fn);};window.extend({getWidth:function(){if(this.webkit419)return this.innerWidth;if(this.opera)return document.body.clientWidth;return document.documentElement.clientWidth;},getHeight:function(){if(this.webkit419)return this.innerHeight;if(this.opera)return document.body.clientHeight;return document.documentElement.clientHeight;},getScrollWidth:function(){if(this.ie)return Math.max(document.documentElement.offsetWidth,document.documentElement.scrollWidth);if(this.webkit)return document.body.scrollWidth;return document.documentElement.scrollWidth;},getScrollHeight:function(){if(this.ie)return Math.max(document.documentElement.offsetHeight,document.documentElement.scrollHeight);if(this.webkit)return document.body.scrollHeight;return document.documentElement.scrollHeight;},getScrollLeft:function(){return this.pageXOffset||document.documentElement.scrollLeft;},getScrollTop:function(){return this.pageYOffset||document.documentElement.scrollTop;},getSize:function(){return{'size':{'x':this.getWidth(),'y':this.getHeight()},'scrollSize':{'x':this.getScrollWidth(),'y':this.getScrollHeight()},'scroll':{'x':this.getScrollLeft(),'y':this.getScrollTop()}};},getPosition:function(){return{'x':0,'y':0};}});var Fx={};Fx.Base=new Class({options:{onStart:Class.empty,onComplete:Class.empty,onCancel:Class.empty,transition:function(p){return-(Math.cos(Math.PI*p)-1)/2;},duration:500,unit:'px',wait:true,fps:50},initialize:function(options){this.element=this.element||null;this.setOptions(options);if(this.options.initialize)this.options.initialize.call(this);},step:function(){var time=$time();if(time<this.time+this.options.duration){this.delta=this.options.transition((time-this.time)/this.options.duration);this.setNow();this.increase();}else{this.stop(true);this.set(this.to);this.fireEvent('onComplete',this.element,10);this.callChain();}},set:function(to){this.now=to;this.increase();return this;},setNow:function(){this.now=this.compute(this.from,this.to);},compute:function(from,to){return(to-from)*this.delta+from;},start:function(from,to){if(!this.options.wait)this.stop();else if(this.timer)return this;this.from=from;this.to=to;this.change=this.to-this.from;this.time=$time();this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);this.fireEvent('onStart',this.element);return this;},stop:function(end){if(!this.timer)return this;this.timer=$clear(this.timer);if(!end)this.fireEvent('onCancel',this.element);return this;},custom:function(from,to){return this.start(from,to);},clearTimer:function(end){return this.stop(end);}});Fx.Base.implement(new Chain,new Events,new Options);Fx.CSS={select:function(property,to){if(property.test(/color/i))return this.Color;var type=$type(to);if((type=='array')||(type=='string'&&to.contains(' ')))return this.Multi;return this.Single;},parse:function(el,property,fromTo){if(!fromTo.push)fromTo=[fromTo];var from=fromTo[0],to=fromTo[1];if(!$chk(to)){to=from;from=el.getStyle(property);}
 
var css=this.select(property,to);return{'from':css.parse(from),'to':css.parse(to),'css':css};}};Fx.CSS.Single={parse:function(value){return parseFloat(value);},getNow:function(from,to,fx){return fx.compute(from,to);},getValue:function(value,unit,property){if(unit=='px'&&property!='opacity')value=Math.round(value);return value+unit;}};Fx.CSS.Multi={parse:function(value){return value.push?value:value.split(' ').map(function(v){return parseFloat(v);});},getNow:function(from,to,fx){var now=[];for(var i=0;i<from.length;i++)now[i]=fx.compute(from[i],to[i]);return now;},getValue:function(value,unit,property){if(unit=='px'&&property!='opacity')value=value.map(Math.round);return value.join(unit+' ')+unit;}};Fx.CSS.Color={parse:function(value){return value.push?value:value.hexToRgb(true);},getNow:function(from,to,fx){var now=[];for(var i=0;i<from.length;i++)now[i]=Math.round(fx.compute(from[i],to[i]));return now;},getValue:function(value){return'rgb('+value.join(',')+')';}};Fx.Style=Fx.Base.extend({initialize:function(el,property,options){this.element=$(el);this.property=property;this.parent(options);},hide:function(){return this.set(0);},setNow:function(){this.now=this.css.getNow(this.from,this.to,this);},set:function(to){this.css=Fx.CSS.select(this.property,to);return this.parent(this.css.parse(to));},start:function(from,to){if(this.timer&&this.options.wait)return this;var parsed=Fx.CSS.parse(this.element,this.property,[from,to]);this.css=parsed.css;return this.parent(parsed.from,parsed.to);},increase:function(){this.element.setStyle(this.property,this.css.getValue(this.now,this.options.unit,this.property));}});Element.extend({effect:function(property,options){return new Fx.Style(this,property,options);}});Fx.Styles=Fx.Base.extend({initialize:function(el,options){this.element=$(el);this.parent(options);},setNow:function(){for(var p in this.from)this.now[p]=this.css[p].getNow(this.from[p],this.to[p],this);},set:function(to){var parsed={};this.css={};for(var p in to){this.css[p]=Fx.CSS.select(p,to[p]);parsed[p]=this.css[p].parse(to[p]);}
 
return this.parent(parsed);},start:function(obj){if(this.timer&&this.options.wait)return this;this.now={};this.css={};var from={},to={};for(var p in obj){var parsed=Fx.CSS.parse(this.element,p,obj[p]);from[p]=parsed.from;to[p]=parsed.to;this.css[p]=parsed.css;}
 
return this.parent(from,to);},increase:function(){for(var p in this.now)this.element.setStyle(p,this.css[p].getValue(this.now[p],this.options.unit,p));}});Element.extend({effects:function(options){return new Fx.Styles(this,options);}});Fx.Elements=Fx.Base.extend({initialize:function(elements,options){this.elements=$$(elements);this.parent(options);},setNow:function(){for(var i in this.from){var iFrom=this.from[i],iTo=this.to[i],iCss=this.css[i],iNow=this.now[i]={};for(var p in iFrom)iNow[p]=iCss[p].getNow(iFrom[p],iTo[p],this);}},set:function(to){var parsed={};this.css={};for(var i in to){var iTo=to[i],iCss=this.css[i]={},iParsed=parsed[i]={};for(var p in iTo){iCss[p]=Fx.CSS.select(p,iTo[p]);iParsed[p]=iCss[p].parse(iTo[p]);}}
 
return this.parent(parsed);},start:function(obj){if(this.timer&&this.options.wait)return this;this.now={};this.css={};var from={},to={};for(var i in obj){var iProps=obj[i],iFrom=from[i]={},iTo=to[i]={},iCss=this.css[i]={};for(var p in iProps){var parsed=Fx.CSS.parse(this.elements[i],p,iProps[p]);iFrom[p]=parsed.from;iTo[p]=parsed.to;iCss[p]=parsed.css;}}
 
return this.parent(from,to);},increase:function(){for(var i in this.now){var iNow=this.now[i],iCss=this.css[i];for(var p in iNow)this.elements[i].setStyle(p,iCss[p].getValue(iNow[p],this.options.unit,p));}}});Fx.Scroll=Fx.Base.extend({options:{overflown:[],offset:{'x':0,'y':0},wheelStops:true},initialize:function(element,options){this.now=[];this.element=$(element);this.bound={'stop':this.stop.bind(this,false)};this.parent(options);if(this.options.wheelStops){this.addEvent('onStart',function(){document.addEvent('mousewheel',this.bound.stop);}.bind(this));this.addEvent('onComplete',function(){document.removeEvent('mousewheel',this.bound.stop);}.bind(this));}},setNow:function(){for(var i=0;i<2;i++)this.now[i]=this.compute(this.from[i],this.to[i]);},scrollTo:function(x,y){if(this.timer&&this.options.wait)return this;var el=this.element.getSize();var values={'x':x,'y':y};for(var z in el.size){var max=el.scrollSize[z]-el.size[z];if($chk(values[z]))values[z]=($type(values[z])=='number')?values[z].limit(0,max):max;else values[z]=el.scroll[z];values[z]+=this.options.offset[z];}
 
return this.start([el.scroll.x,el.scroll.y],[values.x,values.y]);},toTop:function(){return this.scrollTo(false,0);},toBottom:function(){return this.scrollTo(false,'full');},toLeft:function(){return this.scrollTo(0,false);},toRight:function(){return this.scrollTo('full',false);},toElement:function(el){var parent=this.element.getPosition(this.options.overflown);var target=$(el).getPosition(this.options.overflown);return this.scrollTo(target.x-parent.x,target.y-parent.y);},increase:function(){this.element.scrollTo(this.now[0],this.now[1]);}});Fx.Slide=Fx.Base.extend({options:{mode:'vertical'},initialize:function(el,options){this.element=$(el);this.wrapper=new Element('div',{'styles':$extend(this.element.getStyles('margin'),{'overflow':'hidden'})}).injectAfter(this.element).adopt(this.element);this.element.setStyle('margin',0);this.setOptions(options);this.now=[];this.parent(this.options);this.open=true;this.addEvent('onComplete',function(){this.open=(this.now[0]===0);});if(window.webkit419)this.addEvent('onComplete',function(){if(this.open)this.element.remove().inject(this.wrapper);});},setNow:function(){for(var i=0;i<2;i++)this.now[i]=this.compute(this.from[i],this.to[i]);},vertical:function(){this.margin='margin-top';this.layout='height';this.offset=this.element.offsetHeight;},horizontal:function(){this.margin='margin-left';this.layout='width';this.offset=this.element.offsetWidth;},slideIn:function(mode){this[mode||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[0,this.offset]);},slideOut:function(mode){this[mode||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[-this.offset,0]);},hide:function(mode){this[mode||this.options.mode]();this.open=false;return this.set([-this.offset,0]);},show:function(mode){this[mode||this.options.mode]();this.open=true;return this.set([0,this.offset]);},toggle:function(mode){if(this.wrapper.offsetHeight==0||this.wrapper.offsetWidth==0)return this.slideIn(mode);return this.slideOut(mode);},increase:function(){this.element.setStyle(this.margin,this.now[0]+this.options.unit);this.wrapper.setStyle(this.layout,this.now[1]+this.options.unit);}});Fx.Transition=function(transition,params){params=params||[];if($type(params)!='array')params=[params];return $extend(transition,{easeIn:function(pos){return transition(pos,params);},easeOut:function(pos){return 1-transition(1-pos,params);},easeInOut:function(pos){return(pos<=0.5)?transition(2*pos,params)/2:(2-transition(2*(1-pos),params))/2;}});};Fx.Transitions=new Abstract({linear:function(p){return p;}});Fx.Transitions.extend=function(transitions){for(var transition in transitions){Fx.Transitions[transition]=new Fx.Transition(transitions[transition]);Fx.Transitions.compat(transition);}};Fx.Transitions.compat=function(transition){['In','Out','InOut'].each(function(easeType){Fx.Transitions[transition.toLowerCase()+easeType]=Fx.Transitions[transition]['ease'+easeType];});};Fx.Transitions.extend({Pow:function(p,x){return Math.pow(p,x[0]||6);},Expo:function(p){return Math.pow(2,8*(p-1));},Circ:function(p){return 1-Math.sin(Math.acos(p));},Sine:function(p){return 1-Math.sin((1-p)*Math.PI/2);},Back:function(p,x){x=x[0]||1.618;return Math.pow(p,2)*((x+1)*p-x);},Bounce:function(p){var value;for(var a=0,b=1;1;a+=b,b/=2){if(p>=(7-4*a)/11){value=-Math.pow((11-6*a-11*p)/4,2)+b*b;break;}}
 
return value;},Elastic:function(p,x){return Math.pow(2,10*--p)*Math.cos(20*p*Math.PI*(x[0]||1)/3);}});['Quad','Cubic','Quart','Quint'].each(function(transition,i){Fx.Transitions[transition]=new Fx.Transition(function(p){return Math.pow(p,[i+2]);});Fx.Transitions.compat(transition);});var Drag={};Drag.Base=new Class({options:{handle:false,unit:'px',onStart:Class.empty,onBeforeStart:Class.empty,onComplete:Class.empty,onSnap:Class.empty,onDrag:Class.empty,limit:false,modifiers:{x:'left',y:'top'},grid:false,snap:6},initialize:function(el,options){this.setOptions(options);this.element=$(el);this.handle=$(this.options.handle)||this.element;this.mouse={'now':{},'pos':{}};this.value={'start':{},'now':{}};this.bound={'start':this.start.bindWithEvent(this),'check':this.check.bindWithEvent(this),'drag':this.drag.bindWithEvent(this),'stop':this.stop.bind(this)};this.attach();if(this.options.initialize)this.options.initialize.call(this);},attach:function(){this.handle.addEvent('mousedown',this.bound.start);return this;},detach:function(){this.handle.removeEvent('mousedown',this.bound.start);return this;},start:function(event){this.fireEvent('onBeforeStart',this.element);this.mouse.start=event.page;var limit=this.options.limit;this.limit={'x':[],'y':[]};for(var z in this.options.modifiers){if(!this.options.modifiers[z])continue;this.value.now[z]=this.element.getStyle(this.options.modifiers[z]).toInt();this.mouse.pos[z]=event.page[z]-this.value.now[z];if(limit&&limit[z]){for(var i=0;i<2;i++){if($chk(limit[z][i]))this.limit[z][i]=($type(limit[z][i])=='function')?limit[z][i]():limit[z][i];}}}
 
if($type(this.options.grid)=='number')this.options.grid={'x':this.options.grid,'y':this.options.grid};document.addListener('mousemove',this.bound.check);document.addListener('mouseup',this.bound.stop);this.fireEvent('onStart',this.element);event.stop();},check:function(event){var distance=Math.round(Math.sqrt(Math.pow(event.page.x-this.mouse.start.x,2)+Math.pow(event.page.y-this.mouse.start.y,2)));if(distance>this.options.snap){document.removeListener('mousemove',this.bound.check);document.addListener('mousemove',this.bound.drag);this.drag(event);this.fireEvent('onSnap',this.element);}
 
event.stop();},drag:function(event){this.out=false;this.mouse.now=event.page;for(var z in this.options.modifiers){if(!this.options.modifiers[z])continue;this.value.now[z]=this.mouse.now[z]-this.mouse.pos[z];if(this.limit[z]){if($chk(this.limit[z][1])&&(this.value.now[z]>this.limit[z][1])){this.value.now[z]=this.limit[z][1];this.out=true;}else if($chk(this.limit[z][0])&&(this.value.now[z]<this.limit[z][0])){this.value.now[z]=this.limit[z][0];this.out=true;}}
 
if(this.options.grid[z])this.value.now[z]-=(this.value.now[z]%this.options.grid[z]);this.element.setStyle(this.options.modifiers[z],this.value.now[z]+this.options.unit);}
 
this.fireEvent('onDrag',this.element);event.stop();},stop:function(){document.removeListener('mousemove',this.bound.check);document.removeListener('mousemove',this.bound.drag);document.removeListener('mouseup',this.bound.stop);this.fireEvent('onComplete',this.element);}});Drag.Base.implement(new Events,new Options);Element.extend({makeResizable:function(options){return new Drag.Base(this,$merge({modifiers:{x:'width',y:'height'}},options));}});Drag.Move=Drag.Base.extend({options:{droppables:[],container:false,overflown:[]},initialize:function(el,options){this.setOptions(options);this.element=$(el);this.droppables=$$(this.options.droppables);this.container=$(this.options.container);this.position={'element':this.element.getStyle('position'),'container':false};if(this.container)this.position.container=this.container.getStyle('position');if(!['relative','absolute','fixed'].contains(this.position.element))this.position.element='absolute';var top=this.element.getStyle('top').toInt();var left=this.element.getStyle('left').toInt();if(this.position.element=='absolute'&&!['relative','absolute','fixed'].contains(this.position.container)){top=$chk(top)?top:this.element.getTop(this.options.overflown);left=$chk(left)?left:this.element.getLeft(this.options.overflown);}else{top=$chk(top)?top:0;left=$chk(left)?left:0;}
 
this.element.setStyles({'top':top,'left':left,'position':this.position.element});this.parent(this.element);},start:function(event){this.overed=null;if(this.container){var cont=this.container.getCoordinates();var el=this.element.getCoordinates();if(this.position.element=='absolute'&&!['relative','absolute','fixed'].contains(this.position.container)){this.options.limit={'x':[cont.left,cont.right-el.width],'y':[cont.top,cont.bottom-el.height]};}else{this.options.limit={'y':[0,cont.height-el.height],'x':[0,cont.width-el.width]};}}
 
this.parent(event);},drag:function(event){this.parent(event);var overed=this.out?false:this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=overed){if(this.overed)this.overed.fireEvent('leave',[this.element,this]);this.overed=overed?overed.fireEvent('over',[this.element,this]):null;}
 
return this;},checkAgainst:function(el){el=el.getCoordinates(this.options.overflown);var now=this.mouse.now;return(now.x>el.left&&now.x<el.right&&now.y<el.bottom&&now.y>el.top);},stop:function(){if(this.overed&&!this.out)this.overed.fireEvent('drop',[this.element,this]);else this.element.fireEvent('emptydrop',this);this.parent();return this;}});Element.extend({makeDraggable:function(options){return new Drag.Move(this,options);}});var XHR=new Class({options:{method:'post',async:true,onRequest:Class.empty,onSuccess:Class.empty,onFailure:Class.empty,urlEncoded:true,encoding:'utf-8',autoCancel:false,headers:{}},setTransport:function(){this.transport=(window.XMLHttpRequest)?new XMLHttpRequest():(window.ie?new ActiveXObject('Microsoft.XMLHTTP'):false);return this;},initialize:function(options){this.setTransport().setOptions(options);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers={};if(this.options.urlEncoded&&this.options.method=='post'){var encoding=(this.options.encoding)?'; charset='+this.options.encoding:'';this.setHeader('Content-type','application/x-www-form-urlencoded'+encoding);}
 
if(this.options.initialize)this.options.initialize.call(this);},onStateChange:function(){if(this.transport.readyState!=4||!this.running)return;this.running=false;var status=0;try{status=this.transport.status;}catch(e){};if(this.options.isSuccess.call(this,status))this.onSuccess();else this.onFailure();this.transport.onreadystatechange=Class.empty;},isSuccess:function(status){return((status>=200)&&(status<300));},onSuccess:function(){this.response={'text':this.transport.responseText,'xml':this.transport.responseXML};this.fireEvent('onSuccess',[this.response.text,this.response.xml]);this.callChain();},onFailure:function(){this.fireEvent('onFailure',this.transport);},setHeader:function(name,value){this.headers[name]=value;return this;},send:function(url,data){if(this.options.autoCancel)this.cancel();else if(this.running)return this;this.running=true;if(data&&this.options.method=='get'){url=url+(url.contains('?')?'&':'?')+data;data=null;}
 
this.transport.open(this.options.method.toUpperCase(),url,this.options.async);this.transport.onreadystatechange=this.onStateChange.bind(this);if((this.options.method=='post')&&this.transport.overrideMimeType)this.setHeader('Connection','close');$extend(this.headers,this.options.headers);for(var type in this.headers)try{this.transport.setRequestHeader(type,this.headers[type]);}catch(e){};this.fireEvent('onRequest');this.transport.send($pick(data,null));return this;},cancel:function(){if(!this.running)return this;this.running=false;this.transport.abort();this.transport.onreadystatechange=Class.empty;this.setTransport();this.fireEvent('onCancel');return this;}});XHR.implement(new Chain,new Events,new Options);var Ajax=XHR.extend({options:{data:null,update:null,onComplete:Class.empty,evalScripts:false,evalResponse:false},initialize:function(url,options){this.addEvent('onSuccess',this.onComplete);this.setOptions(options);this.options.data=this.options.data||this.options.postBody;if(!['post','get'].contains(this.options.method)){this._method='_method='+this.options.method;this.options.method='post';}
 
this.parent();this.setHeader('X-Requested-With','XMLHttpRequest');this.setHeader('Accept','text/javascript, text/html, application/xml, text/xml, */*');this.url=url;},onComplete:function(){if(this.options.update)$(this.options.update).empty().setHTML(this.response.text);if(this.options.evalScripts||this.options.evalResponse)this.evalScripts();this.fireEvent('onComplete',[this.response.text,this.response.xml],20);},request:function(data){data=data||this.options.data;switch($type(data)){case'element':data=$(data).toQueryString();break;case'object':data=Object.toQueryString(data);}
 
if(this._method)data=(data)?[this._method,data].join('&'):this._method;return this.send(this.url,data);},evalScripts:function(){var script,scripts;if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader('Content-type')))scripts=this.response.text;else{scripts=[];var regexp=/<script[^>]*>([\s\S]*?)<\/script>/gi;while((script=regexp.exec(this.response.text)))scripts.push(script[1]);scripts=scripts.join('\n');}
 
if(scripts)(window.execScript)?window.execScript(scripts):window.setTimeout(scripts,0);},getHeader:function(name){try{return this.transport.getResponseHeader(name);}catch(e){};return null;}});Object.toQueryString=function(source){var queryString=[];for(var property in source)queryString.push(encodeURIComponent(property)+'='+encodeURIComponent(source[property]));return queryString.join('&');};Element.extend({send:function(options){return new Ajax(this.getProperty('action'),$merge({data:this.toQueryString()},options,{method:'post'})).request();}});var Cookie=new Abstract({options:{domain:false,path:false,duration:false,secure:false},set:function(key,value,options){options=$merge(this.options,options);value=encodeURIComponent(value);if(options.domain)value+='; domain='+options.domain;if(options.path)value+='; path='+options.path;if(options.duration){var date=new Date();date.setTime(date.getTime()+options.duration*24*60*60*1000);value+='; expires='+date.toGMTString();}
 
if(options.secure)value+='; secure';document.cookie=key+'='+value;return $extend(options,{'key':key,'value':value});},get:function(key){var value=document.cookie.match('(?:^|;)\\s*'+key.escapeRegExp()+'=([^;]*)');return value?decodeURIComponent(value[1]):false;},remove:function(cookie,options){if($type(cookie)=='object')this.set(cookie.key,'',$merge(cookie,{duration:-1}));else this.set(cookie,'',$merge(options,{duration:-1}));}});var Json={toString:function(obj){switch($type(obj)){case'string':return'"'+obj.replace(/(["\\])/g,'\\$1')+'"';case'array':return'['+obj.map(Json.toString).join(',')+']';case'object':var string=[];for(var property in obj)string.push(Json.toString(property)+':'+Json.toString(obj[property]));return'{'+string.join(',')+'}';case'number':if(isFinite(obj))break;case false:return'null';}
 
return String(obj);},evaluate:function(str,secure){return(($type(str)!='string')||(secure&&!str.test(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/)))?null:eval('('+str+')');}};Json.Remote=XHR.extend({initialize:function(url,options){this.url=url;this.addEvent('onSuccess',this.onComplete);this.parent(options);this.setHeader('X-Request','JSON');},send:function(obj){return this.parent(this.url,'json='+Json.toString(obj));},onComplete:function(){this.fireEvent('onComplete',[Json.evaluate(this.response.text,this.options.secure)]);}});var Asset=new Abstract({javascript:function(source,properties){properties=$merge({'onload':Class.empty},properties);var script=new Element('script',{'src':source}).addEvents({'load':properties.onload,'readystatechange':function(){if(this.readyState=='complete')this.fireEvent('load');}});delete properties.onload;return script.setProperties(properties).inject(document.head);},css:function(source,properties){return new Element('link',$merge({'rel':'stylesheet','media':'screen','type':'text/css','href':source},properties)).inject(document.head);},image:function(source,properties){properties=$merge({'onload':Class.empty,'onabort':Class.empty,'onerror':Class.empty},properties);var image=new Image();image.src=source;var element=new Element('img',{'src':source});['load','abort','error'].each(function(type){var event=properties['on'+type];delete properties['on'+type];element.addEvent(type,function(){this.removeEvent(type,arguments.callee);event.call(this);});});if(image.width&&image.height)element.fireEvent('load',element,1);return element.setProperties(properties);},images:function(sources,options){options=$merge({onComplete:Class.empty,onProgress:Class.empty},options);if(!sources.push)sources=[sources];var images=[];var counter=0;sources.each(function(source){var img=new Asset.image(source,{'onload':function(){options.onProgress.call(this,counter);counter++;if(counter==sources.length)options.onComplete();}});images.push(img);});return new Elements(images);}});var Hash=new Class({length:0,initialize:function(object){this.obj=object||{};this.setLength();},get:function(key){return(this.hasKey(key))?this.obj[key]:null;},hasKey:function(key){return(key in this.obj);},set:function(key,value){if(!this.hasKey(key))this.length++;this.obj[key]=value;return this;},setLength:function(){this.length=0;for(var p in this.obj)this.length++;return this;},remove:function(key){if(this.hasKey(key)){delete this.obj[key];this.length--;}
 
return this;},each:function(fn,bind){$each(this.obj,fn,bind);},extend:function(obj){$extend(this.obj,obj);return this.setLength();},merge:function(){this.obj=$merge.apply(null,[this.obj].extend(arguments));return this.setLength();},empty:function(){this.obj={};this.length=0;return this;},keys:function(){var keys=[];for(var property in this.obj)keys.push(property);return keys;},values:function(){var values=[];for(var property in this.obj)values.push(this.obj[property]);return values;}});function $H(obj){return new Hash(obj);};Hash.Cookie=Hash.extend({initialize:function(name,options){this.name=name;this.options=$extend({'autoSave':true},options||{});this.load();},save:function(){if(this.length==0){Cookie.remove(this.name,this.options);return true;}
 
var str=Json.toString(this.obj);if(str.length>4096)return false;Cookie.set(this.name,str,this.options);return true;},load:function(){this.obj=Json.evaluate(Cookie.get(this.name),true)||{};this.setLength();}});Hash.Cookie.Methods={};['extend','set','merge','empty','remove'].each(function(method){Hash.Cookie.Methods[method]=function(){Hash.prototype[method].apply(this,arguments);if(this.options.autoSave)this.save();return this;};});Hash.Cookie.implement(Hash.Cookie.Methods);var Color=new Class({initialize:function(color,type){type=type||(color.push?'rgb':'hex');var rgb,hsb;switch(type){case'rgb':rgb=color;hsb=rgb.rgbToHsb();break;case'hsb':rgb=color.hsbToRgb();hsb=color;break;default:rgb=color.hexToRgb(true);hsb=rgb.rgbToHsb();}
 
rgb.hsb=hsb;rgb.hex=rgb.rgbToHex();return $extend(rgb,Color.prototype);},mix:function(){var colors=$A(arguments);var alpha=($type(colors[colors.length-1])=='number')?colors.pop():50;var rgb=this.copy();colors.each(function(color){color=new Color(color);for(var i=0;i<3;i++)rgb[i]=Math.round((rgb[i]/100*(100-alpha))+(color[i]/100*alpha));});return new Color(rgb,'rgb');},invert:function(){return new Color(this.map(function(value){return 255-value;}));},setHue:function(value){return new Color([value,this.hsb[1],this.hsb[2]],'hsb');},setSaturation:function(percent){return new Color([this.hsb[0],percent,this.hsb[2]],'hsb');},setBrightness:function(percent){return new Color([this.hsb[0],this.hsb[1],percent],'hsb');}});function $RGB(r,g,b){return new Color([r,g,b],'rgb');};function $HSB(h,s,b){return new Color([h,s,b],'hsb');};Array.extend({rgbToHsb:function(){var red=this[0],green=this[1],blue=this[2];var hue,saturation,brightness;var max=Math.max(red,green,blue),min=Math.min(red,green,blue);var delta=max-min;brightness=max/255;saturation=(max!=0)?delta/max:0;if(saturation==0){hue=0;}else{var rr=(max-red)/delta;var gr=(max-green)/delta;var br=(max-blue)/delta;if(red==max)hue=br-gr;else if(green==max)hue=2+rr-br;else hue=4+gr-rr;hue/=6;if(hue<0)hue++;}
 
return[Math.round(hue*360),Math.round(saturation*100),Math.round(brightness*100)];},hsbToRgb:function(){var br=Math.round(this[2]/100*255);if(this[1]==0){return[br,br,br];}else{var hue=this[0]%360;var f=hue%60;var p=Math.round((this[2]*(100-this[1]))/10000*255);var q=Math.round((this[2]*(6000-this[1]*f))/600000*255);var t=Math.round((this[2]*(6000-this[1]*(60-f)))/600000*255);switch(Math.floor(hue/60)){case 0:return[br,t,p];case 1:return[q,br,p];case 2:return[p,br,t];case 3:return[p,q,br];case 4:return[t,p,br];case 5:return[br,p,q];}}
 
return false;}});var Scroller=new Class({options:{area:20,velocity:1,onChange:function(x,y){this.element.scrollTo(x,y);}},initialize:function(element,options){this.setOptions(options);this.element=$(element);this.mousemover=([window,document].contains(element))?$(document.body):this.element;},start:function(){this.coord=this.getCoords.bindWithEvent(this);this.mousemover.addListener('mousemove',this.coord);},stop:function(){this.mousemover.removeListener('mousemove',this.coord);this.timer=$clear(this.timer);},getCoords:function(event){this.page=(this.element==window)?event.client:event.page;if(!this.timer)this.timer=this.scroll.periodical(50,this);},scroll:function(){var el=this.element.getSize();var pos=this.element.getPosition();var change={'x':0,'y':0};for(var z in this.page){if(this.page[z]<(this.options.area+pos[z])&&el.scroll[z]!=0)
 
change[z]=(this.page[z]-this.options.area-pos[z])*this.options.velocity;else if(this.page[z]+this.options.area>(el.size[z]+pos[z])&&el.scroll[z]+el.size[z]!=el.scrollSize[z])
 
change[z]=(this.page[z]-el.size[z]+this.options.area-pos[z])*this.options.velocity;}
 
if(change.y||change.x)this.fireEvent('onChange',[el.scroll.x+change.x,el.scroll.y+change.y]);}});Scroller.implement(new Events,new Options);var Slider=new Class({options:{onChange:Class.empty,onComplete:Class.empty,onTick:function(pos){this.knob.setStyle(this.p,pos);},mode:'horizontal',steps:100,offset:0},initialize:function(el,knob,options){this.element=$(el);this.knob=$(knob);this.setOptions(options);this.previousChange=-1;this.previousEnd=-1;this.step=-1;this.element.addEvent('mousedown',this.clickedElement.bindWithEvent(this));var mod,offset;switch(this.options.mode){case'horizontal':this.z='x';this.p='left';mod={'x':'left','y':false};offset='offsetWidth';break;case'vertical':this.z='y';this.p='top';mod={'x':false,'y':'top'};offset='offsetHeight';}
 
this.max=this.element[offset]-this.knob[offset]+(this.options.offset*2);this.half=this.knob[offset]/2;this.getPos=this.element['get'+this.p.capitalize()].bind(this.element);this.knob.setStyle('position','relative').setStyle(this.p,-this.options.offset);var lim={};lim[this.z]=[-this.options.offset,this.max-this.options.offset];this.drag=new Drag.Base(this.knob,{limit:lim,modifiers:mod,snap:0,onStart:function(){this.draggedKnob();}.bind(this),onDrag:function(){this.draggedKnob();}.bind(this),onComplete:function(){this.draggedKnob();this.end();}.bind(this)});if(this.options.initialize)this.options.initialize.call(this);},set:function(step){this.step=step.limit(0,this.options.steps);this.checkStep();this.end();this.fireEvent('onTick',this.toPosition(this.step));return this;},clickedElement:function(event){var position=event.page[this.z]-this.getPos()-this.half;position=position.limit(-this.options.offset,this.max-this.options.offset);this.step=this.toStep(position);this.checkStep();this.end();this.fireEvent('onTick',position);},draggedKnob:function(){this.step=this.toStep(this.drag.value.now[this.z]);this.checkStep();},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent('onChange',this.step);}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent('onComplete',this.step+'');}},toStep:function(position){return Math.round((position+this.options.offset)/this.max*this.options.steps);},toPosition:function(step){return this.max*step/this.options.steps;}});Slider.implement(new Events);Slider.implement(new Options);var SmoothScroll=Fx.Scroll.extend({initialize:function(options){this.parent(window,options);this.links=(this.options.links)?$$(this.options.links):$$(document.links);var location=window.location.href.match(/^[^#]*/)[0]+'#';this.links.each(function(link){if(link.href.indexOf(location)!=0)return;var anchor=link.href.substr(location.length);if(anchor&&$(anchor))this.useLink(link,anchor);},this);if(!window.webkit419)this.addEvent('onComplete',function(){window.location.hash=this.anchor;});},useLink:function(link,anchor){link.addEvent('click',function(event){this.anchor=anchor;this.toElement(anchor);event.stop();}.bindWithEvent(this));}});var Sortables=new Class({options:{handles:false,onStart:Class.empty,onComplete:Class.empty,ghost:true,snap:3,onDragStart:function(element,ghost){ghost.setStyle('opacity',0.7);element.setStyle('opacity',0.7);},onDragComplete:function(element,ghost){element.setStyle('opacity',1);ghost.remove();this.trash.remove();}},initialize:function(list,options){this.setOptions(options);this.list=$(list);this.elements=this.list.getChildren();this.handles=(this.options.handles)?$$(this.options.handles):this.elements;this.bound={'start':[],'moveGhost':this.moveGhost.bindWithEvent(this)};for(var i=0,l=this.handles.length;i<l;i++){this.bound.start[i]=this.start.bindWithEvent(this,this.elements[i]);}
 
this.attach();if(this.options.initialize)this.options.initialize.call(this);this.bound.move=this.move.bindWithEvent(this);this.bound.end=this.end.bind(this);},attach:function(){this.handles.each(function(handle,i){handle.addEvent('mousedown',this.bound.start[i]);},this);},detach:function(){this.handles.each(function(handle,i){handle.removeEvent('mousedown',this.bound.start[i]);},this);},start:function(event,el){this.active=el;this.coordinates=this.list.getCoordinates();if(this.options.ghost){var position=el.getPosition();this.offset=event.page.y-position.y;this.trash=new Element('div').inject(document.body);this.ghost=el.clone().inject(this.trash).setStyles({'position':'absolute','left':position.x,'top':event.page.y-this.offset});document.addListener('mousemove',this.bound.moveGhost);this.fireEvent('onDragStart',[el,this.ghost]);}
 
document.addListener('mousemove',this.bound.move);document.addListener('mouseup',this.bound.end);this.fireEvent('onStart',el);event.stop();},moveGhost:function(event){var value=event.page.y-this.offset;value=value.limit(this.coordinates.top,this.coordinates.bottom-this.ghost.offsetHeight);this.ghost.setStyle('top',value);event.stop();},move:function(event){var now=event.page.y;this.previous=this.previous||now;var up=((this.previous-now)>0);var prev=this.active.getPrevious();var next=this.active.getNext();if(prev&&up&&now<prev.getCoordinates().bottom)this.active.injectBefore(prev);if(next&&!up&&now>next.getCoordinates().top)this.active.injectAfter(next);this.previous=now;},serialize:function(converter){return this.list.getChildren().map(converter||function(el){return this.elements.indexOf(el);},this);},end:function(){this.previous=null;document.removeListener('mousemove',this.bound.move);document.removeListener('mouseup',this.bound.end);if(this.options.ghost){document.removeListener('mousemove',this.bound.moveGhost);this.fireEvent('onDragComplete',[this.active,this.ghost]);}
 
this.fireEvent('onComplete',this.active);}});Sortables.implement(new Events,new Options);var Tips=new Class({options:{onShow:function(tip){tip.setStyle('visibility','visible');},onHide:function(tip){tip.setStyle('visibility','hidden');},maxTitleChars:30,showDelay:100,hideDelay:100,className:'tool',offsets:{'x':16,'y':16},fixed:false},initialize:function(elements,options){this.setOptions(options);this.toolTip=new Element('div',{'class':this.options.className+'-tip','styles':{'position':'absolute','top':'0','left':'0','visibility':'hidden'}}).inject(document.body);this.wrapper=new Element('div').inject(this.toolTip);$$(elements).each(this.build,this);if(this.options.initialize)this.options.initialize.call(this);},build:function(el){el.$tmp.myTitle=(el.href&&el.getTag()=='a')?el.href.replace('http://',''):(el.rel||false);if(el.title){var dual=el.title.split('::');if(dual.length>1){el.$tmp.myTitle=dual[0].trim();el.$tmp.myText=dual[1].trim();}else{el.$tmp.myText=el.title;}
 
el.removeAttribute('title');}else{el.$tmp.myText=false;}
 
if(el.$tmp.myTitle&&el.$tmp.myTitle.length>this.options.maxTitleChars)el.$tmp.myTitle=el.$tmp.myTitle.substr(0,this.options.maxTitleChars-1)+"&hellip;";el.addEvent('mouseenter',function(event){this.start(el);if(!this.options.fixed)this.locate(event);else this.position(el);}.bind(this));if(!this.options.fixed)el.addEvent('mousemove',this.locate.bindWithEvent(this));var end=this.end.bind(this);el.addEvent('mouseleave',end);el.addEvent('trash',end);},start:function(el){this.wrapper.empty();if(el.$tmp.myTitle){this.title=new Element('span').inject(new Element('div',{'class':this.options.className+'-title'}).inject(this.wrapper)).setHTML(el.$tmp.myTitle);}
 
if(el.$tmp.myText){this.text=new Element('span').inject(new Element('div',{'class':this.options.className+'-text'}).inject(this.wrapper)).setHTML(el.$tmp.myText);}
 
$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this);},end:function(event){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this);},position:function(element){var pos=element.getPosition();this.toolTip.setStyles({'left':pos.x+this.options.offsets.x,'top':pos.y+this.options.offsets.y});},locate:function(event){var win={'x':window.getWidth(),'y':window.getHeight()};var scroll={'x':window.getScrollLeft(),'y':window.getScrollTop()};var tip={'x':this.toolTip.offsetWidth,'y':this.toolTip.offsetHeight};var prop={'x':'left','y':'top'};for(var z in prop){var pos=event.page[z]+this.options.offsets[z];if((pos+tip[z]-scroll[z])>win[z])pos=event.page[z]-this.options.offsets[z]-tip[z];this.toolTip.setStyle(prop[z],pos);};},show:function(){if(this.options.timeout)this.timer=this.hide.delay(this.options.timeout,this);this.fireEvent('onShow',[this.toolTip]);},hide:function(){this.fireEvent('onHide',[this.toolTip]);}});Tips.implement(new Events,new Options);var Group=new Class({initialize:function(){this.instances=$A(arguments);this.events={};this.checker={};},addEvent:function(type,fn){this.checker[type]=this.checker[type]||{};this.events[type]=this.events[type]||[];if(this.events[type].contains(fn))return false;else this.events[type].push(fn);this.instances.each(function(instance,i){instance.addEvent(type,this.check.bind(this,[type,instance,i]));},this);return this;},check:function(type,instance,i){this.checker[type][i]=true;var every=this.instances.every(function(current,j){return this.checker[type][j]||false;},this);if(!every)return;this.checker[type]={};this.events[type].each(function(event){event.call(this,this.instances,instance);},this);}});var Accordion=Fx.Elements.extend({options:{onActive:Class.empty,onBackground:Class.empty,display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var options,togglers,elements,container;$each(arguments,function(argument,i){switch($type(argument)){case'object':options=argument;break;case'element':container=$(argument);break;default:var temp=$$(argument);if(!togglers)togglers=temp;else elements=temp;}});this.togglers=togglers||[];this.elements=elements||[];this.container=$(container);this.setOptions(options);this.previous=-1;if(this.options.alwaysHide)this.options.wait=true;if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show;}
 
if(this.options.start){this.options.display=false;this.options.show=false;}
 
this.effects={};if(this.options.opacity)this.effects.opacity='fullOpacity';if(this.options.width)this.effects.width=this.options.fixedWidth?'fullWidth':'offsetWidth';if(this.options.height)this.effects.height=this.options.fixedHeight?'fullHeight':'scrollHeight';for(var i=0,l=this.togglers.length;i<l;i++)this.addSection(this.togglers[i],this.elements[i]);this.elements.each(function(el,i){if(this.options.show===i){this.fireEvent('onActive',[this.togglers[i],el]);}else{for(var fx in this.effects)el.setStyle(fx,0);}},this);this.parent(this.elements);if($chk(this.options.display))this.display(this.options.display);},addSection:function(toggler,element,pos){toggler=$(toggler);element=$(element);var test=this.togglers.contains(toggler);var len=this.togglers.length;this.togglers.include(toggler);this.elements.include(element);if(len&&(!test||pos)){pos=$pick(pos,len-1);toggler.injectBefore(this.togglers[pos]);element.injectAfter(toggler);}else if(this.container&&!test){toggler.inject(this.container);element.inject(this.container);}
 
var idx=this.togglers.indexOf(toggler);toggler.addEvent('click',this.display.bind(this,idx));if(this.options.height)element.setStyles({'padding-top':0,'border-top':'none','padding-bottom':0,'border-bottom':'none'});if(this.options.width)element.setStyles({'padding-left':0,'border-left':'none','padding-right':0,'border-right':'none'});element.fullOpacity=1;if(this.options.fixedWidth)element.fullWidth=this.options.fixedWidth;if(this.options.fixedHeight)element.fullHeight=this.options.fixedHeight;element.setStyle('overflow','hidden');if(!test){for(var fx in this.effects)element.setStyle(fx,0);}
 
return this;},display:function(index){index=($type(index)=='element')?this.elements.indexOf(index):index;if((this.timer&&this.options.wait)||(index===this.previous&&!this.options.alwaysHide))return this;this.previous=index;var obj={};this.elements.each(function(el,i){obj[i]={};var hide=(i!=index)||(this.options.alwaysHide&&(el.offsetHeight>0));this.fireEvent(hide?'onBackground':'onActive',[this.togglers[i],el]);for(var fx in this.effects)obj[i][fx]=hide?0:el[this.effects[fx]];},this);return this.start(obj);},showThisHideOpen:function(index){return this.display(index);}});Fx.Accordion=Accordion;
 
\ No newline at end of file
components/com_morfeoshow/src/js/picas.js
Show inline comments
 
new file 100644
 
/**
 
 * Picasa Webalbum Integration Library
 
 * This library was inspired and based on pwa  by Dieter Raber (http://www.gnu.org/copyleft/lesser.html)
 
 * @name pwi-0.3.js
 
 * @author Jeroen Diderik - http://www.multiprof.nl
 
 * @version 0.2
 
 * @date March 27, 2008
 
 * @copyright (c) 2008 Jeroen Diderik(www.multiprof.nl)
 
 * @license Creative Commons Attribution-Share Alike 3.0 Netherlands License - http://creativecommons.org/licenses/by-sa/3.0/nl/
 
 * @example Visit http://www.multiprof.nl/ for more informations about this library
 
 */
 
 
 

	
 
// ****  DONT CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING ****
 
//preset globals
 
var pwi_currAlbum = "";
 
var pwi_currAlbumTitle = "";
 
var pwi_currPhoto = "";
 
var pwi_page = "";
 
var pwi_si = 1;
 
var pwi_storage_albums;
 
var pwi_storage_photos;
 
var pwi_storage_photo;
 
var pwi_history = "";
 

	
 
// various functions
 
//get querytring (for later use to make deeplinks)
 
function readGet() {
 
	var _GET = new Array();
 
	var uriStr = window.location.href.replace(/&amp;/g, '&');
 
	var paraArr,
 
	paraSplit;
 
	if (uriStr.indexOf('?') > -1) {
 
		var uriArr = uriStr.split('?');
 
		var paraStr = uriArr[1];
 
	} else {
 
		return _GET;
 
	}
 
	if (paraStr.indexOf('&') > -1) {
 
		paraArr = paraStr.split('&');
 
	} else {
 
		paraArr = new Array(paraStr);
 
	}
 
	for (var i = 0; i < paraArr.length; i++) {
 
		paraArr[i] = paraArr[i].indexOf('=') > -1 ? paraArr[i] : paraArr[i] + '=';
 
		paraSplit = paraArr[i].split('=');
 
		_GET[paraSplit[0]] = decodeURI(paraSplit[1].replace(/\+/g, ' '));
 
	}
 
	return _GET;
 
};
 
var _GET = readGet();
 

	
 
//fast string concat function ( var.push(x), var.toString() )
 
function StringCat() {
 
	var sp;
 
	var ep;
 
	var l = 0;
 
	this.push = function(what) {
 
		if (typeof(sp) == 'undefined') {
 
			ep = new Array();
 
			sp = ep;
 
		} else {
 
			var oep = ep;
 
			ep = new Array();
 
			oep[1] = ep;
 
		}
 
		ep[0] = what; ++l;
 
	};
 
	this.toString = function() {
 
		if (l == 0) return;
 
		while (l > 1) {
 
			var ptr = sp;
 
			var nsp = new Array();
 
			var nep = nsp;
 
			var nl = 0;
 
			while (typeof(ptr) != 'undefined') {
 
				if (typeof(nep[0]) == 'undefined') {
 
					nep[0] = ptr[0]; ++nl;
 
				} else {
 
					if (typeof(ptr[0]) != 'undefined') nep[0] += ptr[0];
 
					nep[1] = new Array();
 
					nep = nep[1];
 
				};
 
				ptr = ptr[1];
 
			};
 
			sp = nsp;
 
			ep = nep;
 
			l = nl;
 
		};
 
		return sp[0];
 
	};
 
}
 

	
 
function formatDateTime(dt) {
 
	var today = new Date(Number(dt));
 
	var year = today.getYear();
 
	if (year < 1000) {
 
		year += 1900
 
	};
 
	return (today.getDate() + "-" + (today.getMonth() + 1) + "-" + year + " " + today.getHours() + ":" + (today.getMinutes() < 10 ? "0" + today.getMinutes() : today.getMinutes()));
 
}
 

	
 
var photoids = new Array();
 

	
 

	
 
function getAlbums() {
 
	if (pwi_storage_albums) {
 
		show(false, pwi_storage_albums);
 
	} else {
 
		show(true, '');
 
		var url = 'http://picasaweb.google.com/data/feed/api/user/' + pwi_username + '?category=album&max-results=' + pwi_maxalbums + '&access=public&alt=json';
 
		$.getJSON(url, 'callback=?', albums);
 
	}
 
}
 

	
 
function getAlbum(albumid, newPage) {
 
	if (albumid != pwi_currAlbum || pwi_page != newPage) {
 
		pwi_page = newPage;
 
		pwi_currAlbum = albumid;
 
		pwi_si = ((pwi_page - 1) * pwi_maxresults) + 1;
 
		var url = 'http://picasaweb.google.com/data/feed/api/user/' + pwi_username + '/albumid/' + albumid + '?category=photo&max-results=' + pwi_maxresults + '&start-index=' + pwi_si + '&alt=json';
 
		show(true, '');
 
		$.getJSON(url, 'callback=?', album);
 
	} else {
 
		show(false, pwi_storage_photos);
 
	}
 
}
 

	
 
function fromHistory(hash) {
 
	if (hash) {
 
		var a,p;
 
		if (hash.indexOf("/") > 0) {
 
			a = hash.split("/")[0];
 
			p = hash.split("/")[1];
 
			getAlbum(a, p);
 
		}
 
	} else {
 
		getAlbums();
 
	}
 
}
 
\ No newline at end of file
components/com_morfeoshow/src/js/prototype.js
Show inline comments
 
new file 100644
 
var Prototype={Version:"1.6.0.2",Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div").__proto__&&document.createElement("div").__proto__!==document.createElement("form").__proto__},ScriptFragment:"<script[^>]*>([\\S\\s]*?)</script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){
 
},K:function(x){
 
return x;
 
}};
 
if(Prototype.Browser.MobileSafari){
 
Prototype.BrowserFeatures.SpecificElementExtensions=false;
 
}
 
var Class={create:function(){
 
var _2=null,properties=$A(arguments);
 
if(Object.isFunction(properties[0])){
 
_2=properties.shift();
 
}
 
function klass(){
 
this.initialize.apply(this,arguments);
 
}
 
Object.extend(klass,Class.Methods);
 
klass.superclass=_2;
 
klass.subclasses=[];
 
if(_2){
 
var _3=function(){
 
};
 
_3.prototype=_2.prototype;
 
klass.prototype=new _3;
 
_2.subclasses.push(klass);
 
}
 
for(var i=0;i<properties.length;i++){
 
klass.addMethods(properties[i]);
 
}
 
if(!klass.prototype.initialize){
 
klass.prototype.initialize=Prototype.emptyFunction;
 
}
 
klass.prototype.constructor=klass;
 
return klass;
 
}};
 
Class.Methods={addMethods:function(_5){
 
var _6=this.superclass&&this.superclass.prototype;
 
var _7=Object.keys(_5);
 
if(!Object.keys({toString:true}).length){
 
_7.push("toString","valueOf");
 
}
 
for(var i=0,length=_7.length;i<length;i++){
 
var _9=_7[i],value=_5[_9];
 
if(_6&&Object.isFunction(value)&&value.argumentNames().first()=="$super"){
 
var _a=value,value=Object.extend((function(m){
 
return function(){
 
return _6[m].apply(this,arguments);
 
};
 
})(_9).wrap(_a),{valueOf:function(){
 
return _a;
 
},toString:function(){
 
return _a.toString();
 
}});
 
}
 
this.prototype[_9]=value;
 
}
 
return this;
 
}};
 
var Abstract={};
 
Object.extend=function(_c,_d){
 
for(var _e in _d){
 
_c[_e]=_d[_e];
 
}
 
return _c;
 
};
 
Object.extend(Object,{inspect:function(_f){
 
try{
 
if(Object.isUndefined(_f)){
 
return "undefined";
 
}
 
if(_f===null){
 
return "null";
 
}
 
return _f.inspect?_f.inspect():String(_f);
 
}
 
catch(e){
 
if(e instanceof RangeError){
 
return "...";
 
}
 
throw e;
 
}
 
},toJSON:function(_10){
 
var _11=typeof _10;
 
switch(_11){
 
case "undefined":
 
case "function":
 
case "unknown":
 
return;
 
case "boolean":
 
return _10.toString();
 
}
 
if(_10===null){
 
return "null";
 
}
 
if(_10.toJSON){
 
return _10.toJSON();
 
}
 
if(Object.isElement(_10)){
 
return;
 
}
 
var _12=[];
 
for(var _13 in _10){
 
var _14=Object.toJSON(_10[_13]);
 
if(!Object.isUndefined(_14)){
 
_12.push(_13.toJSON()+": "+_14);
 
}
 
}
 
return "{"+_12.join(", ")+"}";
 
},toQueryString:function(_15){
 
return $H(_15).toQueryString();
 
},toHTML:function(_16){
 
return _16&&_16.toHTML?_16.toHTML():String.interpret(_16);
 
},keys:function(_17){
 
var _18=[];
 
for(var _19 in _17){
 
_18.push(_19);
 
}
 
return _18;
 
},values:function(_1a){
 
var _1b=[];
 
for(var _1c in _1a){
 
_1b.push(_1a[_1c]);
 
}
 
return _1b;
 
},clone:function(_1d){
 
return Object.extend({},_1d);
 
},isElement:function(_1e){
 
return _1e&&_1e.nodeType==1;
 
},isArray:function(_1f){
 
return _1f!=null&&typeof _1f=="object"&&"splice" in _1f&&"join" in _1f;
 
},isHash:function(_20){
 
return _20 instanceof Hash;
 
},isFunction:function(_21){
 
return typeof _21=="function";
 
},isString:function(_22){
 
return typeof _22=="string";
 
},isNumber:function(_23){
 
return typeof _23=="number";
 
},isUndefined:function(_24){
 
return typeof _24=="undefined";
 
}});
 
Object.extend(Function.prototype,{argumentNames:function(){
 
var _25=this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");
 
return _25.length==1&&!_25[0]?[]:_25;
 
},bind:function(){
 
if(arguments.length<2&&Object.isUndefined(arguments[0])){
 
return this;
 
}
 
var _26=this,args=$A(arguments),object=args.shift();
 
return function(){
 
return _26.apply(object,args.concat($A(arguments)));
 
};
 
},bindAsEventListener:function(){
 
var _27=this,args=$A(arguments),object=args.shift();
 
return function(_28){
 
return _27.apply(object,[_28||window.event].concat(args));
 
};
 
},curry:function(){
 
if(!arguments.length){
 
return this;
 
}
 
var _29=this,args=$A(arguments);
 
return function(){
 
return _29.apply(this,args.concat($A(arguments)));
 
};
 
},delay:function(){
 
var _2a=this,args=$A(arguments),timeout=args.shift()*1000;
 
return window.setTimeout(function(){
 
return _2a.apply(_2a,args);
 
},timeout);
 
},wrap:function(_2b){
 
var _2c=this;
 
return function(){
 
return _2b.apply(this,[_2c.bind(this)].concat($A(arguments)));
 
};
 
},methodize:function(){
 
if(this._methodized){
 
return this._methodized;
 
}
 
var _2d=this;
 
return this._methodized=function(){
 
return _2d.apply(null,[this].concat($A(arguments)));
 
};
 
}});
 
Function.prototype.defer=Function.prototype.delay.curry(0.01);
 
Date.prototype.toJSON=function(){
 
return "\""+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+"Z\"";
 
};
 
var Try={these:function(){
 
var _2e;
 
for(var i=0,length=arguments.length;i<length;i++){
 
var _30=arguments[i];
 
try{
 
_2e=_30();
 
break;
 
}
 
catch(e){
 
}
 
}
 
return _2e;
 
}};
 
RegExp.prototype.match=RegExp.prototype.test;
 
RegExp.escape=function(str){
 
return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1");
 
};
 
var PeriodicalExecuter=Class.create({initialize:function(_32,_33){
 
this.callback=_32;
 
this.frequency=_33;
 
this.currentlyExecuting=false;
 
this.registerCallback();
 
},registerCallback:function(){
 
this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
 
},execute:function(){
 
this.callback(this);
 
},stop:function(){
 
if(!this.timer){
 
return;
 
}
 
clearInterval(this.timer);
 
this.timer=null;
 
},onTimerEvent:function(){
 
if(!this.currentlyExecuting){
 
try{
 
this.currentlyExecuting=true;
 
this.execute();
 
}
 
finally{
 
this.currentlyExecuting=false;
 
}
 
}
 
}});
 
Object.extend(String,{interpret:function(_34){
 
return _34==null?"":String(_34);
 
},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});
 
Object.extend(String.prototype,{gsub:function(_35,_36){
 
var _37="",source=this,match;
 
_36=arguments.callee.prepareReplacement(_36);
 
while(source.length>0){
 
if(match=source.match(_35)){
 
_37+=source.slice(0,match.index);
 
_37+=String.interpret(_36(match));
 
source=source.slice(match.index+match[0].length);
 
}else{
 
_37+=source,source="";
 
}
 
}
 
return _37;
 
},sub:function(_38,_39,_3a){
 
_39=this.gsub.prepareReplacement(_39);
 
_3a=Object.isUndefined(_3a)?1:_3a;
 
return this.gsub(_38,function(_3b){
 
if(--_3a<0){
 
return _3b[0];
 
}
 
return _39(_3b);
 
});
 
},scan:function(_3c,_3d){
 
this.gsub(_3c,_3d);
 
return String(this);
 
},truncate:function(_3e,_3f){
 
_3e=_3e||30;
 
_3f=Object.isUndefined(_3f)?"...":_3f;
 
return this.length>_3e?this.slice(0,_3e-_3f.length)+_3f:String(this);
 
},strip:function(){
 
return this.replace(/^\s+/,"").replace(/\s+$/,"");
 
},stripTags:function(){
 
return this.replace(/<\/?[^>]+>/gi,"");
 
},stripScripts:function(){
 
return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");
 
},extractScripts:function(){
 
var _40=new RegExp(Prototype.ScriptFragment,"img");
 
var _41=new RegExp(Prototype.ScriptFragment,"im");
 
return (this.match(_40)||[]).map(function(_42){
 
return (_42.match(_41)||["",""])[1];
 
});
 
},evalScripts:function(){
 
return this.extractScripts().map(function(_43){
 
return eval(_43);
 
});
 
},escapeHTML:function(){
 
var _44=arguments.callee;
 
_44.text.data=this;
 
return _44.div.innerHTML;
 
},unescapeHTML:function(){
 
var div=new Element("div");
 
div.innerHTML=this.stripTags();
 
return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject("",function(_46,_47){
 
return _46+_47.nodeValue;
 
}):div.childNodes[0].nodeValue):"";
 
},toQueryParams:function(_48){
 
var _49=this.strip().match(/([^?#]*)(#.*)?$/);
 
if(!_49){
 
return {};
 
}
 
return _49[1].split(_48||"&").inject({},function(_4a,_4b){
 
if((_4b=_4b.split("="))[0]){
 
var key=decodeURIComponent(_4b.shift());
 
var _4d=_4b.length>1?_4b.join("="):_4b[0];
 
if(_4d!=undefined){
 
_4d=decodeURIComponent(_4d);
 
}
 
if(key in _4a){
 
if(!Object.isArray(_4a[key])){
 
_4a[key]=[_4a[key]];
 
}
 
_4a[key].push(_4d);
 
}else{
 
_4a[key]=_4d;
 
}
 
}
 
return _4a;
 
});
 
},toArray:function(){
 
return this.split("");
 
},succ:function(){
 
return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1);
 
},times:function(_4e){
 
return _4e<1?"":new Array(_4e+1).join(this);
 
},camelize:function(){
 
var _4f=this.split("-"),len=_4f.length;
 
if(len==1){
 
return _4f[0];
 
}
 
var _50=this.charAt(0)=="-"?_4f[0].charAt(0).toUpperCase()+_4f[0].substring(1):_4f[0];
 
for(var i=1;i<len;i++){
 
_50+=_4f[i].charAt(0).toUpperCase()+_4f[i].substring(1);
 
}
 
return _50;
 
},capitalize:function(){
 
return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();
 
},underscore:function(){
 
return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase();
 
},dasherize:function(){
 
return this.gsub(/_/,"-");
 
},inspect:function(_52){
 
var _53=this.gsub(/[\x00-\x1f\\]/,function(_54){
 
var _55=String.specialChar[_54[0]];
 
return _55?_55:"\\u00"+_54[0].charCodeAt().toPaddedString(2,16);
 
});
 
if(_52){
 
return "\""+_53.replace(/"/g,"\\\"")+"\"";
 
}
 
return "'"+_53.replace(/'/g,"\\'")+"'";
 
},toJSON:function(){
 
return this.inspect(true);
 
},unfilterJSON:function(_56){
 
return this.sub(_56||Prototype.JSONFilter,"#{1}");
 
},isJSON:function(){
 
var str=this;
 
if(str.blank()){
 
return false;
 
}
 
str=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");
 
return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);
 
},evalJSON:function(_58){
 
var _59=this.unfilterJSON();
 
try{
 
if(!_58||_59.isJSON()){
 
return eval("("+_59+")");
 
}
 
}
 
catch(e){
 
}
 
throw new SyntaxError("Badly formed JSON string: "+this.inspect());
 
},include:function(_5a){
 
return this.indexOf(_5a)>-1;
 
},startsWith:function(_5b){
 
return this.indexOf(_5b)===0;
 
},endsWith:function(_5c){
 
var d=this.length-_5c.length;
 
return d>=0&&this.lastIndexOf(_5c)===d;
 
},empty:function(){
 
return this=="";
 
},blank:function(){
 
return /^\s*$/.test(this);
 
},interpolate:function(_5e,_5f){
 
return new Template(this,_5f).evaluate(_5e);
 
}});
 
if(Prototype.Browser.WebKit||Prototype.Browser.IE){
 
Object.extend(String.prototype,{escapeHTML:function(){
 
return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
 
},unescapeHTML:function(){
 
return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">");
 
}});
 
}
 
String.prototype.gsub.prepareReplacement=function(_60){
 
if(Object.isFunction(_60)){
 
return _60;
 
}
 
var _61=new Template(_60);
 
return function(_62){
 
return _61.evaluate(_62);
 
};
 
};
 
String.prototype.parseQuery=String.prototype.toQueryParams;
 
Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});
 
with(String.prototype.escapeHTML){
 
div.appendChild(text);
 
}
 
var Template=Class.create({initialize:function(_63,_64){
 
this.template=_63.toString();
 
this.pattern=_64||Template.Pattern;
 
},evaluate:function(_65){
 
if(Object.isFunction(_65.toTemplateReplacements)){
 
_65=_65.toTemplateReplacements();
 
}
 
return this.template.gsub(this.pattern,function(_66){
 
if(_65==null){
 
return "";
 
}
 
var _67=_66[1]||"";
 
if(_67=="\\"){
 
return _66[2];
 
}
 
var ctx=_65,expr=_66[3];
 
var _69=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;
 
_66=_69.exec(expr);
 
if(_66==null){
 
return _67;
 
}
 
while(_66!=null){
 
var _6a=_66[1].startsWith("[")?_66[2].gsub("\\\\]","]"):_66[1];
 
ctx=ctx[_6a];
 
if(null==ctx||""==_66[3]){
 
break;
 
}
 
expr=expr.substring("["==_66[3]?_66[1].length:_66[0].length);
 
_66=_69.exec(expr);
 
}
 
return _67+String.interpret(ctx);
 
});
 
}});
 
Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
 
var $break={};
 
var Enumerable={each:function(_6b,_6c){
 
var _6d=0;
 
_6b=_6b.bind(_6c);
 
try{
 
this._each(function(_6e){
 
_6b(_6e,_6d++);
 
});
 
}
 
catch(e){
 
if(e!=$break){
 
throw e;
 
}
 
}
 
return this;
 
},eachSlice:function(_6f,_70,_71){
 
_70=_70?_70.bind(_71):Prototype.K;
 
var _72=-_6f,slices=[],array=this.toArray();
 
while((_72+=_6f)<array.length){
 
slices.push(array.slice(_72,_72+_6f));
 
}
 
return slices.collect(_70,_71);
 
},all:function(_73,_74){
 
_73=_73?_73.bind(_74):Prototype.K;
 
var _75=true;
 
this.each(function(_76,_77){
 
_75=_75&&!!_73(_76,_77);
 
if(!_75){
 
throw $break;
 
}
 
});
 
return _75;
 
},any:function(_78,_79){
 
_78=_78?_78.bind(_79):Prototype.K;
 
var _7a=false;
 
this.each(function(_7b,_7c){
 
if(_7a=!!_78(_7b,_7c)){
 
throw $break;
 
}
 
});
 
return _7a;
 
},collect:function(_7d,_7e){
 
_7d=_7d?_7d.bind(_7e):Prototype.K;
 
var _7f=[];
 
this.each(function(_80,_81){
 
_7f.push(_7d(_80,_81));
 
});
 
return _7f;
 
},detect:function(_82,_83){
 
_82=_82.bind(_83);
 
var _84;
 
this.each(function(_85,_86){
 
if(_82(_85,_86)){
 
_84=_85;
 
throw $break;
 
}
 
});
 
return _84;
 
},findAll:function(_87,_88){
 
_87=_87.bind(_88);
 
var _89=[];
 
this.each(function(_8a,_8b){
 
if(_87(_8a,_8b)){
 
_89.push(_8a);
 
}
 
});
 
return _89;
 
},grep:function(_8c,_8d,_8e){
 
_8d=_8d?_8d.bind(_8e):Prototype.K;
 
var _8f=[];
 
if(Object.isString(_8c)){
 
_8c=new RegExp(_8c);
 
}
 
this.each(function(_90,_91){
 
if(_8c.match(_90)){
 
_8f.push(_8d(_90,_91));
 
}
 
});
 
return _8f;
 
},include:function(_92){
 
if(Object.isFunction(this.indexOf)){
 
if(this.indexOf(_92)!=-1){
 
return true;
 
}
 
}
 
var _93=false;
 
this.each(function(_94){
 
if(_94==_92){
 
_93=true;
 
throw $break;
 
}
 
});
 
return _93;
 
},inGroupsOf:function(_95,_96){
 
_96=Object.isUndefined(_96)?null:_96;
 
return this.eachSlice(_95,function(_97){
 
while(_97.length<_95){
 
_97.push(_96);
 
}
 
return _97;
 
});
 
},inject:function(_98,_99,_9a){
 
_99=_99.bind(_9a);
 
this.each(function(_9b,_9c){
 
_98=_99(_98,_9b,_9c);
 
});
 
return _98;
 
},invoke:function(_9d){
 
var _9e=$A(arguments).slice(1);
 
return this.map(function(_9f){
 
return _9f[_9d].apply(_9f,_9e);
 
});
 
},max:function(_a0,_a1){
 
_a0=_a0?_a0.bind(_a1):Prototype.K;
 
var _a2;
 
this.each(function(_a3,_a4){
 
_a3=_a0(_a3,_a4);
 
if(_a2==null||_a3>=_a2){
 
_a2=_a3;
 
}
 
});
 
return _a2;
 
},min:function(_a5,_a6){
 
_a5=_a5?_a5.bind(_a6):Prototype.K;
 
var _a7;
 
this.each(function(_a8,_a9){
 
_a8=_a5(_a8,_a9);
 
if(_a7==null||_a8<_a7){
 
_a7=_a8;
 
}
 
});
 
return _a7;
 
},partition:function(_aa,_ab){
 
_aa=_aa?_aa.bind(_ab):Prototype.K;
 
var _ac=[],falses=[];
 
this.each(function(_ad,_ae){
 
(_aa(_ad,_ae)?_ac:falses).push(_ad);
 
});
 
return [_ac,falses];
 
},pluck:function(_af){
 
var _b0=[];
 
this.each(function(_b1){
 
_b0.push(_b1[_af]);
 
});
 
return _b0;
 
},reject:function(_b2,_b3){
 
_b2=_b2.bind(_b3);
 
var _b4=[];
 
this.each(function(_b5,_b6){
 
if(!_b2(_b5,_b6)){
 
_b4.push(_b5);
 
}
 
});
 
return _b4;
 
},sortBy:function(_b7,_b8){
 
_b7=_b7.bind(_b8);
 
return this.map(function(_b9,_ba){
 
return {value:_b9,criteria:_b7(_b9,_ba)};
 
}).sort(function(_bb,_bc){
 
var a=_bb.criteria,b=_bc.criteria;
 
return a<b?-1:a>b?1:0;
 
}).pluck("value");
 
},toArray:function(){
 
return this.map();
 
},zip:function(){
 
var _be=Prototype.K,args=$A(arguments);
 
if(Object.isFunction(args.last())){
 
_be=args.pop();
 
}
 
var _bf=[this].concat(args).map($A);
 
return this.map(function(_c0,_c1){
 
return _be(_bf.pluck(_c1));
 
});
 
},size:function(){
 
return this.toArray().length;
 
},inspect:function(){
 
return "#<Enumerable:"+this.toArray().inspect()+">";
 
}};
 
Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});
 
function $A(_c2){
 
if(!_c2){
 
return [];
 
}
 
if(_c2.toArray){
 
return _c2.toArray();
 
}
 
var _c3=_c2.length||0,results=new Array(_c3);
 
while(_c3--){
 
results[_c3]=_c2[_c3];
 
}
 
return results;
 
}
 
if(Prototype.Browser.WebKit){
 
$A=function(_c4){
 
if(!_c4){
 
return [];
 
}
 
if(!(Object.isFunction(_c4)&&_c4=="[object NodeList]")&&_c4.toArray){
 
return _c4.toArray();
 
}
 
var _c5=_c4.length||0,results=new Array(_c5);
 
while(_c5--){
 
results[_c5]=_c4[_c5];
 
}
 
return results;
 
};
 
}
 
Array.from=$A;
 
Object.extend(Array.prototype,Enumerable);
 
if(!Array.prototype._reverse){
 
Array.prototype._reverse=Array.prototype.reverse;
 
}
 
Object.extend(Array.prototype,{_each:function(_c6){
 
for(var i=0,length=this.length;i<length;i++){
 
_c6(this[i]);
 
}
 
},clear:function(){
 
this.length=0;
 
return this;
 
},first:function(){
 
return this[0];
 
},last:function(){
 
return this[this.length-1];
 
},compact:function(){
 
return this.select(function(_c8){
 
return _c8!=null;
 
});
 
},flatten:function(){
 
return this.inject([],function(_c9,_ca){
 
return _c9.concat(Object.isArray(_ca)?_ca.flatten():[_ca]);
 
});
 
},without:function(){
 
var _cb=$A(arguments);
 
return this.select(function(_cc){
 
return !_cb.include(_cc);
 
});
 
},reverse:function(_cd){
 
return (_cd!==false?this:this.toArray())._reverse();
 
},reduce:function(){
 
return this.length>1?this:this[0];
 
},uniq:function(_ce){
 
return this.inject([],function(_cf,_d0,_d1){
 
if(0==_d1||(_ce?_cf.last()!=_d0:!_cf.include(_d0))){
 
_cf.push(_d0);
 
}
 
return _cf;
 
});
 
},intersect:function(_d2){
 
return this.uniq().findAll(function(_d3){
 
return _d2.detect(function(_d4){
 
return _d3===_d4;
 
});
 
});
 
},clone:function(){
 
return [].concat(this);
 
},size:function(){
 
return this.length;
 
},inspect:function(){
 
return "["+this.map(Object.inspect).join(", ")+"]";
 
},toJSON:function(){
 
var _d5=[];
 
this.each(function(_d6){
 
var _d7=Object.toJSON(_d6);
 
if(!Object.isUndefined(_d7)){
 
_d5.push(_d7);
 
}
 
});
 
return "["+_d5.join(", ")+"]";
 
}});
 
if(Object.isFunction(Array.prototype.forEach)){
 
Array.prototype._each=Array.prototype.forEach;
 
}
 
if(!Array.prototype.indexOf){
 
Array.prototype.indexOf=function(_d8,i){
 
i||(i=0);
 
var _da=this.length;
 
if(i<0){
 
i=_da+i;
 
}
 
for(;i<_da;i++){
 
if(this[i]===_d8){
 
return i;
 
}
 
}
 
return -1;
 
};
 
}
 
if(!Array.prototype.lastIndexOf){
 
Array.prototype.lastIndexOf=function(_db,i){
 
i=isNaN(i)?this.length:(i<0?this.length+i:i)+1;
 
var n=this.slice(0,i).reverse().indexOf(_db);
 
return (n<0)?n:i-n-1;
 
};
 
}
 
Array.prototype.toArray=Array.prototype.clone;
 
function $w(_de){
 
if(!Object.isString(_de)){
 
return [];
 
}
 
_de=_de.strip();
 
return _de?_de.split(/\s+/):[];
 
}
 
if(Prototype.Browser.Opera){
 
Array.prototype.concat=function(){
 
var _df=[];
 
for(var i=0,length=this.length;i<length;i++){
 
_df.push(this[i]);
 
}
 
for(var i=0,length=arguments.length;i<length;i++){
 
if(Object.isArray(arguments[i])){
 
for(var j=0,arrayLength=arguments[i].length;j<arrayLength;j++){
 
_df.push(arguments[i][j]);
 
}
 
}else{
 
_df.push(arguments[i]);
 
}
 
}
 
return _df;
 
};
 
}
 
Object.extend(Number.prototype,{toColorPart:function(){
 
return this.toPaddedString(2,16);
 
},succ:function(){
 
return this+1;
 
},times:function(_e3){
 
$R(0,this,true).each(_e3);
 
return this;
 
},toPaddedString:function(_e4,_e5){
 
var _e6=this.toString(_e5||10);
 
return "0".times(_e4-_e6.length)+_e6;
 
},toJSON:function(){
 
return isFinite(this)?this.toString():"null";
 
}});
 
$w("abs round ceil floor").each(function(_e7){
 
Number.prototype[_e7]=Math[_e7].methodize();
 
});
 
function $H(_e8){
 
return new Hash(_e8);
 
}
 
var Hash=Class.create(Enumerable,(function(){
 
function toQueryPair(key,_ea){
 
if(Object.isUndefined(_ea)){
 
return key;
 
}
 
return key+"="+encodeURIComponent(String.interpret(_ea));
 
}
 
return {initialize:function(_eb){
 
this._object=Object.isHash(_eb)?_eb.toObject():Object.clone(_eb);
 
},_each:function(_ec){
 
for(var key in this._object){
 
var _ee=this._object[key],pair=[key,_ee];
 
pair.key=key;
 
pair.value=_ee;
 
_ec(pair);
 
}
 
},set:function(key,_f0){
 
return this._object[key]=_f0;
 
},get:function(key){
 
return this._object[key];
 
},unset:function(key){
 
var _f3=this._object[key];
 
delete this._object[key];
 
return _f3;
 
},toObject:function(){
 
return Object.clone(this._object);
 
},keys:function(){
 
return this.pluck("key");
 
},values:function(){
 
return this.pluck("value");
 
},index:function(_f4){
 
var _f5=this.detect(function(_f6){
 
return _f6.value===_f4;
 
});
 
return _f5&&_f5.key;
 
},merge:function(_f7){
 
return this.clone().update(_f7);
 
},update:function(_f8){
 
return new Hash(_f8).inject(this,function(_f9,_fa){
 
_f9.set(_fa.key,_fa.value);
 
return _f9;
 
});
 
},toQueryString:function(){
 
return this.map(function(_fb){
 
var key=encodeURIComponent(_fb.key),values=_fb.value;
 
if(values&&typeof values=="object"){
 
if(Object.isArray(values)){
 
return values.map(toQueryPair.curry(key)).join("&");
 
}
 
}
 
return toQueryPair(key,values);
 
}).join("&");
 
},inspect:function(){
 
return "#<Hash:{"+this.map(function(_fd){
 
return _fd.map(Object.inspect).join(": ");
 
}).join(", ")+"}>";
 
},toJSON:function(){
 
return Object.toJSON(this.toObject());
 
},clone:function(){
 
return new Hash(this);
 
}};
 
})());
 
Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;
 
Hash.from=$H;
 
var ObjectRange=Class.create(Enumerable,{initialize:function(_fe,end,_100){
 
this.start=_fe;
 
this.end=end;
 
this.exclusive=_100;
 
},_each:function(_101){
 
var _102=this.start;
 
while(this.include(_102)){
 
_101(_102);
 
_102=_102.succ();
 
}
 
},include:function(_103){
 
if(_103<this.start){
 
return false;
 
}
 
if(this.exclusive){
 
return _103<this.end;
 
}
 
return _103<=this.end;
 
}});
 
var $R=function(_104,end,_106){
 
return new ObjectRange(_104,end,_106);
 
};
 
var Ajax={getTransport:function(){
 
return Try.these(function(){
 
return new XMLHttpRequest();
 
},function(){
 
return new ActiveXObject("Msxml2.XMLHTTP");
 
},function(){
 
return new ActiveXObject("Microsoft.XMLHTTP");
 
})||false;
 
},activeRequestCount:0};
 
Ajax.Responders={responders:[],_each:function(_107){
 
this.responders._each(_107);
 
},register:function(_108){
 
if(!this.include(_108)){
 
this.responders.push(_108);
 
}
 
},unregister:function(_109){
 
this.responders=this.responders.without(_109);
 
},dispatch:function(_10a,_10b,_10c,json){
 
this.each(function(_10e){
 
if(Object.isFunction(_10e[_10a])){
 
try{
 
_10e[_10a].apply(_10e,[_10b,_10c,json]);
 
}
 
catch(e){
 
}
 
}
 
});
 
}};
 
Object.extend(Ajax.Responders,Enumerable);
 
Ajax.Responders.register({onCreate:function(){
 
Ajax.activeRequestCount++;
 
},onComplete:function(){
 
Ajax.activeRequestCount--;
 
}});
 
Ajax.Base=Class.create({initialize:function(_10f){
 
this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};
 
Object.extend(this.options,_10f||{});
 
this.options.method=this.options.method.toLowerCase();
 
if(Object.isString(this.options.parameters)){
 
this.options.parameters=this.options.parameters.toQueryParams();
 
}else{
 
if(Object.isHash(this.options.parameters)){
 
this.options.parameters=this.options.parameters.toObject();
 
}
 
}
 
}});
 
Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function(_110,url,_112){
 
_110(_112);
 
this.transport=Ajax.getTransport();
 
this.request(url);
 
},request:function(url){
 
this.url=url;
 
this.method=this.options.method;
 
var _114=Object.clone(this.options.parameters);
 
if(!["get","post"].include(this.method)){
 
_114["_method"]=this.method;
 
this.method="post";
 
}
 
this.parameters=_114;
 
if(_114=Object.toQueryString(_114)){
 
if(this.method=="get"){
 
this.url+=(this.url.include("?")?"&":"?")+_114;
 
}else{
 
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
 
_114+="&_=";
 
}
 
}
 
}
 
try{
 
var _115=new Ajax.Response(this);
 
if(this.options.onCreate){
 
this.options.onCreate(_115);
 
}
 
Ajax.Responders.dispatch("onCreate",this,_115);
 
this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);
 
if(this.options.asynchronous){
 
this.respondToReadyState.bind(this).defer(1);
 
}
 
this.transport.onreadystatechange=this.onStateChange.bind(this);
 
this.setRequestHeaders();
 
this.body=this.method=="post"?(this.options.postBody||_114):null;
 
this.transport.send(this.body);
 
if(!this.options.asynchronous&&this.transport.overrideMimeType){
 
this.onStateChange();
 
}
 
}
 
catch(e){
 
this.dispatchException(e);
 
}
 
},onStateChange:function(){
 
var _116=this.transport.readyState;
 
if(_116>1&&!((_116==4)&&this._complete)){
 
this.respondToReadyState(this.transport.readyState);
 
}
 
},setRequestHeaders:function(){
 
var _117={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"};
 
if(this.method=="post"){
 
_117["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");
 
if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){
 
_117["Connection"]="close";
 
}
 
}
 
if(typeof this.options.requestHeaders=="object"){
 
var _118=this.options.requestHeaders;
 
if(Object.isFunction(_118.push)){
 
for(var i=0,length=_118.length;i<length;i+=2){
 
_117[_118[i]]=_118[i+1];
 
}
 
}else{
 
$H(_118).each(function(pair){
 
_117[pair.key]=pair.value;
 
});
 
}
 
}
 
for(var name in _117){
 
this.transport.setRequestHeader(name,_117[name]);
 
}
 
},success:function(){
 
var _11c=this.getStatus();
 
return !_11c||(_11c>=200&&_11c<300);
 
},getStatus:function(){
 
try{
 
return this.transport.status||0;
 
}
 
catch(e){
 
return 0;
 
}
 
},respondToReadyState:function(_11d){
 
var _11e=Ajax.Request.Events[_11d],response=new Ajax.Response(this);
 
if(_11e=="Complete"){
 
try{
 
this._complete=true;
 
(this.options["on"+response.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(response,response.headerJSON);
 
}
 
catch(e){
 
this.dispatchException(e);
 
}
 
var _11f=response.getHeader("Content-type");
 
if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&_11f&&_11f.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){
 
this.evalResponse();
 
}
 
}
 
try{
 
(this.options["on"+_11e]||Prototype.emptyFunction)(response,response.headerJSON);
 
Ajax.Responders.dispatch("on"+_11e,this,response,response.headerJSON);
 
}
 
catch(e){
 
this.dispatchException(e);
 
}
 
if(_11e=="Complete"){
 
this.transport.onreadystatechange=Prototype.emptyFunction;
 
}
 
},isSameOrigin:function(){
 
var m=this.url.match(/^\s*https?:\/\/[^\/]*/);
 
return !m||(m[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}));
 
},getHeader:function(name){
 
try{
 
return this.transport.getResponseHeader(name)||null;
 
}
 
catch(e){
 
return null;
 
}
 
},evalResponse:function(){
 
try{
 
return eval((this.transport.responseText||"").unfilterJSON());
 
}
 
catch(e){
 
this.dispatchException(e);
 
}
 
},dispatchException:function(_122){
 
(this.options.onException||Prototype.emptyFunction)(this,_122);
 
Ajax.Responders.dispatch("onException",this,_122);
 
}});
 
Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
 
Ajax.Response=Class.create({initialize:function(_123){
 
this.request=_123;
 
var _124=this.transport=_123.transport,readyState=this.readyState=_124.readyState;
 
if((readyState>2&&!Prototype.Browser.IE)||readyState==4){
 
this.status=this.getStatus();
 
this.statusText=this.getStatusText();
 
this.responseText=String.interpret(_124.responseText);
 
this.headerJSON=this._getHeaderJSON();
 
}
 
if(readyState==4){
 
var xml=_124.responseXML;
 
this.responseXML=Object.isUndefined(xml)?null:xml;
 
this.responseJSON=this._getResponseJSON();
 
}
 
},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){
 
try{
 
return this.transport.statusText||"";
 
}
 
catch(e){
 
return "";
 
}
 
},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){
 
try{
 
return this.getAllResponseHeaders();
 
}
 
catch(e){
 
return null;
 
}
 
},getResponseHeader:function(name){
 
return this.transport.getResponseHeader(name);
 
},getAllResponseHeaders:function(){
 
return this.transport.getAllResponseHeaders();
 
},_getHeaderJSON:function(){
 
var json=this.getHeader("X-JSON");
 
if(!json){
 
return null;
 
}
 
json=decodeURIComponent(escape(json));
 
try{
 
return json.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin());
 
}
 
catch(e){
 
this.request.dispatchException(e);
 
}
 
},_getResponseJSON:function(){
 
var _128=this.request.options;
 
if(!_128.evalJSON||(_128.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){
 
return null;
 
}
 
try{
 
return this.responseText.evalJSON(_128.sanitizeJSON||!this.request.isSameOrigin());
 
}
 
catch(e){
 
this.request.dispatchException(e);
 
}
 
}});
 
Ajax.Updater=Class.create(Ajax.Request,{initialize:function(_129,_12a,url,_12c){
 
this.container={success:(_12a.success||_12a),failure:(_12a.failure||(_12a.success?null:_12a))};
 
_12c=Object.clone(_12c);
 
var _12d=_12c.onComplete;
 
_12c.onComplete=(function(_12e,json){
 
this.updateContent(_12e.responseText);
 
if(Object.isFunction(_12d)){
 
_12d(_12e,json);
 
}
 
}).bind(this);
 
_129(url,_12c);
 
},updateContent:function(_130){
 
var _131=this.container[this.success()?"success":"failure"],options=this.options;
 
if(!options.evalScripts){
 
_130=_130.stripScripts();
 
}
 
if(_131=$(_131)){
 
if(options.insertion){
 
if(Object.isString(options.insertion)){
 
var _132={};
 
_132[options.insertion]=_130;
 
_131.insert(_132);
 
}else{
 
options.insertion(_131,_130);
 
}
 
}else{
 
_131.update(_130);
 
}
 
}
 
}});
 
Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function(_133,_134,url,_136){
 
_133(_136);
 
this.onComplete=this.options.onComplete;
 
this.frequency=(this.options.frequency||2);
 
this.decay=(this.options.decay||1);
 
this.updater={};
 
this.container=_134;
 
this.url=url;
 
this.start();
 
},start:function(){
 
this.options.onComplete=this.updateComplete.bind(this);
 
this.onTimerEvent();
 
},stop:function(){
 
this.updater.options.onComplete=undefined;
 
clearTimeout(this.timer);
 
(this.onComplete||Prototype.emptyFunction).apply(this,arguments);
 
},updateComplete:function(_137){
 
if(this.options.decay){
 
this.decay=(_137.responseText==this.lastText?this.decay*this.options.decay:1);
 
this.lastText=_137.responseText;
 
}
 
this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency);
 
},onTimerEvent:function(){
 
this.updater=new Ajax.Updater(this.container,this.url,this.options);
 
}});
 
function $(_138){
 
if(arguments.length>1){
 
for(var i=0,elements=[],length=arguments.length;i<length;i++){
 
elements.push($(arguments[i]));
 
}
 
return elements;
 
}
 
if(Object.isString(_138)){
 
_138=document.getElementById(_138);
 
}
 
return Element.extend(_138);
 
}
 
if(Prototype.BrowserFeatures.XPath){
 
document._getElementsByXPath=function(_13a,_13b){
 
var _13c=[];
 
var _13d=document.evaluate(_13a,$(_13b)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
 
for(var i=0,length=_13d.snapshotLength;i<length;i++){
 
_13c.push(Element.extend(_13d.snapshotItem(i)));
 
}
 
return _13c;
 
};
 
}
 
if(!window.Node){
 
var Node={};
 
}
 
if(!Node.ELEMENT_NODE){
 
Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12});
 
}
 
(function(){
 
var _13f=this.Element;
 
this.Element=function(_140,_141){
 
_141=_141||{};
 
_140=_140.toLowerCase();
 
var _142=Element.cache;
 
if(Prototype.Browser.IE&&_141.name){
 
_140="<"+_140+" name=\""+_141.name+"\">";
 
delete _141.name;
 
return Element.writeAttribute(document.createElement(_140),_141);
 
}
 
if(!_142[_140]){
 
_142[_140]=Element.extend(document.createElement(_140));
 
}
 
return Element.writeAttribute(_142[_140].cloneNode(false),_141);
 
};
 
Object.extend(this.Element,_13f||{});
 
}).call(window);
 
Element.cache={};
 
Element.Methods={visible:function(_143){
 
return $(_143).style.display!="none";
 
},toggle:function(_144){
 
_144=$(_144);
 
Element[Element.visible(_144)?"hide":"show"](_144);
 
return _144;
 
},hide:function(_145){
 
$(_145).style.display="none";
 
return _145;
 
},show:function(_146){
 
$(_146).style.display="";
 
return _146;
 
},remove:function(_147){
 
_147=$(_147);
 
_147.parentNode.removeChild(_147);
 
return _147;
 
},update:function(_148,_149){
 
_148=$(_148);
 
if(_149&&_149.toElement){
 
_149=_149.toElement();
 
}
 
if(Object.isElement(_149)){
 
return _148.update().insert(_149);
 
}
 
_149=Object.toHTML(_149);
 
_148.innerHTML=_149.stripScripts();
 
_149.evalScripts.bind(_149).defer();
 
return _148;
 
},replace:function(_14a,_14b){
 
_14a=$(_14a);
 
if(_14b&&_14b.toElement){
 
_14b=_14b.toElement();
 
}else{
 
if(!Object.isElement(_14b)){
 
_14b=Object.toHTML(_14b);
 
var _14c=_14a.ownerDocument.createRange();
 
_14c.selectNode(_14a);
 
_14b.evalScripts.bind(_14b).defer();
 
_14b=_14c.createContextualFragment(_14b.stripScripts());
 
}
 
}
 
_14a.parentNode.replaceChild(_14b,_14a);
 
return _14a;
 
},insert:function(_14d,_14e){
 
_14d=$(_14d);
 
if(Object.isString(_14e)||Object.isNumber(_14e)||Object.isElement(_14e)||(_14e&&(_14e.toElement||_14e.toHTML))){
 
_14e={bottom:_14e};
 
}
 
var _14f,insert,tagName,childNodes;
 
for(var _150 in _14e){
 
_14f=_14e[_150];
 
_150=_150.toLowerCase();
 
insert=Element._insertionTranslations[_150];
 
if(_14f&&_14f.toElement){
 
_14f=_14f.toElement();
 
}
 
if(Object.isElement(_14f)){
 
insert(_14d,_14f);
 
continue;
 
}
 
_14f=Object.toHTML(_14f);
 
tagName=((_150=="before"||_150=="after")?_14d.parentNode:_14d).tagName.toUpperCase();
 
childNodes=Element._getContentFromAnonymousElement(tagName,_14f.stripScripts());
 
if(_150=="top"||_150=="after"){
 
childNodes.reverse();
 
}
 
childNodes.each(insert.curry(_14d));
 
_14f.evalScripts.bind(_14f).defer();
 
}
 
return _14d;
 
},wrap:function(_151,_152,_153){
 
_151=$(_151);
 
if(Object.isElement(_152)){
 
$(_152).writeAttribute(_153||{});
 
}else{
 
if(Object.isString(_152)){
 
_152=new Element(_152,_153);
 
}else{
 
_152=new Element("div",_152);
 
}
 
}
 
if(_151.parentNode){
 
_151.parentNode.replaceChild(_152,_151);
 
}
 
_152.appendChild(_151);
 
return _152;
 
},inspect:function(_154){
 
_154=$(_154);
 
var _155="<"+_154.tagName.toLowerCase();
 
$H({"id":"id","className":"class"}).each(function(pair){
 
var _157=pair.first(),attribute=pair.last();
 
var _158=(_154[_157]||"").toString();
 
if(_158){
 
_155+=" "+attribute+"="+_158.inspect(true);
 
}
 
});
 
return _155+">";
 
},recursivelyCollect:function(_159,_15a){
 
_159=$(_159);
 
var _15b=[];
 
while(_159=_159[_15a]){
 
if(_159.nodeType==1){
 
_15b.push(Element.extend(_159));
 
}
 
}
 
return _15b;
 
},ancestors:function(_15c){
 
return $(_15c).recursivelyCollect("parentNode");
 
},descendants:function(_15d){
 
return $(_15d).select("*");
 
},firstDescendant:function(_15e){
 
_15e=$(_15e).firstChild;
 
while(_15e&&_15e.nodeType!=1){
 
_15e=_15e.nextSibling;
 
}
 
return $(_15e);
 
},immediateDescendants:function(_15f){
 
if(!(_15f=$(_15f).firstChild)){
 
return [];
 
}
 
while(_15f&&_15f.nodeType!=1){
 
_15f=_15f.nextSibling;
 
}
 
if(_15f){
 
return [_15f].concat($(_15f).nextSiblings());
 
}
 
return [];
 
},previousSiblings:function(_160){
 
return $(_160).recursivelyCollect("previousSibling");
 
},nextSiblings:function(_161){
 
return $(_161).recursivelyCollect("nextSibling");
 
},siblings:function(_162){
 
_162=$(_162);
 
return _162.previousSiblings().reverse().concat(_162.nextSiblings());
 
},match:function(_163,_164){
 
if(Object.isString(_164)){
 
_164=new Selector(_164);
 
}
 
return _164.match($(_163));
 
},up:function(_165,_166,_167){
 
_165=$(_165);
 
if(arguments.length==1){
 
return $(_165.parentNode);
 
}
 
var _168=_165.ancestors();
 
return Object.isNumber(_166)?_168[_166]:Selector.findElement(_168,_166,_167);
 
},down:function(_169,_16a,_16b){
 
_169=$(_169);
 
if(arguments.length==1){
 
return _169.firstDescendant();
 
}
 
return Object.isNumber(_16a)?_169.descendants()[_16a]:_169.select(_16a)[_16b||0];
 
},previous:function(_16c,_16d,_16e){
 
_16c=$(_16c);
 
if(arguments.length==1){
 
return $(Selector.handlers.previousElementSibling(_16c));
 
}
 
var _16f=_16c.previousSiblings();
 
return Object.isNumber(_16d)?_16f[_16d]:Selector.findElement(_16f,_16d,_16e);
 
},next:function(_170,_171,_172){
 
_170=$(_170);
 
if(arguments.length==1){
 
return $(Selector.handlers.nextElementSibling(_170));
 
}
 
var _173=_170.nextSiblings();
 
return Object.isNumber(_171)?_173[_171]:Selector.findElement(_173,_171,_172);
 
},select:function(){
 
var args=$A(arguments),element=$(args.shift());
 
return Selector.findChildElements(element,args);
 
},adjacent:function(){
 
var args=$A(arguments),element=$(args.shift());
 
return Selector.findChildElements(element.parentNode,args).without(element);
 
},identify:function(_176){
 
_176=$(_176);
 
var id=_176.readAttribute("id"),self=arguments.callee;
 
if(id){
 
return id;
 
}
 
do{
 
id="anonymous_element_"+self.counter++;
 
}while($(id));
 
_176.writeAttribute("id",id);
 
return id;
 
},readAttribute:function(_178,name){
 
_178=$(_178);
 
if(Prototype.Browser.IE){
 
var t=Element._attributeTranslations.read;
 
if(t.values[name]){
 
return t.values[name](_178,name);
 
}
 
if(t.names[name]){
 
name=t.names[name];
 
}
 
if(name.include(":")){
 
return (!_178.attributes||!_178.attributes[name])?null:_178.attributes[name].value;
 
}
 
}
 
return _178.getAttribute(name);
 
},writeAttribute:function(_17b,name,_17d){
 
_17b=$(_17b);
 
var _17e={},t=Element._attributeTranslations.write;
 
if(typeof name=="object"){
 
_17e=name;
 
}else{
 
_17e[name]=Object.isUndefined(_17d)?true:_17d;
 
}
 
for(var attr in _17e){
 
name=t.names[attr]||attr;
 
_17d=_17e[attr];
 
if(t.values[attr]){
 
name=t.values[attr](_17b,_17d);
 
}
 
if(_17d===false||_17d===null){
 
_17b.removeAttribute(name);
 
}else{
 
if(_17d===true){
 
_17b.setAttribute(name,name);
 
}else{
 
_17b.setAttribute(name,_17d);
 
}
 
}
 
}
 
return _17b;
 
},getHeight:function(_180){
 
return $(_180).getDimensions().height;
 
},getWidth:function(_181){
 
return $(_181).getDimensions().width;
 
},classNames:function(_182){
 
return new Element.ClassNames(_182);
 
},hasClassName:function(_183,_184){
 
if(!(_183=$(_183))){
 
return;
 
}
 
var _185=_183.className;
 
return (_185.length>0&&(_185==_184||new RegExp("(^|\\s)"+_184+"(\\s|$)").test(_185)));
 
},addClassName:function(_186,_187){
 
if(!(_186=$(_186))){
 
return;
 
}
 
if(!_186.hasClassName(_187)){
 
_186.className+=(_186.className?" ":"")+_187;
 
}
 
return _186;
 
},removeClassName:function(_188,_189){
 
if(!(_188=$(_188))){
 
return;
 
}
 
_188.className=_188.className.replace(new RegExp("(^|\\s+)"+_189+"(\\s+|$)")," ").strip();
 
return _188;
 
},toggleClassName:function(_18a,_18b){
 
if(!(_18a=$(_18a))){
 
return;
 
}
 
return _18a[_18a.hasClassName(_18b)?"removeClassName":"addClassName"](_18b);
 
},cleanWhitespace:function(_18c){
 
_18c=$(_18c);
 
var node=_18c.firstChild;
 
while(node){
 
var _18e=node.nextSibling;
 
if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
 
_18c.removeChild(node);
 
}
 
node=_18e;
 
}
 
return _18c;
 
},empty:function(_18f){
 
return $(_18f).innerHTML.blank();
 
},descendantOf:function(_190,_191){
 
_190=$(_190),_191=$(_191);
 
var _192=_191;
 
if(_190.compareDocumentPosition){
 
return (_190.compareDocumentPosition(_191)&8)===8;
 
}
 
if(_190.sourceIndex&&!Prototype.Browser.Opera){
 
var e=_190.sourceIndex,a=_191.sourceIndex,nextAncestor=_191.nextSibling;
 
if(!nextAncestor){
 
do{
 
_191=_191.parentNode;
 
}while(!(nextAncestor=_191.nextSibling)&&_191.parentNode);
 
}
 
if(nextAncestor&&nextAncestor.sourceIndex){
 
return (e>a&&e<nextAncestor.sourceIndex);
 
}
 
}
 
while(_190=_190.parentNode){
 
if(_190==_192){
 
return true;
 
}
 
}
 
return false;
 
},scrollTo:function(_194){
 
_194=$(_194);
 
var pos=_194.cumulativeOffset();
 
window.scrollTo(pos[0],pos[1]);
 
return _194;
 
},getStyle:function(_196,_197){
 
_196=$(_196);
 
_197=_197=="float"?"cssFloat":_197.camelize();
 
var _198=_196.style[_197];
 
if(!_198){
 
var css=document.defaultView.getComputedStyle(_196,null);
 
_198=css?css[_197]:null;
 
}
 
if(_197=="opacity"){
 
return _198?parseFloat(_198):1;
 
}
 
return _198=="auto"?null:_198;
 
},getOpacity:function(_19a){
 
return $(_19a).getStyle("opacity");
 
},setStyle:function(_19b,_19c){
 
_19b=$(_19b);
 
var _19d=_19b.style,match;
 
if(Object.isString(_19c)){
 
_19b.style.cssText+=";"+_19c;
 
return _19c.include("opacity")?_19b.setOpacity(_19c.match(/opacity:\s*(\d?\.?\d*)/)[1]):_19b;
 
}
 
for(var _19e in _19c){
 
if(_19e=="opacity"){
 
_19b.setOpacity(_19c[_19e]);
 
}else{
 
_19d[(_19e=="float"||_19e=="cssFloat")?(Object.isUndefined(_19d.styleFloat)?"cssFloat":"styleFloat"):_19e]=_19c[_19e];
 
}
 
}
 
return _19b;
 
},setOpacity:function(_19f,_1a0){
 
_19f=$(_19f);
 
_19f.style.opacity=(_1a0==1||_1a0==="")?"":(_1a0<0.00001)?0:_1a0;
 
return _19f;
 
},getDimensions:function(_1a1){
 
_1a1=$(_1a1);
 
var _1a2=$(_1a1).getStyle("display");
 
if(_1a2!="none"&&_1a2!=null){
 
return {width:_1a1.offsetWidth,height:_1a1.offsetHeight};
 
}
 
var els=_1a1.style;
 
var _1a4=els.visibility;
 
var _1a5=els.position;
 
var _1a6=els.display;
 
els.visibility="hidden";
 
els.position="absolute";
 
els.display="block";
 
var _1a7=_1a1.clientWidth;
 
var _1a8=_1a1.clientHeight;
 
els.display=_1a6;
 
els.position=_1a5;
 
els.visibility=_1a4;
 
return {width:_1a7,height:_1a8};
 
},makePositioned:function(_1a9){
 
_1a9=$(_1a9);
 
var pos=Element.getStyle(_1a9,"position");
 
if(pos=="static"||!pos){
 
_1a9._madePositioned=true;
 
_1a9.style.position="relative";
 
if(window.opera){
 
_1a9.style.top=0;
 
_1a9.style.left=0;
 
}
 
}
 
return _1a9;
 
},undoPositioned:function(_1ab){
 
_1ab=$(_1ab);
 
if(_1ab._madePositioned){
 
_1ab._madePositioned=undefined;
 
_1ab.style.position=_1ab.style.top=_1ab.style.left=_1ab.style.bottom=_1ab.style.right="";
 
}
 
return _1ab;
 
},makeClipping:function(_1ac){
 
_1ac=$(_1ac);
 
if(_1ac._overflow){
 
return _1ac;
 
}
 
_1ac._overflow=Element.getStyle(_1ac,"overflow")||"auto";
 
if(_1ac._overflow!=="hidden"){
 
_1ac.style.overflow="hidden";
 
}
 
return _1ac;
 
},undoClipping:function(_1ad){
 
_1ad=$(_1ad);
 
if(!_1ad._overflow){
 
return _1ad;
 
}
 
_1ad.style.overflow=_1ad._overflow=="auto"?"":_1ad._overflow;
 
_1ad._overflow=null;
 
return _1ad;
 
},cumulativeOffset:function(_1ae){
 
var _1af=0,valueL=0;
 
do{
 
_1af+=_1ae.offsetTop||0;
 
valueL+=_1ae.offsetLeft||0;
 
_1ae=_1ae.offsetParent;
 
}while(_1ae);
 
return Element._returnOffset(valueL,_1af);
 
},positionedOffset:function(_1b0){
 
var _1b1=0,valueL=0;
 
do{
 
_1b1+=_1b0.offsetTop||0;
 
valueL+=_1b0.offsetLeft||0;
 
_1b0=_1b0.offsetParent;
 
if(_1b0){
 
if(_1b0.tagName=="BODY"){
 
break;
 
}
 
var p=Element.getStyle(_1b0,"position");
 
if(p!=="static"){
 
break;
 
}
 
}
 
}while(_1b0);
 
return Element._returnOffset(valueL,_1b1);
 
},absolutize:function(_1b3){
 
_1b3=$(_1b3);
 
if(_1b3.getStyle("position")=="absolute"){
 
return;
 
}
 
var _1b4=_1b3.positionedOffset();
 
var top=_1b4[1];
 
var left=_1b4[0];
 
var _1b7=_1b3.clientWidth;
 
var _1b8=_1b3.clientHeight;
 
_1b3._originalLeft=left-parseFloat(_1b3.style.left||0);
 
_1b3._originalTop=top-parseFloat(_1b3.style.top||0);
 
_1b3._originalWidth=_1b3.style.width;
 
_1b3._originalHeight=_1b3.style.height;
 
_1b3.style.position="absolute";
 
_1b3.style.top=top+"px";
 
_1b3.style.left=left+"px";
 
_1b3.style.width=_1b7+"px";
 
_1b3.style.height=_1b8+"px";
 
return _1b3;
 
},relativize:function(_1b9){
 
_1b9=$(_1b9);
 
if(_1b9.getStyle("position")=="relative"){
 
return;
 
}
 
_1b9.style.position="relative";
 
var top=parseFloat(_1b9.style.top||0)-(_1b9._originalTop||0);
 
var left=parseFloat(_1b9.style.left||0)-(_1b9._originalLeft||0);
 
_1b9.style.top=top+"px";
 
_1b9.style.left=left+"px";
 
_1b9.style.height=_1b9._originalHeight;
 
_1b9.style.width=_1b9._originalWidth;
 
return _1b9;
 
},cumulativeScrollOffset:function(_1bc){
 
var _1bd=0,valueL=0;
 
do{
 
_1bd+=_1bc.scrollTop||0;
 
valueL+=_1bc.scrollLeft||0;
 
_1bc=_1bc.parentNode;
 
}while(_1bc);
 
return Element._returnOffset(valueL,_1bd);
 
},getOffsetParent:function(_1be){
 
if(_1be.offsetParent){
 
return $(_1be.offsetParent);
 
}
 
if(_1be==document.body){
 
return $(_1be);
 
}
 
while((_1be=_1be.parentNode)&&_1be!=document.body){
 
if(Element.getStyle(_1be,"position")!="static"){
 
return $(_1be);
 
}
 
}
 
return $(document.body);
 
},viewportOffset:function(_1bf){
 
var _1c0=0,valueL=0;
 
var _1c1=_1bf;
 
do{
 
_1c0+=_1c1.offsetTop||0;
 
valueL+=_1c1.offsetLeft||0;
 
if(_1c1.offsetParent==document.body&&Element.getStyle(_1c1,"position")=="absolute"){
 
break;
 
}
 
}while(_1c1=_1c1.offsetParent);
 
_1c1=_1bf;
 
do{
 
if(!Prototype.Browser.Opera||_1c1.tagName=="BODY"){
 
_1c0-=_1c1.scrollTop||0;
 
valueL-=_1c1.scrollLeft||0;
 
}
 
}while(_1c1=_1c1.parentNode);
 
return Element._returnOffset(valueL,_1c0);
 
},clonePosition:function(_1c2,_1c3){
 
var _1c4=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
 
_1c3=$(_1c3);
 
var p=_1c3.viewportOffset();
 
_1c2=$(_1c2);
 
var _1c6=[0,0];
 
var _1c7=null;
 
if(Element.getStyle(_1c2,"position")=="absolute"){
 
_1c7=_1c2.getOffsetParent();
 
_1c6=_1c7.viewportOffset();
 
}
 
if(_1c7==document.body){
 
_1c6[0]-=document.body.offsetLeft;
 
_1c6[1]-=document.body.offsetTop;
 
}
 
if(_1c4.setLeft){
 
_1c2.style.left=(p[0]-_1c6[0]+_1c4.offsetLeft)+"px";
 
}
 
if(_1c4.setTop){
 
_1c2.style.top=(p[1]-_1c6[1]+_1c4.offsetTop)+"px";
 
}
 
if(_1c4.setWidth){
 
_1c2.style.width=_1c3.offsetWidth+"px";
 
}
 
if(_1c4.setHeight){
 
_1c2.style.height=_1c3.offsetHeight+"px";
 
}
 
return _1c2;
 
}};
 
Element.Methods.identify.counter=1;
 
Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});
 
Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};
 
if(Prototype.Browser.Opera){
 
Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(_1c8,_1c9,_1ca){
 
switch(_1ca){
 
case "left":
 
case "top":
 
case "right":
 
case "bottom":
 
if(_1c8(_1c9,"position")==="static"){
 
return null;
 
}
 
case "height":
 
case "width":
 
if(!Element.visible(_1c9)){
 
return null;
 
}
 
var dim=parseInt(_1c8(_1c9,_1ca),10);
 
if(dim!==_1c9["offset"+_1ca.capitalize()]){
 
return dim+"px";
 
}
 
var _1cc;
 
if(_1ca==="height"){
 
_1cc=["border-top-width","padding-top","padding-bottom","border-bottom-width"];
 
}else{
 
_1cc=["border-left-width","padding-left","padding-right","border-right-width"];
 
}
 
return _1cc.inject(dim,function(memo,_1ce){
 
var val=_1c8(_1c9,_1ce);
 
return val===null?memo:memo-parseInt(val,10);
 
})+"px";
 
default:
 
return _1c8(_1c9,_1ca);
 
}
 
});
 
Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(_1d0,_1d1,_1d2){
 
if(_1d2==="title"){
 
return _1d1.title;
 
}
 
return _1d0(_1d1,_1d2);
 
});
 
}else{
 
if(Prototype.Browser.IE){
 
Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(_1d3,_1d4){
 
_1d4=$(_1d4);
 
var _1d5=_1d4.getStyle("position");
 
if(_1d5!=="static"){
 
return _1d3(_1d4);
 
}
 
_1d4.setStyle({position:"relative"});
 
var _1d6=_1d3(_1d4);
 
_1d4.setStyle({position:_1d5});
 
return _1d6;
 
});
 
$w("positionedOffset viewportOffset").each(function(_1d7){
 
Element.Methods[_1d7]=Element.Methods[_1d7].wrap(function(_1d8,_1d9){
 
_1d9=$(_1d9);
 
var _1da=_1d9.getStyle("position");
 
if(_1da!=="static"){
 
return _1d8(_1d9);
 
}
 
var _1db=_1d9.getOffsetParent();
 
if(_1db&&_1db.getStyle("position")==="fixed"){
 
_1db.setStyle({zoom:1});
 
}
 
_1d9.setStyle({position:"relative"});
 
var _1dc=_1d8(_1d9);
 
_1d9.setStyle({position:_1da});
 
return _1dc;
 
});
 
});
 
Element.Methods.getStyle=function(_1dd,_1de){
 
_1dd=$(_1dd);
 
_1de=(_1de=="float"||_1de=="cssFloat")?"styleFloat":_1de.camelize();
 
var _1df=_1dd.style[_1de];
 
if(!_1df&&_1dd.currentStyle){
 
_1df=_1dd.currentStyle[_1de];
 
}
 
if(_1de=="opacity"){
 
if(_1df=(_1dd.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){
 
if(_1df[1]){
 
return parseFloat(_1df[1])/100;
 
}
 
}
 
return 1;
 
}
 
if(_1df=="auto"){
 
if((_1de=="width"||_1de=="height")&&(_1dd.getStyle("display")!="none")){
 
return _1dd["offset"+_1de.capitalize()]+"px";
 
}
 
return null;
 
}
 
return _1df;
 
};
 
Element.Methods.setOpacity=function(_1e0,_1e1){
 
function stripAlpha(_1e2){
 
return _1e2.replace(/alpha\([^\)]*\)/gi,"");
 
}
 
_1e0=$(_1e0);
 
var _1e3=_1e0.currentStyle;
 
if((_1e3&&!_1e3.hasLayout)||(!_1e3&&_1e0.style.zoom=="normal")){
 
_1e0.style.zoom=1;
 
}
 
var _1e4=_1e0.getStyle("filter"),style=_1e0.style;
 
if(_1e1==1||_1e1===""){
 
(_1e4=stripAlpha(_1e4))?style.filter=_1e4:style.removeAttribute("filter");
 
return _1e0;
 
}else{
 
if(_1e1<0.00001){
 
_1e1=0;
 
}
 
}
 
style.filter=stripAlpha(_1e4)+"alpha(opacity="+(_1e1*100)+")";
 
return _1e0;
 
};
 
Element._attributeTranslations={read:{names:{"class":"className","for":"htmlFor"},values:{_getAttr:function(_1e5,_1e6){
 
return _1e5.getAttribute(_1e6,2);
 
},_getAttrNode:function(_1e7,_1e8){
 
var node=_1e7.getAttributeNode(_1e8);
 
return node?node.value:"";
 
},_getEv:function(_1ea,_1eb){
 
_1eb=_1ea.getAttribute(_1eb);
 
return _1eb?_1eb.toString().slice(23,-2):null;
 
},_flag:function(_1ec,_1ed){
 
return $(_1ec).hasAttribute(_1ed)?_1ed:null;
 
},style:function(_1ee){
 
return _1ee.style.cssText.toLowerCase();
 
},title:function(_1ef){
 
return _1ef.title;
 
}}}};
 
Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(_1f0,_1f1){
 
_1f0.checked=!!_1f1;
 
},style:function(_1f2,_1f3){
 
_1f2.style.cssText=_1f3?_1f3:"";
 
}}};
 
Element._attributeTranslations.has={};
 
$w("colSpan rowSpan vAlign dateTime accessKey tabIndex "+"encType maxLength readOnly longDesc").each(function(attr){
 
Element._attributeTranslations.write.names[attr.toLowerCase()]=attr;
 
Element._attributeTranslations.has[attr.toLowerCase()]=attr;
 
});
 
(function(v){
 
Object.extend(v,{href:v._getAttr,src:v._getAttr,type:v._getAttr,action:v._getAttrNode,disabled:v._flag,checked:v._flag,readonly:v._flag,multiple:v._flag,onload:v._getEv,onunload:v._getEv,onclick:v._getEv,ondblclick:v._getEv,onmousedown:v._getEv,onmouseup:v._getEv,onmouseover:v._getEv,onmousemove:v._getEv,onmouseout:v._getEv,onfocus:v._getEv,onblur:v._getEv,onkeypress:v._getEv,onkeydown:v._getEv,onkeyup:v._getEv,onsubmit:v._getEv,onreset:v._getEv,onselect:v._getEv,onchange:v._getEv});
 
})(Element._attributeTranslations.read.values);
 
}else{
 
if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){
 
Element.Methods.setOpacity=function(_1f6,_1f7){
 
_1f6=$(_1f6);
 
_1f6.style.opacity=(_1f7==1)?0.999999:(_1f7==="")?"":(_1f7<0.00001)?0:_1f7;
 
return _1f6;
 
};
 
}else{
 
if(Prototype.Browser.WebKit){
 
Element.Methods.setOpacity=function(_1f8,_1f9){
 
_1f8=$(_1f8);
 
_1f8.style.opacity=(_1f9==1||_1f9==="")?"":(_1f9<0.00001)?0:_1f9;
 
if(_1f9==1){
 
if(_1f8.tagName=="IMG"&&_1f8.width){
 
_1f8.width++;
 
_1f8.width--;
 
}else{
 
try{
 
var n=document.createTextNode(" ");
 
_1f8.appendChild(n);
 
_1f8.removeChild(n);
 
}
 
catch(e){
 
}
 
}
 
}
 
return _1f8;
 
};
 
Element.Methods.cumulativeOffset=function(_1fb){
 
var _1fc=0,valueL=0;
 
do{
 
_1fc+=_1fb.offsetTop||0;
 
valueL+=_1fb.offsetLeft||0;
 
if(_1fb.offsetParent==document.body){
 
if(Element.getStyle(_1fb,"position")=="absolute"){
 
break;
 
}
 
}
 
_1fb=_1fb.offsetParent;
 
}while(_1fb);
 
return Element._returnOffset(valueL,_1fc);
 
};
 
}
 
}
 
}
 
}
 
if(Prototype.Browser.IE||Prototype.Browser.Opera){
 
Element.Methods.update=function(_1fd,_1fe){
 
_1fd=$(_1fd);
 
if(_1fe&&_1fe.toElement){
 
_1fe=_1fe.toElement();
 
}
 
if(Object.isElement(_1fe)){
 
return _1fd.update().insert(_1fe);
 
}
 
_1fe=Object.toHTML(_1fe);
 
var _1ff=_1fd.tagName.toUpperCase();
 
if(_1ff in Element._insertionTranslations.tags){
 
$A(_1fd.childNodes).each(function(node){
 
_1fd.removeChild(node);
 
});
 
Element._getContentFromAnonymousElement(_1ff,_1fe.stripScripts()).each(function(node){
 
_1fd.appendChild(node);
 
});
 
}else{
 
_1fd.innerHTML=_1fe.stripScripts();
 
}
 
_1fe.evalScripts.bind(_1fe).defer();
 
return _1fd;
 
};
 
}
 
if("outerHTML" in document.createElement("div")){
 
Element.Methods.replace=function(_202,_203){
 
_202=$(_202);
 
if(_203&&_203.toElement){
 
_203=_203.toElement();
 
}
 
if(Object.isElement(_203)){
 
_202.parentNode.replaceChild(_203,_202);
 
return _202;
 
}
 
_203=Object.toHTML(_203);
 
var _204=_202.parentNode,tagName=_204.tagName.toUpperCase();
 
if(Element._insertionTranslations.tags[tagName]){
 
var _205=_202.next();
 
var _206=Element._getContentFromAnonymousElement(tagName,_203.stripScripts());
 
_204.removeChild(_202);
 
if(_205){
 
_206.each(function(node){
 
_204.insertBefore(node,_205);
 
});
 
}else{
 
_206.each(function(node){
 
_204.appendChild(node);
 
});
 
}
 
}else{
 
_202.outerHTML=_203.stripScripts();
 
}
 
_203.evalScripts.bind(_203).defer();
 
return _202;
 
};
 
}
 
Element._returnOffset=function(l,t){
 
var _20b=[l,t];
 
_20b.left=l;
 
_20b.top=t;
 
return _20b;
 
};
 
Element._getContentFromAnonymousElement=function(_20c,html){
 
var div=new Element("div"),t=Element._insertionTranslations.tags[_20c];
 
if(t){
 
div.innerHTML=t[0]+html+t[1];
 
t[2].times(function(){
 
div=div.firstChild;
 
});
 
}else{
 
div.innerHTML=html;
 
}
 
return $A(div.childNodes);
 
};
 
Element._insertionTranslations={before:function(_20f,node){
 
_20f.parentNode.insertBefore(node,_20f);
 
},top:function(_211,node){
 
_211.insertBefore(node,_211.firstChild);
 
},bottom:function(_213,node){
 
_213.appendChild(node);
 
},after:function(_215,node){
 
_215.parentNode.insertBefore(node,_215.nextSibling);
 
},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};
 
(function(){
 
Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD});
 
}).call(Element._insertionTranslations);
 
Element.Methods.Simulated={hasAttribute:function(_217,_218){
 
_218=Element._attributeTranslations.has[_218]||_218;
 
var node=$(_217).getAttributeNode(_218);
 
return node&&node.specified;
 
}};
 
Element.Methods.ByTag={};
 
Object.extend(Element,Element.Methods);
 
if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div").__proto__){
 
window.HTMLElement={};
 
window.HTMLElement.prototype=document.createElement("div").__proto__;
 
Prototype.BrowserFeatures.ElementExtensions=true;
 
}
 
Element.extend=(function(){
 
if(Prototype.BrowserFeatures.SpecificElementExtensions){
 
return Prototype.K;
 
}
 
var _21a={},ByTag=Element.Methods.ByTag;
 
var _21b=Object.extend(function(_21c){
 
if(!_21c||_21c._extendedByPrototype||_21c.nodeType!=1||_21c==window){
 
return _21c;
 
}
 
var _21d=Object.clone(_21a),tagName=_21c.tagName,property,value;
 
if(ByTag[tagName]){
 
Object.extend(_21d,ByTag[tagName]);
 
}
 
for(property in _21d){
 
value=_21d[property];
 
if(Object.isFunction(value)&&!(property in _21c)){
 
_21c[property]=value.methodize();
 
}
 
}
 
_21c._extendedByPrototype=Prototype.emptyFunction;
 
return _21c;
 
},{refresh:function(){
 
if(!Prototype.BrowserFeatures.ElementExtensions){
 
Object.extend(_21a,Element.Methods);
 
Object.extend(_21a,Element.Methods.Simulated);
 
}
 
}});
 
_21b.refresh();
 
return _21b;
 
})();
 
Element.hasAttribute=function(_21e,_21f){
 
if(_21e.hasAttribute){
 
return _21e.hasAttribute(_21f);
 
}
 
return Element.Methods.Simulated.hasAttribute(_21e,_21f);
 
};
 
Element.addMethods=function(_220){
 
var F=Prototype.BrowserFeatures,T=Element.Methods.ByTag;
 
if(!_220){
 
Object.extend(Form,Form.Methods);
 
Object.extend(Form.Element,Form.Element.Methods);
 
Object.extend(Element.Methods.ByTag,{"FORM":Object.clone(Form.Methods),"INPUT":Object.clone(Form.Element.Methods),"SELECT":Object.clone(Form.Element.Methods),"TEXTAREA":Object.clone(Form.Element.Methods)});
 
}
 
if(arguments.length==2){
 
var _222=_220;
 
_220=arguments[1];
 
}
 
if(!_222){
 
Object.extend(Element.Methods,_220||{});
 
}else{
 
if(Object.isArray(_222)){
 
_222.each(extend);
 
}else{
 
extend(_222);
 
}
 
}
 
function extend(_223){
 
_223=_223.toUpperCase();
 
if(!Element.Methods.ByTag[_223]){
 
Element.Methods.ByTag[_223]={};
 
}
 
Object.extend(Element.Methods.ByTag[_223],_220);
 
}
 
function copy(_224,_225,_226){
 
_226=_226||false;
 
for(var _227 in _224){
 
var _228=_224[_227];
 
if(!Object.isFunction(_228)){
 
continue;
 
}
 
if(!_226||!(_227 in _225)){
 
_225[_227]=_228.methodize();
 
}
 
}
 
}
 
function findDOMClass(_229){
 
var _22a;
 
var _22b={"OPTGROUP":"OptGroup","TEXTAREA":"TextArea","P":"Paragraph","FIELDSET":"FieldSet","UL":"UList","OL":"OList","DL":"DList","DIR":"Directory","H1":"Heading","H2":"Heading","H3":"Heading","H4":"Heading","H5":"Heading","H6":"Heading","Q":"Quote","INS":"Mod","DEL":"Mod","A":"Anchor","IMG":"Image","CAPTION":"TableCaption","COL":"TableCol","COLGROUP":"TableCol","THEAD":"TableSection","TFOOT":"TableSection","TBODY":"TableSection","TR":"TableRow","TH":"TableCell","TD":"TableCell","FRAMESET":"FrameSet","IFRAME":"IFrame"};
 
if(_22b[_229]){
 
_22a="HTML"+_22b[_229]+"Element";
 
}
 
if(window[_22a]){
 
return window[_22a];
 
}
 
_22a="HTML"+_229+"Element";
 
if(window[_22a]){
 
return window[_22a];
 
}
 
_22a="HTML"+_229.capitalize()+"Element";
 
if(window[_22a]){
 
return window[_22a];
 
}
 
window[_22a]={};
 
window[_22a].prototype=document.createElement(_229).__proto__;
 
return window[_22a];
 
}
 
if(F.ElementExtensions){
 
copy(Element.Methods,HTMLElement.prototype);
 
copy(Element.Methods.Simulated,HTMLElement.prototype,true);
 
}
 
if(F.SpecificElementExtensions){
 
for(var tag in Element.Methods.ByTag){
 
var _22d=findDOMClass(tag);
 
if(Object.isUndefined(_22d)){
 
continue;
 
}
 
copy(T[tag],_22d.prototype);
 
}
 
}
 
Object.extend(Element,Element.Methods);
 
delete Element.ByTag;
 
if(Element.extend.refresh){
 
Element.extend.refresh();
 
}
 
Element.cache={};
 
};
 
document.viewport={getDimensions:function(){
 
var _22e={};
 
var B=Prototype.Browser;
 
$w("width height").each(function(d){
 
var D=d.capitalize();
 
_22e[d]=(B.WebKit&&!document.evaluate)?self["inner"+D]:(B.Opera)?document.body["client"+D]:document.documentElement["client"+D];
 
});
 
return _22e;
 
},getWidth:function(){
 
return this.getDimensions().width;
 
},getHeight:function(){
 
return this.getDimensions().height;
 
},getScrollOffsets:function(){
 
return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop);
 
}};
 
var Selector=Class.create({initialize:function(_232){
 
this.expression=_232.strip();
 
this.compileMatcher();
 
},shouldUseXPath:function(){
 
if(!Prototype.BrowserFeatures.XPath){
 
return false;
 
}
 
var e=this.expression;
 
if(Prototype.Browser.WebKit&&(e.include("-of-type")||e.include(":empty"))){
 
return false;
 
}
 
if((/(\[[\w-]*?:|:checked)/).test(this.expression)){
 
return false;
 
}
 
return true;
 
},compileMatcher:function(){
 
if(this.shouldUseXPath()){
 
return this.compileXPathMatcher();
 
}
 
var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;
 
if(Selector._cache[e]){
 
this.matcher=Selector._cache[e];
 
return;
 
}
 
this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];
 
while(e&&le!=e&&(/\S/).test(e)){
 
le=e;
 
for(var i in ps){
 
p=ps[i];
 
if(m=e.match(p)){
 
this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));
 
e=e.replace(m[0],"");
 
break;
 
}
 
}
 
}
 
this.matcher.push("return h.unique(n);\n}");
 
eval(this.matcher.join("\n"));
 
Selector._cache[this.expression]=this.matcher;
 
},compileXPathMatcher:function(){
 
var e=this.expression,ps=Selector.patterns,x=Selector.xpath,le,m;
 
if(Selector._cache[e]){
 
this.xpath=Selector._cache[e];
 
return;
 
}
 
this.matcher=[".//*"];
 
while(e&&le!=e&&(/\S/).test(e)){
 
le=e;
 
for(var i in ps){
 
if(m=e.match(ps[i])){
 
this.matcher.push(Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m));
 
e=e.replace(m[0],"");
 
break;
 
}
 
}
 
}
 
this.xpath=this.matcher.join("");
 
Selector._cache[this.expression]=this.xpath;
 
},findElements:function(root){
 
root=root||document;
 
if(this.xpath){
 
return document._getElementsByXPath(this.xpath,root);
 
}
 
return this.matcher(root);
 
},match:function(_239){
 
this.tokens=[];
 
var e=this.expression,ps=Selector.patterns,as=Selector.assertions;
 
var le,p,m;
 
while(e&&le!==e&&(/\S/).test(e)){
 
le=e;
 
for(var i in ps){
 
p=ps[i];
 
if(m=e.match(p)){
 
if(as[i]){
 
this.tokens.push([i,Object.clone(m)]);
 
e=e.replace(m[0],"");
 
}else{
 
return this.findElements(document).include(_239);
 
}
 
}
 
}
 
}
 
var _23d=true,name,matches;
 
for(var i=0,token;token=this.tokens[i];i++){
 
name=token[0],matches=token[1];
 
if(!Selector.assertions[name](_239,matches)){
 
_23d=false;
 
break;
 
}
 
}
 
return _23d;
 
},toString:function(){
 
return this.expression;
 
},inspect:function(){
 
return "#<Selector:"+this.expression.inspect()+">";
 
}});
 
Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(m){
 
if(m[1]=="*"){
 
return "";
 
}
 
return "[local-name()='"+m[1].toLowerCase()+"' or local-name()='"+m[1].toUpperCase()+"']";
 
},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(m){
 
m[1]=m[1].toLowerCase();
 
return new Template("[@#{1}]").evaluate(m);
 
},attr:function(m){
 
m[1]=m[1].toLowerCase();
 
m[3]=m[5]||m[6];
 
return new Template(Selector.xpath.operators[m[2]]).evaluate(m);
 
},pseudo:function(m){
 
var h=Selector.xpath.pseudos[m[1]];
 
if(!h){
 
return "";
 
}
 
if(Object.isFunction(h)){
 
return h(m);
 
}
 
return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);
 
},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]","empty":"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]","checked":"[@checked]","disabled":"[@disabled]","enabled":"[not(@disabled)]","not":function(m){
 
var e=m[6],p=Selector.patterns,x=Selector.xpath,le,v;
 
var _246=[];
 
while(e&&le!=e&&(/\S/).test(e)){
 
le=e;
 
for(var i in p){
 
if(m=e.match(p[i])){
 
v=Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m);
 
_246.push("("+v.substring(1,v.length-1)+")");
 
e=e.replace(m[0],"");
 
break;
 
}
 
}
 
}
 
return "[not("+_246.join(" and ")+")]";
 
},"nth-child":function(m){
 
return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",m);
 
},"nth-last-child":function(m){
 
return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",m);
 
},"nth-of-type":function(m){
 
return Selector.xpath.pseudos.nth("position() ",m);
 
},"nth-last-of-type":function(m){
 
return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",m);
 
},"first-of-type":function(m){
 
m[6]="1";
 
return Selector.xpath.pseudos["nth-of-type"](m);
 
},"last-of-type":function(m){
 
m[6]="1";
 
return Selector.xpath.pseudos["nth-last-of-type"](m);
 
},"only-of-type":function(m){
 
var p=Selector.xpath.pseudos;
 
return p["first-of-type"](m)+p["last-of-type"](m);
 
},nth:function(_250,m){
 
var mm,formula=m[6],predicate;
 
if(formula=="even"){
 
formula="2n+0";
 
}
 
if(formula=="odd"){
 
formula="2n+1";
 
}
 
if(mm=formula.match(/^(\d+)$/)){
 
return "["+_250+"= "+mm[1]+"]";
 
}
 
if(mm=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){
 
if(mm[1]=="-"){
 
mm[1]=-1;
 
}
 
var a=mm[1]?Number(mm[1]):1;
 
var b=mm[2]?Number(mm[2]):0;
 
predicate="[((#{fragment} - #{b}) mod #{a} = 0) and "+"((#{fragment} - #{b}) div #{a} >= 0)]";
 
return new Template(predicate).evaluate({fragment:_250,a:a,b:b});
 
}
 
}}},criteria:{tagName:"n = h.tagName(n, r, \"#{1}\", c);      c = false;",className:"n = h.className(n, r, \"#{1}\", c);    c = false;",id:"n = h.id(n, r, \"#{1}\", c);           c = false;",attrPresence:"n = h.attrPresence(n, r, \"#{1}\", c); c = false;",attr:function(m){
 
m[3]=(m[5]||m[6]);
 
return new Template("n = h.attr(n, r, \"#{1}\", \"#{3}\", \"#{2}\", c); c = false;").evaluate(m);
 
},pseudo:function(m){
 
if(m[6]){
 
m[6]=m[6].replace(/"/g,"\\\"");
 
}
 
return new Template("n = h.pseudo(n, \"#{1}\", \"#{6}\", r, c); c = false;").evaluate(m);
 
},descendant:"c = \"descendant\";",child:"c = \"child\";",adjacent:"c = \"adjacent\";",laterSibling:"c = \"laterSibling\";"},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(_257,_258){
 
return _258[1].toUpperCase()==_257.tagName.toUpperCase();
 
},className:function(_259,_25a){
 
return Element.hasClassName(_259,_25a[1]);
 
},id:function(_25b,_25c){
 
return _25b.id===_25c[1];
 
},attrPresence:function(_25d,_25e){
 
return Element.hasAttribute(_25d,_25e[1]);
 
},attr:function(_25f,_260){
 
var _261=Element.readAttribute(_25f,_260[1]);
 
return _261&&Selector.operators[_260[2]](_261,_260[5]||_260[6]);
 
}},handlers:{concat:function(a,b){
 
for(var i=0,node;node=b[i];i++){
 
a.push(node);
 
}
 
return a;
 
},mark:function(_265){
 
var _266=Prototype.emptyFunction;
 
for(var i=0,node;node=_265[i];i++){
 
node._countedByPrototype=_266;
 
}
 
return _265;
 
},unmark:function(_268){
 
for(var i=0,node;node=_268[i];i++){
 
node._countedByPrototype=undefined;
 
}
 
return _268;
 
},index:function(_26a,_26b,_26c){
 
_26a._countedByPrototype=Prototype.emptyFunction;
 
if(_26b){
 
for(var _26d=_26a.childNodes,i=_26d.length-1,j=1;i>=0;i--){
 
var node=_26d[i];
 
if(node.nodeType==1&&(!_26c||node._countedByPrototype)){
 
node.nodeIndex=j++;
 
}
 
}
 
}else{
 
for(var i=0,j=1,_26d=_26a.childNodes;node=_26d[i];i++){
 
if(node.nodeType==1&&(!_26c||node._countedByPrototype)){
 
node.nodeIndex=j++;
 
}
 
}
 
}
 
},unique:function(_270){
 
if(_270.length==0){
 
return _270;
 
}
 
var _271=[],n;
 
for(var i=0,l=_270.length;i<l;i++){
 
if(!(n=_270[i])._countedByPrototype){
 
n._countedByPrototype=Prototype.emptyFunction;
 
_271.push(Element.extend(n));
 
}
 
}
 
return Selector.handlers.unmark(_271);
 
},descendant:function(_273){
 
var h=Selector.handlers;
 
for(var i=0,results=[],node;node=_273[i];i++){
 
h.concat(results,node.getElementsByTagName("*"));
 
}
 
return results;
 
},child:function(_276){
 
var h=Selector.handlers;
 
for(var i=0,results=[],node;node=_276[i];i++){
 
for(var j=0,child;child=node.childNodes[j];j++){
 
if(child.nodeType==1&&child.tagName!="!"){
 
results.push(child);
 
}
 
}
 
}
 
return results;
 
},adjacent:function(_27a){
 
for(var i=0,results=[],node;node=_27a[i];i++){
 
var next=this.nextElementSibling(node);
 
if(next){
 
results.push(next);
 
}
 
}
 
return results;
 
},laterSibling:function(_27d){
 
var h=Selector.handlers;
 
for(var i=0,results=[],node;node=_27d[i];i++){
 
h.concat(results,Element.nextSiblings(node));
 
}
 
return results;
 
},nextElementSibling:function(node){
 
while(node=node.nextSibling){
 
if(node.nodeType==1){
 
return node;
 
}
 
}
 
return null;
 
},previousElementSibling:function(node){
 
while(node=node.previousSibling){
 
if(node.nodeType==1){
 
return node;
 
}
 
}
 
return null;
 
},tagName:function(_282,root,_284,_285){
 
var _286=_284.toUpperCase();
 
var _287=[],h=Selector.handlers;
 
if(_282){
 
if(_285){
 
if(_285=="descendant"){
 
for(var i=0,node;node=_282[i];i++){
 
h.concat(_287,node.getElementsByTagName(_284));
 
}
 
return _287;
 
}else{
 
_282=this[_285](_282);
 
}
 
if(_284=="*"){
 
return _282;
 
}
 
}
 
for(var i=0,node;node=_282[i];i++){
 
if(node.tagName.toUpperCase()===_286){
 
_287.push(node);
 
}
 
}
 
return _287;
 
}else{
 
return root.getElementsByTagName(_284);
 
}
 
},id:function(_28a,root,id,_28d){
 
var _28e=$(id),h=Selector.handlers;
 
if(!_28e){
 
return [];
 
}
 
if(!_28a&&root==document){
 
return [_28e];
 
}
 
if(_28a){
 
if(_28d){
 
if(_28d=="child"){
 
for(var i=0,node;node=_28a[i];i++){
 
if(_28e.parentNode==node){
 
return [_28e];
 
}
 
}
 
}else{
 
if(_28d=="descendant"){
 
for(var i=0,node;node=_28a[i];i++){
 
if(Element.descendantOf(_28e,node)){
 
return [_28e];
 
}
 
}
 
}else{
 
if(_28d=="adjacent"){
 
for(var i=0,node;node=_28a[i];i++){
 
if(Selector.handlers.previousElementSibling(_28e)==node){
 
return [_28e];
 
}
 
}
 
}else{
 
_28a=h[_28d](_28a);
 
}
 
}
 
}
 
}
 
for(var i=0,node;node=_28a[i];i++){
 
if(node==_28e){
 
return [_28e];
 
}
 
}
 
return [];
 
}
 
return (_28e&&Element.descendantOf(_28e,root))?[_28e]:[];
 
},className:function(_293,root,_295,_296){
 
if(_293&&_296){
 
_293=this[_296](_293);
 
}
 
return Selector.handlers.byClassName(_293,root,_295);
 
},byClassName:function(_297,root,_299){
 
if(!_297){
 
_297=Selector.handlers.descendant([root]);
 
}
 
var _29a=" "+_299+" ";
 
for(var i=0,results=[],node,nodeClassName;node=_297[i];i++){
 
nodeClassName=node.className;
 
if(nodeClassName.length==0){
 
continue;
 
}
 
if(nodeClassName==_299||(" "+nodeClassName+" ").include(_29a)){
 
results.push(node);
 
}
 
}
 
return results;
 
},attrPresence:function(_29c,root,attr,_29f){
 
if(!_29c){
 
_29c=root.getElementsByTagName("*");
 
}
 
if(_29c&&_29f){
 
_29c=this[_29f](_29c);
 
}
 
var _2a0=[];
 
for(var i=0,node;node=_29c[i];i++){
 
if(Element.hasAttribute(node,attr)){
 
_2a0.push(node);
 
}
 
}
 
return _2a0;
 
},attr:function(_2a2,root,attr,_2a5,_2a6,_2a7){
 
if(!_2a2){
 
_2a2=root.getElementsByTagName("*");
 
}
 
if(_2a2&&_2a7){
 
_2a2=this[_2a7](_2a2);
 
}
 
var _2a8=Selector.operators[_2a6],results=[];
 
for(var i=0,node;node=_2a2[i];i++){
 
var _2aa=Element.readAttribute(node,attr);
 
if(_2aa===null){
 
continue;
 
}
 
if(_2a8(_2aa,_2a5)){
 
results.push(node);
 
}
 
}
 
return results;
 
},pseudo:function(_2ab,name,_2ad,root,_2af){
 
if(_2ab&&_2af){
 
_2ab=this[_2af](_2ab);
 
}
 
if(!_2ab){
 
_2ab=root.getElementsByTagName("*");
 
}
 
return Selector.pseudos[name](_2ab,_2ad,root);
 
}},pseudos:{"first-child":function(_2b0,_2b1,root){
 
for(var i=0,results=[],node;node=_2b0[i];i++){
 
if(Selector.handlers.previousElementSibling(node)){
 
continue;
 
}
 
results.push(node);
 
}
 
return results;
 
},"last-child":function(_2b4,_2b5,root){
 
for(var i=0,results=[],node;node=_2b4[i];i++){
 
if(Selector.handlers.nextElementSibling(node)){
 
continue;
 
}
 
results.push(node);
 
}
 
return results;
 
},"only-child":function(_2b8,_2b9,root){
 
var h=Selector.handlers;
 
for(var i=0,results=[],node;node=_2b8[i];i++){
 
if(!h.previousElementSibling(node)&&!h.nextElementSibling(node)){
 
results.push(node);
 
}
 
}
 
return results;
 
},"nth-child":function(_2bd,_2be,root){
 
return Selector.pseudos.nth(_2bd,_2be,root);
 
},"nth-last-child":function(_2c0,_2c1,root){
 
return Selector.pseudos.nth(_2c0,_2c1,root,true);
 
},"nth-of-type":function(_2c3,_2c4,root){
 
return Selector.pseudos.nth(_2c3,_2c4,root,false,true);
 
},"nth-last-of-type":function(_2c6,_2c7,root){
 
return Selector.pseudos.nth(_2c6,_2c7,root,true,true);
 
},"first-of-type":function(_2c9,_2ca,root){
 
return Selector.pseudos.nth(_2c9,"1",root,false,true);
 
},"last-of-type":function(_2cc,_2cd,root){
 
return Selector.pseudos.nth(_2cc,"1",root,true,true);
 
},"only-of-type":function(_2cf,_2d0,root){
 
var p=Selector.pseudos;
 
return p["last-of-type"](p["first-of-type"](_2cf,_2d0,root),_2d0,root);
 
},getIndices:function(a,b,_2d5){
 
if(a==0){
 
return b>0?[b]:[];
 
}
 
return $R(1,_2d5).inject([],function(memo,i){
 
if(0==(i-b)%a&&(i-b)/a>=0){
 
memo.push(i);
 
}
 
return memo;
 
});
 
},nth:function(_2d8,_2d9,root,_2db,_2dc){
 
if(_2d8.length==0){
 
return [];
 
}
 
if(_2d9=="even"){
 
_2d9="2n+0";
 
}
 
if(_2d9=="odd"){
 
_2d9="2n+1";
 
}
 
var h=Selector.handlers,results=[],indexed=[],m;
 
h.mark(_2d8);
 
for(var i=0,node;node=_2d8[i];i++){
 
if(!node.parentNode._countedByPrototype){
 
h.index(node.parentNode,_2db,_2dc);
 
indexed.push(node.parentNode);
 
}
 
}
 
if(_2d9.match(/^\d+$/)){
 
_2d9=Number(_2d9);
 
for(var i=0,node;node=_2d8[i];i++){
 
if(node.nodeIndex==_2d9){
 
results.push(node);
 
}
 
}
 
}else{
 
if(m=_2d9.match(/^(-?\d*)?n(([+-])(\d+))?/)){
 
if(m[1]=="-"){
 
m[1]=-1;
 
}
 
var a=m[1]?Number(m[1]):1;
 
var b=m[2]?Number(m[2]):0;
 
var _2e2=Selector.pseudos.getIndices(a,b,_2d8.length);
 
for(var i=0,node,l=_2e2.length;node=_2d8[i];i++){
 
for(var j=0;j<l;j++){
 
if(node.nodeIndex==_2e2[j]){
 
results.push(node);
 
}
 
}
 
}
 
}
 
}
 
h.unmark(_2d8);
 
h.unmark(indexed);
 
return results;
 
},"empty":function(_2e5,_2e6,root){
 
for(var i=0,results=[],node;node=_2e5[i];i++){
 
if(node.tagName=="!"||(node.firstChild&&!node.innerHTML.match(/^\s*$/))){
 
continue;
 
}
 
results.push(node);
 
}
 
return results;
 
},"not":function(_2e9,_2ea,root){
 
var h=Selector.handlers,selectorType,m;
 
var _2ed=new Selector(_2ea).findElements(root);
 
h.mark(_2ed);
 
for(var i=0,results=[],node;node=_2e9[i];i++){
 
if(!node._countedByPrototype){
 
results.push(node);
 
}
 
}
 
h.unmark(_2ed);
 
return results;
 
},"enabled":function(_2ef,_2f0,root){
 
for(var i=0,results=[],node;node=_2ef[i];i++){
 
if(!node.disabled){
 
results.push(node);
 
}
 
}
 
return results;
 
},"disabled":function(_2f3,_2f4,root){
 
for(var i=0,results=[],node;node=_2f3[i];i++){
 
if(node.disabled){
 
results.push(node);
 
}
 
}
 
return results;
 
},"checked":function(_2f7,_2f8,root){
 
for(var i=0,results=[],node;node=_2f7[i];i++){
 
if(node.checked){
 
results.push(node);
 
}
 
}
 
return results;
 
}},operators:{"=":function(nv,v){
 
return nv==v;
 
},"!=":function(nv,v){
 
return nv!=v;
 
},"^=":function(nv,v){
 
return nv.startsWith(v);
 
},"$=":function(nv,v){
 
return nv.endsWith(v);
 
},"*=":function(nv,v){
 
return nv.include(v);
 
},"~=":function(nv,v){
 
return (" "+nv+" ").include(" "+v+" ");
 
},"|=":function(nv,v){
 
return ("-"+nv.toUpperCase()+"-").include("-"+v.toUpperCase()+"-");
 
}},split:function(_309){
 
var _30a=[];
 
_309.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(m){
 
_30a.push(m[1].strip());
 
});
 
return _30a;
 
},matchElements:function(_30c,_30d){
 
var _30e=$$(_30d),h=Selector.handlers;
 
h.mark(_30e);
 
for(var i=0,results=[],element;element=_30c[i];i++){
 
if(element._countedByPrototype){
 
results.push(element);
 
}
 
}
 
h.unmark(_30e);
 
return results;
 
},findElement:function(_310,_311,_312){
 
if(Object.isNumber(_311)){
 
_312=_311;
 
_311=false;
 
}
 
return Selector.matchElements(_310,_311||"*")[_312||0];
 
},findChildElements:function(_313,_314){
 
_314=Selector.split(_314.join(","));
 
var _315=[],h=Selector.handlers;
 
for(var i=0,l=_314.length,selector;i<l;i++){
 
selector=new Selector(_314[i].strip());
 
h.concat(_315,selector.findElements(_313));
 
}
 
return (l>1)?h.unique(_315):_315;
 
}});
 
if(Prototype.Browser.IE){
 
Object.extend(Selector.handlers,{concat:function(a,b){
 
for(var i=0,node;node=b[i];i++){
 
if(node.tagName!=="!"){
 
a.push(node);
 
}
 
}
 
return a;
 
},unmark:function(_31a){
 
for(var i=0,node;node=_31a[i];i++){
 
node.removeAttribute("_countedByPrototype");
 
}
 
return _31a;
 
}});
 
}
 
function $$(){
 
return Selector.findChildElements(document,$A(arguments));
 
}
 
var Form={reset:function(form){
 
$(form).reset();
 
return form;
 
},serializeElements:function(_31d,_31e){
 
if(typeof _31e!="object"){
 
_31e={hash:!!_31e};
 
}else{
 
if(Object.isUndefined(_31e.hash)){
 
_31e.hash=true;
 
}
 
}
 
var key,value,submitted=false,submit=_31e.submit;
 
var data=_31d.inject({},function(_321,_322){
 
if(!_322.disabled&&_322.name){
 
key=_322.name;
 
value=$(_322).getValue();
 
if(value!=null&&(_322.type!="submit"||(!submitted&&submit!==false&&(!submit||key==submit)&&(submitted=true)))){
 
if(key in _321){
 
if(!Object.isArray(_321[key])){
 
_321[key]=[_321[key]];
 
}
 
_321[key].push(value);
 
}else{
 
_321[key]=value;
 
}
 
}
 
}
 
return _321;
 
});
 
return _31e.hash?data:Object.toQueryString(data);
 
}};
 
Form.Methods={serialize:function(form,_324){
 
return Form.serializeElements(Form.getElements(form),_324);
 
},getElements:function(form){
 
return $A($(form).getElementsByTagName("*")).inject([],function(_326,_327){
 
if(Form.Element.Serializers[_327.tagName.toLowerCase()]){
 
_326.push(Element.extend(_327));
 
}
 
return _326;
 
});
 
},getInputs:function(form,_329,name){
 
form=$(form);
 
var _32b=form.getElementsByTagName("input");
 
if(!_329&&!name){
 
return $A(_32b).map(Element.extend);
 
}
 
for(var i=0,matchingInputs=[],length=_32b.length;i<length;i++){
 
var _32d=_32b[i];
 
if((_329&&_32d.type!=_329)||(name&&_32d.name!=name)){
 
continue;
 
}
 
matchingInputs.push(Element.extend(_32d));
 
}
 
return matchingInputs;
 
},disable:function(form){
 
form=$(form);
 
Form.getElements(form).invoke("disable");
 
return form;
 
},enable:function(form){
 
form=$(form);
 
Form.getElements(form).invoke("enable");
 
return form;
 
},findFirstElement:function(form){
 
var _331=$(form).getElements().findAll(function(_332){
 
return "hidden"!=_332.type&&!_332.disabled;
 
});
 
var _333=_331.findAll(function(_334){
 
return _334.hasAttribute("tabIndex")&&_334.tabIndex>=0;
 
}).sortBy(function(_335){
 
return _335.tabIndex;
 
}).first();
 
return _333?_333:_331.find(function(_336){
 
return ["input","select","textarea"].include(_336.tagName.toLowerCase());
 
});
 
},focusFirstElement:function(form){
 
form=$(form);
 
form.findFirstElement().activate();
 
return form;
 
},request:function(form,_339){
 
form=$(form),_339=Object.clone(_339||{});
 
var _33a=_339.parameters,action=form.readAttribute("action")||"";
 
if(action.blank()){
 
action=window.location.href;
 
}
 
_339.parameters=form.serialize(true);
 
if(_33a){
 
if(Object.isString(_33a)){
 
_33a=_33a.toQueryParams();
 
}
 
Object.extend(_339.parameters,_33a);
 
}
 
if(form.hasAttribute("method")&&!_339.method){
 
_339.method=form.method;
 
}
 
return new Ajax.Request(action,_339);
 
}};
 
Form.Element={focus:function(_33b){
 
$(_33b).focus();
 
return _33b;
 
},select:function(_33c){
 
$(_33c).select();
 
return _33c;
 
}};
 
Form.Element.Methods={serialize:function(_33d){
 
_33d=$(_33d);
 
if(!_33d.disabled&&_33d.name){
 
var _33e=_33d.getValue();
 
if(_33e!=undefined){
 
var pair={};
 
pair[_33d.name]=_33e;
 
return Object.toQueryString(pair);
 
}
 
}
 
return "";
 
},getValue:function(_340){
 
_340=$(_340);
 
var _341=_340.tagName.toLowerCase();
 
return Form.Element.Serializers[_341](_340);
 
},setValue:function(_342,_343){
 
_342=$(_342);
 
var _344=_342.tagName.toLowerCase();
 
Form.Element.Serializers[_344](_342,_343);
 
return _342;
 
},clear:function(_345){
 
$(_345).value="";
 
return _345;
 
},present:function(_346){
 
return $(_346).value!="";
 
},activate:function(_347){
 
_347=$(_347);
 
try{
 
_347.focus();
 
if(_347.select&&(_347.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(_347.type))){
 
_347.select();
 
}
 
}
 
catch(e){
 
}
 
return _347;
 
},disable:function(_348){
 
_348=$(_348);
 
_348.blur();
 
_348.disabled=true;
 
return _348;
 
},enable:function(_349){
 
_349=$(_349);
 
_349.disabled=false;
 
return _349;
 
}};
 
var Field=Form.Element;
 
var $F=Form.Element.Methods.getValue;
 
Form.Element.Serializers={input:function(_34a,_34b){
 
switch(_34a.type.toLowerCase()){
 
case "checkbox":
 
case "radio":
 
return Form.Element.Serializers.inputSelector(_34a,_34b);
 
default:
 
return Form.Element.Serializers.textarea(_34a,_34b);
 
}
 
},inputSelector:function(_34c,_34d){
 
if(Object.isUndefined(_34d)){
 
return _34c.checked?_34c.value:null;
 
}else{
 
_34c.checked=!!_34d;
 
}
 
},textarea:function(_34e,_34f){
 
if(Object.isUndefined(_34f)){
 
return _34e.value;
 
}else{
 
_34e.value=_34f;
 
}
 
},select:function(_350,_351){
 
if(Object.isUndefined(_351)){
 
return this[_350.type=="select-one"?"selectOne":"selectMany"](_350);
 
}else{
 
var opt,value,single=!Object.isArray(_351);
 
for(var i=0,length=_350.length;i<length;i++){
 
opt=_350.options[i];
 
value=this.optionValue(opt);
 
if(single){
 
if(value==_351){
 
opt.selected=true;
 
return;
 
}
 
}else{
 
opt.selected=_351.include(value);
 
}
 
}
 
}
 
},selectOne:function(_354){
 
var _355=_354.selectedIndex;
 
return _355>=0?this.optionValue(_354.options[_355]):null;
 
},selectMany:function(_356){
 
var _357,length=_356.length;
 
if(!length){
 
return null;
 
}
 
for(var i=0,_357=[];i<length;i++){
 
var opt=_356.options[i];
 
if(opt.selected){
 
_357.push(this.optionValue(opt));
 
}
 
}
 
return _357;
 
},optionValue:function(opt){
 
return Element.extend(opt).hasAttribute("value")?opt.value:opt.text;
 
}};
 
Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function(_35b,_35c,_35d,_35e){
 
_35b(_35e,_35d);
 
this.element=$(_35c);
 
this.lastValue=this.getValue();
 
},execute:function(){
 
var _35f=this.getValue();
 
if(Object.isString(this.lastValue)&&Object.isString(_35f)?this.lastValue!=_35f:String(this.lastValue)!=String(_35f)){
 
this.callback(this.element,_35f);
 
this.lastValue=_35f;
 
}
 
}});
 
Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){
 
return Form.Element.getValue(this.element);
 
}});
 
Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){
 
return Form.serialize(this.element);
 
}});
 
Abstract.EventObserver=Class.create({initialize:function(_360,_361){
 
this.element=$(_360);
 
this.callback=_361;
 
this.lastValue=this.getValue();
 
if(this.element.tagName.toLowerCase()=="form"){
 
this.registerFormCallbacks();
 
}else{
 
this.registerCallback(this.element);
 
}
 
},onElementEvent:function(){
 
var _362=this.getValue();
 
if(this.lastValue!=_362){
 
this.callback(this.element,_362);
 
this.lastValue=_362;
 
}
 
},registerFormCallbacks:function(){
 
Form.getElements(this.element).each(this.registerCallback,this);
 
},registerCallback:function(_363){
 
if(_363.type){
 
switch(_363.type.toLowerCase()){
 
case "checkbox":
 
case "radio":
 
Event.observe(_363,"click",this.onElementEvent.bind(this));
 
break;
 
default:
 
Event.observe(_363,"change",this.onElementEvent.bind(this));
 
break;
 
}
 
}
 
}});
 
Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){
 
return Form.Element.getValue(this.element);
 
}});
 
Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){
 
return Form.serialize(this.element);
 
}});
 
if(!window.Event){
 
var Event={};
 
}
 
Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(_364){
 
var _365;
 
switch(_364.type){
 
case "mouseover":
 
_365=_364.fromElement;
 
break;
 
case "mouseout":
 
_365=_364.toElement;
 
break;
 
default:
 
return null;
 
}
 
return Element.extend(_365);
 
}});
 
Event.Methods=(function(){
 
var _366;
 
if(Prototype.Browser.IE){
 
var _367={0:1,1:4,2:2};
 
_366=function(_368,code){
 
return _368.button==_367[code];
 
};
 
}else{
 
if(Prototype.Browser.WebKit){
 
_366=function(_36a,code){
 
switch(code){
 
case 0:
 
return _36a.which==1&&!_36a.metaKey;
 
case 1:
 
return _36a.which==1&&_36a.metaKey;
 
default:
 
return false;
 
}
 
};
 
}else{
 
_366=function(_36c,code){
 
return _36c.which?(_36c.which===code+1):(_36c.button===code);
 
};
 
}
 
}
 
return {isLeftClick:function(_36e){
 
return _366(_36e,0);
 
},isMiddleClick:function(_36f){
 
return _366(_36f,1);
 
},isRightClick:function(_370){
 
return _366(_370,2);
 
},element:function(_371){
 
var node=Event.extend(_371).target;
 
return Element.extend(node.nodeType==Node.TEXT_NODE?node.parentNode:node);
 
},findElement:function(_373,_374){
 
var _375=Event.element(_373);
 
if(!_374){
 
return _375;
 
}
 
var _376=[_375].concat(_375.ancestors());
 
return Selector.findElement(_376,_374,0);
 
},pointer:function(_377){
 
return {x:_377.pageX||(_377.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),y:_377.pageY||(_377.clientY+(document.documentElement.scrollTop||document.body.scrollTop))};
 
},pointerX:function(_378){
 
return Event.pointer(_378).x;
 
},pointerY:function(_379){
 
return Event.pointer(_379).y;
 
},stop:function(_37a){
 
Event.extend(_37a);
 
_37a.preventDefault();
 
_37a.stopPropagation();
 
_37a.stopped=true;
 
}};
 
})();
 
Event.extend=(function(){
 
var _37b=Object.keys(Event.Methods).inject({},function(m,name){
 
m[name]=Event.Methods[name].methodize();
 
return m;
 
});
 
if(Prototype.Browser.IE){
 
Object.extend(_37b,{stopPropagation:function(){
 
this.cancelBubble=true;
 
},preventDefault:function(){
 
this.returnValue=false;
 
},inspect:function(){
 
return "[object Event]";
 
}});
 
return function(_37e){
 
if(!_37e){
 
return false;
 
}
 
if(_37e._extendedByPrototype){
 
return _37e;
 
}
 
_37e._extendedByPrototype=Prototype.emptyFunction;
 
var _37f=Event.pointer(_37e);
 
Object.extend(_37e,{target:_37e.srcElement,relatedTarget:Event.relatedTarget(_37e),pageX:_37f.x,pageY:_37f.y});
 
return Object.extend(_37e,_37b);
 
};
 
}else{
 
Event.prototype=Event.prototype||document.createEvent("HTMLEvents").__proto__;
 
Object.extend(Event.prototype,_37b);
 
return Prototype.K;
 
}
 
})();
 
Object.extend(Event,(function(){
 
var _380=Event.cache;
 
function getEventID(_381){
 
if(_381._prototypeEventID){
 
return _381._prototypeEventID[0];
 
}
 
arguments.callee.id=arguments.callee.id||1;
 
return _381._prototypeEventID=[++arguments.callee.id];
 
}
 
function getDOMEventName(_382){
 
if(_382&&_382.include(":")){
 
return "dataavailable";
 
}
 
return _382;
 
}
 
function getCacheForID(id){
 
return _380[id]=_380[id]||{};
 
}
 
function getWrappersForEventName(id,_385){
 
var c=getCacheForID(id);
 
return c[_385]=c[_385]||[];
 
}
 
function createWrapper(_387,_388,_389){
 
var id=getEventID(_387);
 
var c=getWrappersForEventName(id,_388);
 
if(c.pluck("handler").include(_389)){
 
return false;
 
}
 
var _38c=function(_38d){
 
if(!Event||!Event.extend||(_38d.eventName&&_38d.eventName!=_388)){
 
return false;
 
}
 
Event.extend(_38d);
 
_389.call(_387,_38d);
 
};
 
_38c.handler=_389;
 
c.push(_38c);
 
return _38c;
 
}
 
function findWrapper(id,_38f,_390){
 
var c=getWrappersForEventName(id,_38f);
 
return c.find(function(_392){
 
return _392.handler==_390;
 
});
 
}
 
function destroyWrapper(id,_394,_395){
 
var c=getCacheForID(id);
 
if(!c[_394]){
 
return false;
 
}
 
c[_394]=c[_394].without(findWrapper(id,_394,_395));
 
}
 
function destroyCache(){
 
for(var id in _380){
 
for(var _398 in _380[id]){
 
_380[id][_398]=null;
 
}
 
}
 
}
 
if(window.attachEvent){
 
window.attachEvent("onunload",destroyCache);
 
}
 
return {observe:function(_399,_39a,_39b){
 
_399=$(_399);
 
var name=getDOMEventName(_39a);
 
var _39d=createWrapper(_399,_39a,_39b);
 
if(!_39d){
 
return _399;
 
}
 
if(_399.addEventListener){
 
_399.addEventListener(name,_39d,false);
 
}else{
 
_399.attachEvent("on"+name,_39d);
 
}
 
return _399;
 
},stopObserving:function(_39e,_39f,_3a0){
 
_39e=$(_39e);
 
var id=getEventID(_39e),name=getDOMEventName(_39f);
 
if(!_3a0&&_39f){
 
getWrappersForEventName(id,_39f).each(function(_3a2){
 
_39e.stopObserving(_39f,_3a2.handler);
 
});
 
return _39e;
 
}else{
 
if(!_39f){
 
Object.keys(getCacheForID(id)).each(function(_3a3){
 
_39e.stopObserving(_3a3);
 
});
 
return _39e;
 
}
 
}
 
var _3a4=findWrapper(id,_39f,_3a0);
 
if(!_3a4){
 
return _39e;
 
}
 
if(_39e.removeEventListener){
 
_39e.removeEventListener(name,_3a4,false);
 
}else{
 
_39e.detachEvent("on"+name,_3a4);
 
}
 
destroyWrapper(id,_39f,_3a0);
 
return _39e;
 
},fire:function(_3a5,_3a6,memo){
 
_3a5=$(_3a5);
 
if(_3a5==document&&document.createEvent&&!_3a5.dispatchEvent){
 
_3a5=document.documentElement;
 
}
 
var _3a8;
 
if(document.createEvent){
 
_3a8=document.createEvent("HTMLEvents");
 
_3a8.initEvent("dataavailable",true,true);
 
}else{
 
_3a8=document.createEventObject();
 
_3a8.eventType="ondataavailable";
 
}
 
_3a8.eventName=_3a6;
 
_3a8.memo=memo||{};
 
if(document.createEvent){
 
_3a5.dispatchEvent(_3a8);
 
}else{
 
_3a5.fireEvent(_3a8.eventType,_3a8);
 
}
 
return Event.extend(_3a8);
 
}};
 
})());
 
Object.extend(Event,Event.Methods);
 
Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});
 
Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});
 
(function(){
 
var _3a9;
 
function fireContentLoadedEvent(){
 
if(document.loaded){
 
return;
 
}
 
if(_3a9){
 
window.clearInterval(_3a9);
 
}
 
document.fire("dom:loaded");
 
document.loaded=true;
 
}
 
if(document.addEventListener){
 
if(Prototype.Browser.WebKit){
 
_3a9=window.setInterval(function(){
 
if(/loaded|complete/.test(document.readyState)){
 
fireContentLoadedEvent();
 
}
 
},0);
 
Event.observe(window,"load",fireContentLoadedEvent);
 
}else{
 
document.addEventListener("DOMContentLoaded",fireContentLoadedEvent,false);
 
}
 
}else{
 
document.write("<script id=__onDOMContentLoaded defer src=//:></script>");
 
$("__onDOMContentLoaded").onreadystatechange=function(){
 
if(this.readyState=="complete"){
 
this.onreadystatechange=null;
 
fireContentLoadedEvent();
 
}
 
};
 
}
 
})();
 
Hash.toQueryString=Object.toQueryString;
 
var Toggle={display:Element.toggle};
 
Element.Methods.childOf=Element.Methods.descendantOf;
 
var Insertion={Before:function(_3aa,_3ab){
 
return Element.insert(_3aa,{before:_3ab});
 
},Top:function(_3ac,_3ad){
 
return Element.insert(_3ac,{top:_3ad});
 
},Bottom:function(_3ae,_3af){
 
return Element.insert(_3ae,{bottom:_3af});
 
},After:function(_3b0,_3b1){
 
return Element.insert(_3b0,{after:_3b1});
 
}};
 
var $continue=new Error("\"throw $continue\" is deprecated, use \"return\" instead");
 
var Position={includeScrollOffsets:false,prepare:function(){
 
this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
 
this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;
 
},within:function(_3b2,x,y){
 
if(this.includeScrollOffsets){
 
return this.withinIncludingScrolloffsets(_3b2,x,y);
 
}
 
this.xcomp=x;
 
this.ycomp=y;
 
this.offset=Element.cumulativeOffset(_3b2);
 
return (y>=this.offset[1]&&y<this.offset[1]+_3b2.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_3b2.offsetWidth);
 
},withinIncludingScrolloffsets:function(_3b5,x,y){
 
var _3b8=Element.cumulativeScrollOffset(_3b5);
 
this.xcomp=x+_3b8[0]-this.deltaX;
 
this.ycomp=y+_3b8[1]-this.deltaY;
 
this.offset=Element.cumulativeOffset(_3b5);
 
return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_3b5.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_3b5.offsetWidth);
 
},overlap:function(mode,_3ba){
 
if(!mode){
 
return 0;
 
}
 
if(mode=="vertical"){
 
return ((this.offset[1]+_3ba.offsetHeight)-this.ycomp)/_3ba.offsetHeight;
 
}
 
if(mode=="horizontal"){
 
return ((this.offset[0]+_3ba.offsetWidth)-this.xcomp)/_3ba.offsetWidth;
 
}
 
},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(_3bb){
 
Position.prepare();
 
return Element.absolutize(_3bb);
 
},relativize:function(_3bc){
 
Position.prepare();
 
return Element.relativize(_3bc);
 
},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(_3bd,_3be,_3bf){
 
_3bf=_3bf||{};
 
return Element.clonePosition(_3be,_3bd,_3bf);
 
}};
 
if(!document.getElementsByClassName){
 
document.getElementsByClassName=function(_3c0){
 
function iter(name){
 
return name.blank()?null:"[contains(concat(' ', @class, ' '), ' "+name+" ')]";
 
}
 
_3c0.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(_3c2,_3c3){
 
_3c3=_3c3.toString().strip();
 
var cond=/\s/.test(_3c3)?$w(_3c3).map(iter).join(""):iter(_3c3);
 
return cond?document._getElementsByXPath(".//*"+cond,_3c2):[];
 
}:function(_3c5,_3c6){
 
_3c6=_3c6.toString().strip();
 
var _3c7=[],classNames=(/\s/.test(_3c6)?$w(_3c6):null);
 
if(!classNames&&!_3c6){
 
return _3c7;
 
}
 
var _3c8=$(_3c5).getElementsByTagName("*");
 
_3c6=" "+_3c6+" ";
 
for(var i=0,child,cn;child=_3c8[i];i++){
 
if(child.className&&(cn=" "+child.className+" ")&&(cn.include(_3c6)||(classNames&&classNames.all(function(name){
 
return !name.toString().blank()&&cn.include(" "+name+" ");
 
})))){
 
_3c7.push(Element.extend(child));
 
}
 
}
 
return _3c7;
 
};
 
return function(_3cb,_3cc){
 
return $(_3cc||document.body).getElementsByClassName(_3cb);
 
};
 
}(Element.Methods);
 
}
 
Element.ClassNames=Class.create();
 
Element.ClassNames.prototype={initialize:function(_3cd){
 
this.element=$(_3cd);
 
},_each:function(_3ce){
 
this.element.className.split(/\s+/).select(function(name){
 
return name.length>0;
 
})._each(_3ce);
 
},set:function(_3d0){
 
this.element.className=_3d0;
 
},add:function(_3d1){
 
if(this.include(_3d1)){
 
return;
 
}
 
this.set($A(this).concat(_3d1).join(" "));
 
},remove:function(_3d2){
 
if(!this.include(_3d2)){
 
return;
 
}
 
this.set($A(this).without(_3d2).join(" "));
 
},toString:function(){
 
return $A(this).join(" ");
 
}};
 
Object.extend(Element.ClassNames.prototype,Enumerable);
 
Element.addMethods();
 

	
components/com_morfeoshow/src/js/swfobject.js
Show inline comments
 
new file 100644
 
/**
 
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 
 *
 
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 
 * http://www.opensource.org/licenses/mit-license.php
 
 *
 
 */
 
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
 
\ No newline at end of file
components/com_morfeoshow/src/js/yui-utilities.js
Show inline comments
 
new file 100644
 
/*
 
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 
Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt
 
version: 2.4.1
 

	
 
Note: This file includes yahoo, dom, event, and anim
 

	
 
*/
 
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules;if(!I[A]){I[A]={versions:[],builds:[]};}var B=I[A],H=D.version,G=D.build,F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(var C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null};var B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{isArray:function(B){if(B){var A=YAHOO.lang;return A.isNumber(B.length)&&A.isFunction(B.splice);}return false;},isBoolean:function(A){return typeof A==="boolean";},isFunction:function(A){return typeof A==="function";},isNull:function(A){return A===null;},isNumber:function(A){return typeof A==="number"&&isFinite(A);},isObject:function(A){return(A&&(typeof A==="object"||YAHOO.lang.isFunction(A)))||false;},isString:function(A){return typeof A==="string";},isUndefined:function(A){return typeof A==="undefined";},hasOwnProperty:function(A,B){if(Object.prototype.hasOwnProperty){return A.hasOwnProperty(B);}return !YAHOO.lang.isUndefined(A[B])&&A.constructor.prototype[B]!==A[B];},_IEEnumFix:function(C,B){if(YAHOO.env.ua.ie){var E=["toString","valueOf"],A;for(A=0;A<E.length;A=A+1){var F=E[A],D=B[F];if(YAHOO.lang.isFunction(D)&&D!=Object.prototype[F]){C[F]=D;}}}},extend:function(D,E,C){if(!E||!D){throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");}var B=function(){};B.prototype=E.prototype;D.prototype=new B();D.prototype.constructor=D;D.superclass=E.prototype;if(E.prototype.constructor==Object.prototype.constructor){E.prototype.constructor=E;}if(C){for(var A in C){D.prototype[A]=C[A];}YAHOO.lang._IEEnumFix(D.prototype,C);}},augmentObject:function(E,D){if(!D||!E){throw new Error("Absorb failed, verify dependencies.");}var A=arguments,C,F,B=A[2];if(B&&B!==true){for(C=2;C<A.length;C=C+1){E[A[C]]=D[A[C]];}}else{for(F in D){if(B||!E[F]){E[F]=D[F];}}YAHOO.lang._IEEnumFix(E,D);}},augmentProto:function(D,C){if(!C||!D){throw new Error("Augment failed, verify dependencies.");}var A=[D.prototype,C.prototype];for(var B=2;B<arguments.length;B=B+1){A.push(arguments[B]);}YAHOO.lang.augmentObject.apply(this,A);},dump:function(A,G){var C=YAHOO.lang,D,F,I=[],J="{...}",B="f(){...}",H=", ",E=" => ";if(!C.isObject(A)){return A+"";}else{if(A instanceof Date||("nodeType" in A&&"tagName" in A)){return A;}else{if(C.isFunction(A)){return B;}}}G=(C.isNumber(G))?G:3;if(C.isArray(A)){I.push("[");for(D=0,F=A.length;D<F;D=D+1){if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}if(I.length>1){I.pop();}I.push("]");}else{I.push("{");for(D in A){if(C.hasOwnProperty(A,D)){I.push(D+E);if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}}if(I.length>1){I.pop();}I.push("}");}return I.join("");},substitute:function(Q,B,J){var G,F,E,M,N,P,D=YAHOO.lang,L=[],C,H="dump",K=" ",A="{",O="}";for(;;){G=Q.lastIndexOf(A);if(G<0){break;}F=Q.indexOf(O,G);if(G+1>=F){break;}C=Q.substring(G+1,F);M=C;P=null;E=M.indexOf(K);if(E>-1){P=M.substring(E+1);M=M.substring(0,E);}N=B[M];if(J){N=J(M,N,P);}if(D.isObject(N)){if(D.isArray(N)){N=D.dump(N,parseInt(P,10));}else{P=P||"";var I=P.indexOf(H);if(I>-1){P=P.substring(4);}if(N.toString===Object.prototype.toString||I>-1){N=D.dump(N,parseInt(P,10));}else{N=N.toString();}}}else{if(!D.isString(N)&&!D.isNumber(N)){N="~-"+L.length+"-~";L[L.length]=C;}}Q=Q.substring(0,G)+N+Q.substring(F+1);}for(G=L.length-1;G>=0;G=G-1){Q=Q.replace(new RegExp("~-"+G+"-~"),"{"+L[G]+"}","g");}return Q;},trim:function(A){try{return A.replace(/^\s+|\s+$/g,"");}catch(B){return A;}},merge:function(){var D={},B=arguments;for(var C=0,A=B.length;C<A;C=C+1){YAHOO.lang.augmentObject(D,B[C],true);}return D;},later:function(H,B,I,D,E){H=H||0;B=B||{};var C=I,G=D,F,A;if(YAHOO.lang.isString(I)){C=B[I];}if(!C){throw new TypeError("method undefined");}if(!YAHOO.lang.isArray(G)){G=[D];}F=function(){C.apply(B,G);};A=(E)?setInterval(F,H):setTimeout(F,H);return{interval:E,cancel:function(){if(this.interval){clearInterval(A);}else{clearTimeout(A);}}};},isValue:function(B){var A=YAHOO.lang;return(A.isObject(B)||A.isString(B)||A.isNumber(B)||A.isBoolean(B));}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.4.1",build:"742"});(function(){var B=YAHOO.util,L,J,H=0,K={},F={},N=window.document;var C=YAHOO.env.ua.opera,M=YAHOO.env.ua.webkit,A=YAHOO.env.ua.gecko,G=YAHOO.env.ua.ie;var E={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i};var O=function(Q){if(!E.HYPHEN.test(Q)){return Q;}if(K[Q]){return K[Q];}var R=Q;while(E.HYPHEN.exec(R)){R=R.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}K[Q]=R;return R;};var P=function(R){var Q=F[R];if(!Q){Q=new RegExp("(?:^|\\s+)"+R+"(?:\\s+|$)");F[R]=Q;}return Q;};if(N.defaultView&&N.defaultView.getComputedStyle){L=function(Q,T){var S=null;if(T=="float"){T="cssFloat";}var R=N.defaultView.getComputedStyle(Q,"");if(R){S=R[O(T)];}return Q.style[T]||S;};}else{if(N.documentElement.currentStyle&&G){L=function(Q,S){switch(O(S)){case"opacity":var U=100;try{U=Q.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(T){try{U=Q.filters("alpha").opacity;}catch(T){}}return U/100;case"float":S="styleFloat";default:var R=Q.currentStyle?Q.currentStyle[S]:null;return(Q.style[S]||R);}};}else{L=function(Q,R){return Q.style[R];};}}if(G){J=function(Q,R,S){switch(R){case"opacity":if(YAHOO.lang.isString(Q.style.filter)){Q.style.filter="alpha(opacity="+S*100+")";if(!Q.currentStyle||!Q.currentStyle.hasLayout){Q.style.zoom=1;}}break;case"float":R="styleFloat";default:Q.style[R]=S;}};}else{J=function(Q,R,S){if(R=="float"){R="cssFloat";}Q.style[R]=S;};}var D=function(Q,R){return Q&&Q.nodeType==1&&(!R||R(Q));};YAHOO.util.Dom={get:function(S){if(S&&(S.tagName||S.item)){return S;}if(YAHOO.lang.isString(S)||!S){return N.getElementById(S);}if(S.length!==undefined){var T=[];for(var R=0,Q=S.length;R<Q;++R){T[T.length]=B.Dom.get(S[R]);}return T;}return S;},getStyle:function(Q,S){S=O(S);var R=function(T){return L(T,S);};return B.Dom.batch(Q,R,B.Dom,true);},setStyle:function(Q,S,T){S=O(S);var R=function(U){J(U,S,T);};B.Dom.batch(Q,R,B.Dom,true);},getXY:function(Q){var R=function(S){if((S.parentNode===null||S.offsetParent===null||this.getStyle(S,"display")=="none")&&S!=S.ownerDocument.body){return false;}return I(S);};return B.Dom.batch(Q,R,B.Dom,true);},getX:function(Q){var R=function(S){return B.Dom.getXY(S)[0];};return B.Dom.batch(Q,R,B.Dom,true);},getY:function(Q){var R=function(S){return B.Dom.getXY(S)[1];};return B.Dom.batch(Q,R,B.Dom,true);},setXY:function(Q,T,S){var R=function(W){var V=this.getStyle(W,"position");if(V=="static"){this.setStyle(W,"position","relative");V="relative";}var Y=this.getXY(W);if(Y===false){return false;}var X=[parseInt(this.getStyle(W,"left"),10),parseInt(this.getStyle(W,"top"),10)];if(isNaN(X[0])){X[0]=(V=="relative")?0:W.offsetLeft;}if(isNaN(X[1])){X[1]=(V=="relative")?0:W.offsetTop;}if(T[0]!==null){W.style.left=T[0]-Y[0]+X[0]+"px";}if(T[1]!==null){W.style.top=T[1]-Y[1]+X[1]+"px";}if(!S){var U=this.getXY(W);if((T[0]!==null&&U[0]!=T[0])||(T[1]!==null&&U[1]!=T[1])){this.setXY(W,T,true);}}};B.Dom.batch(Q,R,B.Dom,true);},setX:function(R,Q){B.Dom.setXY(R,[Q,null]);},setY:function(Q,R){B.Dom.setXY(Q,[null,R]);},getRegion:function(Q){var R=function(S){if((S.parentNode===null||S.offsetParent===null||this.getStyle(S,"display")=="none")&&S!=N.body){return false;}var T=B.Region.getRegion(S);return T;};return B.Dom.batch(Q,R,B.Dom,true);},getClientWidth:function(){return B.Dom.getViewportWidth();},getClientHeight:function(){return B.Dom.getViewportHeight();},getElementsByClassName:function(U,Y,V,W){Y=Y||"*";V=(V)?B.Dom.get(V):null||N;if(!V){return[];}var R=[],Q=V.getElementsByTagName(Y),X=P(U);for(var S=0,T=Q.length;S<T;++S){if(X.test(Q[S].className)){R[R.length]=Q[S];if(W){W.call(Q[S],Q[S]);}}}return R;},hasClass:function(S,R){var Q=P(R);var T=function(U){return Q.test(U.className);};return B.Dom.batch(S,T,B.Dom,true);},addClass:function(R,Q){var S=function(T){if(this.hasClass(T,Q)){return false;}T.className=YAHOO.lang.trim([T.className,Q].join(" "));return true;};return B.Dom.batch(R,S,B.Dom,true);},removeClass:function(S,R){var Q=P(R);var T=function(U){if(!this.hasClass(U,R)){return false;}var V=U.className;U.className=V.replace(Q," ");if(this.hasClass(U,R)){this.removeClass(U,R);}U.className=YAHOO.lang.trim(U.className);return true;};return B.Dom.batch(S,T,B.Dom,true);},replaceClass:function(T,R,Q){if(!Q||R===Q){return false;}var S=P(R);var U=function(V){if(!this.hasClass(V,R)){this.addClass(V,Q);return true;}V.className=V.className.replace(S," "+Q+" ");if(this.hasClass(V,R)){this.replaceClass(V,R,Q);}V.className=YAHOO.lang.trim(V.className);return true;};return B.Dom.batch(T,U,B.Dom,true);},generateId:function(Q,S){S=S||"yui-gen";var R=function(T){if(T&&T.id){return T.id;}var U=S+H++;if(T){T.id=U;}return U;};return B.Dom.batch(Q,R,B.Dom,true)||R.apply(B.Dom,arguments);},isAncestor:function(Q,R){Q=B.Dom.get(Q);R=B.Dom.get(R);if(!Q||!R){return false;}if(Q.contains&&R.nodeType&&!M){return Q.contains(R);}else{if(Q.compareDocumentPosition&&R.nodeType){return !!(Q.compareDocumentPosition(R)&16);}else{if(R.nodeType){return !!this.getAncestorBy(R,function(S){return S==Q;});}}}return false;},inDocument:function(Q){return this.isAncestor(N.documentElement,Q);},getElementsBy:function(X,R,S,U){R=R||"*";S=(S)?B.Dom.get(S):null||N;if(!S){return[];}var T=[],W=S.getElementsByTagName(R);for(var V=0,Q=W.length;V<Q;++V){if(X(W[V])){T[T.length]=W[V];if(U){U(W[V]);}}}return T;},batch:function(U,X,W,S){U=(U&&(U.tagName||U.item))?U:B.Dom.get(U);if(!U||!X){return false;}var T=(S)?W:window;if(U.tagName||U.length===undefined){return X.call(T,U,W);}var V=[];for(var R=0,Q=U.length;R<Q;++R){V[V.length]=X.call(T,U[R],W);}return V;},getDocumentHeight:function(){var R=(N.compatMode!="CSS1Compat")?N.body.scrollHeight:N.documentElement.scrollHeight;var Q=Math.max(R,B.Dom.getViewportHeight());return Q;},getDocumentWidth:function(){var R=(N.compatMode!="CSS1Compat")?N.body.scrollWidth:N.documentElement.scrollWidth;var Q=Math.max(R,B.Dom.getViewportWidth());return Q;},getViewportHeight:function(){var Q=self.innerHeight;var R=N.compatMode;if((R||G)&&!C){Q=(R=="CSS1Compat")?N.documentElement.clientHeight:N.body.clientHeight;
 
}return Q;},getViewportWidth:function(){var Q=self.innerWidth;var R=N.compatMode;if(R||G){Q=(R=="CSS1Compat")?N.documentElement.clientWidth:N.body.clientWidth;}return Q;},getAncestorBy:function(Q,R){while(Q=Q.parentNode){if(D(Q,R)){return Q;}}return null;},getAncestorByClassName:function(R,Q){R=B.Dom.get(R);if(!R){return null;}var S=function(T){return B.Dom.hasClass(T,Q);};return B.Dom.getAncestorBy(R,S);},getAncestorByTagName:function(R,Q){R=B.Dom.get(R);if(!R){return null;}var S=function(T){return T.tagName&&T.tagName.toUpperCase()==Q.toUpperCase();};return B.Dom.getAncestorBy(R,S);},getPreviousSiblingBy:function(Q,R){while(Q){Q=Q.previousSibling;if(D(Q,R)){return Q;}}return null;},getPreviousSibling:function(Q){Q=B.Dom.get(Q);if(!Q){return null;}return B.Dom.getPreviousSiblingBy(Q);},getNextSiblingBy:function(Q,R){while(Q){Q=Q.nextSibling;if(D(Q,R)){return Q;}}return null;},getNextSibling:function(Q){Q=B.Dom.get(Q);if(!Q){return null;}return B.Dom.getNextSiblingBy(Q);},getFirstChildBy:function(Q,S){var R=(D(Q.firstChild,S))?Q.firstChild:null;return R||B.Dom.getNextSiblingBy(Q.firstChild,S);},getFirstChild:function(Q,R){Q=B.Dom.get(Q);if(!Q){return null;}return B.Dom.getFirstChildBy(Q);},getLastChildBy:function(Q,S){if(!Q){return null;}var R=(D(Q.lastChild,S))?Q.lastChild:null;return R||B.Dom.getPreviousSiblingBy(Q.lastChild,S);},getLastChild:function(Q){Q=B.Dom.get(Q);return B.Dom.getLastChildBy(Q);},getChildrenBy:function(R,T){var S=B.Dom.getFirstChildBy(R,T);var Q=S?[S]:[];B.Dom.getNextSiblingBy(S,function(U){if(!T||T(U)){Q[Q.length]=U;}return false;});return Q;},getChildren:function(Q){Q=B.Dom.get(Q);if(!Q){}return B.Dom.getChildrenBy(Q);},getDocumentScrollLeft:function(Q){Q=Q||N;return Math.max(Q.documentElement.scrollLeft,Q.body.scrollLeft);},getDocumentScrollTop:function(Q){Q=Q||N;return Math.max(Q.documentElement.scrollTop,Q.body.scrollTop);},insertBefore:function(R,Q){R=B.Dom.get(R);Q=B.Dom.get(Q);if(!R||!Q||!Q.parentNode){return null;}return Q.parentNode.insertBefore(R,Q);},insertAfter:function(R,Q){R=B.Dom.get(R);Q=B.Dom.get(Q);if(!R||!Q||!Q.parentNode){return null;}if(Q.nextSibling){return Q.parentNode.insertBefore(R,Q.nextSibling);}else{return Q.parentNode.appendChild(R);}},getClientRegion:function(){var S=B.Dom.getDocumentScrollTop(),R=B.Dom.getDocumentScrollLeft(),T=B.Dom.getViewportWidth()+R,Q=B.Dom.getViewportHeight()+S;return new B.Region(S,T,Q,R);}};var I=function(){if(N.documentElement.getBoundingClientRect){return function(R){var S=R.getBoundingClientRect();var Q=R.ownerDocument;return[S.left+B.Dom.getDocumentScrollLeft(Q),S.top+B.Dom.getDocumentScrollTop(Q)];};}else{return function(S){var T=[S.offsetLeft,S.offsetTop];var R=S.offsetParent;var Q=(M&&B.Dom.getStyle(S,"position")=="absolute"&&S.offsetParent==S.ownerDocument.body);if(R!=S){while(R){T[0]+=R.offsetLeft;T[1]+=R.offsetTop;if(!Q&&M&&B.Dom.getStyle(R,"position")=="absolute"){Q=true;}R=R.offsetParent;}}if(Q){T[0]-=S.ownerDocument.body.offsetLeft;T[1]-=S.ownerDocument.body.offsetTop;}R=S.parentNode;while(R.tagName&&!E.ROOT_TAG.test(R.tagName)){if(B.Dom.getStyle(R,"display").search(/^inline|table-row.*$/i)){T[0]-=R.scrollLeft;T[1]-=R.scrollTop;}R=R.parentNode;}return T;};}}();})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this[0]=B;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.4.1",build:"742"});YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){var D=this.subscribers.length;if(!D&&this.silent){return true;}var H=[],F=true,C,I=false;for(C=0;C<arguments.length;++C){H.push(arguments[C]);}if(!this.silent){}for(C=0;C<D;++C){var L=this.subscribers[C];if(!L){I=true;}else{if(!this.silent){}var K=L.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var A=null;if(H.length>0){A=H[0];}try{F=L.fn.call(K,A,L.obj);}catch(E){this.lastError=E;}}else{try{F=L.fn.call(K,this.type,H,L.obj);}catch(G){this.lastError=G;}}if(false===F){if(!this.silent){}return false;}}}if(I){var J=[],B=this.subscribers;for(C=0,D=B.length;C<D;C=C+1){J.push(B[C]);}this.subscribers=J;}return true;},unsubscribeAll:function(){for(var B=0,A=this.subscribers.length;B<A;++B){this._delete(A-1-B);}this.subscribers=[];return B;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers[A]=null;},toString:function(){return"CustomEvent: '"+this.type+"', scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};return{POLL_RETRYS:4000,POLL_INTERVAL:10,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,startInterval:function(){if(!this._interval){var K=this;var L=function(){K._tryPreloadAttach();};this._interval=setInterval(L,this.POLL_INTERVAL);}},onAvailable:function(P,M,Q,O,N){var K=(YAHOO.lang.isString(P))?[P]:P;for(var L=0;L<K.length;L=L+1){F.push({id:K[L],fn:M,obj:Q,override:O,checkReady:N});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(M,K,N,L){this.onAvailable(M,K,N,L,true);},onDOMReady:function(K,M,L){if(this.DOMReady){setTimeout(function(){var N=window;if(L){if(L===true){N=M;}else{N=L;}}K.call(N,"DOMReady",[],M);},0);}else{this.DOMReadyEvent.subscribe(K,M,L);}},addListener:function(M,K,V,Q,L){if(!V||!V.call){return false;}if(this._isValidCollection(M)){var W=true;for(var R=0,T=M.length;R<T;++R){W=this.on(M[R],K,V,Q,L)&&W;}return W;}else{if(YAHOO.lang.isString(M)){var P=this.getEl(M);if(P){M=P;}else{this.onAvailable(M,function(){YAHOO.util.Event.on(M,K,V,Q,L);});return true;}}}if(!M){return false;}if("unload"==K&&Q!==this){J[J.length]=[M,K,V,Q,L];return true;}var Y=M;if(L){if(L===true){Y=Q;}else{Y=L;}}var N=function(Z){return V.call(Y,YAHOO.util.Event.getEvent(Z,M),Q);};var X=[M,K,V,N,Y,Q,L];var S=I.length;I[S]=X;if(this.useLegacyEvent(M,K)){var O=this.getLegacyIndex(M,K);if(O==-1||M!=G[O][0]){O=G.length;B[M.id+K]=O;G[O]=[M,K,M["on"+K]];E[O]=[];M["on"+K]=function(Z){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(Z),O);};}E[O].push(X);}else{try{this._simpleAdd(M,K,N,false);}catch(U){this.lastError=U;this.removeListener(M,K,V);return false;}}return true;},fireLegacyEvent:function(O,M){var Q=true,K,S,R,T,P;S=E[M];for(var L=0,N=S.length;L<N;++L){R=S[L];if(R&&R[this.WFN]){T=R[this.ADJ_SCOPE];P=R[this.WFN].call(T,O);Q=(Q&&P);}}K=G[M];if(K&&K[2]){K[2](O);}return Q;},getLegacyIndex:function(L,M){var K=this.generateId(L)+M;if(typeof B[K]=="undefined"){return -1;}else{return B[K];}},useLegacyEvent:function(L,M){if(this.webkit&&("click"==M||"dblclick"==M)){var K=parseInt(this.webkit,10);if(!isNaN(K)&&K<418){return true;}}return false;},removeListener:function(L,K,T){var O,R,V;if(typeof L=="string"){L=this.getEl(L);}else{if(this._isValidCollection(L)){var U=true;for(O=0,R=L.length;O<R;++O){U=(this.removeListener(L[O],K,T)&&U);}return U;}}if(!T||!T.call){return this.purgeElement(L,false,K);}if("unload"==K){for(O=0,R=J.length;O<R;O++){V=J[O];if(V&&V[0]==L&&V[1]==K&&V[2]==T){J[O]=null;return true;}}return false;}var P=null;var Q=arguments[3];if("undefined"===typeof Q){Q=this._getCacheIndex(L,K,T);}if(Q>=0){P=I[Q];}if(!L||!P){return false;}if(this.useLegacyEvent(L,K)){var N=this.getLegacyIndex(L,K);var M=E[N];if(M){for(O=0,R=M.length;O<R;++O){V=M[O];if(V&&V[this.EL]==L&&V[this.TYPE]==K&&V[this.FN]==T){M[O]=null;break;}}}}else{try{this._simpleRemove(L,K,P[this.WFN],false);}catch(S){this.lastError=S;return false;}}delete I[Q][this.WFN];delete I[Q][this.FN];I[Q]=null;return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(K){if(K&&3==K.nodeType){return K.parentNode;}else{return K;}},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];
 
},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement;}else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in D)){K=D[K];}return K;},_getCacheIndex:function(O,P,N){for(var M=0,L=I.length;M<L;++M){var K=I[M];if(K&&K[this.FN]==N&&K[this.EL]==O&&K[this.TYPE]==P){return M;}}return -1;},generateId:function(K){var L=K.id;if(!L){L="yuievtautoid-"+A;++A;K.id=L;}return L;},_isValidCollection:function(L){try{return(L&&typeof L!=="string"&&L.length&&!L.tagName&&!L.alert&&typeof L[0]!=="undefined");}catch(K){return false;}},elCache:{},getEl:function(K){return(typeof K==="string")?document.getElementById(K):K;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(L){if(!H){H=true;var K=YAHOO.util.Event;K._ready();K._tryPreloadAttach();}},_ready:function(L){var K=YAHOO.util.Event;if(!K.DOMReady){K.DOMReady=true;K.DOMReadyEvent.fire();K._simpleRemove(document,"DOMContentLoaded",K._ready);}},_tryPreloadAttach:function(){if(this.locked){return false;}if(this.isIE){if(!this.DOMReady){this.startInterval();return false;}}this.locked=true;var P=!H;if(!P){P=(C>0);}var O=[];var Q=function(S,T){var R=S;if(T.override){if(T.override===true){R=T.obj;}else{R=T.override;}}T.fn.call(R,T.obj);};var L,K,N,M;for(L=0,K=F.length;L<K;++L){N=F[L];if(N&&!N.checkReady){M=this.getEl(N.id);if(M){Q(M,N);F[L]=null;}else{O.push(N);}}}for(L=0,K=F.length;L<K;++L){N=F[L];if(N&&N.checkReady){M=this.getEl(N.id);if(M){if(H||M.nextSibling){Q(M,N);F[L]=null;}}else{O.push(N);}}}C=(O.length===0)?0:C-1;if(P){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;return true;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=0,K=Q.length;N<K;++N){var L=Q[N];this.removeListener(M,L.type,L.fn,L.index);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N<K;++N){this.purgeElement(M.childNodes[N],P,R);}}},getListeners:function(M,K){var P=[],L;if(!K){L=[I,J];}else{if(K==="unload"){L=[J];}else{L=[I];}}var R=(YAHOO.lang.isString(M))?this.getEl(M):M;for(var O=0;O<L.length;O=O+1){var T=L[O];if(T&&T.length>0){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===R&&(!K||K===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.OVERRIDE],scope:N[this.ADJ_SCOPE],index:Q});}}}}return(P.length)?P:null;},_unload:function(R){var Q=YAHOO.util.Event,O,N,L,K,M;for(O=0,K=J.length;O<K;++O){L=J[O];if(L){var P=window;if(L[Q.ADJ_SCOPE]){if(L[Q.ADJ_SCOPE]===true){P=L[Q.UNLOAD_OBJ];}else{P=L[Q.ADJ_SCOPE];}}L[Q.FN].call(P,Q.getEvent(R,L[Q.EL]),L[Q.UNLOAD_OBJ]);J[O]=null;L=null;P=null;}}J=null;if(YAHOO.env.ua.ie&&I&&I.length>0){N=I.length;while(N){M=N-1;L=I[M];if(L){Q.removeListener(L[Q.EL],L[Q.TYPE],L[Q.FN],M);}N--;}L=null;}G=null;Q._simpleRemove(window,"unload",Q._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var A=YAHOO.util.Event;A.on=A.addListener;if(A.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);A._dri=setInterval(function(){var C=document.createElement("p");try{C.doScroll("left");clearInterval(A._dri);A._dri=null;A._ready();C=null;}catch(B){C=null;}},A.POLL_INTERVAL);}else{if(A.webkit){A._dri=setInterval(function(){var B=document.readyState;if("loaded"==B||"complete"==B){clearInterval(A._dri);A._dri=null;A._ready();}},A.POLL_INTERVAL);}else{A._simpleAdd(document,"DOMContentLoaded",A._ready);}}A._simpleAdd(window,"load",A._load);A._simpleAdd(window,"unload",A._unload);A._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};
 
var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].override);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};YAHOO.util.KeyListener=function(A,F,B,C){if(!A){}else{if(!F){}else{if(!B){}}}if(!C){C=YAHOO.util.KeyListener.KEYDOWN;}var D=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof A=="string"){A=document.getElementById(A);}if(typeof B=="function"){D.subscribe(B);}else{D.subscribe(B.fn,B.scope,B.correctScope);}function E(J,I){if(!F.shift){F.shift=false;}if(!F.alt){F.alt=false;}if(!F.ctrl){F.ctrl=false;}if(J.shiftKey==F.shift&&J.altKey==F.alt&&J.ctrlKey==F.ctrl){var G;if(F.keys instanceof Array){for(var H=0;H<F.keys.length;H++){G=F.keys[H];if(G==J.charCode){D.fire(J.charCode,J);break;}else{if(G==J.keyCode){D.fire(J.keyCode,J);break;}}}}else{G=F.keys;if(G==J.charCode){D.fire(J.charCode,J);}else{if(G==J.keyCode){D.fire(J.keyCode,J);}}}}}this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(A,C,E);this.enabledEvent.fire(F);}this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(A,C,E);this.disabledEvent.fire(F);}this.enabled=false;};this.toString=function(){return"KeyListener ["+F.keys+"] "+A.tagName+(A.id?"["+A.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};YAHOO.register("event",YAHOO.util.Event,{version:"2.4.1",build:"742"});YAHOO.register("yahoo-dom-event", YAHOO, {version: "2.4.1", build: "742"});
 
YAHOO.util.Anim=function(B,A,C,D){if(!B){}this.init(B,A,C,D);};YAHOO.util.Anim.prototype={toString:function(){var A=this.getEl();var B=A.id||A.tagName||A;return("Anim "+B);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(A,C,B){return this.method(this.currentFrame,C,B-C,this.totalFrames);},setAttribute:function(A,C,B){if(this.patterns.noNegatives.test(A)){C=(C>0)?C:0;}YAHOO.util.Dom.setStyle(this.getEl(),A,C+B);},getAttribute:function(A){var C=this.getEl();var E=YAHOO.util.Dom.getStyle(C,A);if(E!=="auto"&&!this.patterns.offsetUnit.test(E)){return parseFloat(E);}var B=this.patterns.offsetAttribute.exec(A)||[];var F=!!(B[3]);var D=!!(B[2]);if(D||(YAHOO.util.Dom.getStyle(C,"position")=="absolute"&&F)){E=C["offset"+B[0].charAt(0).toUpperCase()+B[0].substr(1)];}else{E=0;}return E;},getDefaultUnit:function(A){if(this.patterns.defaultUnit.test(A)){return"px";}return"";},setRuntimeAttribute:function(B){var G;var C;var D=this.attributes;this.runtimeAttributes[B]={};var F=function(H){return(typeof H!=="undefined");};if(!F(D[B]["to"])&&!F(D[B]["by"])){return false;}G=(F(D[B]["from"]))?D[B]["from"]:this.getAttribute(B);if(F(D[B]["to"])){C=D[B]["to"];}else{if(F(D[B]["by"])){if(G.constructor==Array){C=[];for(var E=0,A=G.length;E<A;++E){C[E]=G[E]+D[B]["by"][E]*1;}}else{C=G+D[B]["by"]*1;}}}this.runtimeAttributes[B].start=G;this.runtimeAttributes[B].end=C;this.runtimeAttributes[B].unit=(F(D[B].unit))?D[B]["unit"]:this.getDefaultUnit(B);return true;},init:function(C,H,G,A){var B=false;var D=null;var F=0;C=YAHOO.util.Dom.get(C);this.attributes=H||{};this.duration=!YAHOO.lang.isUndefined(G)?G:1;this.method=A||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;this.setEl=function(K){C=YAHOO.util.Dom.get(K);};this.getEl=function(){return C;};this.isAnimated=function(){return B;};this.getStartTime=function(){return D;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}YAHOO.util.AnimMgr.registerElement(this);return true;};this.stop=function(K){if(!this.isAnimated()){return false;}if(K){this.currentFrame=this.totalFrames;this._onTween.fire();}YAHOO.util.AnimMgr.stop(this);};var J=function(){this.onStart.fire();this.runtimeAttributes={};for(var K in this.attributes){this.setRuntimeAttribute(K);}B=true;F=0;D=new Date();};var I=function(){var M={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};M.toString=function(){return("duration: "+M.duration+", currentFrame: "+M.currentFrame);};this.onTween.fire(M);var L=this.runtimeAttributes;for(var K in L){this.setAttribute(K,this.doMethod(K,L[K].start,L[K].end),L[K].unit);}F+=1;};var E=function(){var K=(new Date()-D)/1000;var L={duration:K,frames:F,fps:F/K};L.toString=function(){return("duration: "+L.duration+", frames: "+L.frames+", fps: "+L.fps);};B=false;F=0;this.onComplete.fire(L);};this._onStart=new YAHOO.util.CustomEvent("_start",this,true);this.onStart=new YAHOO.util.CustomEvent("start",this);this.onTween=new YAHOO.util.CustomEvent("tween",this);this._onTween=new YAHOO.util.CustomEvent("_tween",this,true);this.onComplete=new YAHOO.util.CustomEvent("complete",this);this._onComplete=new YAHOO.util.CustomEvent("_complete",this,true);this._onStart.subscribe(J);this._onTween.subscribe(I);this._onComplete.subscribe(E);}};YAHOO.util.AnimMgr=new function(){var C=null;var B=[];var A=0;this.fps=1000;this.delay=1;this.registerElement=function(F){B[B.length]=F;A+=1;F._onStart.fire();this.start();};this.unRegister=function(G,F){F=F||E(G);if(!G.isAnimated()||F==-1){return false;}G._onComplete.fire();B.splice(F,1);A-=1;if(A<=0){this.stop();}return true;};this.start=function(){if(C===null){C=setInterval(this.run,this.delay);}};this.stop=function(H){if(!H){clearInterval(C);for(var G=0,F=B.length;G<F;++G){this.unRegister(B[0],0);}B=[];C=null;A=0;}else{this.unRegister(H);}};this.run=function(){for(var H=0,F=B.length;H<F;++H){var G=B[H];if(!G||!G.isAnimated()){continue;}if(G.currentFrame<G.totalFrames||G.totalFrames===null){G.currentFrame+=1;if(G.useSeconds){D(G);}G._onTween.fire();}else{YAHOO.util.AnimMgr.stop(G,H);}}};var E=function(H){for(var G=0,F=B.length;G<F;++G){if(B[G]==H){return G;}}return -1;};var D=function(G){var J=G.totalFrames;var I=G.currentFrame;var H=(G.currentFrame*G.duration*1000/G.totalFrames);var F=(new Date()-G.getStartTime());var K=0;if(F<G.duration*1000){K=Math.round((F/H-1)*G.currentFrame);}else{K=J-(I+1);}if(K>0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1);}G.currentFrame+=K;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(E,D){var F=E.length;var C=[];for(var B=0;B<F;++B){C[B]=[E[B][0],E[B][1]];}for(var A=1;A<F;++A){for(B=0;B<F-A;++B){C[B][0]=(1-D)*C[B][0]+D*C[parseInt(B+1,10)][0];C[B][1]=(1-D)*C[B][1]+D*C[parseInt(B+1,10)][1];}}return[C[0][0],C[0][1]];};};(function(){YAHOO.util.ColorAnim=function(E,D,F,G){YAHOO.util.ColorAnim.superclass.constructor.call(this,E,D,F,G);};YAHOO.extend(YAHOO.util.ColorAnim,YAHOO.util.Anim);var B=YAHOO.util;var C=B.ColorAnim.superclass;var A=B.ColorAnim.prototype;A.toString=function(){var D=this.getEl();var E=D.id||D.tagName;return("ColorAnim "+E);};A.patterns.color=/color$/i;A.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;A.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;A.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;A.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;A.parseColor=function(D){if(D.length==3){return D;}var E=this.patterns.hex.exec(D);if(E&&E.length==4){return[parseInt(E[1],16),parseInt(E[2],16),parseInt(E[3],16)];}E=this.patterns.rgb.exec(D);if(E&&E.length==4){return[parseInt(E[1],10),parseInt(E[2],10),parseInt(E[3],10)];
 
}E=this.patterns.hex3.exec(D);if(E&&E.length==4){return[parseInt(E[1]+E[1],16),parseInt(E[2]+E[2],16),parseInt(E[3]+E[3],16)];}return null;};A.getAttribute=function(D){var F=this.getEl();if(this.patterns.color.test(D)){var G=YAHOO.util.Dom.getStyle(F,D);if(this.patterns.transparent.test(G)){var E=F.parentNode;G=B.Dom.getStyle(E,D);while(E&&this.patterns.transparent.test(G)){E=E.parentNode;G=B.Dom.getStyle(E,D);if(E.tagName.toUpperCase()=="HTML"){G="#fff";}}}}else{G=C.getAttribute.call(this,D);}return G;};A.doMethod=function(E,I,F){var H;if(this.patterns.color.test(E)){H=[];for(var G=0,D=I.length;G<D;++G){H[G]=C.doMethod.call(this,E,I[G],F[G]);}H="rgb("+Math.floor(H[0])+","+Math.floor(H[1])+","+Math.floor(H[2])+")";}else{H=C.doMethod.call(this,E,I,F);}return H;};A.setRuntimeAttribute=function(E){C.setRuntimeAttribute.call(this,E);if(this.patterns.color.test(E)){var G=this.attributes;var I=this.parseColor(this.runtimeAttributes[E].start);var F=this.parseColor(this.runtimeAttributes[E].end);if(typeof G[E]["to"]==="undefined"&&typeof G[E]["by"]!=="undefined"){F=this.parseColor(G[E].by);for(var H=0,D=I.length;H<D;++H){F[H]=I[H]+F[H];}}this.runtimeAttributes[E].start=I;this.runtimeAttributes[E].end=F;}};})();YAHOO.util.Easing={easeNone:function(B,A,D,C){return D*B/C+A;},easeIn:function(B,A,D,C){return D*(B/=C)*B+A;},easeOut:function(B,A,D,C){return -D*(B/=C)*(B-2)+A;},easeBoth:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A;}return -D/2*((--B)*(B-2)-1)+A;},easeInStrong:function(B,A,D,C){return D*(B/=C)*B*B*B+A;},easeOutStrong:function(B,A,D,C){return -D*((B=B/C-1)*B*B*B-1)+A;},easeBothStrong:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B*B+A;}return -D/2*((B-=2)*B*B*B-2)+A;},elasticIn:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return -(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;},elasticOut:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return B*Math.pow(2,-10*C)*Math.sin((C*F-D)*(2*Math.PI)/E)+G+A;},elasticBoth:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F/2)==2){return A+G;}if(!E){E=F*(0.3*1.5);}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}if(C<1){return -0.5*(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;}return B*Math.pow(2,-10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E)*0.5+G+A;},backIn:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*(B/=D)*B*((C+1)*B-C)+A;},backOut:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*((B=B/D-1)*B*((C+1)*B+C)+1)+A;},backBoth:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}if((B/=D/2)<1){return E/2*(B*B*(((C*=(1.525))+1)*B-C))+A;}return E/2*((B-=2)*B*(((C*=(1.525))+1)*B+C)+2)+A;},bounceIn:function(B,A,D,C){return D-YAHOO.util.Easing.bounceOut(C-B,0,D,C)+A;},bounceOut:function(B,A,D,C){if((B/=C)<(1/2.75)){return D*(7.5625*B*B)+A;}else{if(B<(2/2.75)){return D*(7.5625*(B-=(1.5/2.75))*B+0.75)+A;}else{if(B<(2.5/2.75)){return D*(7.5625*(B-=(2.25/2.75))*B+0.9375)+A;}}}return D*(7.5625*(B-=(2.625/2.75))*B+0.984375)+A;},bounceBoth:function(B,A,D,C){if(B<C/2){return YAHOO.util.Easing.bounceIn(B*2,0,D,C)*0.5+A;}return YAHOO.util.Easing.bounceOut(B*2-C,0,D,C)*0.5+D*0.5+A;}};(function(){YAHOO.util.Motion=function(G,F,H,I){if(G){YAHOO.util.Motion.superclass.constructor.call(this,G,F,H,I);}};YAHOO.extend(YAHOO.util.Motion,YAHOO.util.ColorAnim);var D=YAHOO.util;var E=D.Motion.superclass;var B=D.Motion.prototype;B.toString=function(){var F=this.getEl();var G=F.id||F.tagName;return("Motion "+G);};B.patterns.points=/^points$/i;B.setAttribute=function(F,H,G){if(this.patterns.points.test(F)){G=G||"px";E.setAttribute.call(this,"left",H[0],G);E.setAttribute.call(this,"top",H[1],G);}else{E.setAttribute.call(this,F,H,G);}};B.getAttribute=function(F){if(this.patterns.points.test(F)){var G=[E.getAttribute.call(this,"left"),E.getAttribute.call(this,"top")];}else{G=E.getAttribute.call(this,F);}return G;};B.doMethod=function(F,J,G){var I=null;if(this.patterns.points.test(F)){var H=this.method(this.currentFrame,0,100,this.totalFrames)/100;I=D.Bezier.getPosition(this.runtimeAttributes[F],H);}else{I=E.doMethod.call(this,F,J,G);}return I;};B.setRuntimeAttribute=function(O){if(this.patterns.points.test(O)){var G=this.getEl();var I=this.attributes;var F;var K=I["points"]["control"]||[];var H;var L,N;if(K.length>0&&!(K[0] instanceof Array)){K=[K];}else{var J=[];for(L=0,N=K.length;L<N;++L){J[L]=K[L];}K=J;}if(D.Dom.getStyle(G,"position")=="static"){D.Dom.setStyle(G,"position","relative");}if(C(I["points"]["from"])){D.Dom.setXY(G,I["points"]["from"]);}else{D.Dom.setXY(G,D.Dom.getXY(G));}F=this.getAttribute("points");if(C(I["points"]["to"])){H=A.call(this,I["points"]["to"],F);var M=D.Dom.getXY(this.getEl());for(L=0,N=K.length;L<N;++L){K[L]=A.call(this,K[L],F);}}else{if(C(I["points"]["by"])){H=[F[0]+I["points"]["by"][0],F[1]+I["points"]["by"][1]];for(L=0,N=K.length;L<N;++L){K[L]=[F[0]+K[L][0],F[1]+K[L][1]];}}}this.runtimeAttributes[O]=[F];if(K.length>0){this.runtimeAttributes[O]=this.runtimeAttributes[O].concat(K);}this.runtimeAttributes[O][this.runtimeAttributes[O].length]=H;}else{E.setRuntimeAttribute.call(this,O);}};var A=function(F,H){var G=D.Dom.getXY(this.getEl());F=[F[0]-G[0]+H[0],F[1]-G[1]+H[1]];return F;};var C=function(F){return(typeof F!=="undefined");};})();(function(){YAHOO.util.Scroll=function(E,D,F,G){if(E){YAHOO.util.Scroll.superclass.constructor.call(this,E,D,F,G);}};YAHOO.extend(YAHOO.util.Scroll,YAHOO.util.ColorAnim);var B=YAHOO.util;var C=B.Scroll.superclass;var A=B.Scroll.prototype;A.toString=function(){var D=this.getEl();var E=D.id||D.tagName;return("Scroll "+E);};A.doMethod=function(D,G,E){var F=null;if(D=="scroll"){F=[this.method(this.currentFrame,G[0],E[0]-G[0],this.totalFrames),this.method(this.currentFrame,G[1],E[1]-G[1],this.totalFrames)];
 
}else{F=C.doMethod.call(this,D,G,E);}return F;};A.getAttribute=function(D){var F=null;var E=this.getEl();if(D=="scroll"){F=[E.scrollLeft,E.scrollTop];}else{F=C.getAttribute.call(this,D);}return F;};A.setAttribute=function(D,G,F){var E=this.getEl();if(D=="scroll"){E.scrollLeft=G[0];E.scrollTop=G[1];}else{C.setAttribute.call(this,D,G,F);}};})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.4.1",build:"742"});
components/com_morfeoshow/src/lang/index.html
Show inline comments
 
new file 100644
 
<html>
 
<body bgcolor="#FFFFFF">
 
</body>
 
</html>
 
\ No newline at end of file
components/com_morfeoshow/src/lang/shadowbox-de.js
Show inline comments
 
new file 100644
 
/**
 
 * The German (Deutsch) language file for Shadowbox.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: shadowbox-de-DE.js 100 2008-06-23 02:31:30Z mjijackson $
 
 */
 

	
 
if(typeof Shadowbox == 'undefined'){
 
    throw 'Unable to load Shadowbox language file, base library not found.';
 
}
 

	
 
/**
 
 * An object containing all textual messages to be used in Shadowbox. These are
 
 * provided so they may be translated into different languages. Alternative
 
 * translations may be found in js/lang/shadowbox-*.js where * is an abbreviation
 
 * of the language name (see
 
 * http://www.gnu.org/software/gettext/manual/gettext.html#Language-Codes).
 
 *
 
 * @var     {Object}    LANG
 
 * @public
 
 * @static
 
 */
 
Shadowbox.LANG = {
 

	
 
    code:       'de',
 

	
 
    of:         'von',
 

	
 
    loading:    'ladend',
 

	
 
    cancel:     'Abbrechen',
 

	
 
    next:       'Nächste',
 

	
 
    previous:   'Vorige',
 

	
 
    play:       'Abspielen',
 

	
 
    pause:      'Pause',
 

	
 
    close:      'Schließen',
 

	
 
    errors:     {
 
        single: 'Um den Inhalt anzeigen zu können muss die Browser-Erweiterung <a href="{0}">{1}</a> installiert werden.',
 
        shared: 'Um den Inhalt anzeigen zu können müssen die beiden Browser-Erweiterungen <a href="{0}">{1}</a> und <a href="{2}">{3}</a> installiert werden.',
 
        either: 'Um den Inhalt anzeigen zu können muss eine der beiden Browser-Erweiterungen <a href="{0}">{1}</a> oder <a href="{2}">{3}</a> installiert werden.'
 
    }
 

	
 
};
components/com_morfeoshow/src/lang/shadowbox-en.js
Show inline comments
 
new file 100644
 
/**
 
 * The English language file for Shadowbox.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: shadowbox-en.js 99 2008-05-11 16:22:43Z mjijackson $
 
 */
 

	
 
if(typeof Shadowbox == 'undefined'){
 
    throw 'Unable to load Shadowbox language file, base library not found.';
 
}
 

	
 
/**
 
 * An object containing all textual messages to be used in Shadowbox. These are
 
 * provided so they may be translated into different languages. Alternative
 
 * translations may be found in js/lang/shadowbox-*.js where * is an abbreviation
 
 * of the language name (see
 
 * http://www.gnu.org/software/gettext/manual/gettext.html#Language-Codes).
 
 *
 
 * @var     {Object}    LANG
 
 * @public
 
 * @static
 
 */
 
Shadowbox.LANG = {
 

	
 
    code:       'en',
 

	
 
    of:         'of',
 

	
 
    loading:    'loading',
 

	
 
    cancel:     'Cancel',
 

	
 
    next:       'Next',
 

	
 
    previous:   'Previous',
 

	
 
    play:       'Play',
 

	
 
    pause:      'Pause',
 

	
 
    close:      'Close',
 

	
 
    errors:     {
 
        single: 'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',
 
        shared: 'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',
 
        either: 'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.'
 
    }
 

	
 
};
components/com_morfeoshow/src/lang/shadowbox-es.js
Show inline comments
 
new file 100644
 
/**
 
 * The Spanish (Español) language file for Shadowbox.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: shadowbox-es.js 99 2008-05-11 16:22:43Z mjijackson $
 
 */
 

	
 
if(typeof Shadowbox == 'undefined'){
 
    throw 'Unable to load Shadowbox language file, base library not found.';
 
}
 

	
 
/**
 
 * An object containing all textual messages to be used in Shadowbox. These are
 
 * provided so they may be translated into different languages. Alternative
 
 * translations may be found in js/lang/shadowbox-*.js where * is an abbreviation
 
 * of the language name (see
 
 * http://www.gnu.org/software/gettext/manual/gettext.html#Language-Codes).
 
 *
 
 * @var     {Object}    LANG
 
 * @public
 
 * @static
 
 */
 
Shadowbox.LANG = {
 

	
 
    code:       'es',
 

	
 
    of:         'de',
 

	
 
    loading:    'cargando',
 

	
 
    cancel:     'Cancelar',
 

	
 
    next:       'Siguiente',
 

	
 
    previous:   'Anterior',
 

	
 
    play:       'Reproducir',
 

	
 
    pause:      'Pausa',
 

	
 
    close:      'Cerrar',
 

	
 
    errors:     {
 
        single: 'Debes instalar el plugin <a href="{0}">{1}</a> en el navegador para ver este contenido.',
 
        shared: 'Debes instalar el <a href="{0}">{1}</a> y el <a href="{2}">{3}</a> en el navegador para ver este contenido.',
 
        either: 'Debes instalar o bien el <a href="{0}">{1}</a> o el <a href="{2}">{3}</a> en el navegador para ver este contenido.'
 
    }
 

	
 
};
components/com_morfeoshow/src/lang/shadowbox-fr.js
Show inline comments
 
new file 100644
 
/**
 
 * The French (Français) language file for Shadowbox.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: shadowbox-fr.js 99 2008-05-11 16:22:43Z mjijackson $
 
 */
 

	
 
if(typeof Shadowbox == 'undefined'){
 
    throw 'Unable to load Shadowbox language file, base library not found.';
 
}
 

	
 
/**
 
 * An object containing all textual messages to be used in Shadowbox. These are
 
 * provided so they may be translated into different languages. Alternative
 
 * translations may be found in js/lang/shadowbox-*.js where * is an abbreviation
 
 * of the language name (see
 
 * http://www.gnu.org/software/gettext/manual/gettext.html#Language-Codes).
 
 *
 
 * @var     {Object}    LANG
 
 * @public
 
 * @static
 
 */
 
Shadowbox.LANG = {
 

	
 
    code:       'fr',
 

	
 
    of:         'de',
 

	
 
    loading:    'chargement',
 

	
 
    cancel:     'Annuler',
 

	
 
    next:       'Suivant',
 

	
 
    previous:   'Précédent',
 

	
 
    play:       'Lire',
 

	
 
    pause:      'Pause',
 

	
 
    close:      'Fermer',
 

	
 
    errors:     {
 
        single: 'Vous devez installer le plugin <a href="{0}">{1}</a> pour afficher ce contenu.',
 
        shared: 'Vous devez installer les plugins <a href="{0}">{1}</a> et <a href="{2}">{3}</a> pour afficher ce contenu.',
 
        either: 'Vous devez installer le plugin <a href="{0}">{1}</a> ou <a href="{2}">{3}</a> pour afficher ce contenu.'
 
    }
 

	
 
};
components/com_morfeoshow/src/lang/shadowbox-it.js
Show inline comments
 
new file 100644
 
/**
 
 * The Italian (Italiano) language file for Shadowbox.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: shadowbox-it.js 99 2008-05-11 16:22:43Z mjijackson $
 
 */
 

	
 
if(typeof Shadowbox == 'undefined'){
 
    throw 'Unable to load Shadowbox language file, base library not found.';
 
}
 

	
 
/**
 
 * An object containing all textual messages to be used in Shadowbox. These are
 
 * provided so they may be translated into different languages. Alternative
 
 * translations may be found in js/lang/shadowbox-*.js where * is an abbreviation
 
 * of the language name (see
 
 * http://www.gnu.org/software/gettext/manual/gettext.html#Language-Codes).
 
 *
 
 * @var     {Object}    LANG
 
 * @public
 
 * @static
 
 */
 
Shadowbox.LANG = {
 

	
 
    code:       'it',
 

	
 
    of:         'di',
 

	
 
    loading:    'caricando',
 

	
 
    cancel:     'Cancellare',
 

	
 
    next:       'Prossimo',
 

	
 
    previous:   'Antecedente',
 

	
 
    play:       'Play',
 

	
 
    pause:      'Pausa',
 

	
 
    close:      'Chiudere',
 

	
 
    errors:     {
 
        single: 'È necessario installare il plugin <a href="{0}">{1}</a> per poter vedere questo contenuto.',
 
        shared: 'È necessario installare i plugin <a href="{0}">{1}</a> e <a href="{2}">{3}</a> per poter vedere questo contenuto.',
 
        either: 'È necessario installare o il plugin <a href="{0}">{1}</a> o <a href="{2}">{3}</a> per poter vedere questo contenuto.'
 
    }
 

	
 
};
components/com_morfeoshow/src/lang/shadowbox-nl.js
Show inline comments
 
new file 100644
 
/**
 
 * The Dutch (Nederlands) language file for Shadowbox.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: shadowbox-nl.js 99 2008-05-11 16:22:43Z mjijackson $
 
 */
 

	
 
if(typeof Shadowbox == 'undefined'){
 
    throw 'Unable to load Shadowbox language file, base library not found.';
 
}
 

	
 
/**
 
 * An object containing all textual messages to be used in Shadowbox. These are
 
 * provided so they may be translated into different languages. Alternative
 
 * translations may be found in js/lang/shadowbox-*.js where * is an abbreviation
 
 * of the language name (see
 
 * http://www.gnu.org/software/gettext/manual/gettext.html#Language-Codes).
 
 *
 
 * @var     {Object}    LANG
 
 * @public
 
 * @static
 
 */
 
Shadowbox.LANG = {
 

	
 
    code:       'nl',
 

	
 
    of:         'van',
 

	
 
    loading:    'laden',
 

	
 
    cancel:     'Annuleren',
 

	
 
    next:       'Volgende',
 

	
 
    previous:   'Vorige',
 

	
 
    play:       'Play',
 

	
 
    pause:      'Pause',
 

	
 
    close:      'Sluiten',
 

	
 
    errors:     {
 
        single: 'U moet de <a href="{0}">{1}</a> browser plugin installeren om dit media type te kunnen bekijken.',
 
        shared: 'U moet de <a href="{0}">{1}</a> en de <a href="{2}">{3}</a> browser plugins installeren om dit media type te kunnen bekijken.',
 
        either: 'U moet de <a href="{0}">{1}</a> of de <a href="{2}">{3}</a> browser plugin installeren om dit media type te kunnen bekijken.'
 
    }
 

	
 
};
components/com_morfeoshow/src/lang/shadowbox-pl.js
Show inline comments
 
new file 100644
 
/**
 
 * The Polish (Polski) language file for Shadowbox.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: shadowbox-pl.js 99 2008-05-11 16:22:43Z mjijackson $
 
 */
 

	
 
if(typeof Shadowbox == 'undefined'){
 
    throw 'Unable to load Shadowbox language file, base library not found.';
 
}
 

	
 
/**
 
 * An object containing all textual messages to be used in Shadowbox. These are
 
 * provided so they may be translated into different languages. Alternative
 
 * translations may be found in js/lang/shadowbox-*.js where * is an abbreviation
 
 * of the language name (see
 
 * http://www.gnu.org/software/gettext/manual/gettext.html#Language-Codes).
 
 *
 
 * @var     {Object}    LANG
 
 * @public
 
 * @static
 
 */
 
Shadowbox.LANG = {
 

	
 
    code:       'pl',
 

	
 
    of:         'z',
 

	
 
    loading:    'wczytywanie',
 

	
 
    cancel:     'Anuluj',
 

	
 
    next:       'Dalej',
 

	
 
    previous:   'Wróć',
 

	
 
    play:       'Odtwarzaj',
 

	
 
    pause:      'Pauza',
 

	
 
    close:      'Zamknij',
 

	
 
    errors:     {
 
        single: 'Musisz zainstalować plugin <a href="{0}">{1}</a> aby zobaczyć zawartość',
 
        shared: 'Musisz zainstalować pluginy <a href="{0}">{1}</a> i <a href="{2}">{3}</a> aby zobaczyć zawartość ',
 
        either: 'Musisz zainstalować plugin <a href="{0}">{1}</a> lub <a href="{2}">{3}</a> aby zobaczyć zawartość'
 
    }
 

	
 
};
components/com_morfeoshow/src/lang/shadowbox-pt.js
Show inline comments
 
new file 100644
 
/**
 
 * The Portuguese (Português) language file for Shadowbox.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: shadowbox-pt-PT.js 99 2008-05-11 16:22:43Z mjijackson $
 
 */
 

	
 
if(typeof Shadowbox == 'undefined'){
 
    throw 'Unable to load Shadowbox language file, base library not found.';
 
}
 

	
 
/**
 
 * An object containing all textual messages to be used in Shadowbox. These are
 
 * provided so they may be translated into different languages. Alternative
 
 * translations may be found in js/lang/shadowbox-*.js where * is an abbreviation
 
 * of the language name (see
 
 * http://www.gnu.org/software/gettext/manual/gettext.html#Language-Codes).
 
 *
 
 * @var     {Object}    LANG
 
 * @public
 
 * @static
 
 */
 
Shadowbox.LANG = {
 

	
 
    code:       'pt-PT',
 

	
 
    of:         'de',
 

	
 
    loading:    'A Carregar...',
 

	
 
    cancel:     'Cancelar',
 

	
 
    next:       'Seguinte',
 

	
 
    previous:   'Anterior',
 

	
 
    play:       'Reproduzir',
 

	
 
    pause:      'Pausa',
 

	
 
    close:      'Fechar',
 

	
 
    errors:     {
 
        single: 'É necessário instalar o plugin <a href="{0}">{1}</a> para visualizar este conteúdo.',
 
        shared: 'É necessário instalar os plugins <a href="{0}">{1}</a> e <a href="{2}">{3}</a> para visualizar este conteúdo.',
 
        either: 'É necessário instalar o plugin <a href="{0}">{1}</a> ou o plugin <a href="{2}">{3}</a> para visualizar este conteúdo.'
 
    }
 

	
 
};
components/com_morfeoshow/src/lang/shadowbox-ru.js
Show inline comments
 
new file 100644
 
/**
 
 * The Russian (русский язык) language file for Shadowbox.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: shadowbox-ru.js 99 2008-05-11 16:22:43Z mjijackson $
 
 */
 

	
 
if(typeof Shadowbox == 'undefined'){
 
    throw 'Unable to load Shadowbox language file, base library not found.';
 
}
 

	
 
/**
 
 * An object containing all textual messages to be used in Shadowbox. These are
 
 * provided so they may be translated into different languages. Alternative
 
 * translations may be found in js/lang/shadowbox-*.js where * is an abbreviation
 
 * of the language name (see
 
 * http://www.gnu.org/software/gettext/manual/gettext.html#Language-Codes).
 
 *
 
 * @var     {Object}    LANG
 
 * @public
 
 * @static
 
 */
 
Shadowbox.LANG = {
 

	
 
    code:       'ru',
 

	
 
    of:         'из',
 

	
 
    loading:    'загрузка',
 

	
 
    cancel:     'Отмена',
 

	
 
    next:       'Следующая',
 

	
 
    previous:   'Предыдущая',
 

	
 
    play:       'Пуск',
 

	
 
    pause:      'Пауза',
 

	
 
    close:      'Закрыть',
 

	
 
    errors:     {
 
        single: 'Вы должны установить для браузера плагин <a href="{0}">{1}</a>, чтобы просмотривать этот контент.',
 
        shared: 'Чтобы просмотреть этот контент, вы должны установить и <a href="{0}">{1}</a>, и <a href="{2}">{3}</a>.',
 
        either: 'Вы должны установить или <a href="{0}">{1}</a> плагин, или <a href="{2}">{3}</a>, чтобы просмотреть этот контент.'
 
    }
 

	
 
};
components/com_morfeoshow/src/player/index.html
Show inline comments
 
new file 100644
 
<html>
 
<body bgcolor="#FFFFFF">
 
</body>
 
</html>
 
\ No newline at end of file
components/com_morfeoshow/src/player/shadowbox-img.js
Show inline comments
 
new file 100644
 
/**
 
 * The Shadowbox image player class.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: shadowbox-img.js 103 2008-06-27 06:19:21Z mjijackson $
 
 */
 

	
 
(function(){
 

	
 
    // shorthand
 
    var SB = Shadowbox;
 
    var SL = SB.lib;
 
    var C = SB.getClient();
 

	
 
    /**
 
     * Keeps track of 4 floating values (x, y, start_x, & start_y) that are used
 
     * in the drag calculations.
 
     *
 
     * @property    {Object}        drag
 
     * @private
 
     */
 
    var drag;
 

	
 
    /**
 
     * Holds the draggable element so we don't have to fetch it every time
 
     * the mouse moves.
 
     *
 
     * @property    {HTMLElement}   draggable
 
     * @private
 
     */
 
    var draggable;
 

	
 
    /**
 
     * The id to use for the drag layer.
 
     *
 
     * @property    {String}        drag_id
 
     * @private
 
     */
 
    var drag_id = 'shadowbox_drag_layer';
 

	
 
    /**
 
     * Resource used to preload images. It's class-level so that when a new
 
     * image is requested, the same resource can be reassigned, cancelling
 
     * the original's callback.
 
     *
 
     * @property    {HTMLElement}   preloader
 
     * @private
 
     */
 
    var preloader;
 

	
 
    /**
 
     * Resets the class drag variable.
 
     *
 
     * @return  void
 
     * @private
 
     */
 
    var resetDrag = function(){
 
        drag = {
 
            x:          0,
 
            y:          0,
 
            start_x:    null,
 
            start_y:    null
 
        };
 
    };
 

	
 
    /**
 
     * Toggles the drag function on and off.
 
     *
 
     * @param   {Boolean}   on      True to toggle on, false to toggle off
 
     * @param   {Number}    h       The height of the drag layer
 
     * @param   {Number}    w       The width of the drag layer
 
     * @return  void
 
     * @private
 
     */
 
    var toggleDrag = function(on, h, w){
 
        if(on){
 
            resetDrag();
 
            // add transparent drag layer to prevent browser dragging of actual image
 
            var styles = [
 
                'position:absolute',
 
                'height:' + h + 'px',
 
                'width:' + w + 'px',
 
                'cursor:' + (C.isGecko ? '-moz-grab' : 'move'),
 
                'background-color:' + (C.isIE ? '#fff;filter:alpha(opacity=0)' : 'transparent')
 
            ];
 
            SL.append(SL.get('shadowbox_body_inner'), '<div id="' + drag_id + '" style="' + styles.join(';') + '"></div>');
 
            SL.addEvent(SL.get(drag_id), 'mousedown', listenDrag);
 
        }else{
 
            var d = SL.get(drag_id);
 
            if(d){
 
                SL.removeEvent(d, 'mousedown', listenDrag);
 
                SL.remove(d);
 
            }
 
        }
 
    };
 

	
 
    /**
 
     * Sets up a drag listener on the document. Called when the mouse button is
 
     * pressed (mousedown).
 
     *
 
     * @param   {mixed}     e       The mousedown event
 
     * @return  void
 
     * @private
 
     */
 
    var listenDrag = function(e){
 
        // prevent browser dragging
 
        SL.preventDefault(e);
 

	
 
        var coords = SL.getPageXY(e);
 
        drag.start_x = coords[0];
 
        drag.start_y = coords[1];
 

	
 
        draggable = SL.get('shadowbox_content');
 
        SL.addEvent(document, 'mousemove', positionDrag);
 
        SL.addEvent(document, 'mouseup', unlistenDrag);
 
        if(C.isGecko) SL.setStyle(SL.get(drag_id), 'cursor', '-moz-grabbing');
 
    };
 

	
 
    /**
 
     * Removes the drag listener. Called when the mouse button is released
 
     * (mouseup).
 
     *
 
     * @return  void
 
     * @private
 
     */
 
    var unlistenDrag = function(){
 
        SL.removeEvent(document, 'mousemove', positionDrag);
 
        SL.removeEvent(document, 'mouseup', unlistenDrag); // clean up
 
        if(C.isGecko) SL.setStyle(SL.get(drag_id), 'cursor', '-moz-grab');
 
    };
 

	
 
    /**
 
     * Positions an oversized image on drag.
 
     *
 
     * @param   {mixed}     e       The drag event
 
     * @return  void
 
     * @private
 
     */
 
    var positionDrag = function(e){
 
        var content = SB.getContent();
 
        var dims = SB.getDimensions();
 
        var coords = SL.getPageXY(e);
 

	
 
        var move_x = coords[0] - drag.start_x;
 
        drag.start_x += move_x;
 
        drag.x = Math.max(Math.min(0, drag.x + move_x), dims.inner_w - content.width); // x boundaries
 
        SL.setStyle(draggable, 'left', drag.x + 'px');
 

	
 
        var move_y = coords[1] - drag.start_y;
 
        drag.start_y += move_y;
 
        drag.y = Math.max(Math.min(0, drag.y + move_y), dims.inner_h - content.height); // y boundaries
 
        SL.setStyle(draggable, 'top', drag.y + 'px');
 
    };
 

	
 
    /**
 
     * Constructor. This class is used to display images.
 
     *
 
     * @param   {String}    id      The id to use for this content
 
     * @param   {Object}    obj     The content object
 
     * @public
 
     */
 
    Shadowbox.img = function(id, obj){
 
        this.id = id;
 
        this.obj = obj;
 

	
 
        // images are resizable
 
        this.resizable = true;
 

	
 
        // preload the image
 
        this.ready = false;
 
        var self = this; // needed inside preloader callback
 
        preloader = new Image();
 
        preloader.onload = function(){
 
            // height defaults to image height
 
            self.height = self.obj.height ? parseInt(self.obj.height, 10) : preloader.height;
 

	
 
            // width defaults to image width
 
            self.width = self.obj.width ? parseInt(self.obj.width, 10) : preloader.width;
 

	
 
            // ready to go
 
            self.ready = true;
 

	
 
            // clean up to prevent memory leak in IE
 
            preloader.onload = '';
 
            preloader = null;
 
        };
 
        preloader.src = obj.content;
 
    };
 

	
 
    Shadowbox.img.prototype = {
 

	
 
        /**
 
         * Returns an object containing the markup for this content, suitable
 
         * to pass to Shadowbox.lib.createHTML().
 
         *
 
         * @param   {Object}    dims    The current Shadowbox dimensions
 
         * @return  {Object}            The markup for this content item
 
         * @public
 
         */
 
        markup: function(dims){
 
            return {
 
                tag:    'img',
 
                id:     this.id,
 
                height: dims.resize_h, // use resized dimensions
 
                width:  dims.resize_w,
 
                src:    this.obj.content,
 
                style:  'position:absolute'
 
            };
 
        },
 

	
 
        /**
 
         * An optional callback function to process after this content has been
 
         * loaded.
 
         *
 
         * @return  void
 
         * @public
 
         */
 
        onLoad: function(){
 
            var dims = SB.getDimensions();
 
            if(dims.drag && SB.getOptions().handleOversize == 'drag'){
 
                // listen for drag
 
                // in the case of oversized images, the "resized" height and
 
                // width will actually be the original image height and width
 
                toggleDrag(true, dims.resize_h, dims.resize_w);
 
            }
 
        },
 

	
 
        /**
 
         * Removes this image from the document.
 
         *
 
         * @return  void
 
         * @public
 
         */
 
        remove: function(){
 
            var el = SL.get(this.id);
 
            if(el) SL.remove(el);
 

	
 
            // disable drag layer
 
            toggleDrag(false);
 

	
 
            // prevent old image requests from loading
 
            if(preloader){
 
                preloader.onload = '';
 
                preloader = null;
 
            }
 
        }
 

	
 
    };
 

	
 
})();
components/com_morfeoshow/src/polaroid.swf
Show inline comments
 
new file 100644
 
binary diff not shown
components/com_morfeoshow/src/postcard.swf
Show inline comments
 
new file 100644
 
binary diff not shown
components/com_morfeoshow/src/shadowbox.js
Show inline comments
 
new file 100644
 
/**
 
 * The Shadowbox class.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: shadowbox.js 108 2008-07-11 04:19:01Z mjijackson $
 
 */
 

	
 
if(typeof Shadowbox == 'undefined'){
 
    throw 'Unable to load Shadowbox, no base library adapter found';
 
}
 

	
 
/**
 
 * The Shadowbox class. Used to display different media on a web page using a
 
 * Lightbox-like effect.
 
 *
 
 * Useful resources:
 
 *
 
 * - http://www.alistapart.com/articles/byebyeembed
 
 * - http://www.w3.org/TR/html401/struct/objects.html
 
 * - http://www.dyn-web.com/dhtml/iframes/
 
 * - http://www.apple.com/quicktime/player/specs.html
 
 * - http://www.apple.com/quicktime/tutorials/embed2.html
 
 * - http://www.howtocreate.co.uk/wrongWithIE/?chapter=navigator.plugins
 
 * - http://msdn.microsoft.com/en-us/library/ms532969.aspx
 
 * - http://support.microsoft.com/kb/316992
 
 *
 
 * @class       Shadowbox
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @singleton
 
 */
 
(function(){
 

	
 
    /**
 
     * The current version of Shadowbox.
 
     *
 
     * @var         String
 
     * @private
 
     */
 
    var version = '2.0';
 

	
 
    /**
 
     * Contains the default options for Shadowbox.
 
     *
 
     * @var         Object
 
     * @private
 
     */
 
    var options = {
 

	
 
        /**
 
         * Enable all animations besides fades.
 
         *
 
         * @var     Boolean
 
         */
 
        animate:            true,
 

	
 
        /**
 
         * Enable fade animations.
 
         *
 
         * @var     Boolean
 
         */
 
        animateFade:        true,
 

	
 
        /**
 
         * Specifies the sequence of the height and width animations. May be
 
         * 'wh' (width then height), 'hw' (height then width), or 'sync' (both
 
         * at the same time). Of course this will only work if animate is true.
 
         *
 
         * @var     String
 
         */
 
        animSequence:       'wh',
 

	
 
        /**
 
         * The path to flvplayer.swf.
 
         *
 
         * @var     String
 
         */
 
        flvPlayer:          'flvplayer.swf',
 

	
 
        /**
 
         * Listen to the overlay for clicks. If the user clicks the overlay,
 
         * it will trigger Shadowbox.close().
 
         *
 
         * @var     Boolean
 
         */
 
        modal:              false,
 

	
 
        /**
 
         * The color to use for the modal overlay (in hex).
 
         *
 
         * @var     String
 
         */
 
        overlayColor:       '#000',
 

	
 
        /**
 
         * The opacity to use for the modal overlay.
 
         *
 
         * @var     Number
 
         */
 
        overlayOpacity:     0.8,
 

	
 
        /**
 
         * The default background color to use for Flash movies (in hex).
 
         *
 
         * @var     String
 
         */
 
        flashBgColor:       '#000000',
 

	
 
        /**
 
         * Automatically play movies.
 
         *
 
         * @var     Boolean
 
         */
 
        autoplayMovies:     true,
 

	
 
        /**
 
         * Enable movie controllers on movie players.
 
         *
 
         * @var     Boolean
 
         */
 
        showMovieControls:  true,
 

	
 
        /**
 
         * A delay (in seconds) to use for slideshows. If set to anything other
 
         * than 0, this value determines an interval at which Shadowbox will
 
         * automatically proceed to the next piece in the gallery.
 
         *
 
         * @var     Number
 
         */
 
        slideshowDelay:     0,
 

	
 
        /**
 
         * The duration of the resizing animations (in seconds).
 
         *
 
         * @var     Number
 
         */
 
        resizeDuration:     0.55,
 

	
 
        /**
 
         * The duration of the fading animations (in seconds).
 
         *
 
         * @var     Number
 
         */
 
        fadeDuration:       0.35,
 

	
 
        /**
 
         * Show the navigation controls.
 
         *
 
         * @var     Boolean
 
         */
 
        displayNav:         true,
 

	
 
        /**
 
         * Enable continuous galleries. When this is true, users will be able
 
         * to skip to the first gallery image from the last using next and vice
 
         * versa.
 
         *
 
         * @var     Boolean
 
         */
 
        continuous:         false,
 

	
 
        /**
 
         * Display the gallery counter.
 
         *
 
         * @var     Boolean
 
         */
 
        displayCounter:     true,
 

	
 
        /**
 
         * This option may be either 'default' or 'skip'. The default counter is
 
         * a simple '1 of 5' message. The skip counter displays a link for each
 
         * piece in the gallery that enables a user to skip directly to any
 
         * piece.
 
         *
 
         * @var     String
 
         */
 
        counterType:        'default',
 

	
 
        /**
 
         * Limits the number of counter links that will be displayed in a "skip"
 
         * style counter. If the actual number of gallery elements is greater
 
         * than this value, the counter will be restrained to the elements
 
         * immediately preceeding and following the current element.
 
         *
 
         * @var     Number
 
         */
 
        counterLimit:       10,
 

	
 
        /**
 
         * The amount of padding to maintain around the viewport edge (in
 
         * pixels). This only applies when the image is very large and takes up
 
         * the entire viewport.
 
         *
 
         * @var     Number
 
         */
 
        viewportPadding:    20,
 

	
 
        /**
 
         * How to handle content that is too large to display in its entirety
 
         * (and is resizable). A value of 'resize' will resize the content while
 
         * preserving aspect ratio and display it at the smaller resolution. If
 
         * the content is an image, a value of 'drag' will display the image at
 
         * its original resolution but it will be draggable within Shadowbox. A
 
         * value of 'none' will display the content at its original resolution
 
         * but it may be cropped.
 
         *
 
         * @var     String
 
         */
 
        handleOversize:     'resize',
 

	
 
        /**
 
         * An exception handling function that will be called whenever
 
         * Shadowbox should throw an exception. Will be passed the error
 
         * message as its first argument.
 
         *
 
         * @var     Function
 
         */
 
        handleException:    null,
 

	
 
        /**
 
         * The mode to use when handling unsupported media. May be either
 
         * 'remove' or 'link'. If it is 'remove', the unsupported gallery item
 
         * will merely be removed from the gallery. If it is the only item in
 
         * the gallery, the link will simply be followed. If it is 'link', a
 
         * link will be provided to the appropriate plugin page in place of the
 
         * gallery element.
 
         *
 
         * @var     String
 
         */
 
        handleUnsupported:  'link',
 

	
 
        /**
 
         * The initial height of Shadowbox (in pixels).
 
         *
 
         * @var     Number
 
         */
 
        initialHeight:      160,
 

	
 
        /**
 
         * The initial width of Shadowbox (in pixels).
 
         *
 
         * @var     Number
 
         */
 
        initialWidth:       320,
 

	
 
        /**
 
         * Enable keyboard control.
 
         *
 
         * @var     Boolean
 
         */
 
        enableKeys:         true,
 

	
 
        /**
 
         * A hook function to be fired when Shadowbox opens. The single argument
 
         * will be the current gallery element.
 
         *
 
         * @var     Function
 
         */
 
        onOpen:             null,
 

	
 
        /**
 
         * A hook function to be fired when Shadowbox finishes loading its
 
         * content. The single argument will be the current gallery element on
 
         * display.
 
         *
 
         * @var     Function
 
         */
 
        onFinish:           null,
 

	
 
        /**
 
         * A hook function to be fired when Shadowbox changes from one gallery
 
         * element to the next. The single argument will be the current gallery
 
         * element that is about to be displayed.
 
         *
 
         * @var     Function
 
         */
 
        onChange:           null,
 

	
 
        /**
 
         * A hook function that will be fired when Shadowbox closes. The single
 
         * argument will be the gallery element most recently displayed.
 
         *
 
         * @var     Function
 
         */
 
        onClose:            null,
 

	
 
        /**
 
         * Skips calling Shadowbox.setup() in init(). This means that it must
 
         * be called later manually.
 
         *
 
         * @var     Boolean
 
         */
 
        skipSetup:          false,
 

	
 
        /**
 
         * An object containing names of plugins and links to their respective
 
         * download pages.
 
         *
 
         * @var     Object
 
         */
 
        errors:         {
 

	
 
            fla:        {
 
                name:   'Flash',
 
                url:    'http://www.adobe.com/products/flashplayer/'
 
            },
 

	
 
            qt:         {
 
                name:   'QuickTime',
 
                url:    'http://www.apple.com/quicktime/download/'
 
            },
 

	
 
            wmp:        {
 
                name:   'Windows Media Player',
 
                url:    'http://www.microsoft.com/windows/windowsmedia/'
 
            },
 

	
 
            f4m:        {
 
                name:   'Flip4Mac',
 
                url:    'http://www.flip4mac.com/wmv_download.htm'
 
            }
 

	
 
        },
 

	
 
        /**
 
         * A map of players to the file extensions they support. Each member of
 
         * this object is the name of a player (with one exception), whose value
 
         * is an array of file extensions that player will "play". The one
 
         * exception to this rule is the "qtwmp" member, which contains extensions
 
         * that may be played using either QuickTime or Windows Media Player.
 
         *
 
         * - img: Image file extensions
 
         * - swf: Flash SWF file extensions
 
         * - flv: Flash video file extensions (will be played by JW FLV player)
 
         * - qt: Movie file extensions supported by QuickTime
 
         * - wmp: Movie file extensions supported by Windows Media Player
 
         * - qtwmp: Movie file extensions supported by both QuickTime and Windows Media Player
 
         * - iframe: File extensions that will be display in an iframe
 
         *
 
         * IMPORTANT: If this object is to be modified, it must be copied in its
 
         * entirety and tweaked because it is not merged recursively with the
 
         * default. Also, any modifications must be passed into Shadowbox.init
 
         * for speed reasons.
 
         *
 
         * @var     Object      ext
 
         */
 
        ext:     {
 
            img:        ['png', 'jpg', 'jpeg', 'gif', 'bmp'],
 
            swf:        ['swf'],
 
            flv:        ['flv'],
 
            qt:         ['dv', 'mov', 'moov', 'movie', 'mp4'],
 
            wmp:        ['asf', 'wm', 'wmv'],
 
            qtwmp:      ['avi', 'mpg', 'mpeg'],
 
            iframe:     ['asp', 'aspx', 'cgi', 'cfm', 'htm', 'html', 'pl', 'php',
 
                        'php3', 'php4', 'php5', 'phtml', 'rb', 'rhtml', 'shtml',
 
                        'txt', 'vbs']
 
        }
 

	
 
    };
 

	
 
    // shorthand
 
    var SB = Shadowbox;
 
    var SL = SB.lib;
 

	
 
    /**
 
     * Stores the default set of options in case a custom set of options is used
 
     * on a link-by-link basis so we can restore them later.
 
     *
 
     * @var         Object
 
     * @private
 
     */
 
    var default_options;
 

	
 
    /**
 
     * An object containing some regular expressions we'll need later. Compiled
 
     * up front for speed.
 
     *
 
     * @var         Object
 
     * @private
 
     */
 
    var RE = {
 
        domain:         /:\/\/(.*?)[:\/]/, // domain prefix
 
        inline:         /#(.+)$/, // inline element id
 
        rel:            /^(light|shadow)box/i, // rel attribute format
 
        gallery:        /^(light|shadow)box\[(.*?)\]/i, // rel attribute format for gallery link
 
        unsupported:    /^unsupported-(\w+)/, // unsupported media type
 
        param:          /\s*([a-z_]*?)\s*=\s*(.+)\s*/, // rel string parameter
 
        empty:          /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i // elements that don't have children
 
    };
 

	
 
    /**
 
     * A cache of options for links that have been set up for use with
 
     * Shadowbox.
 
     *
 
     * @var         Array
 
     * @private
 
     */
 
    var cache = [];
 

	
 
    /**
 
     * An array containing the gallery objects currently being viewed. In the
 
     * case of non-gallery items, this will only hold one object.
 
     *
 
     * @var         Array
 
     * @private
 
     */
 
    var gallery;
 

	
 
    /**
 
     * The array index of the current gallery that is currently being viewed.
 
     *
 
     * @var         Number
 
     * @private
 
     */
 
    var current;
 

	
 
    /**
 
     * The current content object.
 
     *
 
     * @var         Object
 
     * @private
 
     */
 
    var content;
 

	
 
    /**
 
     * The id to use for content objects.
 
     *
 
     * @var         String
 
     * @private
 
     */
 
    var content_id = 'shadowbox_content';
 

	
 
    /**
 
     * Holds the current dimensions of Shadowbox as calculated by
 
     * setDimensions(). Contains the following properties:
 
     *
 
     * - height: The total height of #shadowbox
 
     * - width: The total width of #shadowbox
 
     * - inner_h: The height of #shadowbox_body
 
     * - inner_w: The width of #shadowbox_body
 
     * - top: The top to use for #shadowbox
 
     * - resize_h: The height to use for resizable content
 
     * - resize_w: The width to use for resizable content
 
     * - drag: True if dragging should be enabled (oversized image)
 
     *
 
     * @var         Object
 
     * @private
 
     */
 
    var dims;
 

	
 
    /**
 
     * Keeps track of whether or not Shadowbox has been initialized. We never
 
     * want to initialize twice.
 
     *
 
     * @var         Boolean
 
     * @private
 
     */
 
    var initialized = false;
 

	
 
    /**
 
     * Keeps track of whether or not Shadowbox is activated.
 
     *
 
     * @var         Boolean
 
     * @private
 
     */
 
    var activated = false;
 

	
 
    /**
 
     * The timeout id for the slideshow transition function.
 
     *
 
     * @var         Number
 
     * @private
 
     */
 
    var slide_timer;
 

	
 
    /**
 
     * Keeps track of the time at which the current slideshow frame was
 
     * displayed.
 
     *
 
     * @var         Number
 
     * @private
 
     */
 
    var slide_start;
 

	
 
    /**
 
     * The delay on which the next slide will display.
 
     *
 
     * @var         Number
 
     * @private
 
     */
 
    var slide_delay = 0;
 

	
 
    /**
 
     * These parameters for simple browser detection. Adapted from Ext.js.
 
     *
 
     * @var         Object
 
     * @private
 
     */
 
    var ua = navigator.userAgent.toLowerCase();
 
    var client = {
 
        isStrict:   document.compatMode == 'CSS1Compat',
 
        isOpera:    ua.indexOf('opera') > -1,
 
        isIE:       ua.indexOf('msie') > -1,
 
        isIE7:      ua.indexOf('msie 7') > -1,
 
        isSafari:   /webkit|khtml/.test(ua),
 
        isWindows:  ua.indexOf('windows') != -1 || ua.indexOf('win32') != -1,
 
        isMac:      ua.indexOf('macintosh') != -1 || ua.indexOf('mac os x') != -1,
 
        isLinux:    ua.indexOf('linux') != -1
 
    };
 
    client.isBorderBox = client.isIE && !client.isStrict;
 
    client.isSafari3 = client.isSafari && !!(document.evaluate);
 
    client.isGecko = ua.indexOf('gecko') != -1 && !client.isSafari;
 

	
 
    /**
 
     * You're not sill using IE6 are you?
 
     *
 
     * @var         Boolean
 
     * @private
 
     */
 
    var ltIE7 = client.isIE && !client.isIE7;
 

	
 
    /**
 
     * Contains plugin support information. Each property of this object is a
 
     * boolean indicating whether that plugin is supported.
 
     *
 
     * - fla: Flash player
 
     * - qt: QuickTime player
 
     * - wmp: Windows Media player
 
     * - f4m: Flip4Mac plugin
 
     *
 
     * @var         Object
 
     * @private
 
     */
 
    var plugins;
 

	
 
    // detect plugin support
 
    if(navigator.plugins && navigator.plugins.length){
 
        var detectPlugin = function(plugin_name){
 
            var detected = false;
 
            for (var i = 0, len = navigator.plugins.length; i < len; ++i){
 
                if(navigator.plugins[i].name.indexOf(plugin_name) > -1){
 
                    detected = true;
 
                    break;
 
                }
 
            }
 
            return detected;
 
        };
 
        var f4m = detectPlugin('Flip4Mac');
 
        plugins = {
 
            fla:    detectPlugin('Shockwave Flash'),
 
            qt:     detectPlugin('QuickTime'),
 
            wmp:    !f4m && detectPlugin('Windows Media'), // if it's Flip4Mac, it's not really WMP
 
            f4m:    f4m
 
        };
 
    }else{
 
        var detectPlugin = function(plugin_name){
 
            var detected = false;
 
            try{
 
                var axo = new ActiveXObject(plugin_name);
 
                if(axo) detected = true;
 
            }catch(e){}
 
            return detected;
 
        };
 
        plugins = {
 
            fla:    detectPlugin('ShockwaveFlash.ShockwaveFlash'),
 
            qt:     detectPlugin('QuickTime.QuickTime'),
 
            wmp:    detectPlugin('wmplayer.ocx'),
 
            f4m:    false
 
        };
 
    }
 

	
 
    /**
 
     * Applies all properties of e to o.
 
     *
 
     * @param   Object      o       The original object
 
     * @param   Object      e       The extension object
 
     * @return  Object              The original object with all properties
 
     *                              of the extension object applied
 
     * @private
 
     */
 
    var apply = function(o, e){
 
        for(var p in e) o[p] = e[p];
 
        return o;
 
    };
 

	
 
    /**
 
     * Determines if the given object is an anchor/area element.
 
     *
 
     * @param   mixed       el      The object to check
 
     * @return  Boolean             True if the object is a link element
 
     * @private
 
     */
 
    var isLink = function(el){
 
        return el && typeof el.tagName == 'string' && (el.tagName.toUpperCase() == 'A' || el.tagName.toUpperCase() == 'AREA');
 
    };
 

	
 
    /**
 
     * Gets the height of the viewport in pixels. Note: This function includes
 
     * scrollbars in Safari 3.
 
     *
 
     * @return  Number          The height of the viewport
 
     * @public
 
     * @static
 
     */
 
    SL.getViewportHeight = function(){
 
        var h = window.innerHeight; // Safari
 
        var mode = document.compatMode;
 
        if((mode || client.isIE) && !client.isOpera){
 
            h = client.isStrict ? document.documentElement.clientHeight : document.body.clientHeight;
 
        }
 
        return h;
 
    };
 

	
 
    /**
 
     * Gets the width of the viewport in pixels. Note: This function includes
 
     * scrollbars in Safari 3.
 
     *
 
     * @return  Number          The width of the viewport
 
     * @public
 
     * @static
 
     */
 
    SL.getViewportWidth = function(){
 
        var w = window.innerWidth; // Safari
 
        var mode = document.compatMode;
 
        if(mode || client.isIE){
 
            w = client.isStrict ? document.documentElement.clientWidth : document.body.clientWidth;
 
        }
 
        return w;
 
    };
 

	
 
    /**
 
     * Creates an HTML string from an object representing HTML elements. Based
 
     * on Ext.DomHelper's createHtml.
 
     *
 
     * @param   Object      obj     The HTML definition object
 
     * @return  String              An HTML string
 
     * @public
 
     * @static
 
     */
 
    SL.createHTML = function(obj){
 
        var html = '<' + obj.tag;
 
        for(var attr in obj){
 
            if(attr == 'tag' || attr == 'html' || attr == 'children') continue;
 
            if(attr == 'cls'){
 
                html += ' class="' + obj['cls'] + '"';
 
            }else{
 
                html += ' ' + attr + '="' + obj[attr] + '"';
 
            }
 
        }
 
        if(RE.empty.test(obj.tag)){
 
            html += '/>';
 
        }else{
 
            html += '>';
 
            var cn = obj.children;
 
            if(cn){
 
                for(var i = 0, len = cn.length; i < len; ++i){
 
                    html += this.createHTML(cn[i]);
 
                }
 
            }
 
            if(obj.html) html += obj.html;
 
            html += '</' + obj.tag + '>';
 
        }
 
        return html;
 
    };
 

	
 
    /**
 
     * Easing function used for animations. Based on a cubic polynomial.
 
     *
 
     * @param   Number      x       The state of the animation (% complete)
 
     * @return  Number              The adjusted easing value
 
     * @private
 
     * @static
 
     */
 
    var ease = function(x){
 
        return 1 + Math.pow(x - 1, 3);
 
    };
 

	
 
    /**
 
     * Animates any numeric (not color) style of the given element from its
 
     * current state to the given value. Defaults to using pixel-based
 
     * measurements.
 
     *
 
     * @param   HTMLElement     el      The DOM element to animate
 
     * @param   String          p       The property to animate (in camelCase)
 
     * @param   mixed           to      The value to animate to
 
     * @param   Number          d       The duration of the animation (in
 
     *                                  seconds)
 
     * @param   Function        cb      A callback function to call when the
 
     *                                  animation completes
 
     * @return  void
 
     * @private
 
     * @static
 
     */
 
    var animate = function(el, p, to, d, cb){
 
        var from = parseFloat(SL.getStyle(el, p));
 
        if(isNaN(from)) from = 0;
 

	
 
        if(from == to){
 
            if(typeof cb == 'function') cb();
 
            return; // nothing to animate
 
        }
 

	
 
        var delta = to - from;
 
        var op = p == 'opacity';
 
        var unit = op ? '' : 'px'; // default unit is px
 
        var fn = function(ease){
 
            SL.setStyle(el, p, from + ease * delta + unit);
 
        };
 

	
 
        // cancel the animation here if set in the options
 
        if(!options.animate && !op || op && !options.animateFade){
 
            fn(1);
 
            if(typeof cb == 'function') cb();
 
            return;
 
        }
 

	
 
        d *= 1000; // convert to milliseconds
 
        var begin = new Date().getTime();
 
        var end = begin + d;
 

	
 
        var timer = setInterval(function(){
 
            var time = new Date().getTime();
 
            if(time >= end){ // end of animation
 
                clearInterval(timer);
 
                fn(1);
 
                if(typeof cb == 'function') cb();
 
            }else{
 
                fn(ease((time - begin) / d));
 
            }
 
        }, 10); // 10 ms interval is minimum on WebKit
 
    };
 

	
 
    /**
 
     * A utility function used by the fade functions to clear the opacity
 
     * style setting of the given element. Required in some cases for IE.
 
     *
 
     * @param   HTMLElement     el      The DOM element
 
     * @return  void
 
     * @private
 
     */
 
    var clearOpacity = function(el){
 
        var s = el.style;
 
        if(client.isIE){
 
            if(typeof s.filter == 'string' && (/alpha/i).test(s.filter)){
 
                // careful not to overwrite other filters!
 
                s.filter = s.filter.replace(/[\w\.]*alpha\(.*?\);?/i, '');
 
            }
 
        }else{
 
            s.opacity = '';
 
            s['-moz-opacity'] = '';
 
            s['-khtml-opacity'] = '';
 
        }
 
    };
 

	
 
    /**
 
     * Gets the computed height of the given element, including padding and
 
     * borders.
 
     *
 
     * @param   HTMLElement     el  The element
 
     * @return  Number              The computed height of the element
 
     * @private
 
     */
 
    var getComputedHeight = function(el){
 
        var h = Math.max(el.offsetHeight, el.clientHeight);
 
        if(!h){
 
            h = parseInt(SL.getStyle(el, 'height'), 10) || 0;
 
            if(!client.isBorderBox){
 
                h += parseInt(SL.getStyle(el, 'padding-top'), 10)
 
                    + parseInt(SL.getStyle(el, 'padding-bottom'), 10)
 
                    + parseInt(SL.getStyle(el, 'border-top-width'), 10)
 
                    + parseInt(SL.getStyle(el, 'border-bottom-width'), 10);
 
            }
 
        }
 
        return h;
 
    };
 

	
 
    /**
 
     * Determines the player needed to display the file at the given URL. If
 
     * the file type is not supported, the return value will be 'unsupported'.
 
     * If the file type is not supported but the correct player can be
 
     * determined, the return value will be 'unsupported-*' where * will be the
 
     * player abbreviation (e.g. 'qt' = QuickTime).
 
     *
 
     * @param   String          url     The url of the file
 
     * @return  String                  The name of the player to use
 
     * @private
 
     */
 
    var getPlayer = function(url){
 
        var m = url.match(RE.domain);
 
        var d = m && document.domain == m[1]; // same domain
 
        if(url.indexOf('#') > -1 && d) return 'inline';
 
        var q = url.indexOf('?');
 
        if(q > -1) url = url.substring(0, q); // strip query string for player detection purposes
 
        if(RE.img.test(url)) return 'img';
 
        if(RE.swf.test(url)) return plugins.fla ? 'swf' : 'unsupported-swf';
 
        if(RE.flv.test(url)) return plugins.fla ? 'flv' : 'unsupported-flv';
 
        if(RE.qt.test(url)) return plugins.qt ? 'qt' : 'unsupported-qt';
 
        if(RE.wmp.test(url)){
 
            if(plugins.wmp) return 'wmp';
 
            if(plugins.f4m) return 'qt';
 
            if(client.isMac) return plugins.qt ? 'unsupported-f4m' : 'unsupported-qtf4m';
 
            return 'unsupported-wmp';
 
        }else if(RE.qtwmp.test(url)){
 
            if(plugins.qt) return 'qt';
 
            if(plugins.wmp) return 'wmp';
 
            return client.isMac ? 'unsupported-qt' : 'unsupported-qtwmp';
 
        }else if(!d || RE.iframe.test(url)){
 
            return 'iframe';
 
        }
 
        return 'unsupported'; // same domain, not supported
 
    };
 

	
 
    /**
 
     * Handles all clicks on links that have been set up to work with Shadowbox
 
     * and cancels the default event behavior when appropriate.
 
     *
 
     * @param   {Event}         ev          The click event object
 
     * @return  void
 
     * @private
 
     */
 
    var handleClick = function(ev){
 
        // get anchor/area element
 
        var link;
 
        if(isLink(this)){
 
            link = this; // jQuery, Prototype, YUI
 
        }else{
 
            link = SL.getTarget(ev); // Ext, standalone
 
            while(!isLink(link) && link.parentNode){
 
                link = link.parentNode;
 
            }
 
        }
 

	
 
        //SL.preventDefault(ev); // good for debugging
 

	
 
        if(link){
 
            SB.open(link);
 
            if(gallery.length) SL.preventDefault(ev); // stop event
 
        }
 
    };
 

	
 
    /**
 
     * Toggles the display of the nav control with the given id on and off.
 
     *
 
     * @param   String      id      The id of the navigation control
 
     * @param   Boolean     on      True to toggle on, false to toggle off
 
     * @return  void
 
     * @private
 
     */
 
    var toggleNav = function(id, on){
 
        var el = SL.get('shadowbox_nav_' + id);
 
        if(el) el.style.display = on ? '' : 'none';
 
    };
 

	
 
    /**
 
     * Builds the content for the title and information bars.
 
     *
 
     * @param   Function    cb      A callback function to execute after the
 
     *                              bars are built
 
     * @return  void
 
     * @private
 
     */
 
    var buildBars = function(cb){
 
        var obj = gallery[current];
 
        var title_i = SL.get('shadowbox_title_inner');
 

	
 
        // build the title
 
        title_i.innerHTML = obj.title || '';
 

	
 
        // build the nav
 
        var nav = SL.get('shadowbox_nav');
 
        if(nav){
 
            var c, n, pl, pa, p;
 

	
 
            // need to build the nav?
 
            if(options.displayNav){
 
                c = true;
 
                // next & previous links
 
                var len = gallery.length;
 
                if(len > 1){
 
                    if(options.continuous){
 
                        n = p = true; // show both
 
                    }else{
 
                        n = (len - 1) > current; // not last in gallery, show next
 
                        p = current > 0; // not first in gallery, show previous
 
                    }
 
                }
 
                // in a slideshow?
 
                if(options.slideshowDelay > 0 && hasNext()){
 
                    pa = slide_timer != 'paused';
 
                    pl = !pa;
 
                }
 
            }else{
 
                c = n = pl = pa = p = false;
 
            }
 

	
 
            toggleNav('close', c);
 
            toggleNav('next', n);
 
            toggleNav('play', pl);
 
            toggleNav('pause', pa);
 
            toggleNav('previous', p);
 
        }
 

	
 
        // build the counter
 
        var counter = SL.get('shadowbox_counter');
 
        if(counter){
 
            var co = '';
 

	
 
            // need to build the counter?
 
            if(options.displayCounter && gallery.length > 1){
 
                if(options.counterType == 'skip'){
 
                    // limit the counter?
 
                    var i = 0, len = gallery.length, end = len;
 
                    var limit = parseInt(options.counterLimit);
 
                    if(limit < len){ // support large galleries
 
                        var h = Math.round(limit / 2);
 
                        i = current - h;
 
                        if(i < 0) i += len;
 
                        end = current + (limit - h);
 
                        if(end > len) end -= len;
 
                    }
 
                    while(i != end){
 
                        if(i == len) i = 0;
 
                        co += '<a onclick="Shadowbox.change(' + i + ');"';
 
                        if(i == current) co += ' class="shadowbox_counter_current"';
 
                        co += '>' + (++i) + '</a>';
 
                    }
 
                }else{ // default
 
                    co = (current + 1) + ' ' + SB.LANG.of + ' ' + len;
 
                }
 
            }
 

	
 
            counter.innerHTML = co;
 
        }
 

	
 
        cb();
 
    };
 

	
 
    /**
 
     * Hides the title and info bars.
 
     *
 
     * @param   Boolean     anim    True to animate the transition
 
     * @param   Function    cb      A callback function to execute after the
 
     *                              animation completes
 
     * @return  void
 
     * @private
 
     */
 
    var hideBars = function(anim, cb){
 
        var obj = gallery[current];
 
        var title = SL.get('shadowbox_title');
 
        var info = SL.get('shadowbox_info');
 
        var title_i = SL.get('shadowbox_title_inner');
 
        var info_i = SL.get('shadowbox_info_inner');
 

	
 
        // build bars after they are hidden
 
        var fn = function(){
 
            buildBars(cb);
 
        };
 

	
 
        var title_h = getComputedHeight(title);
 
        var info_h = getComputedHeight(info) * -1;
 
        if(anim){
 
            // animate the transition
 
            animate(title_i, 'margin-top', title_h, 0.35);
 
            animate(info_i, 'margin-top', info_h, 0.35, fn);
 
        }else{
 
            SL.setStyle(title_i, 'margin-top', title_h + 'px');
 
            SL.setStyle(info_i, 'margin-top', info_h + 'px');
 
            fn();
 
        }
 
    };
 

	
 
    /**
 
     * Shows the title and info bars.
 
     *
 
     * @param   Function    cb      A callback function to execute after the
 
     *                              animation completes
 
     * @return  void
 
     * @private
 
     */
 
    var showBars = function(cb){
 
        var title_i = SL.get('shadowbox_title_inner');
 
        var info_i = SL.get('shadowbox_info_inner');
 
        var t = title_i.innerHTML != ''; // is there a title to display?
 

	
 
        if(t) animate(title_i, 'margin-top', 0, 0.35);
 
        animate(info_i, 'margin-top', 0, 0.35, cb);
 
    };
 

	
 
    /**
 
     * Loads the Shadowbox with the current piece.
 
     *
 
     * @return  void
 
     * @private
 
     */
 
    var loadContent = function(){
 
        var obj = gallery[current];
 
        if(!obj) return; // invalid
 

	
 
        var changing = false;
 
        if(content){
 
            content.remove(); // remove old content first
 
            changing = true; // changing from some previous content
 
        }
 

	
 
        // determine player, inline is really just HTML
 
        var p = obj.player == 'inline' ? 'html' : obj.player;
 

	
 
        // make sure player is loaded
 
        if(typeof SB[p] != 'function'){
 
            SB.raise('Unknown player ' + obj.player);
 
        }
 
        content = new SB[p](content_id, obj); // instantiate new content object
 

	
 
        listenKeys(false); // disable the keyboard temporarily
 
        toggleLoading(true);
 

	
 
        hideBars(changing, function(){ // if changing, animate the bars transition
 
            if(!content) return;
 

	
 
            // if opening, clear #shadowbox display
 
            if(!changing){
 
                 SL.get('shadowbox').style.display = '';
 
            }
 

	
 
            var fn = function(){
 
                resizeContent(function(){
 
                    if(!content) return;
 

	
 

	
 
                    showBars(function(){
 
                        if(!content) return;
 

	
 
                        // append content just before hiding the loading layer
 
                        SL.get('shadowbox_body_inner').innerHTML = SL.createHTML(content.markup(dims));
 

	
 
                        toggleLoading(false, function(){
 
                            if(!content) return;
 

	
 
                            if(typeof content.onLoad == 'function'){
 
                                content.onLoad(); // call onLoad callback if present
 
                            }
 
                            if(options.onFinish && typeof options.onFinish == 'function'){
 
                                options.onFinish(gallery[current]); // fire onFinish handler
 
                            }
 
                            if(slide_timer != 'paused'){
 
                                SB.play(); // kick off next slide
 
                            }
 
                            listenKeys(true); // re-enable the keyboard
 
                        });
 
                    });
 
                });
 
            };
 

	
 
            if(typeof content.ready != 'undefined'){ // does the object have a ready property?
 
                var id = setInterval(function(){ // if so, wait for the object to be ready
 
                    if(content){
 
                        if(content.ready){
 
                            clearInterval(id); // clean up
 
                            id = null;
 
                            fn();
 
                        }
 
                    }else{ // content has been removed
 
                        clearInterval(id);
 
                        id = null;
 
                    }
 
                }, 100);
 
            }else{
 
                fn();
 
            }
 
        });
 

	
 
        // preload neighboring gallery images
 
        if(gallery.length > 1){
 
            var next = gallery[current + 1] || gallery[0];
 
            if(next.player == 'img'){
 
                var a = new Image();
 
                a.src = next.content;
 
            }
 
            var prev = gallery[current - 1] || gallery[gallery.length - 1];
 
            if(prev.player == 'img'){
 
                var b = new Image();
 
                b.src = prev.content;
 
            }
 
        }
 
    };
 

	
 
    /**
 
     * Calculates the dimensions for Shadowbox, taking into account the borders
 
     * and surrounding elements of the shadowbox_body. If the height/width
 
     * combination is too large for Shadowbox and handleOversize option is set
 
     * to 'resize', the resized dimensions will be returned (preserving the
 
     * original aspect ratio). Otherwise, the originally calculated dimensions
 
     * will be used. Stores all dimensions in the private dims variable.
 
     *
 
     * @param   Number      height      The content player height
 
     * @param   Number      width       The content player width
 
     * @param   Boolean     resizable   True if the content is able to be
 
     *                                  resized. Defaults to false.
 
     * @return  void
 
     * @private
 
     */
 
    var setDimensions = function(height, width, resizable){
 
        resizable = resizable || false;
 

	
 
        var sb = SL.get('shadowbox_body');
 
        var h = height = parseInt(height);
 
        var w = width = parseInt(width);
 
        var view_h = SL.getViewportHeight();
 
        var view_w = SL.getViewportWidth();
 

	
 
        // calculate the max width
 
        var border_w = parseInt(SL.getStyle(sb, 'border-left-width'), 10)
 
            + parseInt(SL.getStyle(sb, 'border-right-width'), 10);
 
        var extra_w = border_w + 2 * options.viewportPadding;
 
        if(w + extra_w >= view_w){
 
            w = view_w - extra_w;
 
        }
 

	
 
        // calculate the max height
 
        var border_h = parseInt(SL.getStyle(sb, 'border-top-width'), 10)
 
            + parseInt(SL.getStyle(sb, 'border-bottom-width'), 10);
 
        var bar_h = getComputedHeight(SL.get('shadowbox_title'))
 
            + getComputedHeight(SL.get('shadowbox_info'));
 
        var extra_h = border_h + 2 * options.viewportPadding + bar_h;
 
        if(h + extra_h >= view_h){
 
            h = view_h - extra_h;
 
        }
 

	
 
        // handle oversized content
 
        var drag = false;
 
        var resize_h = height;
 
        var resize_w = width;
 
        var handle = options.handleOversize;
 
        if(resizable && (handle == 'resize' || handle == 'drag')){
 
            var change_h = (height - h) / height;
 
            var change_w = (width - w) / width;
 
            if(handle == 'resize'){
 
                if(change_h > change_w){
 
                    w = Math.round((width / height) * h);
 
                }else if(change_w > change_h){
 
                    h = Math.round((height / width) * w);
 
                }
 
                // adjust resized height or width accordingly
 
                resize_w = w;
 
                resize_h = h;
 
            }else{
 
                // drag on oversized images only
 
                var link = gallery[current];
 
                if(link) drag = link.player == 'img' && (change_h > 0 || change_w > 0);
 
            }
 
        }
 

	
 
        // update dims
 
        dims = {
 
            height:     h + border_h + bar_h,
 
            width:      w + border_w,
 
            inner_h:    h,
 
            inner_w:    w,
 
            top:        (view_h - (h + extra_h)) / 2 + options.viewportPadding,
 
            resize_h:   resize_h,
 
            resize_w:   resize_w,
 
            drag:       drag
 
        };
 
    };
 

	
 
    /**
 
     * Resizes Shadowbox to the given height and width. If the callback
 
     * parameter is given, the transition will be animated and the callback
 
     * function will be called when the animation completes. Note: The private
 
     * content variable must be updated before calling this function.
 
     *
 
     * @param   Function    cb      A callback function to execute after the
 
     *                              content has been resized
 
     * @return  void
 
     * @private
 
     */
 
    var resizeContent = function(cb){
 
        if(!content) return; // no content
 

	
 
        // set new dimensions
 
        setDimensions(content.height, content.width, content.resizable);
 

	
 
        if(cb){
 
            switch(options.animSequence){
 
                case 'hw':
 
                    adjustHeight(dims.inner_h, dims.top, true, function(){
 
                        adjustWidth(dims.width, true, cb);
 
                    });
 
                    break;
 
                case 'wh':
 
                    adjustWidth(dims.width, true, function(){
 
                        adjustHeight(dims.inner_h, dims.top, true, cb);
 
                    });
 
                    break;
 
                case 'sync':
 
                default:
 
                    adjustWidth(dims.width, true);
 
                    adjustHeight(dims.inner_h, dims.top, true, cb);
 
            }
 
        }else{ // window resize
 
            adjustWidth(dims.width, false);
 
            adjustHeight(dims.inner_h, dims.top, false);
 
            var c = SL.get(content_id);
 
            if(c){
 
                // resize resizable content when in resize mode
 
                if(content.resizable && options.handleOversize == 'resize'){
 
                    c.height = dims.resize_h;
 
                    c.width = dims.resize_w;
 
                }
 
                // fix draggable positioning if enlarging viewport
 
                if(gallery[current].player == 'img' && options.handleOversize == 'drag'){
 
                    var top = parseInt(SL.getStyle(c, 'top'));
 
                    if(top + content.height < dims.inner_h){
 
                        SL.setStyle(c, 'top', dims.inner_h - content.height + 'px');
 
                    }
 
                    var left = parseInt(SL.getStyle(c, 'left'));
 
                    if(left + content.width < dims.inner_w){
 
                        SL.setStyle(c, 'left', dims.inner_w - content.width + 'px');
 
                    }
 
                }
 
            }
 
        }
 
    };
 

	
 
    /**
 
     * Adjusts the height of #shadowbox_body and centers #shadowbox vertically
 
     * in the viewport.
 
     *
 
     * @param   Number      height      The height to use for #shadowbox_body
 
     * @param   Number      top         The top to use for #shadowbox
 
     * @param   Boolean     anim        True to animate the transition
 
     * @param   Function    cb          A callback to use when the animation
 
     *                                  completes
 
     * @return  void
 
     * @private
 
     */
 
    var adjustHeight = function(height, top, anim, cb){
 
        height = parseInt(height);
 

	
 
        // adjust the height
 
        var sb = SL.get('shadowbox_body');
 
        if(anim){
 
            animate(sb, 'height', height, options.resizeDuration);
 
        }else{
 
            SL.setStyle(sb, 'height', height + 'px');
 
        }
 

	
 
        // adjust the top
 
        var s = SL.get('shadowbox');
 
        if(anim){
 
            animate(s, 'top', top, options.resizeDuration, cb);
 
        }else{
 
            SL.setStyle(s, 'top', top + 'px');
 
            if(typeof cb == 'function') cb();
 
        }
 
    };
 

	
 
    /**
 
     * Adjusts the width of #shadowbox.
 
     *
 
     * @param   Number      width       The width to use for #shadowbox
 
     * @param   Boolean     anim        True to animate the transition
 
     * @param   Function    cb          A callback to use when the animation
 
     *                                  completes
 
     * @return  void
 
     * @private
 
     */
 
    var adjustWidth = function(width, anim, cb){
 
        width = parseInt(width);
 

	
 
        // adjust the width
 
        var s = SL.get('shadowbox');
 
        if(anim){
 
            animate(s, 'width', width, options.resizeDuration, cb);
 
        }else{
 
            SL.setStyle(s, 'width', width + 'px');
 
            if(typeof cb == 'function') cb();
 
        }
 
    };
 

	
 
    /**
 
     * Sets up a listener on the document for keystrokes.
 
     *
 
     * @param   Boolean     on      True to enable the listener, false to turn
 
     *                              it off
 
     * @return  void
 
     * @private
 
     */
 
    var listenKeys = function(on){
 
        if(!options.enableKeys) return;
 
        SL[(on ? 'add' : 'remove') + 'Event'](document, 'keydown', handleKey);
 
    };
 

	
 
    /**
 
     * A listener function that is fired when a key is pressed.
 
     *
 
     * @param   mixed       e       The event object
 
     * @return  void
 
     * @private
 
     */
 
    var handleKey = function(e){
 
        var code = SL.keyCode(e);
 

	
 
        // attempt to prevent default key action
 
        SL.preventDefault(e);
 

	
 
        if(code == 81 || code == 88 || code == 27){ // q, x, or esc
 
            SB.close();
 
        }else if(code == 37){ // left arrow
 
            SB.previous();
 
        }else if(code == 39){ // right arrow
 
            SB.next();
 
        }else if(code == 32){ // space bar
 
            SB[(typeof slide_timer == 'number' ? 'pause' : 'play')]();
 
        }
 
    };
 

	
 
    /**
 
     * Toggles the visibility of the "loading" layer.
 
     *
 
     * @param   Boolean     on      True to toggle on, false to toggle off
 
     * @param   Function    cb      The callback function to call when toggling
 
     *                              completes
 
     * @return  void
 
     * @private
 
     */
 
    var toggleLoading = function(on, cb){
 
        var loading = SL.get('shadowbox_loading');
 
        if(on){
 
            loading.style.display = '';
 
            if(typeof cb == 'function') cb();
 
        }else{
 
            var p = gallery[current].player;
 
            var anim = (p == 'img' || p == 'html'); // fade on images & html
 
            var fn = function(){
 
                loading.style.display = 'none';
 
                clearOpacity(loading);
 
                if(typeof cb == 'function') cb();
 
            };
 
            if(anim){
 
                animate(loading, 'opacity', 0, options.fadeDuration, fn);
 
            }else{
 
                fn();
 
            }
 
        }
 
    };
 

	
 
    /**
 
     * Sets the top of the container element. This is only necessary in IE6
 
     * where the container uses absolute positioning instead of fixed.
 
     *
 
     * @return  void
 
     * @private
 
     */
 
    var fixTop = function(){
 
        SL.get('shadowbox_container').style.top = document.documentElement.scrollTop + 'px';
 
    };
 

	
 
    /**
 
     * Sets the height of the overlay element to the full viewport height. This
 
     * is only necessary in IE6 where the container uses absolute positioning
 
     * instead of fixed, thus restricting the size of the overlay element.
 
     *
 
     * @return  void
 
     * @private
 
     */
 
    var fixHeight = function(){
 
        SL.get('shadowbox_overlay').style.height = SL.getViewportHeight() + 'px';
 
    };
 

	
 
    /**
 
     * Determines if there is a next piece to display in the current gallery.
 
     *
 
     * @return  bool            True if there is another piece, false otherwise
 
     * @private
 
     */
 
    var hasNext = function(){
 
        return gallery.length > 1 && (current != gallery.length - 1 || options.continuous);
 
    };
 

	
 
    /**
 
     * Toggles the visibility of #shadowbox_container and sets its size (if on
 
     * IE6). Also toggles the visibility of elements (<select>, <object>, and
 
     * <embed>) that are troublesome for semi-transparent modal overlays. IE has
 
     * problems with <select> elements, while Firefox has trouble with
 
     * <object>s.
 
     *
 
     * @param   Function    cb      A callback to call after toggling on, absent
 
     *                              when toggling off
 
     * @return  void
 
     * @private
 
     */
 
    var toggleVisible = function(cb){
 
        var els, v = (cb) ? 'hidden' : 'visible';
 
        var hide = ['select', 'object', 'embed']; // tags to hide
 
        for(var i = 0; i < hide.length; ++i){
 
            els = document.getElementsByTagName(hide[i]);
 
            for(var j = 0, len = els.length; j < len; ++j){
 
                els[j].style.visibility = v;
 
            }
 
        }
 

	
 
        // resize & show container
 
        var so = SL.get('shadowbox_overlay');
 
        var sc = SL.get('shadowbox_container');
 
        var sb = SL.get('shadowbox');
 
        if(cb){
 
            // set overlay color/opacity
 
            SL.setStyle(so, {
 
                backgroundColor: options.overlayColor,
 
                opacity: 0
 
            });
 
            if(!options.modal) SL.addEvent(so, 'click', SB.close);
 
            if(ltIE7){
 
                // fix container top & overlay height before showing
 
                fixTop();
 
                fixHeight();
 
                SL.addEvent(window, 'scroll', fixTop);
 
            }
 

	
 
            // fade in animation
 
            sb.style.display = 'none'; // will be cleared in loadContent()
 
            sc.style.visibility = 'visible';
 
            animate(so, 'opacity', parseFloat(options.overlayOpacity), options.fadeDuration, cb);
 
        }else{
 
            SL.removeEvent(so, 'click', SB.close);
 
            if(ltIE7) SL.removeEvent(window, 'scroll', fixTop);
 

	
 
            // fade out effect
 
            sb.style.display = 'none';
 
            animate(so, 'opacity', 0, options.fadeDuration, function(){
 
                sc.style.visibility = 'hidden';
 
                sb.style.display = '';
 
                clearOpacity(so);
 
            });
 
        }
 
    };
 

	
 
    /**
 
     * Initializes the Shadowbox environment. Loads the skin (if necessary),
 
     * compiles the player matching regular expressions, and sets up the
 
     * window resize listener.
 
     *
 
     * @param   Object      opts    (optional) The default options to use
 
     * @return  void
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.init = function(opts){
 
        // don't initialize twice
 
        if(initialized) return;
 

	
 
        // make sure language is loaded
 
        if(typeof SB.LANG == 'undefined'){
 
            SB.raise('No Shadowbox language loaded');
 
            return;
 
        }
 
        // make sure skin is loaded
 
        if(typeof SB.SKIN == 'undefined'){
 
            SB.raise('No Shadowbox skin loaded');
 
            return;
 
        }
 

	
 
        // apply custom options
 
        apply(options, opts || {});
 

	
 
        // add markup
 
        var markup = SB.SKIN.markup.replace(/\{(\w+)\}/g, function(m, p){
 
            return SB.LANG[p];
 
        });
 
        var bd = document.body || document.documentElement;
 
        SL.append(bd, markup);
 

	
 
        // several fixes for IE6
 
        if(ltIE7){
 
            // give the container absolute positioning
 
            SL.setStyle(SL.get('shadowbox_container'), 'position', 'absolute');
 
            // give shadowbox_body "layout"...whatever that is
 
            SL.get('shadowbox_body').style.zoom = 1;
 
            // use AlphaImageLoader for transparent PNG support
 
            var png = SB.SKIN.png_fix;
 
            if(png && png.constructor == Array){
 
                for(var i = 0; i < png.length; ++i){
 
                    var el = SL.get(png[i]);
 
                    if(el){
 
                        var match = SL.getStyle(el, 'background-image').match(/url\("(.*\.png)"\)/);
 
                        if(match){
 
                            SL.setStyle(el, {
 
                                backgroundImage: 'none',
 
                                filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src=' + match[1] + ',sizingMethod=scale);'
 
                            });
 
                        }
 
                    }
 
                }
 
            }
 
        }
 

	
 
        // compile file type regular expressions here for speed
 
        for(var e in options.ext){
 
            RE[e] = new RegExp('\.(' + options.ext[e].join('|') + ')\s*$', 'i');
 
        }
 

	
 
        // set up window resize event handler
 
        var id;
 
        SL.addEvent(window, 'resize', function(){
 
            // use 50 ms event buffering to prevent jerky window resizing
 
            if(id){
 
                clearTimeout(id);
 
                id = null;
 
            }
 
            id = setTimeout(function(){
 
                if(ltIE7) fixHeight();
 
                resizeContent();
 
            }, 50);
 
        });
 

	
 
        if(!options.skipSetup) SB.setup();
 
        initialized = true;
 
    };
 

	
 
    /**
 
     * Dynamically loads the specified skin for use with Shadowbox. If the skin
 
     * is included already in the page via the appropriate <script> and <link>
 
     * tags, this function does not need to be called. Otherwise, this function
 
     * must be called before window.onload.
 
     *
 
     * @param   String      skin        The directory where the skin is located
 
     * @param   String      dir         The directory where the Shadowbox skin
 
     *                                  files are located
 
     * @return  void
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.loadSkin = function(skin, dir){
 
        if(!(/\/$/.test(dir))) dir += '/';
 
        skin = dir + skin + '/';
 

	
 
        // Safari 2.0 fails using DOM, use document.write instead
 
        document.write('<link rel="stylesheet" type="text/css" href="' + skin + 'skin.css">');
 
        document.write('<scr' + 'ipt type="text/javascript" src="' + skin + 'skin.js"><\/script>');
 
    };
 

	
 
    /**
 
     * Dynamically loads the specified language file to be used with Shadowbox.
 
     * If the language file is included already in the page via the appropriate
 
     * <script> tag, this function does not need to be called. Otherwise, this
 
     * function must be called before window.onload.
 
     *
 
     * @param   String      lang        The language abbreviation (e.g. en)
 
     * @param   String      dir         The directory where the Shadowbox
 
     *                                  language file(s) is located
 
     * @return  void
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.loadLanguage = function(lang, dir){
 
        if(!(/\/$/.test(dir))) dir += '/';
 

	
 
        // Safari 2.0 fails using DOM, use document.write instead
 
        document.write('<scr' + 'ipt type="text/javascript" src="' + dir + 'shadowbox-' + lang + '.js"><\/script>');
 
    };
 

	
 
    /**
 
     * Dynamically loads the specified player(s) to be used with Shadowbox. If
 
     * the needed player(s) is already included in the page via the appropriate
 
     * <script> tag(s), this function does not need to be called. Otherwise,
 
     * this function must be called before window.onload.
 
     *
 
     * @param   Array       players     The player(s) to load
 
     * @param   String      dir         The director where the Shadowbox player
 
     *                                  file(s) is located
 
     * @return  void
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.loadPlayer = function(players, dir){
 
        if(typeof players == 'string') players = [players];
 
        if(!(/\/$/.test(dir))) dir += '/';
 

	
 
        for(var i = 0, len = players.length; i < len; ++i){
 
            // Safari 2.0 fails using DOM, use document.write instead
 
            document.write('<scr' + 'ipt type="text/javascript" src="' + dir + 'shadowbox-' + players[i] + '.js"><\/script>');
 
        }
 
    };
 

	
 
    /**
 
     * Sets up listeners on the given links that will trigger Shadowbox. If no
 
     * links are given, this method will set up every anchor element on the page
 
     * with the appropriate rel attribute. Note: Because AREA elements do not
 
     * support the rel attribute, they must be explicitly passed to this method.
 
     *
 
     * @param   Array       links       An array (or array-like) list of anchor
 
     *                                  and/or area elements to set up
 
     * @param   Object      opts        Some options to use for the given links
 
     * @return  void
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.setup = function(links, opts){
 
        // get links if none specified
 
        if(!links){
 
            var links = [];
 
            var a = document.getElementsByTagName('a'), rel;
 
            for(var i = 0, len = a.length; i < len; ++i){
 
                rel = a[i].getAttribute('rel');
 
                if(rel && RE.rel.test(rel)) links[links.length] = a[i];
 
            }
 
        }else if(!links.length){
 
            links = [links]; // one link
 
        }
 

	
 
        var link;
 
        for(var i = 0, len = links.length; i < len; ++i){
 
            link = links[i];
 
            if(typeof link.shadowboxCacheKey == 'undefined'){
 
                // assign cache key expando
 
                // use integer primitive to avoid memory leak in IE
 
                link.shadowboxCacheKey = cache.length;
 
                SL.addEvent(link, 'click', handleClick); // add listener
 
            }
 
            cache[link.shadowboxCacheKey] = this.buildCacheObj(link, opts);
 
        }
 
    };
 

	
 
    /**
 
     * Builds an object from the original link element data to store in cache.
 
     * These objects contain (most of) the following keys:
 
     *
 
     * - el: the link element
 
     * - title: the linked file title
 
     * - player: the player to use for the linked file
 
     * - content: the linked file's URL
 
     * - gallery: the gallery the file belongs to (optional)
 
     * - height: the height of the linked file (only necessary for movies)
 
     * - width: the width of the linked file (only necessary for movies)
 
     * - options: custom options to use (optional)
 
     *
 
     * @param   HTMLElement     link    The link element to process
 
     * @return  Object                  An object representing the link
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.buildCacheObj = function(link, opts){
 
        var href = link.href; // don't use getAttribute() here
 
        var o = {
 
            el:         link,
 
            title:      link.getAttribute('title'),
 
            player:     getPlayer(href),
 
            options:    apply({}, opts || {}), // break the reference
 
            content:    href
 
        };
 

	
 
        // remove link-level options from top-level options
 
        var opt, l_opts = ['player', 'title', 'height', 'width', 'gallery'];
 
        for(var i = 0, len = l_opts.length; i < len; ++i){
 
            opt = l_opts[i];
 
            if(typeof o.options[opt] != 'undefined'){
 
                o[opt] = o.options[opt];
 
                delete o.options[opt];
 
            }
 
        }
 

	
 
        // HTML options always trump JavaScript options, so do these last
 
        var rel = link.getAttribute('rel');
 
        if(rel){
 
            // extract gallery name from shadowbox[name] format
 
            var match = rel.match(RE.gallery);
 
            if(match) o.gallery = escape(match[2]);
 

	
 
            // other parameters
 
            var params = rel.split(';');
 
            for(var i = 0, len = params.length; i < len; ++i){
 
                match = params[i].match(RE.param);
 
                if(match){
 
                    if(match[1] == 'options'){
 
                        eval('apply(o.options, ' + match[2] + ')');
 
                    }else{
 
                        o[match[1]] = match[2];
 
                    }
 
                }
 
            }
 
        }
 

	
 
        return o;
 
    };
 

	
 
    /**
 
     * Applies the given set of options to those currently in use. Note: Options
 
     * will be reset on Shadowbox.open() so this function is only useful after
 
     * it has already been called (while Shadowbox is open).
 
     *
 
     * @param   Object      opts        The options to apply
 
     * @return  void
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.applyOptions = function(opts){
 
        if(opts){
 
            // use apply here to break references
 
            default_options = apply({}, options); // store default options
 
            options = apply(options, opts); // apply options
 
        }
 
    };
 

	
 
    /**
 
     * Reverts Shadowbox' options to the last default set in use before
 
     * Shadowbox.applyOptions() was called.
 
     *
 
     * @return  void
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.revertOptions = function(){
 
        if(default_options){
 
            options = default_options; // revert to default options
 
            default_options = null; // erase for next time
 
        }
 
    };
 

	
 
    /**
 
     * Opens the given object in Shadowbox. This object may be either an
 
     * anchor/area element, or an object similar to the one created by
 
     * Shadowbox.buildCacheObj().
 
     *
 
     * @param   mixed       obj         The object or link element that defines
 
     *                                  what to display
 
     * @return  void
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.open = function(obj, opts){
 
        // revert options
 
        this.revertOptions();
 

	
 
        // is it a link?
 
        if(isLink(obj)){
 
            if(typeof obj.shadowboxCacheKey == 'undefined' || typeof cache[obj.shadowboxCacheKey] == 'undefined'){
 
                // link element that hasn't been set up before
 
                // create on-the-fly object
 
                obj = this.buildCacheObj(obj, opts);
 
            }else{
 
                // link element that has been set up before, get from cache
 
                obj = cache[obj.shadowboxCacheKey];
 
            }
 
        }
 

	
 
        // is it already a gallery?
 
        if(obj.constructor == Array){
 
            gallery = obj;
 
            current = 0;
 
        }else{
 
            // create a copy so it doesn't get modified later
 
            var copy = apply({}, obj);
 

	
 
            // is it part of a gallery?
 
            if(!obj.gallery){ // single item, no gallery
 
                gallery = [copy];
 
                current = 0;
 
            }else{
 
                current = null; // reset current
 
                gallery = []; // clear the current gallery
 
                var ci;
 
                for(var i = 0, len = cache.length; i < len; ++i){
 
                    ci = cache[i];
 
                    if(ci.gallery){
 
                        if(ci.content == obj.content
 
                            && ci.gallery == obj.gallery
 
                            && ci.title == obj.title){ // compare content, gallery, & title
 
                                current = gallery.length; // key element found
 
                        }
 
                        if(ci.gallery == obj.gallery){
 
                            gallery.push(apply({}, ci));
 
                        }
 
                    }
 
                }
 
                // if not found in cache, prepend to front of gallery
 
                if(current == null){
 
                    gallery.unshift(copy);
 
                    current = 0;
 
                }
 
            }
 
        }
 

	
 
        obj = gallery[current];
 

	
 
        // apply custom options
 
        if(obj.options || opts){
 
            // use apply here to break references
 
            this.applyOptions(apply(apply({}, obj.options || {}), opts || {}));
 
        }
 

	
 
        // filter gallery for unsupported elements
 
        var match, r;
 
        for(var i = 0, len = gallery.length; i < len; ++i){
 
            r = false; // remove the element?
 
            if(gallery[i].player == 'unsupported'){ // don't support this at all
 
                r = true;
 
            }else if(match = RE.unsupported.exec(gallery[i].player)){ // handle unsupported elements
 
                if(options.handleUnsupported == 'link'){
 
                    gallery[i].player = 'html';
 
                    // generate a link to the appropriate plugin download page(s)
 
                    var s, a, oe = options.errors;
 
                    switch(match[1]){
 
                        case 'qtwmp':
 
                            s = 'either';
 
                            a = [oe.qt.url, oe.qt.name, oe.wmp.url, oe.wmp.name];
 
                        break;
 
                        case 'qtf4m':
 
                            s = 'shared';
 
                            a = [oe.qt.url, oe.qt.name, oe.f4m.url, oe.f4m.name];
 
                        break;
 
                        default:
 
                            s = 'single';
 
                            if(match[1] == 'swf' || match[1] == 'flv') match[1] = 'fla';
 
                            a = [oe[match[1]].url, oe[match[1]].name];
 
                    }
 
                    var msg = SB.LANG.errors[s].replace(/\{(\d+)\}/g, function(m, i){
 
                        return a[i];
 
                    });
 
                    gallery[i].content = '<div class="shadowbox_message">' + msg + '</div>';
 
                }else{
 
                    r = true;
 
                }
 
            }else if(gallery[i].player == 'inline'){ // handle inline elements
 
                // retrieve the innerHTML of the inline element
 
                var match = RE.inline.exec(gallery[i].content);
 
                if(match){
 
                    var el;
 
                    if(el = SL.get(match[1])){
 
                        gallery[i].content = el.innerHTML;
 
                    }else{
 
                        SB.raise('Cannot find element with id ' + match[1]);
 
                    }
 
                }else{
 
                    SB.raise('Cannot find element id for inline content');
 
                }
 
            }
 
            if(r){
 
                gallery.splice(i, 1); // remove the element from the gallery
 
                if(i < current){
 
                    --current;
 
                }else if(i == current){
 
                    // if current is unsupported, look for supported neighbor
 
                    current = i > 0 ? current - 1 : i;
 
                }
 
                --i; // decrement to account for splice
 
                len = gallery.length; // gallery.length has changed!
 
            }
 
        }
 

	
 
        // anything left?
 
        if(gallery.length){
 
            // fire onOpen hook
 
            if(options.onOpen && typeof options.onOpen == 'function'){
 
                options.onOpen(obj);
 
            }
 

	
 
            if(!activated){
 
                // set initial dimensions & load
 
                setDimensions(options.initialHeight, options.initialWidth);
 
                adjustHeight(dims.inner_h, dims.top, false);
 
                adjustWidth(dims.width, false);
 
                toggleVisible(loadContent);
 
            } else {
 
                loadContent();
 
            }
 

	
 
            activated = true;
 
        }
 
    };
 

	
 
    /**
 
     * Jumps to the piece in the current gallery with index num.
 
     *
 
     * @param   Number      num     The gallery index to view
 
     * @return  void
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.change = function(num){
 
        if(!gallery) return; // no current gallery
 
        if(!gallery[num]){ // index does not exist
 
            if(!options.continuous){
 
                return;
 
            }else{
 
                num = num < 0 ? (gallery.length - 1) : 0; // loop
 
            }
 
        }
 

	
 
        if(typeof slide_timer == 'number'){
 
            clearTimeout(slide_timer);
 
            slide_timer = null;
 
            slide_delay = slide_start = 0; // reset slideshow variables
 
        }
 
        current = num; // update current
 

	
 
        if(options.onChange && typeof options.onChange == 'function'){
 
            options.onChange(gallery[current]); // fire onChange handler
 
        }
 

	
 
        loadContent();
 
    };
 

	
 
    /**
 
     * Jumps to the next piece in the gallery.
 
     *
 
     * @return  void
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.next = function(){
 
        this.change(current + 1);
 
    };
 

	
 
    /**
 
     * Jumps to the previous piece in the gallery.
 
     *
 
     * @return  void
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.previous = function(){
 
        this.change(current - 1);
 
    };
 

	
 
    /**
 
     * Sets the timer for the next image in the slideshow to be displayed.
 
     *
 
     * @return  void
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.play = function(){
 
        if(!hasNext()) return;
 
        if(!slide_delay) slide_delay = options.slideshowDelay * 1000;
 
        if(slide_delay){
 
            slide_start = new Date().getTime();
 
            slide_timer = setTimeout(function(){
 
                slide_delay = slide_start = 0; // reset slideshow
 
                SB.next();
 
            }, slide_delay);
 

	
 
            // change play nav to pause
 
            toggleNav('play', false);
 
            toggleNav('pause', true);
 
        }
 
    };
 

	
 
    /**
 
     * Pauses the current slideshow.
 
     *
 
     * @return  void
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.pause = function(){
 
        if(typeof slide_timer == 'number'){
 
            var time = new Date().getTime();
 
            slide_delay = Math.max(0, slide_delay - (time - slide_start));
 

	
 
            // any delay left on current slide? if so, stop the timer
 
            if(slide_delay){
 
                clearTimeout(slide_timer);
 
                slide_timer = 'paused';
 
            }
 

	
 
            // change pause nav to play
 
            toggleNav('pause', false);
 
            toggleNav('play', true);
 
        }
 
    };
 

	
 
    /**
 
     * Deactivates Shadowbox.
 
     *
 
     * @return  void
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.close = function(){
 
        if(!activated) return; // already closed
 

	
 
        // stop listening for keys
 
        listenKeys(false);
 
        // hide
 
        toggleVisible(false);
 
        // remove the content
 
        if(content){
 
            content.remove();
 
            content = null;
 
        }
 

	
 
        // clear slideshow variables
 
        if(typeof slide_timer == 'number') clearTimeout(slide_timer);
 
        slide_timer = null;
 
        slide_delay = 0;
 

	
 
        // fire onClose handler
 
        if(options.onClose && typeof options.onClose == 'function'){
 
            options.onClose(gallery[current]);
 
        }
 

	
 
        activated = false;
 
    };
 

	
 
    /**
 
     * Clears Shadowbox' cache and removes listeners and expandos from all
 
     * cached link elements. May be used to completely reset Shadowbox in case
 
     * links on a page change.
 
     *
 
     * @return  void
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.clearCache = function(){
 
        for(var i = 0, len = cache.length; i < len; ++i){
 
            if(cache[i].el){
 
                SL.removeEvent(cache[i].el, 'click', handleClick);
 
                delete cache[i].el.shadowboxCacheKey; // remove expando
 
            }
 
        }
 
        cache = [];
 
    };
 

	
 
    /**
 
     * Gets an object that lists which plugins are supported by the client. The
 
     * keys of this object will be:
 
     *
 
     * - fla: Adobe Flash Player
 
     * - qt: QuickTime Player
 
     * - wmp: Windows Media Player
 
     * - f4m: Flip4Mac QuickTime Player
 
     *
 
     * @return  Object          The plugins object
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.getPlugins = function(){
 
        return plugins;
 
    };
 

	
 
    /**
 
     * Gets the current options object in use.
 
     *
 
     * @return  Object          The options object
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.getOptions = function(){
 
        return options;
 
    };
 

	
 
    /**
 
     * Gets the current gallery object.
 
     *
 
     * @return  Object          The current gallery item
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.getCurrent = function(){
 
        return gallery[current];
 
    };
 

	
 
    /**
 
     * Gets the current version number of Shadowbox.
 
     *
 
     * @return  String          The current version
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.getVersion = function(){
 
        return version;
 
    };
 

	
 
    /**
 
     * Returns an object containing information about the current client
 
     * configuration.
 
     *
 
     * @return  Object          The object containing client data
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.getClient = function(){
 
        return client;
 
    };
 

	
 
    /**
 
     * Returns the current content object in use.
 
     *
 
     * @return  Object          The current content object
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.getContent = function(){
 
        return content;
 
    };
 

	
 
    /**
 
     * Gets the current dimensions of Shadowbox as calculated by
 
     * setDimensions().
 
     *
 
     * @return  Object          The current dimensions of Shadowbox
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.getDimensions = function(){
 
        return dims;
 
    };
 

	
 
    /**
 
     * Handles all Shadowbox exceptions (errors). Calls the exception
 
     * handler callback if one is present (see handleException option) or
 
     * throws a new exception.
 
     *
 
     * @param   String      e       The error message
 
     * @return  void
 
     * @public
 
     * @static
 
     */
 
    Shadowbox.raise = function(e){
 
        if(typeof options.handleException == 'function'){
 
            options.handleException(e);
 
        }else{
 
            throw e;
 
        }
 
    };
 

	
 
})();
 
\ No newline at end of file
components/com_morfeoshow/src/skin/classic/icons/close.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/src/skin/classic/icons/index.html
Show inline comments
 
new file 100644
 
<html>
 
<body bgcolor="#FFFFFF">
 
</body>
 
</html>
 
\ No newline at end of file
components/com_morfeoshow/src/skin/classic/icons/next.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/src/skin/classic/icons/pause.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/src/skin/classic/icons/play.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/src/skin/classic/icons/previous.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/src/skin/classic/index.html
Show inline comments
 
new file 100644
 
<html>
 
<body bgcolor="#FFFFFF">
 
</body>
 
</html>
 
\ No newline at end of file
components/com_morfeoshow/src/skin/classic/loading.gif
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/src/skin/classic/skin.css
Show inline comments
 
new file 100644
 
/**
 
 * The "classic" theme CSS for Shadowbox.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: skin.js 91 2008-03-28 17:39:13Z mjijackson $
 
 */
 
 
/*_____________________________________________________  container & overlay  */
 
#shadowbox_container, #shadowbox_overlay {
 
  top: 0;
 
  left: 0;
 
  height: 100%;
 
  width: 100%;
 
  margin: 0;
 
  padding: 0;
 
}
 
#shadowbox_container {
 
  position: fixed;
 
  display: block;
 
  visibility: hidden;
 
  z-index: 999;
 
  text-align: center; /* centers #shadowbox in quirks and IE */
 
}
 
#shadowbox_overlay {
 
  position: absolute;
 
}
 
 
/*_______________________________________________________________  shadowbox  */
 
#shadowbox {
 
  position: relative;
 
  margin: 0 auto;
 
  text-align: left; /* reset left alignment */
 
}
 
 
/*____________________________________________________________________  body  */
 
#shadowbox_body {
 
  position: relative;
 
  margin: 0;
 
  padding: 0;
 
  border: 1px solid #333;
 
  overflow: hidden;
 
}
 
#shadowbox_body_inner {
 
  position: relative;
 
  height: 100%;
 
}
 
#shadowbox_content.html {
 
  height: 100%;
 
  overflow: auto; /* make html content scrollable */
 
}
 
 
/*_________________________________________________________________  loading  */
 
#shadowbox_loading {
 
  position: absolute;
 
  top: 0;
 
  width: 100%;
 
  height: 100%;
 
}
 
#shadowbox_body, #shadowbox_loading {
 
  background-color: #060606; /* should match loading image background color */
 
}
 
#shadowbox_loading_indicator {
 
  float: left;
 
  margin: 10px 10px 0 10px;
 
  height: 32px;
 
  width: 32px;
 
  background-image: url(loading.gif);
 
  background-repeat: no-repeat;
 
}
 
#shadowbox_loading span {
 
  font-family: 'Lucida Grande', Tahoma, sans-serif;
 
  font-size: 10px;
 
  float: left;
 
  margin-top: 16px;
 
}
 
#shadowbox_loading span a:link,
 
#shadowbox_loading span a:visited {
 
  color: #fff;
 
  text-decoration: underline;
 
}
 
 
/*____________________________________________________________  title & info  */
 
#shadowbox_title, #shadowbox_info {
 
  position: relative;
 
  margin: 0; /* these must have no vertical margin or padding */
 
  padding: 0;
 
  overflow: hidden;
 
}
 
#shadowbox_title_inner, #shadowbox_info_inner {
 
  position: relative;
 
  font-family: 'Lucida Grande', Tahoma, sans-serif;
 
  line-height: 16px;
 
}
 
#shadowbox_title {
 
  height: 26px;
 
}
 
#shadowbox_title_inner {
 
  font-size: 16px;
 
  padding: 5px 0;
 
  color: #fff;
 
}
 
#shadowbox_info {
 
  height: 20px;
 
}
 
#shadowbox_info_inner {
 
  font-size: 12px;
 
  color: #fff;
 
}
 
 
/*_____________________________________________________________________  nav  */
 
#shadowbox_nav {
 
  float: right;
 
  height: 16px;
 
  padding: 2px 0;
 
  width: 45%;
 
}
 
#shadowbox_nav a {
 
  display: block;
 
  float: right;
 
  height: 16px;
 
  width: 16px;
 
  margin-left: 3px;
 
  cursor: pointer;
 
}
 
#shadowbox_nav_close {
 
  background-image: url(icons/close.png);
 
  background-repeat: no-repeat;
 
}
 
#shadowbox_nav_next {
 
  background-image: url(icons/next.png);
 
  background-repeat: no-repeat;
 
}
 
#shadowbox_nav_previous {
 
  background-image: url(icons/previous.png);
 
  background-repeat: no-repeat;
 
}
 
#shadowbox_nav_play {
 
  background-image: url(icons/play.png);
 
  background-repeat: no-repeat;
 
}
 
#shadowbox_nav_pause {
 
  background-image: url(icons/pause.png);
 
  background-repeat: no-repeat;
 
}
 
 
/*_________________________________________________________________  counter  */
 
#shadowbox_counter {
 
  float: left;
 
  padding: 2px 0;
 
  width: 45%;
 
}
 
#shadowbox_counter a {
 
  padding: 0 4px 0 0;
 
  text-decoration: none;
 
  cursor: pointer;
 
  color: #fff;
 
}
 
#shadowbox_counter a.shadowbox_counter_current {
 
  text-decoration: underline;
 
}
 
 
/*___________________________________________________________________  clear  */
 
div.shadowbox_clear {
 
  clear: both; /* clear floating counter & nav */
 
}
 
 
/*________________________________________________________________  messages  */
 
div.shadowbox_message {
 
  font-family: 'Lucida Grande', Tahoma, sans-serif;
 
  font-size: 12px;
 
  padding: 10px;
 
  text-align: center;
 
}
 
div.shadowbox_message a:link,
 
div.shadowbox_message a:visited {
 
  color: #fff;
 
  text-decoration: underline;
 
}
components/com_morfeoshow/src/skin/classic/skin.js
Show inline comments
 
new file 100644
 
/**
 
 * The "classic" theme markup for Shadowbox.
 
 *
 
 * This file is part of Shadowbox.
 
 *
 
 * Shadowbox is an online media viewer application that supports all of the
 
 * web's most popular media publishing formats. Shadowbox is written entirely
 
 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website
 
 * authors can showcase a wide assortment of media in all major browsers without
 
 * navigating users away from the linking page.
 
 *
 
 * Shadowbox is released under version 3.0 of the Creative Commons Attribution-
 
 * Noncommercial-Share Alike license. This means that it is absolutely free
 
 * for personal, noncommercial use provided that you 1) make attribution to the
 
 * author and 2) release any derivative work under the same or a similar
 
 * license.
 
 *
 
 * If you wish to use Shadowbox for commercial purposes, licensing information
 
 * can be found at http://mjijackson.com/shadowbox/.
 
 *
 
 * @author      Michael J. I. Jackson <mjijackson@gmail.com>
 
 * @copyright   2007-2008 Michael J. I. Jackson
 
 * @license     http://creativecommons.org/licenses/by-nc-sa/3.0/
 
 * @version     SVN: $Id: skin.js 108 2008-07-11 04:19:01Z mjijackson $
 
 */
 

	
 
if(typeof Shadowbox == 'undefined'){
 
    throw 'Unable to load Shadowbox skin, base library not found.';
 
}
 

	
 
/**
 
 * The HTML markup to use for Shadowbox.
 
 *
 
 * IMPORTANT: The script depends on most of these elements being present.
 
 *
 
 * @property    {Object}    SKIN
 
 * @public
 
 * @static
 
 */
 
Shadowbox.SKIN = {
 

	
 
    markup:     '<div id="shadowbox_container">' +
 
                    '<div id="shadowbox_overlay"></div>' +
 
                    '<div id="shadowbox">' +
 
                        '<div id="shadowbox_title">' +
 
                            '<div id="shadowbox_title_inner"></div>' +
 
                        '</div>' +
 
                        '<div id="shadowbox_body">' +
 
                            '<div id="shadowbox_body_inner"></div>' +
 
                            '<div id="shadowbox_loading">' +
 
                                '<div id="shadowbox_loading_indicator"></div>' +
 
                                '<span><a onclick="Shadowbox.close();">{cancel}</a></span>' +
 
                            '</div>' +
 
                        '</div>' +
 
                        '<div id="shadowbox_info">' +
 
                            '<div id="shadowbox_info_inner">' +
 
                                '<div id="shadowbox_counter"></div>' +
 
                                '<div id="shadowbox_nav">' +
 
                                    '<a id="shadowbox_nav_close" title="{close}" onclick="Shadowbox.close()"></a>' +
 
                                    '<a id="shadowbox_nav_next" title="{next}" onclick="Shadowbox.next()"></a>' +
 
                                    '<a id="shadowbox_nav_play" title="{play}" onclick="Shadowbox.play()"></a>' +
 
                                    '<a id="shadowbox_nav_pause" title="{pause}" onclick="Shadowbox.pause()"></a>' +
 
                                    '<a id="shadowbox_nav_previous" title="{previous}" onclick="Shadowbox.previous()"></a>' +
 
                                '</div>' +
 
                                '<div class="shadowbox_clear"></div>' +
 
                            '</div>' +
 
                        '</div>' +
 
                    '</div>' +
 
                '</div>',
 

	
 
    png_fix:    [
 
        'shadowbox_nav_close',
 
        'shadowbox_nav_next',
 
        'shadowbox_nav_play',
 
        'shadowbox_nav_pause',
 
        'shadowbox_nav_previous'
 
    ]
 

	
 
};
components/com_morfeoshow/src/skin/index.html
Show inline comments
 
new file 100644
 
<html>
 
<body bgcolor="#FFFFFF">
 
</body>
 
</html>
 
\ No newline at end of file
components/com_morfeoshow/src/viewer.swf
Show inline comments
 
new file 100644
 
binary diff not shown
components/com_morfeoshow/style/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/style/style.css
Show inline comments
 
new file 100644
 
.tinytext{
 
font-size: 10px;
 
}
 
 
.smalltext{
 
font-size: 12px;
 
}
 
 
.medtext{
 
font-size: 14px;
 
}
 
 
a{
 
text-decoration: underline;
 
}
 
 
#container{}
 
 
.toggler {color: #222;margin: 0;padding: 2px 5px;background: #eee;border-bottom: 1px solid #DDD;border-right: 1px solid #DDD;border-top: 1px solid #F5F5F5;border-left: 1px solid #F5F5F5;font-size: 13px;font-weight: normal;font-family: 'Andale Mono', sans-serif;}
 
 
 
fieldset.morfeo { border: 0px solid #ccc; margin: 0 0 0 0; }
 
fieldset.flickr { border: 1px solid #ccc; margin: 0 3px 3px 3px; }
 
 
fieldset {
 
	margin-bottom: 10px;
 
	border: 1px #ccc solid;
 
	padding: 5px;
 
	text-align: left;
 
}
 

	
 
fieldset p {  margin: 10px 0px;  }
 

	
 
legend    {
 
	color: #0B55C4;
 
	font-size: 12px;
 
	font-weight: bold;
 
}
 
 
.gallerytable {
 
	border-right: solid 1px #d5d5d5;
 
	border-bottom: solid 1px #d5d5d5;	
 
	padding: 3px;
 
	margin: 5px;
 
	width: 100%;
 
	text-align: center;	
 
}
 
 
 
table.desctable {
 
}
 
 
table.fototable {
 

	
 
}
 
 
table.fltable {
 

	
 
}
 
 
img#front {
 
	margin-top: 20px;
 
	width: 618px;
 
	height: 128px;
 
	position: absolute;
 
	right: 10px;
 
	float: right;
 
}
 
 

	
 
img#front {
 
	background: url(../images/front1.png) 0 0 no-repeat;
 
}
 
 
a.nounder {
 
	text-decoration: none;
 
	border: 0;
 
	cursor: pointer;
 
}
 

	
 
a.nounder:hover {
 
	text-decoration: none;
 
}
 
\ No newline at end of file
components/com_morfeoshow/tpl/classic/fancybox1.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
* @package		Joomla
 
* @subpackage	com_morfeoshow
 
* @copyright	Copyright (C) Vamba & Matthew Thomson. All rights reserved.
 
* @license		GNU/GPL.
 
* @author 		Vamba (.joomlaitalia.com) & Matthew Thomson (ignitejoomlaextensions.com)
 
* @based on  	com_ignitiongallery
 
* @author 		Matthew Thomson (ignitejoomlaextensions.com)
 
* Joomla! and com_morfeoshow are free software. This version may have been modified pursuant
 
* to the GNU General Public License, and as distributed they include or
 
* are derivative of works licensed under the GNU General Public License or
 
* other free or open source software licenses.
 
*/
 
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
 
$result = $count;	
 
if($result > 0) {
 
$x=0;
 
 
if ($params_morfeo['style'] == 1) { 
 
echo '<style>';
 
echo $params_morfeo['style1'];
 
echo '</style>';
 
		} 
 
		else
 
		{		
 
 
echo '<style>
 
.sboxgallery {padding: 10px 10px 30px 30px;}
 
#sboxth {padding: 0 5px 15px 0;text-align:center;font-size:10px;width:100px;}
 
#sboxth img {border: 1px solid #eeeccc;	border-width: 2px 2px 2px;}
 
#sboxth a:hover img {border: 1px solid #3e3e3e;border-width: 2px 2px 2px;}
 
</style>';
 
		}
 
	echo '
 
<script src="'.JURI::root(true).'/components/com_morfeoshow/tpl/resources/boxover/boxover.js" type="text/javascript"></script>	
 
	<table class="sboxgallery" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>';		
 
		foreach ($items as $file) 
 
	{ 
 
 
	$x=$x+1;
 
	if ($x % $params['colonne'] == 0) { 	
 
	
 
 if ($params_morfeo['titolo'] == 0) {
 
		$file->titolo = ''; 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->titolo = $file->filename;		
 
		$file->titolo = str_replace($ext, '', $file->titolo);	
 
		} else {
 
		$file->titolo = $file->title;
 
		}	
 
		}//end elsefilename		
 
echo '
 
<td id="sboxth">
 
		<a class="photo-link" rel="one-big-group" href="'.$path1.$file->filename.'">
 
			<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'" title="header=['.$file->titolo.'] body=['.$file->html.']">
 
		</a>'
 
;			
 
		echo'</td></tr><tr>';
 
 
}else{	
 
 
 if ($params_morfeo['titolo'] == 0) {
 
		$file->titolo = ''; 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->titolo = $file->filename;		
 
		$file->titolo = str_replace($ext, '', $file->titolo);	
 
		} else {
 
		$file->titolo = $file->title;
 
		}	
 
		}//end elsefilename		
 
echo '
 
<td id="sboxth">
 
		<a class="photo-link" rel="one-big-group" href="'.$path1.$file->filename.'">
 
			<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'" title="header=['.$file->titolo.'] body=['.$file->html.']">
 
		</a>'
 
;			
 
	echo'</td>';
 
		
 
	}	
 
	
 
}	
 
}
 
	echo '<tr></tr><tr><br /></tr></table>';
 
\ No newline at end of file
components/com_morfeoshow/tpl/classic/fancybox2.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
* @package		Joomla
 
* @subpackage	com_morfeoshow
 
* @copyright	Copyright (C) Vamba & Matthew Thomson. All rights reserved.
 
* @license		GNU/GPL.
 
* @author 		Vamba (.joomlaitalia.com) & Matthew Thomson (ignitejoomlaextensions.com)
 
* @based on  	com_ignitiongallery
 
* @author 		Matthew Thomson (ignitejoomlaextensions.com)
 
* Joomla! and com_morfeoshow are free software. This version may have been modified pursuant
 
* to the GNU General Public License, and as distributed they include or
 
* are derivative of works licensed under the GNU General Public License or
 
* other free or open source software licenses.
 
*/
 
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
 
$result = $count;	
 
if($result > 0) {
 
$x=0;
 
 
if ($params_morfeo['style0'] == 1) { 
 
echo '<style>';
 
echo $params_morfeo['style2'];
 
echo '</style>';
 
		} 
 
		else
 
		{
 
?>
 
<style>
 
a img, img 	{ border: none; text-decoration: none; }
 
#page-wrap	{ width: auto; margin: 0 auto; }
 
.photo-link	{padding: 5px;margin: 5px;border: 1px solid #999;display: block;width: <?php echo $params_morfeo['larghezza']?>px;text-align:center;font-size:9px;text-decoration: none;}
 
.photo-link:hover{border-color: white;text-decoration: none;}
 
</style>
 
<?php
 
}
 
	echo '<script src="'.JURI::root(true).'/components/com_morfeoshow/tpl/resources/boxover/boxover.js" type="text/javascript"></script>	
 
	<table valign="top" border="0" cellpadding="0" cellspacing="0" width="100%">';
 
		echo '<tr>';
 
	echo '<div id="page-wrap">';
 
		foreach ($items as $file) 
 
	{ 
 
	
 
	$x=$x+1;
 
	if ($x % $params['colonne'] == 0) { 	
 
	
 
 if ($params_morfeo['titolo'] == 0) {
 
		$file->titolo = ''; 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->titolo = $file->filename;		
 
		$file->titolo = str_replace($ext, '', $file->titolo);	
 
		} else {
 
		$file->titolo = $file->title;
 
		}	
 
		}//end elsefilename		
 
echo '<td align="center"><a class="photo-link" rel="one-big-group"  href="'.$path1.$file->filename.'">
 
		<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'" title="header=['.$file->titolo.'] body=['.$file->html.']">'
 
;			
 
echo '</a>';
 
echo'</td></tr><tr>';
 
 
}else{	
 
 
 if ($params_morfeo['titolo'] == 0) {
 
		$file->titolo = ''; 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->titolo = $file->filename;		
 
		$file->titolo = str_replace($ext, '', $file->titolo);	
 
		} else {
 
		$file->titolo = $file->title;
 
		}	
 
		}//end elsefilename		
 
echo '<td align="center"><a class="photo-link" rel="one-big-group"  href="'.$path1.$file->filename.'">
 
		<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'" title="header=['.$file->titolo.'] body=['.$file->html.']">'
 
;			
 
echo '</a>';
 
echo'</td>';
 
 
	}	
 
	
 
}	
 
}		
 
		echo '</td></tr><tr><td></br /></td></tr></table>';		
 
\ No newline at end of file
components/com_morfeoshow/tpl/classic/fancybox3.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
* @package		Joomla
 
* @subpackage	com_morfeoshow
 
* @copyright	Copyright (C) Vamba & Matthew Thomson. All rights reserved.
 
* @license		GNU/GPL.
 
* @author 		Vamba (.joomlaitalia.com) & Matthew Thomson (ignitejoomlaextensions.com)
 
* @based on  	com_ignitiongallery
 
* @author 		Matthew Thomson (ignitejoomlaextensions.com)
 
* Joomla! and com_morfeoshow are free software. This version may have been modified pursuant
 
* to the GNU General Public License, and as distributed they include or
 
* are derivative of works licensed under the GNU General Public License or
 
* other free or open source software licenses.
 
*/
 
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
 
$result = $count;	
 
if($result > 0) {
 
$x=0;
 
 
if ($params_morfeo['style'] == 1) { 
 
echo '<style>';
 
echo $params_morfeo['style1'];
 
echo '</style>';
 
		} 
 
		else
 
		{		
 
 
echo '<style>
 
.sboxgallery {padding: 10px 10px 30px 30px;}
 
#sboxth {padding: 0 5px 15px 0;text-align:center;font-size:10px;width:100px;}
 
#sboxth img {border: 1px solid #eeeccc;	border-width: 2px 2px 2px;}
 
#sboxth a:hover img {border: 1px solid #3e3e3e;border-width: 2px 2px 2px;}
 
</style>';
 
		}
 
	echo '<table class="sboxgallery" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>';		
 
		foreach ($items as $file) 
 
	{ 
 
 
	$x=$x+1;
 
	if ($x % $params['colonne'] == 0) { 	
 
	
 
     if ($file->html =='') 
 
	 { 
 
echo '<td id="sboxth">
 
	<a class="photo-link" rel="one-big-group" href="'.$path1.$file->filename.'">
 
		<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'">
 
	</a>
 
	<br />
 
';
 
	}	
 
	else	
 
	{ 
 
	
 
echo '
 
<td id="sboxth">
 
		<a class="photo-link" rel="one-big-group" href="'.$path1.$file->filename.'">
 
			<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'" title="'.$file->html.'" alt="'.$file->html.'">
 
		</a>
 
			<br />'
 
;			
 
	}//fine else immagine	
 
if ($params_morfeo['titolo'] == 0) { 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->filename = str_replace($ext, '', $file->filename);	
 
			echo $file->filename;
 
				} 
 
				else 
 
				{	
 
			echo $file->title;
 
			}//end elsefilename
 
		}//end else titolo
 
		echo'</td></tr><tr>';
 
		
 
}else{
 
 
     if ($file->html =='') 
 
	 { 
 
echo '<td id="sboxth">
 
	<a class="photo-link" rel="one-big-group" href="'.$path1.$file->filename.'">
 
		<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'">
 
	</a>
 
	<br />
 
';
 
	}	
 
	else	
 
	{ 
 
	
 
echo '
 
<td id="sboxth">
 
		<a class="photo-link" rel="one-big-group" href="'.$path1.$file->filename.'">
 
			<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'" title="'.$file->html.'" alt="'.$file->html.'">
 
		</a>
 
			<br />'
 
;			
 
	}//fine else immagine	
 
if ($params_morfeo['titolo'] == 0) { 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->filename = str_replace($ext, '', $file->filename);	
 
			echo $file->filename;
 
				} 
 
				else 
 
				{	
 
			echo $file->title;
 
			}//end elsefilename
 
		}//end else titolo
 
		echo'</td>';
 
	}	
 
  }	
 
}		
 
		echo '</td></tr><tr><td></br /></td></tr></table>';	
 
\ No newline at end of file
components/com_morfeoshow/tpl/classic/fancybox4.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
* @package		Joomla
 
* @subpackage	com_morfeoshow
 
* @copyright	Copyright (C) Vamba & Matthew Thomson. All rights reserved.
 
* @license		GNU/GPL.
 
* @author 		Vamba (.joomlaitalia.com) & Matthew Thomson (ignitejoomlaextensions.com)
 
* @based on  	com_ignitiongallery
 
* @author 		Matthew Thomson (ignitejoomlaextensions.com)
 
* Joomla! and com_morfeoshow are free software. This version may have been modified pursuant
 
* to the GNU General Public License, and as distributed they include or
 
* are derivative of works licensed under the GNU General Public License or
 
* other free or open source software licenses.
 
*/
 
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
 
$result = $count;	
 
if($result > 0) {
 
$x=0;
 
 
if ($params_morfeo['style0'] == 1) { 
 
echo '<style>';
 
echo $params_morfeo['style2'];
 
echo '</style>';
 
		} 
 
		else
 
		{
 
?>
 
<style>
 
a img, img 	{ border: none; text-decoration: none; }
 
#page-wrap	{ width: auto; margin: 0 auto; }
 
.photo-link	{padding: 5px;margin: 5px;border: 1px solid #999;display: block;width: <?php echo $params_morfeo['larghezza']?>px;text-align:center;font-size:9px;text-decoration: none;}
 
.photo-link:hover{border-color: white;text-decoration: none;}
 
</style>
 
<?php
 
}
 
	echo '<table align="left" valign="top" border="0" cellpadding="0" cellspacing="0" width="100%">';
 
		echo '<tr>';
 
 
	echo '<div id="page-wrap">';
 
		foreach ($items as $file) 
 
	{ 
 
 
	$x=$x+1;
 
	if ($x % $params['colonne'] == 0) { 	
 
	
 
     if ($file->html =='') 
 
	 { 
 
	echo '<td align="center"><a class="photo-link" rel="one-big-group" href="'.$path1.$file->filename.'">
 
		<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'">';
 
if ($params_morfeo['titolo'] == 0) { 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->filename = str_replace($ext, '', $file->filename);	
 
			echo $file->filename;
 
				} 
 
				else 
 
				{	
 
			echo $file->title;
 
			}//end elsefilename
 
		}//end else titolo
 
echo '</a>';
 
	}	
 
	else	
 
	{ 
 
echo '<td align="center"><a class="photo-link" rel="one-big-group"  href="'.$path1.$file->filename.'">
 
		<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'" title="'.$file->html.'" alt="'.$file->html.'">'
 
;			
 
if ($params_morfeo['titolo'] == 0) { 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->filename = str_replace($ext, '', $file->filename);	
 
			echo $file->filename;
 
				} 
 
				else 
 
				{	
 
			echo $file->title;
 
			}//end elsefilename
 
		}//end else titolo
 
echo '</a>';
 
	}//fine else immagine	
 
	echo'</td></tr><tr>';	
 
}else{
 
 
     if ($file->html =='') 
 
	 { 
 
	echo '<td align="center"><a class="photo-link" rel="one-big-group" href="'.$path1.$file->filename.'">
 
		<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'">';
 
if ($params_morfeo['titolo'] == 0) { 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->filename = str_replace($ext, '', $file->filename);	
 
			echo $file->filename;
 
				} 
 
				else 
 
				{	
 
			echo $file->title;
 
			}//end elsefilename
 
		}//end else titolo
 
echo '</a>';
 
	}	
 
	else	
 
	{ 
 
echo '<td align="center"><a class="photo-link" rel="one-big-group"  href="'.$path1.$file->filename.'">
 
		<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'" title="'.$file->html.'" alt="'.$file->html.'">'
 
;			
 
if ($params_morfeo['titolo'] == 0) { 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->filename = str_replace($ext, '', $file->filename);	
 
			echo $file->filename;
 
				} 
 
				else 
 
				{	
 
			echo $file->title;
 
			}//end elsefilename
 
		}//end else titolo
 
echo '</a>';
 
	}//fine else immagine	
 
	echo'</td>';
 
	}	
 
  }	
 
}
 
		echo '</div>';
 
		echo '</td></tr><tr><td></br /></td></tr></table>';		
 
\ No newline at end of file
components/com_morfeoshow/tpl/classic/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/classic/shadowbox1.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
* @package		Joomla
 
* @subpackage	com_morfeoshow
 
* @copyright	Copyright (C) Vamba & Matthew Thomson. All rights reserved.
 
* @license		GNU/GPL.
 
* @author 		Vamba (.joomlaitalia.com) & Matthew Thomson (ignitejoomlaextensions.com)
 
* @based on  	com_ignitiongallery
 
* @author 		Matthew Thomson (ignitejoomlaextensions.com)
 
* Joomla! and com_morfeoshow are free software. This version may have been modified pursuant
 
* to the GNU General Public License, and as distributed they include or
 
* are derivative of works licensed under the GNU General Public License or
 
* other free or open source software licenses.
 
*/
 
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
 
$result = $count;	
 
if($result > 0) {
 
$x=0;
 
 
if ($params_morfeo['style'] == 1) { 
 
echo '<style>';
 
echo $params_morfeo['style1'];
 
echo '</style>';
 
		} 
 
		else
 
		{		
 
 
echo '<style>
 
.sboxgallery {padding: 10px 10px 30px 30px;}
 
#sboxth {padding: 0 5px 15px 0;text-align:center;font-size:10px;width:100px;}
 
#sboxth img {border: 1px solid #eeeccc;	border-width: 2px 2px 2px;}
 
#sboxth a:hover img {border: 1px solid #3e3e3e;border-width: 2px 2px 2px;}
 
</style>';
 
 
		}
 
		
 
	echo '<script src="'.JURI::root(true).'/components/com_morfeoshow/tpl/resources/boxover/boxover.js" type="text/javascript"></script>
 
	<table class="sboxgallery" width="100%" cellspacing="0" cellspacing="0" border="0"><tr>';	
 
		foreach ($items as $file) 
 
	{ 
 
$x=$x+1;
 
if ($x % $params['colonne'] == 0) { 
 
	
 
 if ($params_morfeo['titolo'] == 0) {
 
		$file->titolo = ''; 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->titolo = $file->filename;		
 
		$file->titolo = str_replace($ext, '', $file->titolo);	
 
		} else {
 
		$file->titolo = $file->title;
 
		}
 
 
		}//end elsefilename
 
	echo '<td id="sboxth" style="font-size:12px">
 
		<a rel="shadowbox[Morfeo];options={slideshowDelay:6}" class="option" href="'.$path1.$file->filename.'">
 
			<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'" title="header=['.$file->titolo.'] body=['.$file->html.']">
 
		</a>
 
		</td></tr><tr>';
 
 
}else{	
 
 
 if ($params_morfeo['titolo'] == 0) {
 
		$file->titolo = ''; 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->titolo = $file->filename;		
 
		$file->titolo = str_replace($ext, '', $file->titolo);	
 
		} else {
 
		$file->titolo = $file->title;
 
		}
 
 
		}//end elsefilename
 
	echo '<td id="sboxth" style="font-size:12px">
 
		<a rel="shadowbox[Morfeo];options={slideshowDelay:6}" class="option" href="'.$path1.$file->filename.'">
 
			<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'" title="header=['.$file->titolo.'] body=['.$file->html.']">
 
		</a>
 
		</td>';
 
		
 
	}	
 
	
 
}	
 
}
 
	echo '<tr></tr><tr><br /></tr></table>';
 
\ No newline at end of file
components/com_morfeoshow/tpl/classic/shadowbox2.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
* @package		Joomla
 
* @subpackage	com_morfeoshow
 
* @copyright	Copyright (C) Vamba & Matthew Thomson. All rights reserved.
 
* @license		GNU/GPL.
 
* @author 		Vamba (.joomlaitalia.com) & Matthew Thomson (ignitejoomlaextensions.com)
 
* @based on  	com_ignitiongallery
 
* @author 		Matthew Thomson (ignitejoomlaextensions.com)
 
* Joomla! and com_morfeoshow are free software. This version may have been modified pursuant
 
* to the GNU General Public License, and as distributed they include or
 
* are derivative of works licensed under the GNU General Public License or
 
* other free or open source software licenses.
 
*/
 
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
 
$result = $count;	
 
if($result > 0) {
 
$x=0;
 
 
if ($params_morfeo['style0'] == 1) { 
 
echo '<style>';
 
echo $params_morfeo['style2'];
 
echo '</style>';
 
		} 
 
		else
 
		{
 
?>
 
<style>
 
a img, img 	{ border: none; text-decoration: none; }
 
#page-wrap	{ width: auto; margin: 0 auto; }
 
.photo-link	{padding: 5px;margin: 5px;border: 1px solid #999;display: block;width: <?php echo $params_morfeo['larghezza']?>px;text-align:center;font-size:9px;text-decoration: none;}
 
.photo-link:hover{border-color: white;text-decoration: none;}
 
</style>
 
<?php
 
}
 
	echo '<script src="'.JURI::root(true).'/components/com_morfeoshow/tpl/resources/boxover/boxover.js" type="text/javascript"></script>
 
	<table class="sboxgallery" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>';	
 
	echo '<div id="page-wrap">';
 
		foreach ($items as $file) 
 
	{ 
 
	
 
	$x=$x+1;
 
	if ($x % $params['colonne'] == 0) { 		
 
	
 
 if ($params_morfeo['titolo'] == 0) {
 
		$file->titolo = ''; 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->titolo = $file->filename;		
 
		$file->titolo = str_replace($ext, '', $file->titolo);	
 
		} else {
 
		$file->titolo = $file->title;
 
		}
 
		
 
echo '<td align="center"><a class="photo-link" rel="shadowbox[Morfeo];options={slideshowDelay:6}" class="option" href="'.$path1.$file->filename.'">
 
		<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'" title="header=['.$file->titolo.'] body=['.$file->html.']">'
 
;			
 
echo '</a>';
 
echo'</td></tr><tr>';
 
}
 
}else{	
 
 
 if ($params_morfeo['titolo'] == 0) {
 
		$file->titolo = ''; 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->titolo = $file->filename;		
 
		$file->titolo = str_replace($ext, '', $file->titolo);	
 
		} else {
 
		$file->titolo = $file->title;
 
		}
 
		
 
echo '<td align="center"><a class="photo-link" rel="shadowbox[Morfeo];options={slideshowDelay:6}" class="option" href="'.$path1.$file->filename.'">
 
		<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'" title="header=['.$file->titolo.'] body=['.$file->html.']">'
 
;			
 
echo '</a>';
 
echo'</td>';
 
}
 
 
	}	
 
	
 
}	
 
}		
 
		echo '</div></td></tr><tr><td></br /></td></tr></table>';		
 
\ No newline at end of file
components/com_morfeoshow/tpl/classic/shadowbox3.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
* @package		Joomla
 
* @subpackage	com_morfeoshow
 
* @copyright	Copyright (C) Vamba & Matthew Thomson. All rights reserved.
 
* @license		GNU/GPL.
 
* @author 		Vamba (.joomlaitalia.com) & Matthew Thomson (ignitejoomlaextensions.com)
 
* @based on  	com_ignitiongallery
 
* @author 		Matthew Thomson (ignitejoomlaextensions.com)
 
* Joomla! and com_morfeoshow are free software. This version may have been modified pursuant
 
* to the GNU General Public License, and as distributed they include or
 
* are derivative of works licensed under the GNU General Public License or
 
* other free or open source software licenses.
 
*/
 
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
 
$result = $count;	
 
if($result > 0) {
 
$x=0;
 
 
 
if ($params_morfeo['style'] == 1) { 
 
echo '<style>';
 
echo $params_morfeo['style1'];
 
echo '</style>';
 
		} 
 
		else
 
		{		
 
 
echo '<style>
 
.sboxgallery {padding: 10px 10px 30px 30px;}
 
#sboxth {padding: 0 5px 15px 0;text-align:center;font-size:10px;width:100px;}
 
#sboxth img {border: 1px solid #eeeccc;	border-width: 2px 2px 2px;}
 
#sboxth a:hover img {border: 1px solid #3e3e3e;border-width: 2px 2px 2px;}
 
</style>';
 
		}
 
		
 
	echo '<table class="sboxgallery" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>';		
 
		foreach ($items as $file) 
 
	{ 
 
 
	$x=$x+1;
 
	if ($x % $params['colonne'] == 0) { 	
 
	
 
     if ($file->html =='') 
 
	 { 
 
echo '<td id="sboxth">
 
	<a rel="shadowbox[Morfeo];options={slideshowDelay:6}" class="option" href="'.$path1.$file->filename.'">
 
		<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'">
 
	</a>
 
	<br />
 
';
 
	}	
 
	else	
 
	{ 
 
	
 
echo '
 
<td id="sboxth">
 
		<a rel="shadowbox[Morfeo];options={slideshowDelay:6}" class="option" href="'.$path1.$file->filename.'">
 
			<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'" title="'.$file->html.'" alt="'.$file->html.'">
 
		</a>
 
			<br />'
 
;			
 
	}//fine else immagine	
 
if ($params_morfeo['titolo'] == 0) { 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->filename = str_replace($ext, '', $file->filename);	
 
			echo $file->filename;
 
				} 
 
				else 
 
				{	
 
			echo $file->title;
 
			}//end elsefilename
 
		}//end else titolo
 
		echo'</td></tr><tr>';
 
		
 
}else{			
 
		
 
     if ($file->html =='') 
 
	 { 
 
echo '<td id="sboxth">
 
	<a rel="shadowbox[Morfeo];options={slideshowDelay:6}" class="option" href="'.$path1.$file->filename.'">
 
		<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'">
 
	</a>
 
	<br />
 
';
 
	}	
 
	else	
 
	{ 
 
	
 
echo '
 
<td id="sboxth">
 
		<a rel="shadowbox[Morfeo];options={slideshowDelay:6}" class="option" href="'.$path1.$file->filename.'">
 
			<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'" title="'.$file->html.'" alt="'.$file->html.'">
 
		</a>
 
			<br />'
 
;			
 
	}//fine else immagine	
 
if ($params_morfeo['titolo'] == 0) { 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->filename = str_replace($ext, '', $file->filename);	
 
			echo $file->filename;
 
				} 
 
				else 
 
				{	
 
			echo $file->title;
 
			}//end elsefilename
 
		}//end else titolo
 
		echo '</td>';
 
		
 
	}	
 
  }	
 
}		
 
		echo '</td></tr><tr><td></br /></td></tr></table>';	
 
\ No newline at end of file
components/com_morfeoshow/tpl/classic/shadowbox4.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
* @package		Joomla
 
* @subpackage	com_morfeoshow
 
* @copyright	Copyright (C) Vamba & Matthew Thomson. All rights reserved.
 
* @license		GNU/GPL.
 
* @author 		Vamba (.joomlaitalia.com) & Matthew Thomson (ignitejoomlaextensions.com)
 
* @based on  	com_ignitiongallery
 
* @author 		Matthew Thomson (ignitejoomlaextensions.com)
 
* Joomla! and com_morfeoshow are free software. This version may have been modified pursuant
 
* to the GNU General Public License, and as distributed they include or
 
* are derivative of works licensed under the GNU General Public License or
 
* other free or open source software licenses.
 
*/
 
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
 
$result = $count;	
 
if($result > 0) {
 
$x=0;
 
 
if ($params_morfeo['style0'] == 1) { 
 
echo '<style>';
 
echo $params_morfeo['style2'];
 
echo '</style>';
 
		} 
 
		else
 
		{
 
?>
 
<style>
 
a img, img 	{ border: none; text-decoration: none; }
 
#page-wrap	{ width: auto; margin: 0 auto; }
 
.photo-link	{padding: 5px;margin: 5px;border: 1px solid #999;display: block;width: <?php echo $params_morfeo['larghezza']?>px;text-align:center;font-size:9px;text-decoration: none;}
 
.photo-link:hover{border-color: white;text-decoration: none;}
 
</style>
 
<?php
 
}
 
	echo '<table class="sboxgallery" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>';	
 
	echo '<div id="page-wrap">';
 
		foreach ($items as $file) 
 
	{ 
 
	
 
	$x=$x+1;
 
	if ($x % $params['colonne'] == 0) { 	
 
	
 
     if ($file->html =='') 
 
	 { 
 
	echo '<td align="center"><a class="photo-link" rel="shadowbox[Morfeo];options={slideshowDelay:6}" class="option" href="'.$path1.$file->filename.'">
 
		<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'">';
 
if ($params_morfeo['titolo'] == 0) { 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->filename = str_replace($ext, '', $file->filename);	
 
			echo $file->filename;
 
				} 
 
				else 
 
				{	
 
			echo $file->title;
 
			}//end elsefilename
 
		}//end else titolo
 
echo '</a>';
 
	}	
 
	else	
 
	{ 
 
echo '<td align="center"><a class="photo-link" rel="shadowbox[Morfeo];options={slideshowDelay:6}" class="option" href="'.$path1.$file->filename.'">
 
		<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'" title="'.$file->html.'" alt="'.$file->html.'">'
 
;			
 
if ($params_morfeo['titolo'] == 0) { 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->filename = str_replace($ext, '', $file->filename);	
 
			echo $file->filename;
 
				} 
 
				else 
 
				{	
 
			echo $file->title;
 
			}//end elsefilename
 
		}//end else titolo
 
echo '</a>';
 
	}//fine else immagine
 
	echo'</td></tr><tr>';	
 
}else{
 
 
     if ($file->html =='') 
 
	 { 
 
	echo '<td align="center"><a class="photo-link" rel="shadowbox[Morfeo];options={slideshowDelay:6}" class="option" href="'.$path1.$file->filename.'">
 
		<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'">';
 
if ($params_morfeo['titolo'] == 0) { 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->filename = str_replace($ext, '', $file->filename);	
 
			echo $file->filename;
 
				} 
 
				else 
 
				{	
 
			echo $file->title;
 
			}//end elsefilename
 
		}//end else titolo
 
echo '</a>';
 
	}	
 
	else	
 
	{ 
 
echo '<td align="center"><a class="photo-link" rel="shadowbox[Morfeo];options={slideshowDelay:6}" class="option" href="'.$path1.$file->filename.'">
 
		<img src="'.$path2.$file->filename.'" width="'.$params_morfeo['larghezza'].'" title="'.$file->html.'" alt="'.$file->html.'">'
 
;			
 
if ($params_morfeo['titolo'] == 0) { 
 
		} 
 
		else 
 
		{
 
		if ($file->title == null) 
 
		{	
 
		$ext 			= array('.png','.jpg','.bmp','.gif','(',')','[',']','-','_');
 
		$file->filename = str_replace($ext, '', $file->filename);	
 
			echo $file->filename;
 
				} 
 
				else 
 
				{	
 
			echo $file->title;
 
			}//end elsefilename
 
		}//end else titolo
 
echo '</a>';
 
	}//fine else immagine
 
	echo'</td>';
 
	}	
 
  }	
 
}
 
		echo '</div>';
 
		echo '</td></tr><tr><td></br /></td></tr></table>';			
 
\ No newline at end of file
components/com_morfeoshow/tpl/flickrsingle/flickrsingle.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
* @package		Joomla
 
* @subpackage	com_morfeoshow
 
* @copyright	Copyright (C) Vamba & Matthew Thomson. All rights reserved.
 
* @license		GNU/GPL.
 
* @author 		Vamba (.joomlaitalia.com) & Matthew Thomson (ignitejoomlaextensions.com)
 
* @based on  	com_ignitiongallery
 
* @author 		Matthew Thomson (ignitejoomlaextensions.com)
 
* Joomla! and com_morfeoshow are free software. This version may have been modified pursuant
 
* to the GNU General Public License, and as distributed they include or
 
* are derivative of works licensed under the GNU General Public License or
 
* other free or open source software licenses.
 
*/
 
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
error_reporting(0);
 
?>
 
<style>
 
#gallflickr ul {
 
	margin: 0px;
 
	padding: 0px;
 
	list-style-type: none;
 
}
 
#gallflickr li {
 
	float: left;
 
	margin: 10px;
 
}
 
#gallflickr li a {
 
}
 
</style>
 
				<?php 
 
				
 
					if ($params_morfeo['flickrkey'] == '') {
 
					echo JText::_( 'No Flickr Key ID present' );
 
					}else{
 
					if ($photoset_id == '') {
 
					echo JText::_( 'Invalid or no Photoset id present' );
 
					}
 
					else
 
					{ ?>
 
<table align="center" valign="top" border="0" cellpadding="0" cellspacing="0" width="100%">
 
	<tr>
 
		<td>
 
			<div id="gallflickr">
 
				<ul>
 
				<?php foreach ($photos['photo'] as $photo): ?>
 
				<li><a class="gallflickr" rel="one-big-group" href="<?php echo $f->buildPhotoURL($photo, 'medium') ?>"><img src="<?php echo $f->buildPhotoURL($photo, 'square') ?>" alt="<?php echo $photo['title'] ?>" title="<?php echo $photo['title'] ?>" /></a></li>
 
				<?php endforeach; ?>
 
				</ul>
 
			</div>
 
		</td>
 
	</tr>
 
</table>
 
<?php	
 
					}
 
				}					
 
\ No newline at end of file
components/com_morfeoshow/tpl/flickrsingle/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/imagerotator/imagerotator.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
* @package		Joomla
 
* @subpackage	com_morfeoshow
 
* @copyright	Copyright (C) Vamba & Matthew Thomson. All rights reserved.
 
* @license		GNU/GPL.
 
* @author 		Vamba (.joomlaitalia.com) & Matthew Thomson (ignitejoomlaextensions.com)
 
* @based on  	com_ignitiongallery
 
* @author 		Matthew Thomson (ignitejoomlaextensions.com)
 
* Joomla! and com_morfeoshow are free software. This version may have been modified pursuant
 
* to the GNU General Public License, and as distributed they include or
 
* are derivative of works licensed under the GNU General Public License or
 
* other free or open source software licenses.
 
*/
 
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
 
echo '
 
			   <table class="fototable" border="0" cellpadding="0" cellspacing="0" width="100%">
 
					<tr>
 
						<td align="middle">
 
							<div id="xcontainer" align="middle">
 
								<a href="http://www.macromedia.com/go/getflashplayer">
 
									"'. JText::_( 'Get the Flash Player' ).'"</a> 
 
									"'. JText::_( 'to see this gallery.' ).'"
 
							</div>	
 
						<script type="text/javascript">				
 
						var s1 = new SWFObject("' . JURI::root() .'components/com_morfeoshow/src/imagerotator.swf", "rotator", "'. $params['width'] .'","'. $params['height'] .'","7");
 
							s1.addParam("wmode", "transparent");
 
							s1.addVariable("file","'. JURI::root() .'images/morfeoshow/'. $row->folder .'/xml/imagerotator.xml");
 
							s1.addVariable("width","'. $params['width'] .'");
 
							s1.addVariable("height","'.  $params['height'] .'");
 
							s1.addVariable("transition","'. $trans .'");				
 
							s1.addVariable("shownavigation","'. $nav .'");	
 
							s1.addVariable("kenburns","'. $mov .'");
 
							s1.addVariable("rotatetime","'. $params['tempo'] .'");
 
							s1.addVariable("shuffle","'. $shuffle .'");							
 
							s1.addVariable("screencolor","0x'. $params['bkgnd'] .'");
 
							s1.addVariable("usefullscreen","false");
 
							s1.addVariable("overstretch","'. $overstretch .'");							
 
							s1.write("xcontainer");
 
							</script>
 
						</td>
 
					</tr>
 
				</table>
 
 
';	
 
\ No newline at end of file
components/com_morfeoshow/tpl/imagerotator/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/imageviewer/imageviewer.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
* @package		Joomla
 
* @subpackage	com_morfeoshow
 
* @copyright	Copyright (C) Vamba & Matthew Thomson. All rights reserved.
 
* @license		GNU/GPL.
 
* @author 		Vamba (.joomlaitalia.com) & Matthew Thomson (ignitejoomlaextensions.com)
 
* @based on  	com_ignitiongallery
 
* @author 		Matthew Thomson (ignitejoomlaextensions.com)
 
* Joomla! and com_morfeoshow are free software. This version may have been modified pursuant
 
* to the GNU General Public License, and as distributed they include or
 
* are derivative of works licensed under the GNU General Public License or
 
* other free or open source software licenses.
 
*/
 
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
 
?>
 
<style type="text/css">	
 
	/* hide from ie on mac \*/	
 
	#flashcontent {	width: <?php echo $params["widthsw"]?>px; height: <?php echo $params["heightsw"]?>px;}
 
	/* end hide */
 
	a {	color:#333333;}
 
	p {	width: 480px;}
 
</style>
 
 
<?php
 
 echo '
 
				<table border="0" cellpadding="0" cellspacing="0" width="100%" valign="top">
 
					<tr>
 
						<td style="float:middle;" valign="top">
 
					<div id="xflashcontent" style="float:middle;" valign="top">
 
						<a href="http://www.macromedia.com/go/getflashplayer">
 
									"'. JText::_( 'Get the Flash Player' ).'"</a> 
 
									"'. JText::_( 'to see this gallery.' ).'"
 
					</div>
 
								<script type="text/javascript">
 
								var fo = new SWFObject("'. JURI::root() . 'components/com_morfeoshow/src/viewer.swf", "viewer", "'. $params["widthsw"] .'", "'. $params["heightsw"] .'", "8", "#000000");
 
			
 
								fo.addParam("wmode", "transparent");
 
								fo.addVariable("xmlDataPath", "'. JURI::root() .'images/morfeoshow/'. $row->folder .'/xml/gallery.xml");
 
								fo.addVariable("langOpenImage", "'. JText::_( 'Open Image in New Window.' ).'");
 
								fo.addVariable("langAbout", "'. JText::_( 'About.' ).'");	
 
								fo.addVariable("preloaderColor", "0x999999");
 
								fo.write("xflashcontent");
 
								</script>
 
						</td>
 
					</tr>
 
				</table>
 
	';
 
\ No newline at end of file
components/com_morfeoshow/tpl/imageviewer/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/picasa/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/picasa/picasa.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
* @package		Joomla
 
* @subpackage	com_morfeoshow
 
* @copyright	Copyright (C) Vamba & Matthew Thomson. All rights reserved.
 
* @license		GNU/GPL.
 
* @author 		Vamba (.joomlaitalia.com) & Matthew Thomson (ignitejoomlaextensions.com)
 
* @based on  	com_ignitiongallery
 
* @author 		Matthew Thomson (ignitejoomlaextensions.com)
 
* Joomla! and com_morfeoshow are free software. This version may have been modified pursuant
 
* to the GNU General Public License, and as distributed they include or
 
* are derivative of works licensed under the GNU General Public License or
 
* other free or open source software licenses.
 
*/
 
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
?>
 
<script type="text/javascript">
 
var pwi_username = "<?php echo $row->pusername ;?>";
 
var pwi_photosize = "<?php echo $row->pphotosize ;?>"; //return maximum size picture (see for supported format:  http://code.google.com/apis/picasaweb/reference.html#Parameters)
 
var pwi_thumbsize = "<?php echo $row->pthumbsize ;?>"; //size thumb /cropped(see for supported format:  http://code.google.com/apis/picasaweb/reference.html#Parameters)
 
var pwi_albumcols = "<?php echo $row->palbumcols ;?>"; // distribute thumbs on main page over x collums
 
var pwi_cols ="<?php echo $row->pcols ;?>"; // distribute thumbs on albumphotos page over x collums
 
var pwi_maxresults = "<?php echo $row->pmaxresults ;?>"; //maximum of pictures on albumphotos page
 
var pwi_maxalbums = "<?php echo $row->pmaxalbums ;?>"; //maximum of pictures on albumphotos page
 
var pwi_container_div = "#piccontainer";
 
 
function formatDate(dt) {
 
	var months = new Array(12);
 
	months[0] = "<?php echo JText::_( 'January' ) ?>";
 
	months[1] = "<?php echo JText::_( 'February' ) ?>";
 
	months[2] = "<?php echo JText::_( 'March' ) ?>";
 
	months[3] = "<?php echo JText::_( 'April' ) ?>";
 
	months[4] = "<?php echo JText::_( 'May' ) ?>";
 
	months[5] = "<?php echo JText::_( 'June' ) ?>";
 
	months[6] = "<?php echo JText::_( 'July' ) ?>";
 
	months[7] = "<?php echo JText::_( 'August' ) ?>";
 
	months[8] = "<?php echo JText::_( 'September' ) ?>";
 
	months[9] = "<?php echo JText::_( 'October' ) ?>";
 
	months[10] = "<?php echo JText::_( 'November' ) ?>";
 
	months[11] = "<?php echo JText::_( 'December' ) ?>";
 
	var today = new Date(Number(dt));
 
	var year = today.getYear();
 
	if (year < 1000) {
 
		year += 1900;
 
	};
 
	return (today.getDate() + " " + months[(today.getMonth())]+ " " + year);
 
}
 
 
function albums(j) { //returns the list of all albums for the user
 
	var scAlbums = new StringCat();
 
	scAlbums.push("<table align='center'><tr><td colspan='" + pwi_albumcols + "'><h3><?php echo JText::_( 'Albums' ) ?></h3></td></tr><tr>");
 
	for (var i = 0; i < j.feed.entry.length; i++) {
 
		var id_base = j.feed.entry[i].gphoto$id.$t;
 
		var album_date = formatDate(j.feed.entry[i].gphoto$timestamp.$t);
 
		scAlbums.push("<td valign=top align='center'><span class='small' a href='javascript:void(0)' onclick='javascript:$.historyLoad(\"" + id_base + "/1\")'><img src='" + j.feed.entry[i].media$group.media$thumbnail[0].url + "?imgmax=" + pwi_thumbsize + "&crop=0' class='pwimages' /></a>");
 
		scAlbums.push("<br /><a class='small' href='javascript:void(0)' onclick='javascript:$.historyLoad(\"" + id_base + "/1\")'>" + j.feed.entry[i].title.$t + "</a><br />" + album_date + "&nbsp;&nbsp;&nbsp;&nbsp;" + j.feed.entry[i].gphoto$numphotos.$t + " <?php echo JText::_( 'photos' ) ?></center></span></td>");
 
		if (i % pwi_albumcols == (pwi_albumcols - 1)) {
 
			scAlbums.push("</tr><tr><td colspan='" + pwi_albumcols + "'></td></tr><tr>");
 
		}
 
	}
 
	scAlbums.push("</tr></table>");
 
	pwi_storage_albums = scAlbums.toString();
 
	show(false, pwi_storage_albums);
 
}
 
 

	
 
function album(j) { //returns all photos in a specific album
 
	var scPhotos = new StringCat();
 
	 //get the number of photos in the album
 
	var np = j.feed.openSearch$totalResults.$t;
 
	var loc = j.feed.gphoto$location.$t;
 
	var desc = j.feed.subtitle.$t;
 
	var album_date = formatDate(j.feed.gphoto$timestamp.$t);
 
	var item_plural = "<?php echo JText::_( 's' ) ?>";
 
	if (np == "1") {
 
		item_plural = "";
 
	}
 
	var len = j.feed.entry.length;
 
	pwi_currAlbumTitle = j.feed.title.$t;
 

	
 
	scPhotos.push("<center><table border=0><tr>");
 
scPhotos.push("<tr><td colspan='" + pwi_cols + "'><a class='standard' href='javascript:void(0)' onclick='$.historyLoad(\"\");'><<< <?php echo JText::_( 'Albums' ) ?></a> &gt; " + j.feed.title.$t + "<br/>");	
 
	scPhotos.push("<blockquote><div style='margin-left:3px'><h4>" + j.feed.title.$t + "</h4></div>");
 
	scPhotos.push("<div style='margin-left:3px'><i>" + np + " <?php echo JText::_( 'photo' ) ?>" + item_plural + ", " + album_date + ", " + loc + "</i></div>");
 
	scPhotos.push("<div style='margin-left:3px'><b>" + desc + "</b></div>");
 
	scPhotos.push("</td></tr><tr>");
 
	
 
	 //create paging navigation
 
	pageCount = (np / pwi_maxresults);
 
	var ppage = "<?php echo JText::_( 'photos' ) ?> | ",
 
	npage = "| <?php echo JText::_( 'next' ) ?>";
 
	if (pwi_page > 1) {
 
		ppage = "<a href='javascript:void(0)' onclick='$.historyLoad(\"" + pwi_currAlbum + "/" + (parseInt(pwi_page) - 1) + "\")'><?php echo JText::_( 'previous' ) ?></a> | "
 
	};
 
	if (pwi_page < pageCount) {
 
		npage = "| <a href='javascript:void(0)' onclick='$.historyLoad(\"" + pwi_currAlbum + "/" + (parseInt(pwi_page) + 1) + "\")'><?php echo JText::_( 'next' ) ?></a>"
 
	};
 

	
 
	var navRow = new StringCat();
 
	navRow.push("<tr><td colspan='" + pwi_cols + "'>" + ppage + "<?php echo JText::_( 'Page' ) ?> ");
 
	for (var i = 1; i < pageCount + 1; i++) {	
 
		if (i == pwi_page) {
 
			navRow.push("<b>[" + (i) + "]</b> ");
 
		} else {
 
			navRow.push("<a href='javascript:void(0)' onclick='$.historyLoad(\"" + pwi_currAlbum + "/" + i + "\")'>" + (i) + "</a> ");
 
		};
 
	};
 
	navRow.push(npage + "</td></tr>");
 
	scPhotos.push(navRow.toString());
 
	for (var i = 0; i < len; i++) {
 
		var img_base = j.feed.entry[i].content.src;
 
		var id_base = j.feed.entry[i].gphoto$id.$t;
 
		var desc = j.feed.entry[i].summary.$t;
 
		var photoDate = j.feed.entry[i].exif$tags.exif$time ? formatDateTime(j.feed.entry[i].exif$tags.exif$time.$t) : j.feed.entry[i].published.$t;
 
		desc = photoDate + " - " + desc;
 
		scPhotos.push("<td valign='top'><center><a href='" + img_base + "?imgmax=" + pwi_photosize + "&crop=0' class='lightbox' title='" + desc + "'><img src='" + img_base + "?imgmax=" + pwi_thumbsize + "&crop=1' class='pwimages'/></a>");
 
		scPhotos.push("</center></td>");
 
		if (i % pwi_cols == (pwi_cols - 1)) {
 
			scPhotos.push("</tr><tr><td colspan=" + pwi_cols + "></td></tr><tr>");
 
		}
 
	}
 
	scPhotos.push("</tr>"+navRow+"</table></center>");
 
	pwi_storage_photos = scPhotos.toString();
 
	show(false, pwi_storage_photos);
 
}
 
 
 
function show(loading, data) {
 
	if (loading) {
 
		$(pwi_container_div).fadeOut('slow');
 
		$("#maincontent").block("<img src=\"<?php echo JURI::root()?>components/com_morfeoshow/images/loading.gif\"> <?php echo JText::_( 'Loading' ) ?> ...", {
 
			border: '3px solid #ccc'
 
		});
 
	} else {
 
		$("#maincontent").unblock();
 
		$(pwi_container_div).html(data).fadeIn('fast');
 
		$('a.lightbox').lightBox({
 
		overlayBgColor: '#fff',
 
		overlayOpacity: 0.6,
 
		imageLoading: "<?php echo JURI::root(true)?>/components/com_morfeoshow/tpl/resources/lightbox/load.gif",
 
		imageBtnClose:"<?php echo JURI::root(true)?>/components/com_morfeoshow/tpl/resources/lightbox/close.png",
 
		imageBtnPrev: "<?php echo JURI::root(true)?>/components/com_morfeoshow/tpl/resources/lightbox/prev.gif",
 
		imageBtnNext: "<?php echo JURI::root(true)?>/components/com_morfeoshow/tpl/resources/lightbox/next.gif",
 
		imageBlank:	"<?php echo JURI::root(true)?>/components/com_morfeoshow/tpl/resources/lightbox/blank.gif",
 
		containerResizeSpeed: 350,
 
		txtImage: "<?php echo JText::_( 'Images' ) ?>",
 
		txtOf: "<?php echo JText::_( 'of' ) ?>"
 
   });
 
	}
 
}
 
 
$(document).ready(function() {
 
	if(pwi_username == "<?php echo JText::_( 'picasa username missing' ) ?>"){
 
		alert('<?php echo JText::_( 'You must set one picasa username' ) ?>');
 
	}else{
 
		$.extend($.blockUI.defaults.overlayCSS, {
 
			backgroundColor: '#fff'
 
		});
 
		$.ajaxSetup({
 
			cache: true
 
		});
 
		$.historyInit(fromHistory);
 
	}
 
});
 
 
</script>
 
				<div id="pagebody">
 
					<div id="headerpic"></div>
 
						<div id="maincontent">
 
							<div id="piccontainer"></div>
 
					   </div>
 
					<div id="footerpic"></div>
 
				</div>
 
				<div style="float:right;" class="small">Picasa Gallery System is Property of <a href="http://www.picasa.com" target="blank" title="Picasa" alt="Picasa">Picasa</a> All right reserverd</div>
 
<?php				
 
\ No newline at end of file
components/com_morfeoshow/tpl/polaroid/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/polaroid/polaroid.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
* @package		Joomla
 
* @subpackage	com_morfeoshow
 
* @copyright	Copyright (C) Vamba & Matthew Thomson. All rights reserved.
 
* @license		GNU/GPL.
 
* @author 		Vamba (.joomlaitalia.com) & Matthew Thomson (ignitejoomlaextensions.com)
 
* @based on  	com_ignitiongallery
 
* @author 		Matthew Thomson (ignitejoomlaextensions.com)
 
* Joomla! and com_morfeoshow are free software. This version may have been modified pursuant
 
* to the GNU General Public License, and as distributed they include or
 
* are derivative of works licensed under the GNU General Public License or
 
* other free or open source software licenses.
 
*/
 
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
 
 
		echo '
 
				<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
					<tr>
 
						<td align="middle">
 
							<div id="screen" align="middle">
 
								<a href="http://www.macromedia.com/go/getflashplayer">
 
									"'.JText::_( 'Get the Flash Player' ).'"</a> 
 
									"'. JText::_( 'to see this gallery.' ).'"
 
							</div>
 
									<script type="text/javascript">
 
			//<![CDATA[
 
									var so = new SWFObject("'.JURI::root().'components/com_morfeoshow/src/polaroid.swf", "polaroid", "'.$params["widthpl"].'", "'. $params["heightpl"].'", "8", "#'.$params["bkgnd3"].'");
 
			// specify the url to the xml-file, default is photos.xml
 
									so.addParam("wmode", "transparent");
 
									so.addVariable("xmlURL","'.JURI::root().'images/morfeoshow/'. $row->folder.'/xml/polaroid.xml");
 
									so.write("screen");
 
			//]]>
 
								</script>				
 
						</td>
 
					</tr>
 
				</table>
 
			';	
 
\ No newline at end of file
components/com_morfeoshow/tpl/postcard/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/postcard/postcard.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
* @package		Joomla
 
* @subpackage	com_morfeoshow
 
* @copyright	Copyright (C) Vamba & Matthew Thomson. All rights reserved.
 
* @license		GNU/GPL.
 
* @author 		Vamba (.joomlaitalia.com) & Matthew Thomson (ignitejoomlaextensions.com)
 
* @based on  	com_ignitiongallery
 
* @author 		Matthew Thomson (ignitejoomlaextensions.com)
 
* Joomla! and com_morfeoshow are free software. This version may have been modified pursuant
 
* to the GNU General Public License, and as distributed they include or
 
* are derivative of works licensed under the GNU General Public License or
 
* other free or open source software licenses.
 
*/
 
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
 
		echo '
 
				<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
					<tr>
 
						<td valign=top" style="float:middle;">
 
							<div id="flashcontent" align="middle;">
 
								<a href="http://www.macromedia.com/go/getflashplayer">
 
									"'.JText::_( 'Get the Flash Player' ).'"</a> 
 
									"'. JText::_( 'to see this gallery.' ).'"
 
							</div>
 
							<script type="text/javascript">
 
					//<![CDATA[								
 
							var fo = new SWFObject("'. JURI::root() .'components/com_morfeoshow/src/postcard.swf", "postcard", "'. $params["widthpc"] .'", "'. $params["heightpc"] .'", "8", "' . $params["bkgnd2"] .'");	
 
								fo.addParam("wmode", "transparent");							
 
								fo.addVariable("langOpenImage", "Open Image in New Window");
 
								fo.addVariable("langAbout", "About");	
 
								fo.addVariable("xmlURL", "' .JURI::root() .'images/morfeoshow/' . $row->folder .'/xml/postcard.xml");					
 
								fo.write("flashcontent");	
 
					   //]]>								
 
								</script>
 
	
 
						</td>
 
					</tr>
 
				</table>
 
			';	
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/boxover/boxover.js
Show inline comments
 
new file 100644
 
/* --- BoxOver ---
 
/* --- v 2.1 17th June 2006
 
By Oliver Bryant with help of Matthew Tagg
 
http://boxover.swazz.org */
 
 
if (typeof document.attachEvent!='undefined') {
 
   window.attachEvent('onload',init);
 
   document.attachEvent('onmousemove',moveMouse);
 
   document.attachEvent('onclick',checkMove); }
 
else {
 
   window.addEventListener('load',init,false);
 
   document.addEventListener('mousemove',moveMouse,false);
 
   document.addEventListener('click',checkMove,false);
 
}
 
 
var oDv=document.createElement("div");
 
var dvHdr=document.createElement("div");
 
var dvBdy=document.createElement("div");
 
var windowlock,boxMove,fixposx,fixposy,lockX,lockY,fixx,fixy,ox,oy,boxLeft,boxRight,boxTop,boxBottom,evt,mouseX,mouseY,boxOpen,totalScrollTop,totalScrollLeft;
 
boxOpen=false;
 
ox=10;
 
oy=10;
 
lockX=0;
 
lockY=0;
 
 
function init() {
 
	oDv.appendChild(dvHdr);
 
	oDv.appendChild(dvBdy);
 
	oDv.style.position="absolute";
 
	oDv.style.visibility='hidden';
 
	document.body.appendChild(oDv);	
 
}
 
 
function defHdrStyle() {
 
	dvHdr.innerHTML='<img  style="vertical-align:middle"  src="info.gif">&nbsp;&nbsp;'+dvHdr.innerHTML;
 
	dvHdr.style.fontWeight='bold';
 
	dvHdr.style.width='150px';
 
	dvHdr.style.fontFamily='arial';
 
	dvHdr.style.borderBottom='1px solid #cccccc';
 
	dvHdr.style.borderTop='1px solid #000000';	
 
	dvHdr.style.borderLeft='1px solid #000000';
 
	dvHdr.style.borderRight='1px solid #000000';	
 
	dvHdr.style.padding='6px';
 
	dvHdr.style.fontSize='11px';
 
	dvHdr.style.color='#ffff00';
 
	dvHdr.style.background='#1a1a1a';
 
	dvHdr.style.filter='alpha(opacity=85)'; // IE
 
	dvHdr.style.opacity='0.85'; // FF
 
}
 
 
function defBdyStyle() {
 
	dvBdy.style.borderBottom='1px solid #000000';
 
	dvBdy.style.borderLeft='1px solid #000000';
 
	dvBdy.style.borderRight='1px solid #000000';
 
	dvBdy.style.width='150px';
 
	dvBdy.style.fontFamily='arial';
 
	dvBdy.style.fontSize='9px';
 
	dvBdy.style.padding='6px';
 
	dvBdy.style.color='#ffffff';
 
	dvBdy.style.background='#1a1a1a';
 
	dvBdy.style.filter='alpha(opacity=85)'; // IE
 
	dvBdy.style.opacity='0.85'; // FF
 
}
 
 
function checkElemBO(txt) {
 
if (!txt || typeof(txt) != 'string') return false;
 
if ((txt.indexOf('header')>-1)&&(txt.indexOf('body')>-1)&&(txt.indexOf('[')>-1)&&(txt.indexOf('[')>-1)) 
 
   return true;
 
else
 
   return false;
 
}
 
 
function scanBO(curNode) {
 
	  if (checkElemBO(curNode.title)) {
 
         curNode.boHDR=getParam('header',curNode.title);
 
         curNode.boBDY=getParam('body',curNode.title);
 
			curNode.boCSSBDY=getParam('cssbody',curNode.title);			
 
			curNode.boCSSHDR=getParam('cssheader',curNode.title);
 
			curNode.IEbugfix=(getParam('hideselects',curNode.title)=='on')?true:false;
 
			curNode.fixX=parseInt(getParam('fixedrelx',curNode.title));
 
			curNode.fixY=parseInt(getParam('fixedrely',curNode.title));
 
			curNode.absX=parseInt(getParam('fixedabsx',curNode.title));
 
			curNode.absY=parseInt(getParam('fixedabsy',curNode.title));
 
			curNode.offY=(getParam('offsety',curNode.title)!='')?parseInt(getParam('offsety',curNode.title)):10;
 
			curNode.offX=(getParam('offsetx',curNode.title)!='')?parseInt(getParam('offsetx',curNode.title)):10;
 
			curNode.fade=(getParam('fade',curNode.title)=='on')?true:false;
 
			curNode.fadespeed=(getParam('fadespeed',curNode.title)!='')?getParam('fadespeed',curNode.title):0.04;
 
			curNode.delay=(getParam('delay',curNode.title)!='')?parseInt(getParam('delay',curNode.title)):0;
 
			if (getParam('requireclick',curNode.title)=='on') {
 
				curNode.requireclick=true;
 
				document.all?curNode.attachEvent('onclick',showHideBox):curNode.addEventListener('click',showHideBox,false);
 
				document.all?curNode.attachEvent('onmouseover',hideBox):curNode.addEventListener('mouseover',hideBox,false);
 
			}
 
			else {// Note : if requireclick is on the stop clicks are ignored   			
 
   			if (getParam('doubleclickstop',curNode.title)!='off') {
 
   				document.all?curNode.attachEvent('ondblclick',pauseBox):curNode.addEventListener('dblclick',pauseBox,false);
 
   			}	
 
   			if (getParam('singleclickstop',curNode.title)=='on') {
 
   				document.all?curNode.attachEvent('onclick',pauseBox):curNode.addEventListener('click',pauseBox,false);
 
   			}
 
   		}
 
			curNode.windowLock=getParam('windowlock',curNode.title).toLowerCase()=='off'?false:true;
 
			curNode.title='';
 
			curNode.hasbox=1;
 
	   }
 
	   else
 
	      curNode.hasbox=2;   
 
}
 
 
 
function getParam(param,list) {
 
	var reg = new RegExp('([^a-zA-Z]' + param + '|^' + param + ')\\s*=\\s*\\[\\s*(((\\[\\[)|(\\]\\])|([^\\]\\[]))*)\\s*\\]');
 
	var res = reg.exec(list);
 
	var returnvar;
 
	if(res)
 
		return res[2].replace('[[','[').replace(']]',']');
 
	else
 
		return '';
 
}
 
 
function Left(elem){	
 
	var x=0;
 
	if (elem.calcLeft)
 
		return elem.calcLeft;
 
	var oElem=elem;
 
	while(elem){
 
		 if ((elem.currentStyle)&& (!isNaN(parseInt(elem.currentStyle.borderLeftWidth)))&&(x!=0))
 
		 	x+=parseInt(elem.currentStyle.borderLeftWidth);
 
		 x+=elem.offsetLeft;
 
		 elem=elem.offsetParent;
 
	  } 
 
	oElem.calcLeft=x;
 
	return x;
 
	}
 
 
function Top(elem){
 
	 var x=0;
 
	 if (elem.calcTop)
 
	 	return elem.calcTop;
 
	 var oElem=elem;
 
	 while(elem){		
 
	 	 if ((elem.currentStyle)&& (!isNaN(parseInt(elem.currentStyle.borderTopWidth)))&&(x!=0))
 
		 	x+=parseInt(elem.currentStyle.borderTopWidth); 
 
		 x+=elem.offsetTop;
 
	         elem=elem.offsetParent;
 
 	 } 
 
 	 oElem.calcTop=x;
 
 	 return x;
 
 	 
 
}
 
 
var ah,ab;
 
function applyStyles() {
 
	if(ab)
 
		oDv.removeChild(dvBdy);
 
	if (ah)
 
		oDv.removeChild(dvHdr);
 
	dvHdr=document.createElement("div");
 
	dvBdy=document.createElement("div");
 
	CBE.boCSSBDY?dvBdy.className=CBE.boCSSBDY:defBdyStyle();
 
	CBE.boCSSHDR?dvHdr.className=CBE.boCSSHDR:defHdrStyle();
 
	dvHdr.innerHTML=CBE.boHDR;
 
	dvBdy.innerHTML=CBE.boBDY;
 
	ah=false;
 
	ab=false;
 
	if (CBE.boHDR!='') {		
 
		oDv.appendChild(dvHdr);
 
		ah=true;
 
	}	
 
	if (CBE.boBDY!=''){
 
		oDv.appendChild(dvBdy);
 
		ab=true;
 
	}	
 
}
 
 
var CSE,iterElem,LSE,CBE,LBE, totalScrollLeft, totalScrollTop, width, height ;
 
var ini=false;
 
 
// Customised function for inner window dimension
 
function SHW() {
 
   if (document.body && (document.body.clientWidth !=0)) {
 
      width=document.body.clientWidth;
 
      height=document.body.clientHeight;
 
   }
 
   if (document.documentElement && (document.documentElement.clientWidth!=0) && (document.body.clientWidth + 20 >= document.documentElement.clientWidth)) {
 
      width=document.documentElement.clientWidth;   
 
      height=document.documentElement.clientHeight;   
 
   }   
 
   return [width,height];
 
}
 
 
 
var ID=null;
 
function moveMouse(e) {
 
   //boxMove=true;
 
	e?evt=e:evt=event;
 
	
 
	CSE=evt.target?evt.target:evt.srcElement;
 
	
 
	if (!CSE.hasbox) {
 
	   // Note we need to scan up DOM here, some elements like TR don't get triggered as srcElement
 
	   iElem=CSE;
 
	   while ((iElem.parentNode) && (!iElem.hasbox)) {
 
	      scanBO(iElem);
 
	      iElem=iElem.parentNode;
 
	   }	   
 
	}
 
	
 
	if ((CSE!=LSE)&&(!isChild(CSE,dvHdr))&&(!isChild(CSE,dvBdy))){		
 
	   if (!CSE.boxItem) {
 
			iterElem=CSE;
 
			while ((iterElem.hasbox==2)&&(iterElem.parentNode))
 
					iterElem=iterElem.parentNode; 
 
			CSE.boxItem=iterElem;
 
			}
 
		iterElem=CSE.boxItem;
 
		if (CSE.boxItem&&(CSE.boxItem.hasbox==1))  {
 
			LBE=CBE;
 
			CBE=iterElem;
 
			if (CBE!=LBE) {
 
				applyStyles();
 
				if (!CBE.requireclick)
 
					if (CBE.fade) {
 
						if (ID!=null)
 
							clearTimeout(ID);
 
						ID=setTimeout("fadeIn("+CBE.fadespeed+")",CBE.delay);
 
					}
 
					else {
 
						if (ID!=null)
 
							clearTimeout(ID);
 
						COL=1;
 
						ID=setTimeout("oDv.style.visibility='visible';ID=null;",CBE.delay);						
 
					}
 
				if (CBE.IEbugfix) {hideSelects();} 
 
				fixposx=!isNaN(CBE.fixX)?Left(CBE)+CBE.fixX:CBE.absX;
 
				fixposy=!isNaN(CBE.fixY)?Top(CBE)+CBE.fixY:CBE.absY;			
 
				lockX=0;
 
				lockY=0;
 
				boxMove=true;
 
				ox=CBE.offX?CBE.offX:10;
 
				oy=CBE.offY?CBE.offY:10;
 
			}
 
		}
 
		else if (!isChild(CSE,dvHdr) && !isChild(CSE,dvBdy) && (boxMove))	{
 
			// The conditional here fixes flickering between tables cells.
 
			if ((!isChild(CBE,CSE)) || (CSE.tagName!='TABLE')) {   			
 
   			CBE=null;
 
   			if (ID!=null)
 
  					clearTimeout(ID);
 
   			fadeOut();
 
   			showSelects();
 
			}
 
		}
 
		LSE=CSE;
 
	}
 
	else if (((isChild(CSE,dvHdr) || isChild(CSE,dvBdy))&&(boxMove))) {
 
		totalScrollLeft=0;
 
		totalScrollTop=0;
 
		
 
		iterElem=CSE;
 
		while(iterElem) {
 
			if(!isNaN(parseInt(iterElem.scrollTop)))
 
				totalScrollTop+=parseInt(iterElem.scrollTop);
 
			if(!isNaN(parseInt(iterElem.scrollLeft)))
 
				totalScrollLeft+=parseInt(iterElem.scrollLeft);
 
			iterElem=iterElem.parentNode;			
 
		}
 
		if (CBE!=null) {
 
			boxLeft=Left(CBE)-totalScrollLeft;
 
			boxRight=parseInt(Left(CBE)+CBE.offsetWidth)-totalScrollLeft;
 
			boxTop=Top(CBE)-totalScrollTop;
 
			boxBottom=parseInt(Top(CBE)+CBE.offsetHeight)-totalScrollTop;
 
			doCheck();
 
		}
 
	}
 
	
 
	if (boxMove&&CBE) {
 
		// This added to alleviate bug in IE6 w.r.t DOCTYPE
 
		bodyScrollTop=document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;
 
		bodyScrollLet=document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;
 
		mouseX=evt.pageX?evt.pageX-bodyScrollLet:evt.clientX-document.body.clientLeft;
 
		mouseY=evt.pageY?evt.pageY-bodyScrollTop:evt.clientY-document.body.clientTop;
 
		if ((CBE)&&(CBE.windowLock)) {
 
			mouseY < -oy?lockY=-mouseY-oy:lockY=0;
 
			mouseX < -ox?lockX=-mouseX-ox:lockX=0;
 
			mouseY > (SHW()[1]-oDv.offsetHeight-oy)?lockY=-mouseY+SHW()[1]-oDv.offsetHeight-oy:lockY=lockY;
 
			mouseX > (SHW()[0]-dvBdy.offsetWidth-ox)?lockX=-mouseX-ox+SHW()[0]-dvBdy.offsetWidth:lockX=lockX;			
 
		}
 
		oDv.style.left=((fixposx)||(fixposx==0))?fixposx:bodyScrollLet+mouseX+ox+lockX+"px";
 
		oDv.style.top=((fixposy)||(fixposy==0))?fixposy:bodyScrollTop+mouseY+oy+lockY+"px";		
 
		
 
	}
 
}
 
 
function doCheck() {	
 
	if (   (mouseX < boxLeft)    ||     (mouseX >boxRight)     || (mouseY < boxTop) || (mouseY > boxBottom)) {
 
		if (!CBE.requireclick)
 
			fadeOut();
 
		if (CBE.IEbugfix) {showSelects();}
 
		CBE=null;
 
	}
 
}
 
 
function pauseBox(e) {
 
   e?evt=e:evt=event;
 
	boxMove=false;
 
	evt.cancelBubble=true;
 
}
 
 
function showHideBox(e) {
 
	oDv.style.visibility=(oDv.style.visibility!='visible')?'visible':'hidden';
 
}
 
 
function hideBox(e) {
 
	oDv.style.visibility='hidden';
 
}
 
 
var COL=0;
 
var stopfade=false;
 
function fadeIn(fs) {
 
		ID=null;
 
		COL=0;
 
		oDv.style.visibility='visible';
 
		fadeIn2(fs);
 
}
 
 
function fadeIn2(fs) {
 
		COL=COL+fs;
 
		COL=(COL>1)?1:COL;
 
		oDv.style.filter='alpha(opacity='+parseInt(100*COL)+')';
 
		oDv.style.opacity=COL;
 
		if (COL<1)
 
		 setTimeout("fadeIn2("+fs+")",20);		
 
}
 
 
 
function fadeOut() {
 
	oDv.style.visibility='hidden';
 
	
 
}
 
 
function isChild(s,d) {
 
	while(s) {
 
		if (s==d) 
 
			return true;
 
		s=s.parentNode;
 
	}
 
	return false;
 
}
 
 
var cSrc;
 
function checkMove(e) {
 
	e?evt=e:evt=event;
 
	cSrc=evt.target?evt.target:evt.srcElement;
 
	if ((!boxMove)&&(!isChild(cSrc,oDv))) {
 
		fadeOut();
 
		if (CBE&&CBE.IEbugfix) {showSelects();}
 
		boxMove=true;
 
		CBE=null;
 
	}
 
}
 
 
function showSelects(){
 
   var elements = document.getElementsByTagName("select");
 
   for (i=0;i< elements.length;i++){
 
      elements[i].style.visibility='visible';
 
   }
 
}
 
 
function hideSelects(){
 
   var elements = document.getElementsByTagName("select");
 
   for (i=0;i< elements.length;i++){
 
   elements[i].style.visibility='hidden';
 
   }
 
}
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/boxover/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/fancy/bg.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/fancy/fancy.css
Show inline comments
 
new file 100644
 
div#fancy_overlay {
 
	position:absolute;
 
	top: 0;
 
	left: 0;
 
	z-index: 90;
 
	width: 100%;
 
	background-color: #333;
 
}
 

	
 
div#fancy_loading {
 
	position: absolute;
 
	height: 40px;
 
	width: 40px;
 
	cursor: pointer;
 
	display: none;
 
	overflow: hidden;
 
	background: transparent;
 
	z-index: 100;
 
}
 

	
 
div#fancy_loading div {
 
	position: absolute;
 
	top: 0;
 
	left: 0;
 
	width: 40px;
 
	height: 480px;
 
	background: transparent url(fancy_progress.png) no-repeat;
 
}
 

	
 
div#fancy_close {
 
	position: absolute;
 
	top: -12px;
 
	right: -12px;
 
	height: 30px;
 
	width: 30px;
 
	background: transparent url(fancy_closebox.png) ;
 
	cursor: pointer;
 
	z-index: 100;
 
	display: none;
 
}
 

	
 
div#fancy_content {
 
	position: absolute;
 
	top: 0;
 
	left: 0;
 
	width: 100%;
 
	height: 100%;
 
	padding: 0; 
 
	margin: 0;
 
	z-index: 96;
 
}
 

	
 
#fancy_frame {
 
	position: relative;
 
	width: 100%;
 
	height: 100%;
 
	display: none;
 
}
 

	
 
img#fancy_img {
 
	position: absolute;
 
	top: 0;
 
	left: 0;
 
	width: 100%;
 
	height: 100%;
 
	border:0; 
 
	padding: 0; 
 
	margin: 0;
 
	z-index: 92;
 
}
 

	
 
div#fancy_title {
 
	position: absolute;
 
	bottom: -35px;
 
	left: 0;
 
	width: 100%;
 
	z-index: 100;
 
	display: none;
 
}
 

	
 
div#fancy_title table {
 
	margin: 0 auto;
 
}
 

	
 
div#fancy_title div {
 
	color: #FFF;
 
	font: bold 12px Arial;
 
	padding-bottom: 2px;
 
}
 

	
 
td#fancy_title_left {
 
	height: 32px;
 
	width: 15px;
 
	background: transparent url(fancy_title_left.png) repeat-x;
 
}
 

	
 
td#fancy_title_main {
 
	height: 32px;
 
	background: transparent url(fancy_title_main.png) repeat-x;
 
}
 

	
 
td#fancy_title_right {
 
	height: 32px;
 
	width: 15px;
 
	background: transparent url(fancy_title_right.png) repeat-x;
 
}
 

	
 
div#fancy_outer {
 
	position: absolute;
 
    top: 0;
 
    left: 0;
 
    z-index: 90;
 
    padding: 18px 18px 58px 18px;
 
    margin: 0;
 
    overflow: hidden;
 
    background: transparent;
 
    display: none;
 
}
 

	
 
div#fancy_inner {
 
	position: relative;
 
	width:100%;
 
	height:100%;
 
	border: 1px solid #444;
 
	background: #FFF;
 
}
 

	
 
a#fancy_left, a#fancy_right {
 
	position: absolute; 
 
	bottom: 10px; 
 
	height: 100%; 
 
	width: 35%; 
 
	cursor: pointer;
 
	background-image: url(data:image/gif;base64,AAAA);
 
	z-index: 100; 
 
}
 

	
 
a#fancy_left {
 
	left: 0px; 
 
}
 

	
 
a#fancy_right {
 
	right: 0px; 
 
}
 

	
 
a#fancy_left:hover {
 
	background: transparent url(fancy_left.gif) no-repeat 0% 100%;
 
}
 

	
 
a#fancy_right:hover {
 
	background: transparent url(fancy_right.gif) no-repeat 100% 100%;
 
}
 

	
 
#fancy_bigIframe, #fancy_freeIframe {
 
	position:absolute;
 
	top: 0;
 
	left: 0;
 
	width: 100%;
 
	height: 100%;
 
	z-index: 10;
 
}
 

	
 
div#fancy_bg {
 
	display: none;
 
}
 
	
 
div.fancy_bg {
 
	position: absolute;
 
	display: block;
 
	z-index: 70;
 
}
 

	
 
div.fancy_bg_n {
 
	top: -18px;
 
	width: 100%;
 
	height: 18px;
 
	background: transparent url(fancy_shadow_n.png) repeat-x;
 
}
 

	
 
div.fancy_bg_ne {
 
	top: -18px;
 
	right: -13px;
 
	width: 13px;
 
	height: 18px;
 
	background: transparent url(fancy_shadow_ne.png) no-repeat;
 
}
 

	
 
div.fancy_bg_e {
 
	right: -13px;
 
	height: 100%;
 
	width: 13px;
 
	background: transparent url(fancy_shadow_e.png) repeat-y;
 
}
 

	
 
div.fancy_bg_se {
 
	bottom: -18px;
 
	right: -13px;
 
	width: 13px;
 
	height: 18px;
 
	background: transparent url(fancy_shadow_se.png) no-repeat;
 
}
 

	
 
div.fancy_bg_s {
 
	bottom: -18px;
 
	width: 100%;
 
	height: 18px;
 
	background: transparent url(fancy_shadow_s.png) repeat-x;
 
}
 

	
 
div.fancy_bg_sw {
 
	bottom: -18px;
 
	left: -13px;
 
	width: 13px;
 
	height: 18px;
 
	background: transparent url(fancy_shadow_sw.png) no-repeat;
 
}
 

	
 
div.fancy_bg_w {
 
	left: -13px;
 
	height: 100%;
 
	width: 13px;
 
	background: transparent url(fancy_shadow_w.png) repeat-y;
 
}
 

	
 
div.fancy_bg_nw {
 
	top: -18px;
 
	left: -13px;
 
	width: 13px;
 
	height: 18px;
 
	background: transparent url(fancy_shadow_nw.png) no-repeat;
 
}
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/fancy/fancy_closebox.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/fancy/fancy_left.gif
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/fancy/fancy_progress.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/fancy/fancy_right.gif
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/fancy/fancy_shadow_e.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/fancy/fancy_shadow_n.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/fancy/fancy_shadow_ne.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/fancy/fancy_shadow_nw.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/fancy/fancy_shadow_s.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/fancy/fancy_shadow_se.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/fancy/fancy_shadow_sw.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/fancy/fancy_shadow_w.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/fancy/fancy_title_left.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/fancy/fancy_title_main.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/fancy/fancy_title_right.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/fancy/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/fancy/jquery.fancybox-1.0.0.js
Show inline comments
 
new file 100644
 
/*
 
 * FancyBox - simple jQuery plugin for fancy image zooming
 
 * Examples and documentation at: http://fancy.klade.lv/
 
 * Version: 1.0.0 (29/04/2008)
 
 * Copyright (c) 2008 Janis Skarnelis
 
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
 
 * Requires: jQuery v1.2.1 or later
 
*/
 
(function($) {
 
	var opts = {}, 
 
		imgPreloader = new Image, imgTypes = ['png', 'jpg', 'jpeg', 'gif'], 
 
		loadingTimer, loadingFrame = 1;
 
 
   $.fn.fancybox = function(settings) {
 
		opts.settings = $.extend({}, $.fn.fancybox.defaults, settings);
 
 
		$.fn.fancybox.init();
 
 
		return this.each(function() {
 
			var $this = $(this);
 
			var o = $.metadata ? $.extend({}, opts.settings, $this.metadata()) : opts.settings;
 
 
			$this.unbind('click').click(function() {
 
				$.fn.fancybox.start(this, o); return false;
 
			});
 
		});
 
	};
 
 
	$.fn.fancybox.start = function(el, o) {
 
		if (opts.animating) return false;
 
 
		if (o.overlayShow) {
 
			$("#fancy_wrap").prepend('<div id="fancy_overlay"></div>');
 
			$("#fancy_overlay").css({'width': $(window).width(), 'height': $(document).height(), 'opacity': o.overlayOpacity});
 
 
			if ($.browser.msie) {
 
				$("#fancy_wrap").prepend('<iframe id="fancy_bigIframe" scrolling="no" frameborder="0"></iframe>');
 
				$("#fancy_bigIframe").css({'width': $(window).width(), 'height': $(document).height(), 'opacity': 0});
 
			}
 
 
			$("#fancy_overlay").click($.fn.fancybox.close);
 
		}
 
 
		opts.itemArray	= [];
 
		opts.itemNum	= 0;
 
 
		if (jQuery.isFunction(o.itemLoadCallback)) {
 
		   o.itemLoadCallback.apply(this, [opts]);
 
 
			var c	= $(el).children("img:first").length ? $(el).children("img:first") : $(el);
 
			var tmp	= {'width': c.width(), 'height': c.height(), 'pos': $.fn.fancybox.getPosition(c)}
 
 
		   for (var i = 0; i < opts.itemArray.length; i++) {
 
				opts.itemArray[i].o = $.extend({}, o, opts.itemArray[i].o);
 
				
 
				if (o.zoomSpeedIn > 0 || o.zoomSpeedOut > 0) {
 
					opts.itemArray[i].orig = tmp;
 
				}
 
		   }
 
 
		} else {
 
			if (!el.rel || el.rel == '') {
 
				var item = {url: el.href, title: el.title, o: o};
 
 
				if (o.zoomSpeedIn > 0 || o.zoomSpeedOut > 0) {
 
					var c = $(el).children("img:first").length ? $(el).children("img:first") : $(el);
 
					item.orig = {'width': c.width(), 'height': c.height(), 'pos': $.fn.fancybox.getPosition(c)}
 
				}
 
 
				opts.itemArray.push(item);
 
 
			} else {
 
				var arr	= $("a[@rel=" + el.rel + "]").get();
 
 
				for (var i = 0; i < arr.length; i++) {
 
					var tmp		= $.metadata ? $.extend({}, o, $(arr[i]).metadata()) : o;
 
   					var item	= {url: arr[i].href, title: arr[i].title, o: tmp};
 
 
   					if (o.zoomSpeedIn > 0 || o.zoomSpeedOut > 0) {
 
						var c = $(arr[i]).children("img:first").length ? $(arr[i]).children("img:first") : $(el);
 
 
						item.orig = {'width': c.width(), 'height': c.height(), 'pos': $.fn.fancybox.getPosition(c)}
 
					}
 
 
					if (arr[i].href == el.href) opts.itemNum = i;
 
 
					opts.itemArray.push(item);
 
				}
 
			}
 
		}
 
 
		$.fn.fancybox.changeItem(opts.itemNum);
 
	};
 
 
	$.fn.fancybox.changeItem = function(n) {
 
		$.fn.fancybox.showLoading();
 
 
		opts.itemNum = n;
 
 
		$("#fancy_nav").empty();
 
		$("#fancy_outer").stop();
 
		$("#fancy_title").hide();
 
		$(document).unbind("keydown");
 
 
		imgRegExp = imgTypes.join('|');
 
    	imgRegExp = new RegExp('\.' + imgRegExp + '$', 'i');
 
 
		var url = opts.itemArray[n].url;
 
 
		if (url.match(/#/)) {
 
			var target = window.location.href.split('#')[0]; target = url.replace(target,'');
 
 
	        $.fn.fancybox.showItem('<div id="fancy_div">' + $(target).html() + '</div>');
 
 
	        $("#fancy_loading").hide();
 
 
		} else if (url.match(imgRegExp)) {
 
			$(imgPreloader).unbind('load').bind('load', function() {
 
				$("#fancy_loading").hide();
 
 
				opts.itemArray[n].o.frameWidth	= imgPreloader.width;
 
				opts.itemArray[n].o.frameHeight	= imgPreloader.height;
 
 
				$.fn.fancybox.showItem('<img id="fancy_img" src="' + imgPreloader.src + '" />');
 
 
			}).attr('src', url + '?rand=' + Math.floor(Math.random() * 999999999) );
 
 
		} else {
 
			$.fn.fancybox.showItem('<iframe id="fancy_frame" onload="$.fn.fancybox.showIframe()" name="fancy_iframe' + Math.round(Math.random()*1000) + '" frameborder="0" hspace="0" src="' + url + '"></iframe>');
 
		}
 
	};
 
 
	$.fn.fancybox.showIframe = function() {
 
		$("#fancy_loading").hide();
 
		$("#fancy_frame").show();
 
	};
 
 
	$.fn.fancybox.showItem = function(val) {
 
		$.fn.fancybox.preloadNeighborImages();
 
 
		var viewportPos	= $.fn.fancybox.getViewport();
 
		var itemSize	= $.fn.fancybox.getMaxSize(viewportPos[0] - 50, viewportPos[1] - 100, opts.itemArray[opts.itemNum].o.frameWidth, opts.itemArray[opts.itemNum].o.frameHeight);
 
 
		var itemLeft	= viewportPos[2] + Math.round((viewportPos[0] - itemSize[0]) / 2) - 20;
 
		var itemTop		= viewportPos[3] + Math.round((viewportPos[1] - itemSize[1]) / 2) - 40;
 
 
		var itemOpts = {
 
			'left':		itemLeft, 
 
			'top':		itemTop, 
 
			'width':	itemSize[0] + 'px', 
 
			'height':	itemSize[1] + 'px'	
 
		}
 
 
		if (opts.active) {
 
			$('#fancy_content').fadeOut("normal", function() {
 
				$("#fancy_content").empty();
 
				
 
				$("#fancy_outer").animate(itemOpts, "normal", function() {
 
					$("#fancy_content").append($(val)).fadeIn("normal");
 
					$.fn.fancybox.updateDetails();
 
				});
 
			});
 
 
		} else {
 
			opts.active = true;
 
 
			$("#fancy_content").empty();
 
 
			if ($("#fancy_content").is(":animated")) {
 
				console.info('animated!');
 
			}
 
 
			if (opts.itemArray[opts.itemNum].o.zoomSpeedIn > 0) {
 
				opts.animating		= true;
 
				itemOpts.opacity	= "show";
 
 
				$("#fancy_outer").css({
 
					'top':		opts.itemArray[opts.itemNum].orig.pos.top - 18,
 
					'left':		opts.itemArray[opts.itemNum].orig.pos.left - 18,
 
					'height':	opts.itemArray[opts.itemNum].orig.height,
 
					'width':	opts.itemArray[opts.itemNum].orig.width
 
				});
 
 
				$("#fancy_content").append($(val)).show();
 
 
				$("#fancy_outer").animate(itemOpts, opts.itemArray[opts.itemNum].o.zoomSpeedIn, function() {
 
					opts.animating = false;
 
					$.fn.fancybox.updateDetails();
 
				});
 
 
			} else {
 
				$("#fancy_content").append($(val)).show();
 
				$("#fancy_outer").css(itemOpts).show();
 
				$.fn.fancybox.updateDetails();
 
			}
 
		 }
 
	};
 
 
	$.fn.fancybox.updateDetails = function() {
 
		$("#fancy_bg,#fancy_close").show();
 
 
		if (opts.itemArray[opts.itemNum].title !== undefined && opts.itemArray[opts.itemNum].title !== '') {
 
			$('#fancy_title div').html(opts.itemArray[opts.itemNum].title);
 
			$('#fancy_title').show();
 
		}
 
 
		if (opts.itemArray[opts.itemNum].o.hideOnContentClick) {
 
			$("#fancy_content").click($.fn.fancybox.close);
 
		} else {
 
			$("#fancy_content").unbind('click');
 
		}
 
 
		if (opts.itemNum != 0) {
 
			$("#fancy_nav").append('<a id="fancy_left" href="javascript:;"></a>');
 
 
			$('#fancy_left').click(function() {
 
				$.fn.fancybox.changeItem(opts.itemNum - 1); return false;
 
			});
 
		}
 
 
		if (opts.itemNum != (opts.itemArray.length - 1)) {
 
			$("#fancy_nav").append('<a id="fancy_right" href="javascript:;"></a>');
 
			
 
			$('#fancy_right').click(function(){
 
				$.fn.fancybox.changeItem(opts.itemNum + 1); return false;
 
			});
 
		}
 
 
		$(document).keydown(function(event) {
 
			if (event.keyCode == 27) {
 
            	$.fn.fancybox.close();
 
 
			} else if(event.keyCode == 37 && opts.itemNum != 0) {
 
            	$.fn.fancybox.changeItem(opts.itemNum - 1);
 
 
			} else if(event.keyCode == 39 && opts.itemNum != (opts.itemArray.length - 1)) {
 
            	$.fn.fancybox.changeItem(opts.itemNum + 1);
 
			}
 
		});
 
	};
 
 
	$.fn.fancybox.preloadNeighborImages = function() {
 
		if ((opts.itemArray.length - 1) > opts.itemNum) {
 
			preloadNextImage = new Image();
 
			preloadNextImage.src = opts.itemArray[opts.itemNum + 1].url;
 
		}
 
 
		if (opts.itemNum > 0) {
 
			preloadPrevImage = new Image();
 
			preloadPrevImage.src = opts.itemArray[opts.itemNum - 1].url;
 
		}
 
	};
 
 
	$.fn.fancybox.close = function() {
 
		if (opts.animating) return false;
 
 
		$(imgPreloader).unbind('load');
 
		$(document).unbind("keydown");
 
 
		$("#fancy_loading,#fancy_title,#fancy_close,#fancy_bg").hide();
 
 
		$("#fancy_nav").empty();
 
 
		opts.active	= false;
 
 
		if (opts.itemArray[opts.itemNum].o.zoomSpeedOut > 0) {
 
			var itemOpts = {
 
				'top':		opts.itemArray[opts.itemNum].orig.pos.top - 18,
 
				'left':		opts.itemArray[opts.itemNum].orig.pos.left - 18,
 
				'height':	opts.itemArray[opts.itemNum].orig.height,
 
				'width':	opts.itemArray[opts.itemNum].orig.width,
 
				'opacity':	'hide'
 
			};
 
 
			opts.animating = true;
 
 
			$("#fancy_outer").animate(itemOpts, opts.itemArray[opts.itemNum].o.zoomSpeedOut, function() {
 
				$("#fancy_content").hide().empty();
 
				$("#fancy_overlay,#fancy_bigIframe").remove();
 
				opts.animating = false;
 
			});
 
 
		} else {
 
			$("#fancy_outer").hide();
 
			$("#fancy_content").hide().empty();
 
			$("#fancy_overlay,#fancy_bigIframe").fadeOut("fast").remove();
 
		}
 
	};
 
 
	$.fn.fancybox.showLoading = function() {
 
		clearInterval(loadingTimer);
 
 
		var pos = $.fn.fancybox.getViewport();
 
 
		$("#fancy_loading").css({'left': ((pos[0] - 40) / 2 + pos[2]), 'top': ((pos[1] - 40) / 2 + pos[3])}).show();
 
		$("#fancy_loading").bind('click', $.fn.fancybox.close);
 
		
 
		loadingTimer = setInterval($.fn.fancybox.animateLoading, 66);
 
	};
 
 
	$.fn.fancybox.animateLoading = function(el, o) {
 
		if (!$("#fancy_loading").is(':visible')){
 
			clearInterval(loadingTimer);
 
			return;
 
		}
 
 
		$("#fancy_loading > div").css('top', (loadingFrame * -40) + 'px');
 
 
		loadingFrame = (loadingFrame + 1) % 12;
 
	};
 
 
	$.fn.fancybox.init = function() {
 
		if (!$('#fancy_wrap').length) {
 
			$('<div id="fancy_wrap"><div id="fancy_loading"><div></div></div><div id="fancy_outer"><div id="fancy_inner"><div id="fancy_nav"></div><div id="fancy_close"></div><div id="fancy_content"></div><div id="fancy_title"></div></div></div></div>').appendTo("body");
 
			$('<div id="fancy_bg"><div class="fancy_bg fancy_bg_n"></div><div class="fancy_bg fancy_bg_ne"></div><div class="fancy_bg fancy_bg_e"></div><div class="fancy_bg fancy_bg_se"></div><div class="fancy_bg fancy_bg_s"></div><div class="fancy_bg fancy_bg_sw"></div><div class="fancy_bg fancy_bg_w"></div><div class="fancy_bg fancy_bg_nw"></div></div>').prependTo("#fancy_inner");
 
			
 
			$('<table cellspacing="0" cellpadding="0" border="0"><tr><td id="fancy_title_left"></td><td id="fancy_title_main"><div></div></td><td id="fancy_title_right"></td></tr></table>').appendTo('#fancy_title');
 
		}
 
 
		if ($.browser.msie) {
 
			$("#fancy_inner").prepend('<iframe id="fancy_freeIframe" scrolling="no" frameborder="0"></iframe>');
 
		}
 
 
		if (jQuery.fn.pngFix) $(document).pngFix();
 
 
    	$("#fancy_close").click($.fn.fancybox.close);
 
	};
 
 
	$.fn.fancybox.getPosition = function(el) {
 
		var pos = el.offset();
 
 
		pos.top	+= $.fn.fancybox.num(el, 'paddingTop');
 
		pos.top	+= $.fn.fancybox.num(el, 'borderTopWidth');
 
 
 		pos.left += $.fn.fancybox.num(el, 'paddingLeft');
 
		pos.left += $.fn.fancybox.num(el, 'borderLeftWidth');
 
 
		return pos;
 
	};
 
 
	$.fn.fancybox.num = function (el, prop) {
 
		return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;
 
	};
 
 
	$.fn.fancybox.getPageScroll = function() {
 
		var xScroll, yScroll;
 
 
		if (self.pageYOffset) {
 
			yScroll = self.pageYOffset;
 
			xScroll = self.pageXOffset;
 
		} else if (document.documentElement && document.documentElement.scrollTop) {
 
			yScroll = document.documentElement.scrollTop;
 
			xScroll = document.documentElement.scrollLeft;
 
		} else if (document.body) {
 
			yScroll = document.body.scrollTop;
 
			xScroll = document.body.scrollLeft;	
 
		}
 
 
		return [xScroll, yScroll]; 
 
	};
 
 
	$.fn.fancybox.getViewport = function() {
 
		var scroll = $.fn.fancybox.getPageScroll();
 
 
		return [$(window).width(), $(window).height(), scroll[0], scroll[1]];
 
	};
 
 
	$.fn.fancybox.getMaxSize = function(maxWidth, maxHeight, imageWidth, imageHeight) {
 
		var r = Math.min(Math.min(maxWidth, imageWidth) / imageWidth, Math.min(maxHeight, imageHeight) / imageHeight);
 
 
		return [Math.round(r * imageWidth), Math.round(r * imageHeight)];
 
	};
 
 
	$.fn.fancybox.defaults = {
 
		hideOnContentClick:	false,
 
		zoomSpeedIn:		500,
 
		zoomSpeedOut:		500,
 
		frameWidth:			600,
 
		frameHeight:		400,
 
		overlayShow:		false,
 
		overlayOpacity:		0.4,
 
		itemLoadCallback:	null
 
	};
 
})(jQuery);
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/fancy/jquery.pngFix.pack.js
Show inline comments
 
new file 100644
 
/**
 
 * --------------------------------------------------------------------
 
 * jQuery-Plugin "pngFix"
 
 * Version: 1.1, 11.09.2007
 
 * by Andreas Eberhard, andreas.eberhard@gmail.com
 
 *                      http://jquery.andreaseberhard.de/
 
 *
 
 * Copyright (c) 2007 Andreas Eberhard
 
 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
 
 */
 
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(s($){3.1s.1k=s(j){j=3.1a({12:\'1m.1j\'},j);8 k=(n.P=="r 10 Z"&&U(n.v)==4&&n.v.E("14 5.5")!=-1);8 l=(n.P=="r 10 Z"&&U(n.v)==4&&n.v.E("14 6.0")!=-1);o(3.17.16&&(k||l)){3(2).L("1r[@m$=.M]").z(s(){3(2).7(\'q\',3(2).q());3(2).7(\'p\',3(2).p());8 a=\'\';8 b=\'\';8 c=(3(2).7(\'K\'))?\'K="\'+3(2).7(\'K\')+\'" \':\'\';8 d=(3(2).7(\'A\'))?\'A="\'+3(2).7(\'A\')+\'" \':\'\';8 e=(3(2).7(\'C\'))?\'C="\'+3(2).7(\'C\')+\'" \':\'\';8 f=(3(2).7(\'B\'))?\'B="\'+3(2).7(\'B\')+\'" \':\'\';8 g=(3(2).7(\'R\'))?\'1d:\'+3(2).7(\'R\')+\';\':\'\';8 h=(3(2).1c().7(\'1b\'))?\'19:18;\':\'\';o(2.9.y){a+=\'y:\'+2.9.y+\';\';2.9.y=\'\'}o(2.9.t){a+=\'t:\'+2.9.t+\';\';2.9.t=\'\'}o(2.9.w){a+=\'w:\'+2.9.w+\';\';2.9.w=\'\'}8 i=(2.9.15);b+=\'<x \'+c+d+e+f;b+=\'9="13:11;1q-1p:1o-1n;O:W-V;N:1l;\'+g+h;b+=\'q:\'+3(2).q()+\'u;\'+\'p:\'+3(2).p()+\'u;\';b+=\'J:I:H.r.G\'+\'(m=\\\'\'+3(2).7(\'m\')+\'\\\', D=\\\'F\\\');\';b+=i+\'"></x>\';o(a!=\'\'){b=\'<x 9="13:11;O:W-V;\'+a+h+\'q:\'+3(2).q()+\'u;\'+\'p:\'+3(2).p()+\'u;\'+\'">\'+b+\'</x>\'}3(2).1i();3(2).1h(b)});3(2).L("*").z(s(){8 a=3(2).T(\'N-S\');o(a.E(".M")!=-1){8 b=a.X(\'1g("\')[1].X(\'")\')[0];3(2).T(\'N-S\',\'1f\');3(2).Q(0).Y.J="I:H.r.G(m=\'"+b+"\',D=\'F\')"}});3(2).L("1e[@m$=.M]").z(s(){8 a=3(2).7(\'m\');3(2).Q(0).Y.J=\'I:H.r.G\'+\'(m=\\\'\'+a+\'\\\', D=\\\'F\\\');\';3(2).7(\'m\',j.12)})}1t 3}})(3);',62,92,'||this|jQuery||||attr|var|style|||||||||||||src|navigator|if|height|width|Microsoft|function|padding|px|appVersion|margin|span|border|each|class|alt|title|sizingMethod|indexOf|scale|AlphaImageLoader|DXImageTransform|progid|filter|id|find|png|background|display|appName|get|align|image|css|parseInt|block|inline|split|runtimeStyle|Explorer|Internet|relative|blankgif|position|MSIE|cssText|msie|browser|hand|cursor|extend|href|parent|float|input|none|url|after|hide|gif|pngFix|transparent|blank|line|pre|space|white|img|fn|return'.split('|'),0,{}))
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/lightbox/blank.gif
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/lightbox/close.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/lightbox/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/lightbox/lb.css
Show inline comments
 
new file 100644
 
/**
 
 * jQuery lightBox plugin
 
 * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
 
 * and adapted to me for use like a plugin from jQuery.
 
 * @name jquery-lightbox-0.5.css
 
 * @author Leandro Vieira Pinho - http://leandrovieira.com
 
 * @version 0.5
 
 * @date April 11, 2008
 
 * @category jQuery plugin
 
 * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
 
 * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US
 
 * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
 
 */
 
#jquery-overlay {
 
	position: absolute;
 
	top: 0;
 
	left: 0;
 
	z-index: 90;
 
	width: 100%;
 
	height: 500px;
 
}
 
#jquery-lightbox {
 
	position: absolute;
 
	top: 0;
 
	left: 0;
 
	width: 100%;
 
	z-index: 100;
 
	text-align: center;
 
	line-height: 0;
 
}
 
#jquery-lightbox a img { border: none; }
 
#lightbox-container-image-box {
 
	position: relative;
 
	background-color: #181818;
 
	width: 250px;
 
	height: 250px;
 
	margin: 0 auto;
 
}
 
#lightbox-container-image { padding: 10px; }
 
#lightbox-loading {
 
	position: absolute;
 
	top: 40%;
 
	left: 0%;
 
	height: 25%;
 
	width: 100%;
 
	text-align: center;
 
	line-height: 0;
 
}
 
#lightbox-nav {
 
	position: absolute;
 
	top: 0;
 
	left: 0;
 
	height: 100%;
 
	width: 100%;
 
	z-index: 10;
 
}
 
#lightbox-container-image-box > #lightbox-nav { left: 0; }
 
#lightbox-nav a { outline: none;}
 
#lightbox-nav-btnPrev, #lightbox-nav-btnNext {
 
	width: 49%;
 
	height: 100%;
 
	display: block;
 
}
 
#lightbox-nav-btnPrev { 
 
	left: 0; 
 
	float: left;
 
}
 
#lightbox-nav-btnNext { 
 
	right: 0; 
 
	float: right;
 
}
 
#lightbox-container-image-data-box {
 
	font: 10px Verdana, Helvetica, sans-serif;
 
	background-color: #181818;
 
	margin: 0 auto;
 
	line-height: 1.4em;
 
	overflow: auto;
 
	width: 100%;
 
	padding: 0 10px 0;
 
}
 
#lightbox-container-image-data {
 
	padding: 0 10px; 
 
	color: #666; 
 
}
 
#lightbox-container-image-data #lightbox-image-details { 
 
	width: 70%; 
 
	float: left; 
 
	text-align: left; 
 
}	
 
#lightbox-image-details-caption { font-weight: bold; }
 
#lightbox-image-details-currentNumber {
 
	display: block; 
 
	clear: left; 
 
	padding-bottom: 1.0em;	
 
}			
 
#lightbox-secNav-btnClose {
 
	width: 22px; 
 
	float: right;
 
	padding-bottom: 0.7em;	
 
}
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/lightbox/lb.js
Show inline comments
 
new file 100644
 
/**
 
 * jQuery lightBox plugin
 
 * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
 
 * and adapted to me for use like a plugin from jQuery.
 
 * @name jquery-lightbox-0.5.js
 
 * @author Leandro Vieira Pinho - http://leandrovieira.com
 
 * @version 0.5
 
 * @date April 11, 2008
 
 * @category jQuery plugin
 
 * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
 
 * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US
 
 * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
 
 */
 
(function($){$.fn.lightBox=function(settings){settings=jQuery.extend({overlayBgColor:'#000',overlayOpacity:0.8,fixedNavigation:false,imageLoading:'../../../components/com_morfeoshow/images/lightbox-ico-loading.gif',imageBtnPrev:'../../../components/com_morfeoshow/images/lightbox-btn-prev.gif',imageBtnNext:'../../../components/com_morfeoshow/images/lightbox-btn-next.gif',imageBtnClose:'../../../components/com_morfeoshow/images/lightbox-btn-close.gif',imageBlank:'../../../components/com_morfeoshow/images/lightbox-blank.gif',containerBorderSize:10,containerResizeSpeed:400,txtImage:'Image',txtOf:'of',keyToClose:'c',keyToPrev:'p',keyToNext:'n',imageArray:[],activeImage:0},settings);var jQueryMatchedObj=this;function _initialize(){_start(this,jQueryMatchedObj);return false;}
 
function _start(objClicked,jQueryMatchedObj){$('embed, object, select').css({'visibility':'hidden'});_set_interface();settings.imageArray.length=0;settings.activeImage=0;if(jQueryMatchedObj.length==1){settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));}else{for(var i=0;i<jQueryMatchedObj.length;i++){settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));}}
 
while(settings.imageArray[settings.activeImage][0]!=objClicked.getAttribute('href')){settings.activeImage++;}
 
_set_image_to_view();}
 
function _set_interface(){$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="'+settings.imageLoading+'"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="'+settings.imageBtnClose+'"></a></div></div></div></div>');var arrPageSizes=___getPageSize();$('#jquery-overlay').css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').click(function(){_finish();});$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function(){_finish();return false;});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#jquery-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});});}
 
function _set_image_to_view(){$('#lightbox-loading').show();if(settings.fixedNavigation){$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}else{$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}
 
var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);objImagePreloader.onload=function(){};};objImagePreloader.src=settings.imageArray[settings.activeImage][0];};function _resize_container_image_box(intImageWidth,intImageHeight){var intCurrentWidth=$('#lightbox-container-image-box').width();var intCurrentHeight=$('#lightbox-container-image-box').height();var intWidth=(intImageWidth+(settings.containerBorderSize*2));var intHeight=(intImageHeight+(settings.containerBorderSize*2));var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;$('#lightbox-container-image-box').animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image();});if((intDiffW==0)&&(intDiffH==0)){if($.browser.msie){___pause(250);}else{___pause(100);}}
 
$('#lightbox-container-image-data-box').css({width:intImageWidth});$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.containerBorderSize*2)});};function _show_image(){$('#lightbox-loading').hide();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation();});_preload_neighbor_images();};function _show_image_data(){$('#lightbox-container-image-data-box').slideDown('fast');$('#lightbox-image-details-caption').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();}
 
if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+settings.imageArray.length).show();}}
 
function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.imageBlank+') no-repeat'});if(settings.activeImage!=0){if(settings.fixedNavigation){$('#lightbox-nav-btnPrev').css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}}
 
if(settings.activeImage!=(settings.imageArray.length-1)){if(settings.fixedNavigation){$('#lightbox-nav-btnNext').css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}}
 
_enable_keyboard_navigation();}
 
function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent);});}
 
function _disable_keyboard_navigation(){$(document).unbind();}
 
function _keyboard_action(objEvent){if(objEvent==null){keycode=event.keyCode;escapeKey=27;}else{keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE;}
 
key=String.fromCharCode(keycode).toLowerCase();if((key==settings.keyToClose)||(key=='x')||(keycode==escapeKey)){_finish();}
 
if((key==settings.keyToPrev)||(keycode==37)){if(settings.activeImage!=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation();}}
 
if((key==settings.keyToNext)||(keycode==39)){if(settings.activeImage!=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation();}}}
 
function _preload_neighbor_images(){if((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0];}
 
if(settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0];}}
 
function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeOut(function(){$('#jquery-overlay').remove();});$('embed, object, select').css({'visibility':'visible'});}
 
function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
 
var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;}
 
windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
 
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
 
if(xScroll<windowWidth){pageWidth=xScroll;}else{pageWidth=windowWidth;}
 
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize;};function ___getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}
 
arrayPageScroll=new Array(xScroll,yScroll);return arrayPageScroll;};function ___pause(ms){var date=new Date();curDate=null;do{var curDate=new Date();}
 
while(curDate-date<ms);};return this.unbind('click').click(_initialize);};})(jQuery);
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/lightbox/load.gif
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/lightbox/next.gif
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/lightbox/prev.gif
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
components/com_morfeoshow/tpl/resources/phpFlickr/PEAR/DB.php
Show inline comments
 
new file 100644
 
<?php
 

	
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 

	
 
/**
 
 * Database independent query interface
 
 *
 
 * PHP versions 4 and 5
 
 *
 
 * LICENSE: This source file is subject to version 3.0 of the PHP license
 
 * that is available through the world-wide-web at the following URI:
 
 * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
 
 * the PHP License and are unable to obtain it through the web, please
 
 * send a note to license@php.net so we can mail you a copy immediately.
 
 *
 
 * @category   Database
 
 * @package    DB
 
 * @author     Stig Bakken <ssb@php.net>
 
 * @author     Tomas V.V.Cox <cox@idecnet.com>
 
 * @author     Daniel Convissor <danielc@php.net>
 
 * @copyright  1997-2005 The PHP Group
 
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 
 * @version    CVS: $Id: DB.php 32 2005-08-01 06:21:02Z dancoulter $
 
 * @link       http://pear.php.net/package/DB
 
 */
 

	
 
/**
 
 * Obtain the PEAR class so it can be extended from
 
 */
 
require_once 'PEAR.php';
 

	
 

	
 
// {{{ constants
 
// {{{ error codes
 

	
 
/**#@+
 
 * One of PEAR DB's portable error codes.
 
 * @see DB_common::errorCode(), DB::errorMessage()
 
 *
 
 * {@internal If you add an error code here, make sure you also add a textual
 
 * version of it in DB::errorMessage().}}
 
 */
 

	
 
/**
 
 * The code returned by many methods upon success
 
 */
 
define('DB_OK', 1);
 

	
 
/**
 
 * Unkown error
 
 */
 
define('DB_ERROR', -1);
 

	
 
/**
 
 * Syntax error
 
 */
 
define('DB_ERROR_SYNTAX', -2);
 

	
 
/**
 
 * Tried to insert a duplicate value into a primary or unique index
 
 */
 
define('DB_ERROR_CONSTRAINT', -3);
 

	
 
/**
 
 * An identifier in the query refers to a non-existant object
 
 */
 
define('DB_ERROR_NOT_FOUND', -4);
 

	
 
/**
 
 * Tried to create a duplicate object
 
 */
 
define('DB_ERROR_ALREADY_EXISTS', -5);
 

	
 
/**
 
 * The current driver does not support the action you attempted
 
 */
 
define('DB_ERROR_UNSUPPORTED', -6);
 

	
 
/**
 
 * The number of parameters does not match the number of placeholders
 
 */
 
define('DB_ERROR_MISMATCH', -7);
 

	
 
/**
 
 * A literal submitted did not match the data type expected
 
 */
 
define('DB_ERROR_INVALID', -8);
 

	
 
/**
 
 * The current DBMS does not support the action you attempted
 
 */
 
define('DB_ERROR_NOT_CAPABLE', -9);
 

	
 
/**
 
 * A literal submitted was too long so the end of it was removed
 
 */
 
define('DB_ERROR_TRUNCATED', -10);
 

	
 
/**
 
 * A literal number submitted did not match the data type expected
 
 */
 
define('DB_ERROR_INVALID_NUMBER', -11);
 

	
 
/**
 
 * A literal date submitted did not match the data type expected
 
 */
 
define('DB_ERROR_INVALID_DATE', -12);
 

	
 
/**
 
 * Attempt to divide something by zero
 
 */
 
define('DB_ERROR_DIVZERO', -13);
 

	
 
/**
 
 * A database needs to be selected
 
 */
 
define('DB_ERROR_NODBSELECTED', -14);
 

	
 
/**
 
 * Could not create the object requested
 
 */
 
define('DB_ERROR_CANNOT_CREATE', -15);
 

	
 
/**
 
 * Could not drop the database requested because it does not exist
 
 */
 
define('DB_ERROR_CANNOT_DROP', -17);
 

	
 
/**
 
 * An identifier in the query refers to a non-existant table
 
 */
 
define('DB_ERROR_NOSUCHTABLE', -18);
 

	
 
/**
 
 * An identifier in the query refers to a non-existant column
 
 */
 
define('DB_ERROR_NOSUCHFIELD', -19);
 

	
 
/**
 
 * The data submitted to the method was inappropriate
 
 */
 
define('DB_ERROR_NEED_MORE_DATA', -20);
 

	
 
/**
 
 * The attempt to lock the table failed
 
 */
 
define('DB_ERROR_NOT_LOCKED', -21);
 

	
 
/**
 
 * The number of columns doesn't match the number of values
 
 */
 
define('DB_ERROR_VALUE_COUNT_ON_ROW', -22);
 

	
 
/**
 
 * The DSN submitted has problems
 
 */
 
define('DB_ERROR_INVALID_DSN', -23);
 

	
 
/**
 
 * Could not connect to the database
 
 */
 
define('DB_ERROR_CONNECT_FAILED', -24);
 

	
 
/**
 
 * The PHP extension needed for this DBMS could not be found
 
 */
 
define('DB_ERROR_EXTENSION_NOT_FOUND',-25);
 

	
 
/**
 
 * The present user has inadequate permissions to perform the task requestd
 
 */
 
define('DB_ERROR_ACCESS_VIOLATION', -26);
 

	
 
/**
 
 * The database requested does not exist
 
 */
 
define('DB_ERROR_NOSUCHDB', -27);
 

	
 
/**
 
 * Tried to insert a null value into a column that doesn't allow nulls
 
 */
 
define('DB_ERROR_CONSTRAINT_NOT_NULL',-29);
 
/**#@-*/
 

	
 

	
 
// }}}
 
// {{{ prepared statement-related
 

	
 

	
 
/**#@+
 
 * Identifiers for the placeholders used in prepared statements.
 
 * @see DB_common::prepare()
 
 */
 

	
 
/**
 
 * Indicates a scalar (<kbd>?</kbd>) placeholder was used
 
 *
 
 * Quote and escape the value as necessary.
 
 */
 
define('DB_PARAM_SCALAR', 1);
 

	
 
/**
 
 * Indicates an opaque (<kbd>&</kbd>) placeholder was used
 
 *
 
 * The value presented is a file name.  Extract the contents of that file
 
 * and place them in this column.
 
 */
 
define('DB_PARAM_OPAQUE', 2);
 

	
 
/**
 
 * Indicates a misc (<kbd>!</kbd>) placeholder was used
 
 *
 
 * The value should not be quoted or escaped.
 
 */
 
define('DB_PARAM_MISC',   3);
 
/**#@-*/
 

	
 

	
 
// }}}
 
// {{{ binary data-related
 

	
 

	
 
/**#@+
 
 * The different ways of returning binary data from queries.
 
 */
 

	
 
/**
 
 * Sends the fetched data straight through to output
 
 */
 
define('DB_BINMODE_PASSTHRU', 1);
 

	
 
/**
 
 * Lets you return data as usual
 
 */
 
define('DB_BINMODE_RETURN', 2);
 

	
 
/**
 
 * Converts the data to hex format before returning it
 
 *
 
 * For example the string "123" would become "313233".
 
 */
 
define('DB_BINMODE_CONVERT', 3);
 
/**#@-*/
 

	
 

	
 
// }}}
 
// {{{ fetch modes
 

	
 

	
 
/**#@+
 
 * Fetch Modes.
 
 * @see DB_common::setFetchMode()
 
 */
 

	
 
/**
 
 * Indicates the current default fetch mode should be used
 
 * @see DB_common::$fetchmode
 
 */
 
define('DB_FETCHMODE_DEFAULT', 0);
 

	
 
/**
 
 * Column data indexed by numbers, ordered from 0 and up
 
 */
 
define('DB_FETCHMODE_ORDERED', 1);
 

	
 
/**
 
 * Column data indexed by column names
 
 */
 
define('DB_FETCHMODE_ASSOC', 2);
 

	
 
/**
 
 * Column data as object properties
 
 */
 
define('DB_FETCHMODE_OBJECT', 3);
 

	
 
/**
 
 * For multi-dimensional results, make the column name the first level
 
 * of the array and put the row number in the second level of the array
 
 *
 
 * This is flipped from the normal behavior, which puts the row numbers
 
 * in the first level of the array and the column names in the second level.
 
 */
 
define('DB_FETCHMODE_FLIPPED', 4);
 
/**#@-*/
 

	
 
/**#@+
 
 * Old fetch modes.  Left here for compatibility.
 
 */
 
define('DB_GETMODE_ORDERED', DB_FETCHMODE_ORDERED);
 
define('DB_GETMODE_ASSOC',   DB_FETCHMODE_ASSOC);
 
define('DB_GETMODE_FLIPPED', DB_FETCHMODE_FLIPPED);
 
/**#@-*/
 

	
 

	
 
// }}}
 
// {{{ tableInfo() && autoPrepare()-related
 

	
 

	
 
/**#@+
 
 * The type of information to return from the tableInfo() method.
 
 *
 
 * Bitwised constants, so they can be combined using <kbd>|</kbd>
 
 * and removed using <kbd>^</kbd>.
 
 *
 
 * @see DB_common::tableInfo()
 
 *
 
 * {@internal Since the TABLEINFO constants are bitwised, if more of them are
 
 * added in the future, make sure to adjust DB_TABLEINFO_FULL accordingly.}}
 
 */
 
define('DB_TABLEINFO_ORDER', 1);
 
define('DB_TABLEINFO_ORDERTABLE', 2);
 
define('DB_TABLEINFO_FULL', 3);
 
/**#@-*/
 

	
 

	
 
/**#@+
 
 * The type of query to create with the automatic query building methods.
 
 * @see DB_common::autoPrepare(), DB_common::autoExecute()
 
 */
 
define('DB_AUTOQUERY_INSERT', 1);
 
define('DB_AUTOQUERY_UPDATE', 2);
 
/**#@-*/
 

	
 

	
 
// }}}
 
// {{{ portability modes
 

	
 

	
 
/**#@+
 
 * Portability Modes.
 
 *
 
 * Bitwised constants, so they can be combined using <kbd>|</kbd>
 
 * and removed using <kbd>^</kbd>.
 
 *
 
 * @see DB_common::setOption()
 
 *
 
 * {@internal Since the PORTABILITY constants are bitwised, if more of them are
 
 * added in the future, make sure to adjust DB_PORTABILITY_ALL accordingly.}}
 
 */
 

	
 
/**
 
 * Turn off all portability features
 
 */
 
define('DB_PORTABILITY_NONE', 0);
 

	
 
/**
 
 * Convert names of tables and fields to lower case
 
 * when using the get*(), fetch*() and tableInfo() methods
 
 */
 
define('DB_PORTABILITY_LOWERCASE', 1);
 

	
 
/**
 
 * Right trim the data output by get*() and fetch*()
 
 */
 
define('DB_PORTABILITY_RTRIM', 2);
 

	
 
/**
 
 * Force reporting the number of rows deleted
 
 */
 
define('DB_PORTABILITY_DELETE_COUNT', 4);
 

	
 
/**
 
 * Enable hack that makes numRows() work in Oracle
 
 */
 
define('DB_PORTABILITY_NUMROWS', 8);
 

	
 
/**
 
 * Makes certain error messages in certain drivers compatible
 
 * with those from other DBMS's
 
 *
 
 * + mysql, mysqli:  change unique/primary key constraints
 
 *   DB_ERROR_ALREADY_EXISTS -> DB_ERROR_CONSTRAINT
 
 *
 
 * + odbc(access):  MS's ODBC driver reports 'no such field' as code
 
 *   07001, which means 'too few parameters.'  When this option is on
 
 *   that code gets mapped to DB_ERROR_NOSUCHFIELD.
 
 */
 
define('DB_PORTABILITY_ERRORS', 16);
 

	
 
/**
 
 * Convert null values to empty strings in data output by
 
 * get*() and fetch*()
 
 */
 
define('DB_PORTABILITY_NULL_TO_EMPTY', 32);
 

	
 
/**
 
 * Turn on all portability features
 
 */
 
define('DB_PORTABILITY_ALL', 63);
 
/**#@-*/
 

	
 
// }}}
 

	
 

	
 
// }}}
 
// {{{ class DB
 

	
 
/**
 
 * Database independent query interface
 
 *
 
 * The main "DB" class is simply a container class with some static
 
 * methods for creating DB objects as well as some utility functions
 
 * common to all parts of DB.
 
 *
 
 * The object model of DB is as follows (indentation means inheritance):
 
 * <pre>
 
 * DB           The main DB class.  This is simply a utility class
 
 *              with some "static" methods for creating DB objects as
 
 *              well as common utility functions for other DB classes.
 
 *
 
 * DB_common    The base for each DB implementation.  Provides default
 
 * |            implementations (in OO lingo virtual methods) for
 
 * |            the actual DB implementations as well as a bunch of
 
 * |            query utility functions.
 
 * |
 
 * +-DB_mysql   The DB implementation for MySQL.  Inherits DB_common.
 
 *              When calling DB::factory or DB::connect for MySQL
 
 *              connections, the object returned is an instance of this
 
 *              class.
 
 * </pre>
 
 *
 
 * @category   Database
 
 * @package    DB
 
 * @author     Stig Bakken <ssb@php.net>
 
 * @author     Tomas V.V.Cox <cox@idecnet.com>
 
 * @author     Daniel Convissor <danielc@php.net>
 
 * @copyright  1997-2005 The PHP Group
 
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 
 * @version    Release: @package_version@
 
 * @link       http://pear.php.net/package/DB
 
 */
 
class DB
 
{
 
    // {{{ &factory()
 

	
 
    /**
 
     * Create a new DB object for the specified database type but don't
 
     * connect to the database
 
     *
 
     * @param string $type     the database type (eg "mysql")
 
     * @param array  $options  an associative array of option names and values
 
     *
 
     * @return object  a new DB object.  A DB_Error object on failure.
 
     *
 
     * @see DB_common::setOption()
 
     */
 
    function &factory($type, $options = false)
 
    {
 
        if (!is_array($options)) {
 
            $options = array('persistent' => $options);
 
        }
 

	
 
        if (isset($options['debug']) && $options['debug'] >= 2) {
 
            // expose php errors with sufficient debug level
 
            include_once "DB/{$type}.php";
 
        } else {
 
            @include_once "DB/{$type}.php";
 
        }
 

	
 
        $classname = "DB_${type}";
 

	
 
        if (!class_exists($classname)) {
 
            $tmp = PEAR::raiseError(null, DB_ERROR_NOT_FOUND, null, null,
 
                                    "Unable to include the DB/{$type}.php"
 
                                    . " file for '$dsn'",
 
                                    'DB_Error', true);
 
            return $tmp;
 
        }
 

	
 
        @$obj =& new $classname;
 

	
 
        foreach ($options as $option => $value) {
 
            $test = $obj->setOption($option, $value);
 
            if (DB::isError($test)) {
 
                return $test;
 
            }
 
        }
 

	
 
        return $obj;
 
    }
 

	
 
    // }}}
 
    // {{{ &connect()
 

	
 
    /**
 
     * Create a new DB object including a connection to the specified database
 
     *
 
     * Example 1.
 
     * <code>
 
     * require_once 'DB.php';
 
     *
 
     * $dsn = 'pgsql://user:password@host/database';
 
     * $options = array(
 
     *     'debug'       => 2,
 
     *     'portability' => DB_PORTABILITY_ALL,
 
     * );
 
     *
 
     * $db =& DB::connect($dsn, $options);
 
     * if (PEAR::isError($db)) {
 
     *     die($db->getMessage());
 
     * }
 
     * </code>
 
     *
 
     * @param mixed $dsn      the string "data source name" or array in the
 
     *                         format returned by DB::parseDSN()
 
     * @param array $options  an associative array of option names and values
 
     *
 
     * @return object  a new DB object.  A DB_Error object on failure.
 
     *
 
     * @uses DB_dbase::connect(), DB_fbsql::connect(), DB_ibase::connect(),
 
     *       DB_ifx::connect(), DB_msql::connect(), DB_mssql::connect(),
 
     *       DB_mysql::connect(), DB_mysqli::connect(), DB_oci8::connect(),
 
     *       DB_odbc::connect(), DB_pgsql::connect(), DB_sqlite::connect(),
 
     *       DB_sybase::connect()
 
     *
 
     * @uses DB::parseDSN(), DB_common::setOption(), PEAR::isError()
 
     */
 
    function &connect($dsn, $options = array())
 
    {
 
        $dsninfo = DB::parseDSN($dsn);
 
        $type = $dsninfo['phptype'];
 

	
 
        if (!is_array($options)) {
 
            /*
 
             * For backwards compatibility.  $options used to be boolean,
 
             * indicating whether the connection should be persistent.
 
             */
 
            $options = array('persistent' => $options);
 
        }
 

	
 
        if (isset($options['debug']) && $options['debug'] >= 2) {
 
            // expose php errors with sufficient debug level
 
            include_once "DB/${type}.php";
 
        } else {
 
            @include_once "DB/${type}.php";
 
        }
 

	
 
        $classname = "DB_${type}";
 
        if (!class_exists($classname)) {
 
            $tmp = PEAR::raiseError(null, DB_ERROR_NOT_FOUND, null, null,
 
                                    "Unable to include the DB/{$type}.php"
 
                                    . " file for '$dsn'",
 
                                    'DB_Error', true);
 
            return $tmp;
 
        }
 

	
 
        @$obj =& new $classname;
 

	
 
        foreach ($options as $option => $value) {
 
            $test = $obj->setOption($option, $value);
 
            if (DB::isError($test)) {
 
                return $test;
 
            }
 
        }
 

	
 
        $err = $obj->connect($dsninfo, $obj->getOption('persistent'));
 
        if (DB::isError($err)) {
 
            $err->addUserInfo($dsn);
 
            return $err;
 
        }
 

	
 
        return $obj;
 
    }
 

	
 
    // }}}
 
    // {{{ apiVersion()
 

	
 
    /**
 
     * Return the DB API version
 
     *
 
     * @return string  the DB API version number
 
     */
 
    function apiVersion()
 
    {
 
        return '@package_version@';
 
    }
 

	
 
    // }}}
 
    // {{{ isError()
 

	
 
    /**
 
     * Determines if a variable is a DB_Error object
 
     *
 
     * @param mixed $value  the variable to check
 
     *
 
     * @return bool  whether $value is DB_Error object
 
     */
 
    function isError($value)
 
    {
 
        return is_a($value, 'DB_Error');
 
    }
 

	
 
    // }}}
 
    // {{{ isConnection()
 

	
 
    /**
 
     * Determines if a value is a DB_<driver> object
 
     *
 
     * @param mixed $value  the value to test
 
     *
 
     * @return bool  whether $value is a DB_<driver> object
 
     */
 
    function isConnection($value)
 
    {
 
        return (is_object($value) &&
 
                is_subclass_of($value, 'db_common') &&
 
                method_exists($value, 'simpleQuery'));
 
    }
 

	
 
    // }}}
 
    // {{{ isManip()
 

	
 
    /**
 
     * Tell whether a query is a data manipulation or data definition query
 
     *
 
     * Examples of data manipulation queries are INSERT, UPDATE and DELETE.
 
     * Examples of data definition queries are CREATE, DROP, ALTER, GRANT,
 
     * REVOKE.
 
     *
 
     * @param string $query  the query
 
     *
 
     * @return boolean  whether $query is a data manipulation query
 
     */
 
    function isManip($query)
 
    {
 
        $manips = 'INSERT|UPDATE|DELETE|REPLACE|'
 
                . 'CREATE|DROP|'
 
                . 'LOAD DATA|SELECT .* INTO|COPY|'
 
                . 'ALTER|GRANT|REVOKE|'
 
                . 'LOCK|UNLOCK';
 
        if (preg_match('/^\s*"?(' . $manips . ')\s+/i', $query)) {
 
            return true;
 
        }
 
        return false;
 
    }
 

	
 
    // }}}
 
    // {{{ errorMessage()
 

	
 
    /**
 
     * Return a textual error message for a DB error code
 
     *
 
     * @param integer $value  the DB error code
 
     *
 
     * @return string  the error message or false if the error code was
 
     *                  not recognized
 
     */
 
    function errorMessage($value)
 
    {
 
        static $errorMessages;
 
        if (!isset($errorMessages)) {
 
            $errorMessages = array(
 
                DB_ERROR                    => 'unknown error',
 
                DB_ERROR_ACCESS_VIOLATION   => 'insufficient permissions',
 
                DB_ERROR_ALREADY_EXISTS     => 'already exists',
 
                DB_ERROR_CANNOT_CREATE      => 'can not create',
 
                DB_ERROR_CANNOT_DROP        => 'can not drop',
 
                DB_ERROR_CONNECT_FAILED     => 'connect failed',
 
                DB_ERROR_CONSTRAINT         => 'constraint violation',
 
                DB_ERROR_CONSTRAINT_NOT_NULL=> 'null value violates not-null constraint',
 
                DB_ERROR_DIVZERO            => 'division by zero',
 
                DB_ERROR_EXTENSION_NOT_FOUND=> 'extension not found',
 
                DB_ERROR_INVALID            => 'invalid',
 
                DB_ERROR_INVALID_DATE       => 'invalid date or time',
 
                DB_ERROR_INVALID_DSN        => 'invalid DSN',
 
                DB_ERROR_INVALID_NUMBER     => 'invalid number',
 
                DB_ERROR_MISMATCH           => 'mismatch',
 
                DB_ERROR_NEED_MORE_DATA     => 'insufficient data supplied',
 
                DB_ERROR_NODBSELECTED       => 'no database selected',
 
                DB_ERROR_NOSUCHDB           => 'no such database',
 
                DB_ERROR_NOSUCHFIELD        => 'no such field',
 
                DB_ERROR_NOSUCHTABLE        => 'no such table',
 
                DB_ERROR_NOT_CAPABLE        => 'DB backend not capable',
 
                DB_ERROR_NOT_FOUND          => 'not found',
 
                DB_ERROR_NOT_LOCKED         => 'not locked',
 
                DB_ERROR_SYNTAX             => 'syntax error',
 
                DB_ERROR_UNSUPPORTED        => 'not supported',
 
                DB_ERROR_TRUNCATED          => 'truncated',
 
                DB_ERROR_VALUE_COUNT_ON_ROW => 'value count on row',
 
                DB_OK                       => 'no error',
 
            );
 
        }
 

	
 
        if (DB::isError($value)) {
 
            $value = $value->getCode();
 
        }
 

	
 
        return isset($errorMessages[$value]) ? $errorMessages[$value]
 
                     : $errorMessages[DB_ERROR];
 
    }
 

	
 
    // }}}
 
    // {{{ parseDSN()
 

	
 
    /**
 
     * Parse a data source name
 
     *
 
     * Additional keys can be added by appending a URI query string to the
 
     * end of the DSN.
 
     *
 
     * The format of the supplied DSN is in its fullest form:
 
     * <code>
 
     *  phptype(dbsyntax)://username:password@protocol+hostspec/database?option=8&another=true
 
     * </code>
 
     *
 
     * Most variations are allowed:
 
     * <code>
 
     *  phptype://username:password@protocol+hostspec:110//usr/db_file.db?mode=0644
 
     *  phptype://username:password@hostspec/database_name
 
     *  phptype://username:password@hostspec
 
     *  phptype://username@hostspec
 
     *  phptype://hostspec/database
 
     *  phptype://hostspec
 
     *  phptype(dbsyntax)
 
     *  phptype
 
     * </code>
 
     *
 
     * @param string $dsn Data Source Name to be parsed
 
     *
 
     * @return array an associative array with the following keys:
 
     *  + phptype:  Database backend used in PHP (mysql, odbc etc.)
 
     *  + dbsyntax: Database used with regards to SQL syntax etc.
 
     *  + protocol: Communication protocol to use (tcp, unix etc.)
 
     *  + hostspec: Host specification (hostname[:port])
 
     *  + database: Database to use on the DBMS server
 
     *  + username: User name for login
 
     *  + password: Password for login
 
     */
 
    function parseDSN($dsn)
 
    {
 
        $parsed = array(
 
            'phptype'  => false,
 
            'dbsyntax' => false,
 
            'username' => false,
 
            'password' => false,
 
            'protocol' => false,
 
            'hostspec' => false,
 
            'port'     => false,
 
            'socket'   => false,
 
            'database' => false,
 
        );
 

	
 
        if (is_array($dsn)) {
 
            $dsn = array_merge($parsed, $dsn);
 
            if (!$dsn['dbsyntax']) {
 
                $dsn['dbsyntax'] = $dsn['phptype'];
 
            }
 
            return $dsn;
 
        }
 

	
 
        // Find phptype and dbsyntax
 
        if (($pos = strpos($dsn, '://')) !== false) {
 
            $str = substr($dsn, 0, $pos);
 
            $dsn = substr($dsn, $pos + 3);
 
        } else {
 
            $str = $dsn;
 
            $dsn = null;
 
        }
 

	
 
        // Get phptype and dbsyntax
 
        // $str => phptype(dbsyntax)
 
        if (preg_match('|^(.+?)\((.*?)\)$|', $str, $arr)) {
 
            $parsed['phptype']  = $arr[1];
 
            $parsed['dbsyntax'] = !$arr[2] ? $arr[1] : $arr[2];
 
        } else {
 
            $parsed['phptype']  = $str;
 
            $parsed['dbsyntax'] = $str;
 
        }
 

	
 
        if (!count($dsn)) {
 
            return $parsed;
 
        }
 

	
 
        // Get (if found): username and password
 
        // $dsn => username:password@protocol+hostspec/database
 
        if (($at = strrpos($dsn,'@')) !== false) {
 
            $str = substr($dsn, 0, $at);
 
            $dsn = substr($dsn, $at + 1);
 
            if (($pos = strpos($str, ':')) !== false) {
 
                $parsed['username'] = rawurldecode(substr($str, 0, $pos));
 
                $parsed['password'] = rawurldecode(substr($str, $pos + 1));
 
            } else {
 
                $parsed['username'] = rawurldecode($str);
 
            }
 
        }
 

	
 
        // Find protocol and hostspec
 

	
 
        if (preg_match('|^([^(]+)\((.*?)\)/?(.*?)$|', $dsn, $match)) {
 
            // $dsn => proto(proto_opts)/database
 
            $proto       = $match[1];
 
            $proto_opts  = $match[2] ? $match[2] : false;
 
            $dsn         = $match[3];
 

	
 
        } else {
 
            // $dsn => protocol+hostspec/database (old format)
 
            if (strpos($dsn, '+') !== false) {
 
                list($proto, $dsn) = explode('+', $dsn, 2);
 
            }
 
            if (strpos($dsn, '/') !== false) {
 
                list($proto_opts, $dsn) = explode('/', $dsn, 2);
 
            } else {
 
                $proto_opts = $dsn;
 
                $dsn = null;
 
            }
 
        }
 

	
 
        // process the different protocol options
 
        $parsed['protocol'] = (!empty($proto)) ? $proto : 'tcp';
 
        $proto_opts = rawurldecode($proto_opts);
 
        if ($parsed['protocol'] == 'tcp') {
 
            if (strpos($proto_opts, ':') !== false) {
 
                list($parsed['hostspec'],
 
                     $parsed['port']) = explode(':', $proto_opts);
 
            } else {
 
                $parsed['hostspec'] = $proto_opts;
 
            }
 
        } elseif ($parsed['protocol'] == 'unix') {
 
            $parsed['socket'] = $proto_opts;
 
        }
 

	
 
        // Get dabase if any
 
        // $dsn => database
 
        if ($dsn) {
 
            if (($pos = strpos($dsn, '?')) === false) {
 
                // /database
 
                $parsed['database'] = rawurldecode($dsn);
 
            } else {
 
                // /database?param1=value1&param2=value2
 
                $parsed['database'] = rawurldecode(substr($dsn, 0, $pos));
 
                $dsn = substr($dsn, $pos + 1);
 
                if (strpos($dsn, '&') !== false) {
 
                    $opts = explode('&', $dsn);
 
                } else { // database?param1=value1
 
                    $opts = array($dsn);
 
                }
 
                foreach ($opts as $opt) {
 
                    list($key, $value) = explode('=', $opt);
 
                    if (!isset($parsed[$key])) {
 
                        // don't allow params overwrite
 
                        $parsed[$key] = rawurldecode($value);
 
                    }
 
                }
 
            }
 
        }
 

	
 
        return $parsed;
 
    }
 

	
 
    // }}}
 
}
 

	
 
// }}}
 
// {{{ class DB_Error
 

	
 
/**
 
 * DB_Error implements a class for reporting portable database error
 
 * messages
 
 *
 
 * @category   Database
 
 * @package    DB
 
 * @author     Stig Bakken <ssb@php.net>
 
 * @copyright  1997-2005 The PHP Group
 
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 
 * @version    Release: @package_version@
 
 * @link       http://pear.php.net/package/DB
 
 */
 
class DB_Error extends PEAR_Error
 
{
 
    // {{{ constructor
 

	
 
    /**
 
     * DB_Error constructor
 
     *
 
     * @param mixed $code       DB error code, or string with error message
 
     * @param int   $mode       what "error mode" to operate in
 
     * @param int   $level      what error level to use for $mode &
 
     *                           PEAR_ERROR_TRIGGER
 
     * @param mixed $debuginfo  additional debug info, such as the last query
 
     *
 
     * @see PEAR_Error
 
     */
 
    function DB_Error($code = DB_ERROR, $mode = PEAR_ERROR_RETURN,
 
                      $level = E_USER_NOTICE, $debuginfo = null)
 
    {
 
        if (is_int($code)) {
 
            $this->PEAR_Error('DB Error: ' . DB::errorMessage($code), $code,
 
                              $mode, $level, $debuginfo);
 
        } else {
 
            $this->PEAR_Error("DB Error: $code", DB_ERROR,
 
                              $mode, $level, $debuginfo);
 
        }
 
    }
 

	
 
    // }}}
 
}
 

	
 
// }}}
 
// {{{ class DB_result
 

	
 
/**
 
 * This class implements a wrapper for a DB result set
 
 *
 
 * A new instance of this class will be returned by the DB implementation
 
 * after processing a query that returns data.
 
 *
 
 * @category   Database
 
 * @package    DB
 
 * @author     Stig Bakken <ssb@php.net>
 
 * @copyright  1997-2005 The PHP Group
 
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 
 * @version    Release: @package_version@
 
 * @link       http://pear.php.net/package/DB
 
 */
 
class DB_result
 
{
 
    // {{{ properties
 

	
 
    /**
 
     * Should results be freed automatically when there are no more rows?
 
     * @var boolean
 
     * @see DB_common::$options
 
     */
 
    var $autofree;
 

	
 
    /**
 
     * A reference to the DB_<driver> object
 
     * @var object
 
     */
 
    var $dbh;
 

	
 
    /**
 
     * The current default fetch mode
 
     * @var integer
 
     * @see DB_common::$fetchmode
 
     */
 
    var $fetchmode;
 

	
 
    /**
 
     * The name of the class into which results should be fetched when
 
     * DB_FETCHMODE_OBJECT is in effect
 
     *
 
     * @var string
 
     * @see DB_common::$fetchmode_object_class
 
     */
 
    var $fetchmode_object_class;
 

	
 
    /**
 
     * The number of rows to fetch from a limit query
 
     * @var integer
 
     */
 
    var $limit_count = null;
 

	
 
    /**
 
     * The row to start fetching from in limit queries
 
     * @var integer
 
     */
 
    var $limit_from = null;
 

	
 
    /**
 
     * The execute parameters that created this result
 
     * @var array
 
     * @since Property available since Release 1.7.0
 
     */
 
    var $parameters;
 

	
 
    /**
 
     * The query string that created this result
 
     *
 
     * Copied here incase it changes in $dbh, which is referenced
 
     *
 
     * @var string
 
     * @since Property available since Release 1.7.0
 
     */
 
    var $query;
 

	
 
    /**
 
     * The query result resource id created by PHP
 
     * @var resource
 
     */
 
    var $result;
 

	
 
    /**
 
     * The present row being dealt with
 
     * @var integer
 
     */
 
    var $row_counter = null;
 

	
 
    /**
 
     * The prepared statement resource id created by PHP in $dbh
 
     *
 
     * This resource is only available when the result set was created using
 
     * a driver's native execute() method, not PEAR DB's emulated one.
 
     *
 
     * Copied here incase it changes in $dbh, which is referenced
 
     *
 
     * {@internal  Mainly here because the InterBase/Firebird API is only
 
     * able to retrieve data from result sets if the statemnt handle is
 
     * still in scope.}}
 
     *
 
     * @var resource
 
     * @since Property available since Release 1.7.0
 
     */
 
    var $statement;
 

	
 

	
 
    // }}}
 
    // {{{ constructor
 

	
 
    /**
 
     * This constructor sets the object's properties
 
     *
 
     * @param object   &$dbh     the DB object reference
 
     * @param resource $result   the result resource id
 
     * @param array    $options  an associative array with result options
 
     *
 
     * @return void
 
     */
 
    function DB_result(&$dbh, $result, $options = array())
 
    {
 
        $this->autofree    = $dbh->options['autofree'];
 
        $this->dbh         = &$dbh;
 
        $this->fetchmode   = $dbh->fetchmode;
 
        $this->fetchmode_object_class = $dbh->fetchmode_object_class;
 
        $this->parameters  = $dbh->last_parameters;
 
        $this->query       = $dbh->last_query;
 
        $this->result      = $result;
 
        $this->statement   = empty($dbh->last_stmt) ? null : $dbh->last_stmt;
 
        foreach ($options as $key => $value) {
 
            $this->setOption($key, $value);
 
        }
 
    }
 

	
 
    /**
 
     * Set options for the DB_result object
 
     *
 
     * @param string $key    the option to set
 
     * @param mixed  $value  the value to set the option to
 
     *
 
     * @return void
 
     */
 
    function setOption($key, $value = null)
 
    {
 
        switch ($key) {
 
            case 'limit_from':
 
                $this->limit_from = $value;
 
                break;
 
            case 'limit_count':
 
                $this->limit_count = $value;
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ fetchRow()
 

	
 
    /**
 
     * Fetch a row of data and return it by reference into an array
 
     *
 
     * The type of array returned can be controlled either by setting this
 
     * method's <var>$fetchmode</var> parameter or by changing the default
 
     * fetch mode setFetchMode() before calling this method.
 
     *
 
     * There are two options for standardizing the information returned
 
     * from databases, ensuring their values are consistent when changing
 
     * DBMS's.  These portability options can be turned on when creating a
 
     * new DB object or by using setOption().
 
     *
 
     *   + <var>DB_PORTABILITY_LOWERCASE</var>
 
     *     convert names of fields to lower case
 
     *
 
     *   + <var>DB_PORTABILITY_RTRIM</var>
 
     *     right trim the data
 
     *
 
     * @param int $fetchmode  the constant indicating how to format the data
 
     * @param int $rownum     the row number to fetch (index starts at 0)
 
     *
 
     * @return mixed  an array or object containing the row's data,
 
     *                 NULL when the end of the result set is reached
 
     *                 or a DB_Error object on failure.
 
     *
 
     * @see DB_common::setOption(), DB_common::setFetchMode()
 
     */
 
    function &fetchRow($fetchmode = DB_FETCHMODE_DEFAULT, $rownum = null)
 
    {
 
        if ($fetchmode === DB_FETCHMODE_DEFAULT) {
 
            $fetchmode = $this->fetchmode;
 
        }
 
        if ($fetchmode === DB_FETCHMODE_OBJECT) {
 
            $fetchmode = DB_FETCHMODE_ASSOC;
 
            $object_class = $this->fetchmode_object_class;
 
        }
 
        if ($this->limit_from !== null) {
 
            if ($this->row_counter === null) {
 
                $this->row_counter = $this->limit_from;
 
                // Skip rows
 
                if ($this->dbh->features['limit'] === false) {
 
                    $i = 0;
 
                    while ($i++ < $this->limit_from) {
 
                        $this->dbh->fetchInto($this->result, $arr, $fetchmode);
 
                    }
 
                }
 
            }
 
            if ($this->row_counter >= ($this->limit_from + $this->limit_count))
 
            {
 
                if ($this->autofree) {
 
                    $this->free();
 
                }
 
                $tmp = null;
 
                return $tmp;
 
            }
 
            if ($this->dbh->features['limit'] === 'emulate') {
 
                $rownum = $this->row_counter;
 
            }
 
            $this->row_counter++;
 
        }
 
        $res = $this->dbh->fetchInto($this->result, $arr, $fetchmode, $rownum);
 
        if ($res === DB_OK) {
 
            if (isset($object_class)) {
 
                // The default mode is specified in the
 
                // DB_common::fetchmode_object_class property
 
                if ($object_class == 'stdClass') {
 
                    $arr = (object) $arr;
 
                } else {
 
                    $arr = &new $object_class($arr);
 
                }
 
            }
 
            return $arr;
 
        }
 
        if ($res == null && $this->autofree) {
 
            $this->free();
 
        }
 
        return $res;
 
    }
 

	
 
    // }}}
 
    // {{{ fetchInto()
 

	
 
    /**
 
     * Fetch a row of data into an array which is passed by reference
 
     *
 
     * The type of array returned can be controlled either by setting this
 
     * method's <var>$fetchmode</var> parameter or by changing the default
 
     * fetch mode setFetchMode() before calling this method.
 
     *
 
     * There are two options for standardizing the information returned
 
     * from databases, ensuring their values are consistent when changing
 
     * DBMS's.  These portability options can be turned on when creating a
 
     * new DB object or by using setOption().
 
     *
 
     *   + <var>DB_PORTABILITY_LOWERCASE</var>
 
     *     convert names of fields to lower case
 
     *
 
     *   + <var>DB_PORTABILITY_RTRIM</var>
 
     *     right trim the data
 
     *
 
     * @param array &$arr       the variable where the data should be placed
 
     * @param int   $fetchmode  the constant indicating how to format the data
 
     * @param int   $rownum     the row number to fetch (index starts at 0)
 
     *
 
     * @return mixed  DB_OK if a row is processed, NULL when the end of the
 
     *                 result set is reached or a DB_Error object on failure
 
     *
 
     * @see DB_common::setOption(), DB_common::setFetchMode()
 
     */
 
    function fetchInto(&$arr, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum = null)
 
    {
 
        if ($fetchmode === DB_FETCHMODE_DEFAULT) {
 
            $fetchmode = $this->fetchmode;
 
        }
 
        if ($fetchmode === DB_FETCHMODE_OBJECT) {
 
            $fetchmode = DB_FETCHMODE_ASSOC;
 
            $object_class = $this->fetchmode_object_class;
 
        }
 
        if ($this->limit_from !== null) {
 
            if ($this->row_counter === null) {
 
                $this->row_counter = $this->limit_from;
 
                // Skip rows
 
                if ($this->dbh->features['limit'] === false) {
 
                    $i = 0;
 
                    while ($i++ < $this->limit_from) {
 
                        $this->dbh->fetchInto($this->result, $arr, $fetchmode);
 
                    }
 
                }
 
            }
 
            if ($this->row_counter >= (
 
                    $this->limit_from + $this->limit_count))
 
            {
 
                if ($this->autofree) {
 
                    $this->free();
 
                }
 
                return null;
 
            }
 
            if ($this->dbh->features['limit'] === 'emulate') {
 
                $rownum = $this->row_counter;
 
            }
 

	
 
            $this->row_counter++;
 
        }
 
        $res = $this->dbh->fetchInto($this->result, $arr, $fetchmode, $rownum);
 
        if ($res === DB_OK) {
 
            if (isset($object_class)) {
 
                // default mode specified in the
 
                // DB_common::fetchmode_object_class property
 
                if ($object_class == 'stdClass') {
 
                    $arr = (object) $arr;
 
                } else {
 
                    $arr = new $object_class($arr);
 
                }
 
            }
 
            return DB_OK;
 
        }
 
        if ($res == null && $this->autofree) {
 
            $this->free();
 
        }
 
        return $res;
 
    }
 

	
 
    // }}}
 
    // {{{ numCols()
 

	
 
    /**
 
     * Get the the number of columns in a result set
 
     *
 
     * @return int  the number of columns.  A DB_Error object on failure.
 
     */
 
    function numCols()
 
    {
 
        return $this->dbh->numCols($this->result);
 
    }
 

	
 
    // }}}
 
    // {{{ numRows()
 

	
 
    /**
 
     * Get the number of rows in a result set
 
     *
 
     * @return int  the number of rows.  A DB_Error object on failure.
 
     */
 
    function numRows()
 
    {
 
        if ($this->dbh->features['numrows'] === 'emulate'
 
            && $this->dbh->options['portability'] & DB_PORTABILITY_NUMROWS)
 
        {
 
            if ($this->dbh->features['prepare']) {
 
                $res = $this->dbh->query($this->query, $this->parameters);
 
            } else {
 
                $res = $this->dbh->query($this->query);
 
            }
 
            if (DB::isError($res)) {
 
                return $res;
 
            }
 
            $i = 0;
 
            while ($res->fetchInto($tmp, DB_FETCHMODE_ORDERED)) {
 
                $i++;
 
            }
 
            return $i;
 
        } else {
 
            return $this->dbh->numRows($this->result);
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ nextResult()
 

	
 
    /**
 
     * Get the next result if a batch of queries was executed
 
     *
 
     * @return bool  true if a new result is available or false if not
 
     */
 
    function nextResult()
 
    {
 
        return $this->dbh->nextResult($this->result);
 
    }
 

	
 
    // }}}
 
    // {{{ free()
 

	
 
    /**
 
     * Frees the resources allocated for this result set
 
     *
 
     * @return bool  true on success.  A DB_Error object on failure.
 
     */
 
    function free()
 
    {
 
        $err = $this->dbh->freeResult($this->result);
 
        if (DB::isError($err)) {
 
            return $err;
 
        }
 
        $this->result = false;
 
        $this->statement = false;
 
        return true;
 
    }
 

	
 
    // }}}
 
    // {{{ tableInfo()
 

	
 
    /**
 
     * @see DB_common::tableInfo()
 
     * @deprecated Method deprecated some time before Release 1.2
 
     */
 
    function tableInfo($mode = null)
 
    {
 
        if (is_string($mode)) {
 
            return $this->dbh->raiseError(DB_ERROR_NEED_MORE_DATA);
 
        }
 
        return $this->dbh->tableInfo($this, $mode);
 
    }
 

	
 
    // }}}
 
    // {{{ getQuery()
 

	
 
    /**
 
     * Determine the query string that created this result
 
     *
 
     * @return string  the query string
 
     *
 
     * @since Method available since Release 1.7.0
 
     */
 
    function getQuery()
 
    {
 
        return $this->query;
 
    }
 

	
 
    // }}}
 
    // {{{ getRowCounter()
 

	
 
    /**
 
     * Tells which row number is currently being processed
 
     *
 
     * @return integer  the current row being looked at.  Starts at 1.
 
     */
 
    function getRowCounter()
 
    {
 
        return $this->row_counter;
 
    }
 

	
 
    // }}}
 
}
 

	
 
// }}}
 
// {{{ class DB_row
 

	
 
/**
 
 * PEAR DB Row Object
 
 *
 
 * The object contains a row of data from a result set.  Each column's data
 
 * is placed in a property named for the column.
 
 *
 
 * @category   Database
 
 * @package    DB
 
 * @author     Stig Bakken <ssb@php.net>
 
 * @copyright  1997-2005 The PHP Group
 
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 
 * @version    Release: @package_version@
 
 * @link       http://pear.php.net/package/DB
 
 * @see        DB_common::setFetchMode()
 
 */
 
class DB_row
 
{
 
    // {{{ constructor
 

	
 
    /**
 
     * The constructor places a row's data into properties of this object
 
     *
 
     * @param array  the array containing the row's data
 
     *
 
     * @return void
 
     */
 
    function DB_row(&$arr)
 
    {
 
        foreach ($arr as $key => $value) {
 
            $this->$key = &$arr[$key];
 
        }
 
    }
 

	
 
    // }}}
 
}
 

	
 
// }}}
 

	
 
/*
 
 * Local variables:
 
 * tab-width: 4
 
 * c-basic-offset: 4
 
 * End:
 
 */
 

	
 
?>
components/com_morfeoshow/tpl/resources/phpFlickr/PEAR/DB/common.php
Show inline comments
 
new file 100644
 
<?php
 

	
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 

	
 
/**
 
 * Contains the DB_common base class
 
 *
 
 * PHP versions 4 and 5
 
 *
 
 * LICENSE: This source file is subject to version 3.0 of the PHP license
 
 * that is available through the world-wide-web at the following URI:
 
 * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
 
 * the PHP License and are unable to obtain it through the web, please
 
 * send a note to license@php.net so we can mail you a copy immediately.
 
 *
 
 * @category   Database
 
 * @package    DB
 
 * @author     Stig Bakken <ssb@php.net>
 
 * @author     Tomas V.V. Cox <cox@idecnet.com>
 
 * @author     Daniel Convissor <danielc@php.net>
 
 * @copyright  1997-2005 The PHP Group
 
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 
 * @version    CVS: $Id: common.php 32 2005-08-01 06:21:02Z dancoulter $
 
 * @link       http://pear.php.net/package/DB
 
 */
 

	
 
/**
 
 * Obtain the PEAR class so it can be extended from
 
 */
 
require_once 'PEAR.php';
 

	
 
/**
 
 * DB_common is the base class from which each database driver class extends
 
 *
 
 * All common methods are declared here.  If a given DBMS driver contains
 
 * a particular method, that method will overload the one here.
 
 *
 
 * @category   Database
 
 * @package    DB
 
 * @author     Stig Bakken <ssb@php.net>
 
 * @author     Tomas V.V. Cox <cox@idecnet.com>
 
 * @author     Daniel Convissor <danielc@php.net>
 
 * @copyright  1997-2005 The PHP Group
 
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 
 * @version    Release: @package_version@
 
 * @link       http://pear.php.net/package/DB
 
 */
 
class DB_common extends PEAR
 
{
 
    // {{{ properties
 

	
 
    /**
 
     * The current default fetch mode
 
     * @var integer
 
     */
 
    var $fetchmode = DB_FETCHMODE_ORDERED;
 

	
 
    /**
 
     * The name of the class into which results should be fetched when
 
     * DB_FETCHMODE_OBJECT is in effect
 
     *
 
     * @var string
 
     */
 
    var $fetchmode_object_class = 'stdClass';
 

	
 
    /**
 
     * Was a connection present when the object was serialized()?
 
     * @var bool
 
     * @see DB_common::__sleep(), DB_common::__wake()
 
     */
 
    var $was_connected = null;
 

	
 
    /**
 
     * The most recently executed query
 
     * @var string
 
     */
 
    var $last_query = '';
 

	
 
    /**
 
     * Run-time configuration options
 
     *
 
     * The 'optimize' option has been deprecated.  Use the 'portability'
 
     * option instead.
 
     *
 
     * @var array
 
     * @see DB_common::setOption()
 
     */
 
    var $options = array(
 
        'result_buffering' => 500,
 
        'persistent' => false,
 
        'ssl' => false,
 
        'debug' => 0,
 
        'seqname_format' => '%s_seq',
 
        'autofree' => false,
 
        'portability' => DB_PORTABILITY_NONE,
 
        'optimize' => 'performance',  // Deprecated.  Use 'portability'.
 
    );
 

	
 
    /**
 
     * The parameters from the most recently executed query
 
     * @var array
 
     * @since Property available since Release 1.7.0
 
     */
 
    var $last_parameters = array();
 

	
 
    /**
 
     * The elements from each prepared statement
 
     * @var array
 
     */
 
    var $prepare_tokens = array();
 

	
 
    /**
 
     * The data types of the various elements in each prepared statement
 
     * @var array
 
     */
 
    var $prepare_types = array();
 

	
 
    /**
 
     * The prepared queries
 
     * @var array
 
     */
 
    var $prepared_queries = array();
 

	
 

	
 
    // }}}
 
    // {{{ DB_common
 

	
 
    /**
 
     * This constructor calls <kbd>$this->PEAR('DB_Error')</kbd>
 
     *
 
     * @return void
 
     */
 
    function DB_common()
 
    {
 
        $this->PEAR('DB_Error');
 
    }
 

	
 
    // }}}
 
    // {{{ __sleep()
 

	
 
    /**
 
     * Automatically indicates which properties should be saved
 
     * when PHP's serialize() function is called
 
     *
 
     * @return array  the array of properties names that should be saved
 
     */
 
    function __sleep()
 
    {
 
        if ($this->connection) {
 
            // Don't disconnect(), people use serialize() for many reasons
 
            $this->was_connected = true;
 
        } else {
 
            $this->was_connected = false;
 
        }
 
        if (isset($this->autocommit)) {
 
            return array('autocommit',
 
                         'dbsyntax',
 
                         'dsn',
 
                         'features',
 
                         'fetchmode',
 
                         'fetchmode_object_class',
 
                         'options',
 
                         'was_connected',
 
                   );
 
        } else {
 
            return array('dbsyntax',
 
                         'dsn',
 
                         'features',
 
                         'fetchmode',
 
                         'fetchmode_object_class',
 
                         'options',
 
                         'was_connected',
 
                   );
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ __wakeup()
 

	
 
    /**
 
     * Automatically reconnects to the database when PHP's unserialize()
 
     * function is called
 
     *
 
     * The reconnection attempt is only performed if the object was connected
 
     * at the time PHP's serialize() function was run.
 
     *
 
     * @return void
 
     */
 
    function __wakeup()
 
    {
 
        if ($this->was_connected) {
 
            $this->connect($this->dsn, $this->options);
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ __toString()
 

	
 
    /**
 
     * Automatic string conversion for PHP 5
 
     *
 
     * @return string  a string describing the current PEAR DB object
 
     *
 
     * @since Method available since Release 1.7.0
 
     */
 
    function __toString()
 
    {
 
        $info = strtolower(get_class($this));
 
        $info .=  ': (phptype=' . $this->phptype .
 
                  ', dbsyntax=' . $this->dbsyntax .
 
                  ')';
 
        if ($this->connection) {
 
            $info .= ' [connected]';
 
        }
 
        return $info;
 
    }
 

	
 
    // }}}
 
    // {{{ toString()
 

	
 
    /**
 
     * DEPRECATED:  String conversion method
 
     *
 
     * @return string  a string describing the current PEAR DB object
 
     *
 
     * @deprecated Method deprecated in Release 1.7.0
 
     */
 
    function toString()
 
    {
 
        return $this->__toString();
 
    }
 

	
 
    // }}}
 
    // {{{ quoteString()
 

	
 
    /**
 
     * DEPRECATED: Quotes a string so it can be safely used within string
 
     * delimiters in a query
 
     *
 
     * @param string $string  the string to be quoted
 
     *
 
     * @return string  the quoted string
 
     *
 
     * @see DB_common::quoteSmart(), DB_common::escapeSimple()
 
     * @deprecated Method deprecated some time before Release 1.2
 
     */
 
    function quoteString($string)
 
    {
 
        $string = $this->quote($string);
 
        if ($string{0} == "'") {
 
            return substr($string, 1, -1);
 
        }
 
        return $string;
 
    }
 

	
 
    // }}}
 
    // {{{ quote()
 

	
 
    /**
 
     * DEPRECATED: Quotes a string so it can be safely used in a query
 
     *
 
     * @param string $string  the string to quote
 
     *
 
     * @return string  the quoted string or the string <samp>NULL</samp>
 
     *                  if the value submitted is <kbd>null</kbd>.
 
     *
 
     * @see DB_common::quoteSmart(), DB_common::escapeSimple()
 
     * @deprecated Deprecated in release 1.6.0
 
     */
 
    function quote($string = null)
 
    {
 
        return ($string === null) ? 'NULL'
 
                                  : "'" . str_replace("'", "''", $string) . "'";
 
    }
 

	
 
    // }}}
 
    // {{{ quoteIdentifier()
 

	
 
    /**
 
     * Quotes a string so it can be safely used as a table or column name
 
     *
 
     * Delimiting style depends on which database driver is being used.
 
     *
 
     * NOTE: just because you CAN use delimited identifiers doesn't mean
 
     * you SHOULD use them.  In general, they end up causing way more
 
     * problems than they solve.
 
     *
 
     * Portability is broken by using the following characters inside
 
     * delimited identifiers:
 
     *   + backtick (<kbd>`</kbd>) -- due to MySQL
 
     *   + double quote (<kbd>"</kbd>) -- due to Oracle
 
     *   + brackets (<kbd>[</kbd> or <kbd>]</kbd>) -- due to Access
 
     *
 
     * Delimited identifiers are known to generally work correctly under
 
     * the following drivers:
 
     *   + mssql
 
     *   + mysql
 
     *   + mysqli
 
     *   + oci8
 
     *   + odbc(access)
 
     *   + odbc(db2)
 
     *   + pgsql
 
     *   + sqlite
 
     *   + sybase (must execute <kbd>set quoted_identifier on</kbd> sometime
 
     *     prior to use)
 
     *
 
     * InterBase doesn't seem to be able to use delimited identifiers
 
     * via PHP 4.  They work fine under PHP 5.
 
     *
 
     * @param string $str  the identifier name to be quoted
 
     *
 
     * @return string  the quoted identifier
 
     *
 
     * @since Method available since Release 1.6.0
 
     */
 
    function quoteIdentifier($str)
 
    {
 
        return '"' . str_replace('"', '""', $str) . '"';
 
    }
 

	
 
    // }}}
 
    // {{{ quoteSmart()
 

	
 
    /**
 
     * Formats input so it can be safely used in a query
 
     *
 
     * The output depends on the PHP data type of input and the database
 
     * type being used.
 
     *
 
     * @param mixed $in  the data to be formatted
 
     *
 
     * @return mixed  the formatted data.  The format depends on the input's
 
     *                 PHP type:
 
     * <ul>
 
     *  <li>
 
     *    <kbd>input</kbd> -> <samp>returns</samp>
 
     *  </li>
 
     *  <li>
 
     *    <kbd>null</kbd> -> the string <samp>NULL</samp>
 
     *  </li>
 
     *  <li>
 
     *    <kbd>integer</kbd> or <kbd>double</kbd> -> the unquoted number
 
     *  </li>
 
     *  <li>
 
     *    <kbd>bool</kbd> -> output depends on the driver in use
 
     *    Most drivers return integers: <samp>1</samp> if
 
     *    <kbd>true</kbd> or <samp>0</samp> if
 
     *    <kbd>false</kbd>.
 
     *    Some return strings: <samp>TRUE</samp> if
 
     *    <kbd>true</kbd> or <samp>FALSE</samp> if
 
     *    <kbd>false</kbd>.
 
     *    Finally one returns strings: <samp>T</samp> if
 
     *    <kbd>true</kbd> or <samp>F</samp> if
 
     *    <kbd>false</kbd>. Here is a list of each DBMS,
 
     *    the values returned and the suggested column type:
 
     *    <ul>
 
     *      <li>
 
     *        <kbd>dbase</kbd> -> <samp>T/F</samp>
 
     *        (<kbd>Logical</kbd>)
 
     *      </li>
 
     *      <li>
 
     *        <kbd>fbase</kbd> -> <samp>TRUE/FALSE</samp>
 
     *        (<kbd>BOOLEAN</kbd>)
 
     *      </li>
 
     *      <li>
 
     *        <kbd>ibase</kbd> -> <samp>1/0</samp>
 
     *        (<kbd>SMALLINT</kbd>) [1]
 
     *      </li>
 
     *      <li>
 
     *        <kbd>ifx</kbd> -> <samp>1/0</samp>
 
     *        (<kbd>SMALLINT</kbd>) [1]
 
     *      </li>
 
     *      <li>
 
     *        <kbd>msql</kbd> -> <samp>1/0</samp>
 
     *        (<kbd>INTEGER</kbd>)
 
     *      </li>
 
     *      <li>
 
     *        <kbd>mssql</kbd> -> <samp>1/0</samp>
 
     *        (<kbd>BIT</kbd>)
 
     *      </li>
 
     *      <li>
 
     *        <kbd>mysql</kbd> -> <samp>1/0</samp>
 
     *        (<kbd>TINYINT(1)</kbd>)
 
     *      </li>
 
     *      <li>
 
     *        <kbd>mysqli</kbd> -> <samp>1/0</samp>
 
     *        (<kbd>TINYINT(1)</kbd>)
 
     *      </li>
 
     *      <li>
 
     *        <kbd>oci8</kbd> -> <samp>1/0</samp>
 
     *        (<kbd>NUMBER(1)</kbd>)
 
     *      </li>
 
     *      <li>
 
     *        <kbd>odbc</kbd> -> <samp>1/0</samp>
 
     *        (<kbd>SMALLINT</kbd>) [1]
 
     *      </li>
 
     *      <li>
 
     *        <kbd>pgsql</kbd> -> <samp>TRUE/FALSE</samp>
 
     *        (<kbd>BOOLEAN</kbd>)
 
     *      </li>
 
     *      <li>
 
     *        <kbd>sqlite</kbd> -> <samp>1/0</samp>
 
     *        (<kbd>INTEGER</kbd>)
 
     *      </li>
 
     *      <li>
 
     *        <kbd>sybase</kbd> -> <samp>1/0</samp>
 
     *        (<kbd>TINYINT(1)</kbd>)
 
     *      </li>
 
     *    </ul>
 
     *    [1] Accommodate the lowest common denominator because not all
 
     *    versions of have <kbd>BOOLEAN</kbd>.
 
     *  </li>
 
     *  <li>
 
     *    other (including strings and numeric strings) ->
 
     *    the data with single quotes escaped by preceeding
 
     *    single quotes, backslashes are escaped by preceeding
 
     *    backslashes, then the whole string is encapsulated
 
     *    between single quotes
 
     *  </li>
 
     * </ul>
 
     *
 
     * @see DB_common::escapeSimple()
 
     * @since Method available since Release 1.6.0
 
     */
 
    function quoteSmart($in)
 
    {
 
        if (is_int($in) || is_double($in)) {
 
            return $in;
 
        } elseif (is_bool($in)) {
 
            return $in ? 1 : 0;
 
        } elseif (is_null($in)) {
 
            return 'NULL';
 
        } else {
 
            return "'" . $this->escapeSimple($in) . "'";
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ escapeSimple()
 

	
 
    /**
 
     * Escapes a string according to the current DBMS's standards
 
     *
 
     * In SQLite, this makes things safe for inserts/updates, but may
 
     * cause problems when performing text comparisons against columns
 
     * containing binary data. See the
 
     * {@link http://php.net/sqlite_escape_string PHP manual} for more info.
 
     *
 
     * @param string $str  the string to be escaped
 
     *
 
     * @return string  the escaped string
 
     *
 
     * @see DB_common::quoteSmart()
 
     * @since Method available since Release 1.6.0
 
     */
 
    function escapeSimple($str)
 
    {
 
        return str_replace("'", "''", $str);
 
    }
 

	
 
    // }}}
 
    // {{{ provides()
 

	
 
    /**
 
     * Tells whether the present driver supports a given feature
 
     *
 
     * @param string $feature  the feature you're curious about
 
     *
 
     * @return bool  whether this driver supports $feature
 
     */
 
    function provides($feature)
 
    {
 
        return $this->features[$feature];
 
    }
 

	
 
    // }}}
 
    // {{{ setFetchMode()
 

	
 
    /**
 
     * Sets the fetch mode that should be used by default for query results
 
     *
 
     * @param integer $fetchmode    DB_FETCHMODE_ORDERED, DB_FETCHMODE_ASSOC
 
     *                               or DB_FETCHMODE_OBJECT
 
     * @param string $object_class  the class name of the object to be returned
 
     *                               by the fetch methods when the
 
     *                               DB_FETCHMODE_OBJECT mode is selected.
 
     *                               If no class is specified by default a cast
 
     *                               to object from the assoc array row will be
 
     *                               done.  There is also the posibility to use
 
     *                               and extend the 'DB_row' class.
 
     *
 
     * @see DB_FETCHMODE_ORDERED, DB_FETCHMODE_ASSOC, DB_FETCHMODE_OBJECT
 
     */
 
    function setFetchMode($fetchmode, $object_class = 'stdClass')
 
    {
 
        switch ($fetchmode) {
 
            case DB_FETCHMODE_OBJECT:
 
                $this->fetchmode_object_class = $object_class;
 
            case DB_FETCHMODE_ORDERED:
 
            case DB_FETCHMODE_ASSOC:
 
                $this->fetchmode = $fetchmode;
 
                break;
 
            default:
 
                return $this->raiseError('invalid fetchmode mode');
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ setOption()
 

	
 
    /**
 
     * Sets run-time configuration options for PEAR DB
 
     *
 
     * Options, their data types, default values and description:
 
     * <ul>
 
     * <li>
 
     * <var>autofree</var> <kbd>boolean</kbd> = <samp>false</samp>
 
     *      <br />should results be freed automatically when there are no
 
     *            more rows?
 
     * </li><li>
 
     * <var>result_buffering</var> <kbd>integer</kbd> = <samp>500</samp>
 
     *      <br />how many rows of the result set should be buffered?
 
     *      <br />In mysql: mysql_unbuffered_query() is used instead of
 
     *            mysql_query() if this value is 0.  (Release 1.7.0)
 
     *      <br />In oci8: this value is passed to ocisetprefetch().
 
     *            (Release 1.7.0)
 
     * </li><li>
 
     * <var>debug</var> <kbd>integer</kbd> = <samp>0</samp>
 
     *      <br />debug level
 
     * </li><li>
 
     * <var>persistent</var> <kbd>boolean</kbd> = <samp>false</samp>
 
     *      <br />should the connection be persistent?
 
     * </li><li>
 
     * <var>portability</var> <kbd>integer</kbd> = <samp>DB_PORTABILITY_NONE</samp>
 
     *      <br />portability mode constant (see below)
 
     * </li><li>
 
     * <var>seqname_format</var> <kbd>string</kbd> = <samp>%s_seq</samp>
 
     *      <br />the sprintf() format string used on sequence names.  This
 
     *            format is applied to sequence names passed to
 
     *            createSequence(), nextID() and dropSequence().
 
     * </li><li>
 
     * <var>ssl</var> <kbd>boolean</kbd> = <samp>false</samp>
 
     *      <br />use ssl to connect?
 
     * </li>
 
     * </ul>
 
     *
 
     * -----------------------------------------
 
     *
 
     * PORTABILITY MODES
 
     *
 
     * These modes are bitwised, so they can be combined using <kbd>|</kbd>
 
     * and removed using <kbd>^</kbd>.  See the examples section below on how
 
     * to do this.
 
     *
 
     * <samp>DB_PORTABILITY_NONE</samp>
 
     * turn off all portability features
 
     *
 
     * This mode gets automatically turned on if the deprecated
 
     * <var>optimize</var> option gets set to <samp>performance</samp>.
 
     *
 
     *
 
     * <samp>DB_PORTABILITY_LOWERCASE</samp>
 
     * convert names of tables and fields to lower case when using
 
     * <kbd>get*()</kbd>, <kbd>fetch*()</kbd> and <kbd>tableInfo()</kbd>
 
     *
 
     * This mode gets automatically turned on in the following databases
 
     * if the deprecated option <var>optimize</var> gets set to
 
     * <samp>portability</samp>:
 
     * + oci8
 
     *
 
     *
 
     * <samp>DB_PORTABILITY_RTRIM</samp>
 
     * right trim the data output by <kbd>get*()</kbd> <kbd>fetch*()</kbd>
 
     *
 
     *
 
     * <samp>DB_PORTABILITY_DELETE_COUNT</samp>
 
     * force reporting the number of rows deleted
 
     *
 
     * Some DBMS's don't count the number of rows deleted when performing
 
     * simple <kbd>DELETE FROM tablename</kbd> queries.  This portability
 
     * mode tricks such DBMS's into telling the count by adding
 
     * <samp>WHERE 1=1</samp> to the end of <kbd>DELETE</kbd> queries.
 
     *
 
     * This mode gets automatically turned on in the following databases
 
     * if the deprecated option <var>optimize</var> gets set to
 
     * <samp>portability</samp>:
 
     * + fbsql
 
     * + mysql
 
     * + mysqli
 
     * + sqlite
 
     *
 
     *
 
     * <samp>DB_PORTABILITY_NUMROWS</samp>
 
     * enable hack that makes <kbd>numRows()</kbd> work in Oracle
 
     *
 
     * This mode gets automatically turned on in the following databases
 
     * if the deprecated option <var>optimize</var> gets set to
 
     * <samp>portability</samp>:
 
     * + oci8
 
     *
 
     *
 
     * <samp>DB_PORTABILITY_ERRORS</samp>
 
     * makes certain error messages in certain drivers compatible
 
     * with those from other DBMS's
 
     *
 
     * + mysql, mysqli:  change unique/primary key constraints
 
     *   DB_ERROR_ALREADY_EXISTS -> DB_ERROR_CONSTRAINT
 
     *
 
     * + odbc(access):  MS's ODBC driver reports 'no such field' as code
 
     *   07001, which means 'too few parameters.'  When this option is on
 
     *   that code gets mapped to DB_ERROR_NOSUCHFIELD.
 
     *   DB_ERROR_MISMATCH -> DB_ERROR_NOSUCHFIELD
 
     *
 
     * <samp>DB_PORTABILITY_NULL_TO_EMPTY</samp>
 
     * convert null values to empty strings in data output by get*() and
 
     * fetch*().  Needed because Oracle considers empty strings to be null,
 
     * while most other DBMS's know the difference between empty and null.
 
     *
 
     *
 
     * <samp>DB_PORTABILITY_ALL</samp>
 
     * turn on all portability features
 
     *
 
     * -----------------------------------------
 
     *
 
     * Example 1. Simple setOption() example
 
     * <code>
 
     * $db->setOption('autofree', true);
 
     * </code>
 
     *
 
     * Example 2. Portability for lowercasing and trimming
 
     * <code>
 
     * $db->setOption('portability',
 
     *                 DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_RTRIM);
 
     * </code>
 
     *
 
     * Example 3. All portability options except trimming
 
     * <code>
 
     * $db->setOption('portability',
 
     *                 DB_PORTABILITY_ALL ^ DB_PORTABILITY_RTRIM);
 
     * </code>
 
     *
 
     * @param string $option option name
 
     * @param mixed  $value value for the option
 
     *
 
     * @return int  DB_OK on success.  A DB_Error object on failure.
 
     *
 
     * @see DB_common::$options
 
     */
 
    function setOption($option, $value)
 
    {
 
        if (isset($this->options[$option])) {
 
            $this->options[$option] = $value;
 

	
 
            /*
 
             * Backwards compatibility check for the deprecated 'optimize'
 
             * option.  Done here in case settings change after connecting.
 
             */
 
            if ($option == 'optimize') {
 
                if ($value == 'portability') {
 
                    switch ($this->phptype) {
 
                        case 'oci8':
 
                            $this->options['portability'] =
 
                                    DB_PORTABILITY_LOWERCASE |
 
                                    DB_PORTABILITY_NUMROWS;
 
                            break;
 
                        case 'fbsql':
 
                        case 'mysql':
 
                        case 'mysqli':
 
                        case 'sqlite':
 
                            $this->options['portability'] =
 
                                    DB_PORTABILITY_DELETE_COUNT;
 
                            break;
 
                    }
 
                } else {
 
                    $this->options['portability'] = DB_PORTABILITY_NONE;
 
                }
 
            }
 

	
 
            return DB_OK;
 
        }
 
        return $this->raiseError("unknown option $option");
 
    }
 

	
 
    // }}}
 
    // {{{ getOption()
 

	
 
    /**
 
     * Returns the value of an option
 
     *
 
     * @param string $option  the option name you're curious about
 
     *
 
     * @return mixed  the option's value
 
     */
 
    function getOption($option)
 
    {
 
        if (isset($this->options[$option])) {
 
            return $this->options[$option];
 
        }
 
        return $this->raiseError("unknown option $option");
 
    }
 

	
 
    // }}}
 
    // {{{ prepare()
 

	
 
    /**
 
     * Prepares a query for multiple execution with execute()
 
     *
 
     * Creates a query that can be run multiple times.  Each time it is run,
 
     * the placeholders, if any, will be replaced by the contents of
 
     * execute()'s $data argument.
 
     *
 
     * Three types of placeholders can be used:
 
     *   + <kbd>?</kbd>  scalar value (i.e. strings, integers).  The system
 
     *                   will automatically quote and escape the data.
 
     *   + <kbd>!</kbd>  value is inserted 'as is'
 
     *   + <kbd>&</kbd>  requires a file name.  The file's contents get
 
     *                   inserted into the query (i.e. saving binary
 
     *                   data in a db)
 
     *
 
     * Example 1.
 
     * <code>
 
     * $sth = $db->prepare('INSERT INTO tbl (a, b, c) VALUES (?, !, &)');
 
     * $data = array(
 
     *     "John's text",
 
     *     "'it''s good'",
 
     *     'filename.txt'
 
     * );
 
     * $res = $db->execute($sth, $data);
 
     * </code>
 
     *
 
     * Use backslashes to escape placeholder characters if you don't want
 
     * them to be interpreted as placeholders:
 
     * <pre>
 
     *    "UPDATE foo SET col=? WHERE col='over \& under'"
 
     * </pre>
 
     *
 
     * With some database backends, this is emulated.
 
     *
 
     * {@internal ibase and oci8 have their own prepare() methods.}}
 
     *
 
     * @param string $query  the query to be prepared
 
     *
 
     * @return mixed  DB statement resource on success. A DB_Error object
 
     *                 on failure.
 
     *
 
     * @see DB_common::execute()
 
     */
 
    function prepare($query)
 
    {
 
        $tokens   = preg_split('/((?<!\\\)[&?!])/', $query, -1,
 
                               PREG_SPLIT_DELIM_CAPTURE);
 
        $token     = 0;
 
        $types     = array();
 
        $newtokens = array();
 

	
 
        foreach ($tokens as $val) {
 
            switch ($val) {
 
                case '?':
 
                    $types[$token++] = DB_PARAM_SCALAR;
 
                    break;
 
                case '&':
 
                    $types[$token++] = DB_PARAM_OPAQUE;
 
                    break;
 
                case '!':
 
                    $types[$token++] = DB_PARAM_MISC;
 
                    break;
 
                default:
 
                    $newtokens[] = preg_replace('/\\\([&?!])/', "\\1", $val);
 
            }
 
        }
 

	
 
        $this->prepare_tokens[] = &$newtokens;
 
        end($this->prepare_tokens);
 

	
 
        $k = key($this->prepare_tokens);
 
        $this->prepare_types[$k] = $types;
 
        $this->prepared_queries[$k] = implode(' ', $newtokens);
 

	
 
        return $k;
 
    }
 

	
 
    // }}}
 
    // {{{ autoPrepare()
 

	
 
    /**
 
     * Automaticaly generates an insert or update query and pass it to prepare()
 
     *
 
     * @param string $table         the table name
 
     * @param array  $table_fields  the array of field names
 
     * @param int    $mode          a type of query to make:
 
     *                               DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE
 
     * @param string $where         for update queries: the WHERE clause to
 
     *                               append to the SQL statement.  Don't
 
     *                               include the "WHERE" keyword.
 
     *
 
     * @return resource  the query handle
 
     *
 
     * @uses DB_common::prepare(), DB_common::buildManipSQL()
 
     */
 
    function autoPrepare($table, $table_fields, $mode = DB_AUTOQUERY_INSERT,
 
                         $where = false)
 
    {
 
        $query = $this->buildManipSQL($table, $table_fields, $mode, $where);
 
        if (DB::isError($query)) {
 
            return $query;
 
        }
 
        return $this->prepare($query);
 
    }
 

	
 
    // }}}
 
    // {{{ autoExecute()
 

	
 
    /**
 
     * Automaticaly generates an insert or update query and call prepare()
 
     * and execute() with it
 
     *
 
     * @param string $table         the table name
 
     * @param array  $fields_values the associative array where $key is a
 
     *                               field name and $value its value
 
     * @param int    $mode          a type of query to make:
 
     *                               DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE
 
     * @param string $where         for update queries: the WHERE clause to
 
     *                               append to the SQL statement.  Don't
 
     *                               include the "WHERE" keyword.
 
     *
 
     * @return mixed  a new DB_result object for successful SELECT queries
 
     *                 or DB_OK for successul data manipulation queries.
 
     *                 A DB_Error object on failure.
 
     *
 
     * @uses DB_common::autoPrepare(), DB_common::execute()
 
     */
 
    function autoExecute($table, $fields_values, $mode = DB_AUTOQUERY_INSERT,
 
                         $where = false)
 
    {
 
        $sth = $this->autoPrepare($table, array_keys($fields_values), $mode,
 
                                  $where);
 
        if (DB::isError($sth)) {
 
            return $sth;
 
        }
 
        $ret =& $this->execute($sth, array_values($fields_values));
 
        $this->freePrepared($sth);
 
        return $ret;
 

	
 
    }
 

	
 
    // }}}
 
    // {{{ buildManipSQL()
 

	
 
    /**
 
     * Produces an SQL query string for autoPrepare()
 
     *
 
     * Example:
 
     * <pre>
 
     * buildManipSQL('table_sql', array('field1', 'field2', 'field3'),
 
     *               DB_AUTOQUERY_INSERT);
 
     * </pre>
 
     *
 
     * That returns
 
     * <samp>
 
     * INSERT INTO table_sql (field1,field2,field3) VALUES (?,?,?)
 
     * </samp>
 
     *
 
     * NOTES:
 
     *   - This belongs more to a SQL Builder class, but this is a simple
 
     *     facility.
 
     *   - Be carefull! If you don't give a $where param with an UPDATE
 
     *     query, all the records of the table will be updated!
 
     *
 
     * @param string $table         the table name
 
     * @param array  $table_fields  the array of field names
 
     * @param int    $mode          a type of query to make:
 
     *                               DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE
 
     * @param string $where         for update queries: the WHERE clause to
 
     *                               append to the SQL statement.  Don't
 
     *                               include the "WHERE" keyword.
 
     *
 
     * @return string  the sql query for autoPrepare()
 
     */
 
    function buildManipSQL($table, $table_fields, $mode, $where = false)
 
    {
 
        if (count($table_fields) == 0) {
 
            return $this->raiseError(DB_ERROR_NEED_MORE_DATA);
 
        }
 
        $first = true;
 
        switch ($mode) {
 
            case DB_AUTOQUERY_INSERT:
 
                $values = '';
 
                $names = '';
 
                foreach ($table_fields as $value) {
 
                    if ($first) {
 
                        $first = false;
 
                    } else {
 
                        $names .= ',';
 
                        $values .= ',';
 
                    }
 
                    $names .= $value;
 
                    $values .= '?';
 
                }
 
                return "INSERT INTO $table ($names) VALUES ($values)";
 
            case DB_AUTOQUERY_UPDATE:
 
                $set = '';
 
                foreach ($table_fields as $value) {
 
                    if ($first) {
 
                        $first = false;
 
                    } else {
 
                        $set .= ',';
 
                    }
 
                    $set .= "$value = ?";
 
                }
 
                $sql = "UPDATE $table SET $set";
 
                if ($where) {
 
                    $sql .= " WHERE $where";
 
                }
 
                return $sql;
 
            default:
 
                return $this->raiseError(DB_ERROR_SYNTAX);
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ execute()
 

	
 
    /**
 
     * Executes a DB statement prepared with prepare()
 
     *
 
     * Example 1.
 
     * <code>
 
     * $sth = $db->prepare('INSERT INTO tbl (a, b, c) VALUES (?, !, &)');
 
     * $data = array(
 
     *     "John's text",
 
     *     "'it''s good'",
 
     *     'filename.txt'
 
     * );
 
     * $res =& $db->execute($sth, $data);
 
     * </code>
 
     *
 
     * @param resource $stmt  a DB statement resource returned from prepare()
 
     * @param mixed    $data  array, string or numeric data to be used in
 
     *                         execution of the statement.  Quantity of items
 
     *                         passed must match quantity of placeholders in
 
     *                         query:  meaning 1 placeholder for non-array
 
     *                         parameters or 1 placeholder per array element.
 
     *
 
     * @return mixed  a new DB_result object for successful SELECT queries
 
     *                 or DB_OK for successul data manipulation queries.
 
     *                 A DB_Error object on failure.
 
     *
 
     * {@internal ibase and oci8 have their own execute() methods.}}
 
     *
 
     * @see DB_common::prepare()
 
     */
 
    function &execute($stmt, $data = array())
 
    {
 
        $realquery = $this->executeEmulateQuery($stmt, $data);
 
        if (DB::isError($realquery)) {
 
            return $realquery;
 
        }
 
        $result = $this->simpleQuery($realquery);
 

	
 
        if ($result === DB_OK || DB::isError($result)) {
 
            return $result;
 
        } else {
 
            $tmp =& new DB_result($this, $result);
 
            return $tmp;
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ executeEmulateQuery()
 

	
 
    /**
 
     * Emulates executing prepared statements if the DBMS not support them
 
     *
 
     * @param resource $stmt  a DB statement resource returned from execute()
 
     * @param mixed    $data  array, string or numeric data to be used in
 
     *                         execution of the statement.  Quantity of items
 
     *                         passed must match quantity of placeholders in
 
     *                         query:  meaning 1 placeholder for non-array
 
     *                         parameters or 1 placeholder per array element.
 
     *
 
     * @return mixed  a string containing the real query run when emulating
 
     *                 prepare/execute.  A DB_Error object on failure.
 
     *
 
     * @access protected
 
     * @see DB_common::execute()
 
     */
 
    function executeEmulateQuery($stmt, $data = array())
 
    {
 
        $stmt = (int)$stmt;
 
        $data = (array)$data;
 
        $this->last_parameters = $data;
 

	
 
        if (count($this->prepare_types[$stmt]) != count($data)) {
 
            $this->last_query = $this->prepared_queries[$stmt];
 
            return $this->raiseError(DB_ERROR_MISMATCH);
 
        }
 

	
 
        $realquery = $this->prepare_tokens[$stmt][0];
 

	
 
        $i = 0;
 
        foreach ($data as $value) {
 
            if ($this->prepare_types[$stmt][$i] == DB_PARAM_SCALAR) {
 
                $realquery .= $this->quoteSmart($value);
 
            } elseif ($this->prepare_types[$stmt][$i] == DB_PARAM_OPAQUE) {
 
                $fp = @fopen($value, 'rb');
 
                if (!$fp) {
 
                    return $this->raiseError(DB_ERROR_ACCESS_VIOLATION);
 
                }
 
                $realquery .= $this->quoteSmart(fread($fp, filesize($value)));
 
                fclose($fp);
 
            } else {
 
                $realquery .= $value;
 
            }
 

	
 
            $realquery .= $this->prepare_tokens[$stmt][++$i];
 
        }
 

	
 
        return $realquery;
 
    }
 

	
 
    // }}}
 
    // {{{ executeMultiple()
 

	
 
    /**
 
     * Performs several execute() calls on the same statement handle
 
     *
 
     * $data must be an array indexed numerically
 
     * from 0, one execute call is done for every "row" in the array.
 
     *
 
     * If an error occurs during execute(), executeMultiple() does not
 
     * execute the unfinished rows, but rather returns that error.
 
     *
 
     * @param resource $stmt  query handle from prepare()
 
     * @param array    $data  numeric array containing the
 
     *                         data to insert into the query
 
     *
 
     * @return int  DB_OK on success.  A DB_Error object on failure.
 
     *
 
     * @see DB_common::prepare(), DB_common::execute()
 
     */
 
    function executeMultiple($stmt, $data)
 
    {
 
        foreach ($data as $value) {
 
            $res =& $this->execute($stmt, $value);
 
            if (DB::isError($res)) {
 
                return $res;
 
            }
 
        }
 
        return DB_OK;
 
    }
 

	
 
    // }}}
 
    // {{{ freePrepared()
 

	
 
    /**
 
     * Frees the internal resources associated with a prepared query
 
     *
 
     * @param resource $stmt           the prepared statement's PHP resource
 
     * @param bool     $free_resource  should the PHP resource be freed too?
 
     *                                  Use false if you need to get data
 
     *                                  from the result set later.
 
     *
 
     * @return bool  TRUE on success, FALSE if $result is invalid
 
     *
 
     * @see DB_common::prepare()
 
     */
 
    function freePrepared($stmt, $free_resource = true)
 
    {
 
        $stmt = (int)$stmt;
 
        if (isset($this->prepare_tokens[$stmt])) {
 
            unset($this->prepare_tokens[$stmt]);
 
            unset($this->prepare_types[$stmt]);
 
            unset($this->prepared_queries[$stmt]);
 
            return true;
 
        }
 
        return false;
 
    }
 

	
 
    // }}}
 
    // {{{ modifyQuery()
 

	
 
    /**
 
     * Changes a query string for various DBMS specific reasons
 
     *
 
     * It is defined here to ensure all drivers have this method available.
 
     *
 
     * @param string $query  the query string to modify
 
     *
 
     * @return string  the modified query string
 
     *
 
     * @access protected
 
     * @see DB_mysql::modifyQuery(), DB_oci8::modifyQuery(),
 
     *      DB_sqlite::modifyQuery()
 
     */
 
    function modifyQuery($query)
 
    {
 
        return $query;
 
    }
 

	
 
    // }}}
 
    // {{{ modifyLimitQuery()
 

	
 
    /**
 
     * Adds LIMIT clauses to a query string according to current DBMS standards
 
     *
 
     * It is defined here to assure that all implementations
 
     * have this method defined.
 
     *
 
     * @param string $query   the query to modify
 
     * @param int    $from    the row to start to fetching (0 = the first row)
 
     * @param int    $count   the numbers of rows to fetch
 
     * @param mixed  $params  array, string or numeric data to be used in
 
     *                         execution of the statement.  Quantity of items
 
     *                         passed must match quantity of placeholders in
 
     *                         query:  meaning 1 placeholder for non-array
 
     *                         parameters or 1 placeholder per array element.
 
     *
 
     * @return string  the query string with LIMIT clauses added
 
     *
 
     * @access protected
 
     */
 
    function modifyLimitQuery($query, $from, $count, $params = array())
 
    {
 
        return $query;
 
    }
 

	
 
    // }}}
 
    // {{{ query()
 

	
 
    /**
 
     * Sends a query to the database server
 
     *
 
     * The query string can be either a normal statement to be sent directly
 
     * to the server OR if <var>$params</var> are passed the query can have
 
     * placeholders and it will be passed through prepare() and execute().
 
     *
 
     * @param string $query   the SQL query or the statement to prepare
 
     * @param mixed  $params  array, string or numeric data to be used in
 
     *                         execution of the statement.  Quantity of items
 
     *                         passed must match quantity of placeholders in
 
     *                         query:  meaning 1 placeholder for non-array
 
     *                         parameters or 1 placeholder per array element.
 
     *
 
     * @return mixed  a new DB_result object for successful SELECT queries
 
     *                 or DB_OK for successul data manipulation queries.
 
     *                 A DB_Error object on failure.
 
     *
 
     * @see DB_result, DB_common::prepare(), DB_common::execute()
 
     */
 
    function &query($query, $params = array())
 
    {
 
        if (sizeof($params) > 0) {
 
            $sth = $this->prepare($query);
 
            if (DB::isError($sth)) {
 
                return $sth;
 
            }
 
            $ret =& $this->execute($sth, $params);
 
            $this->freePrepared($sth, false);
 
            return $ret;
 
        } else {
 
            $this->last_parameters = array();
 
            $result = $this->simpleQuery($query);
 
            if ($result === DB_OK || DB::isError($result)) {
 
                return $result;
 
            } else {
 
                $tmp =& new DB_result($this, $result);
 
                return $tmp;
 
            }
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ limitQuery()
 

	
 
    /**
 
     * Generates and executes a LIMIT query
 
     *
 
     * @param string $query   the query
 
     * @param intr   $from    the row to start to fetching (0 = the first row)
 
     * @param int    $count   the numbers of rows to fetch
 
     * @param mixed  $params  array, string or numeric data to be used in
 
     *                         execution of the statement.  Quantity of items
 
     *                         passed must match quantity of placeholders in
 
     *                         query:  meaning 1 placeholder for non-array
 
     *                         parameters or 1 placeholder per array element.
 
     *
 
     * @return mixed  a new DB_result object for successful SELECT queries
 
     *                 or DB_OK for successul data manipulation queries.
 
     *                 A DB_Error object on failure.
 
     */
 
    function &limitQuery($query, $from, $count, $params = array())
 
    {
 
        $query = $this->modifyLimitQuery($query, $from, $count, $params);
 
        if (DB::isError($query)){
 
            return $query;
 
        }
 
        $result =& $this->query($query, $params);
 
        if (is_a($result, 'DB_result')) {
 
            $result->setOption('limit_from', $from);
 
            $result->setOption('limit_count', $count);
 
        }
 
        return $result;
 
    }
 

	
 
    // }}}
 
    // {{{ getOne()
 

	
 
    /**
 
     * Fetches the first column of the first row from a query result
 
     *
 
     * Takes care of doing the query and freeing the results when finished.
 
     *
 
     * @param string $query   the SQL query
 
     * @param mixed  $params  array, string or numeric data to be used in
 
     *                         execution of the statement.  Quantity of items
 
     *                         passed must match quantity of placeholders in
 
     *                         query:  meaning 1 placeholder for non-array
 
     *                         parameters or 1 placeholder per array element.
 
     *
 
     * @return mixed  the returned value of the query.
 
     *                 A DB_Error object on failure.
 
     */
 
    function &getOne($query, $params = array())
 
    {
 
        $params = (array)$params;
 
        // modifyLimitQuery() would be nice here, but it causes BC issues
 
        if (sizeof($params) > 0) {
 
            $sth = $this->prepare($query);
 
            if (DB::isError($sth)) {
 
                return $sth;
 
            }
 
            $res =& $this->execute($sth, $params);
 
            $this->freePrepared($sth);
 
        } else {
 
            $res =& $this->query($query);
 
        }
 

	
 
        if (DB::isError($res)) {
 
            return $res;
 
        }
 

	
 
        $err = $res->fetchInto($row, DB_FETCHMODE_ORDERED);
 
        $res->free();
 

	
 
        if ($err !== DB_OK) {
 
            return $err;
 
        }
 

	
 
        return $row[0];
 
    }
 

	
 
    // }}}
 
    // {{{ getRow()
 

	
 
    /**
 
     * Fetches the first row of data returned from a query result
 
     *
 
     * Takes care of doing the query and freeing the results when finished.
 
     *
 
     * @param string $query   the SQL query
 
     * @param mixed  $params  array, string or numeric data to be used in
 
     *                         execution of the statement.  Quantity of items
 
     *                         passed must match quantity of placeholders in
 
     *                         query:  meaning 1 placeholder for non-array
 
     *                         parameters or 1 placeholder per array element.
 
     * @param int $fetchmode  the fetch mode to use
 
     *
 
     * @return array  the first row of results as an array.
 
     *                 A DB_Error object on failure.
 
     */
 
    function &getRow($query, $params = array(),
 
                     $fetchmode = DB_FETCHMODE_DEFAULT)
 
    {
 
        // compat check, the params and fetchmode parameters used to
 
        // have the opposite order
 
        if (!is_array($params)) {
 
            if (is_array($fetchmode)) {
 
                if ($params === null) {
 
                    $tmp = DB_FETCHMODE_DEFAULT;
 
                } else {
 
                    $tmp = $params;
 
                }
 
                $params = $fetchmode;
 
                $fetchmode = $tmp;
 
            } elseif ($params !== null) {
 
                $fetchmode = $params;
 
                $params = array();
 
            }
 
        }
 
        // modifyLimitQuery() would be nice here, but it causes BC issues
 
        if (sizeof($params) > 0) {
 
            $sth = $this->prepare($query);
 
            if (DB::isError($sth)) {
 
                return $sth;
 
            }
 
            $res =& $this->execute($sth, $params);
 
            $this->freePrepared($sth);
 
        } else {
 
            $res =& $this->query($query);
 
        }
 

	
 
        if (DB::isError($res)) {
 
            return $res;
 
        }
 

	
 
        $err = $res->fetchInto($row, $fetchmode);
 

	
 
        $res->free();
 

	
 
        if ($err !== DB_OK) {
 
            return $err;
 
        }
 

	
 
        return $row;
 
    }
 

	
 
    // }}}
 
    // {{{ getCol()
 

	
 
    /**
 
     * Fetches a single column from a query result and returns it as an
 
     * indexed array
 
     *
 
     * @param string $query   the SQL query
 
     * @param mixed  $col     which column to return (integer [column number,
 
     *                         starting at 0] or string [column name])
 
     * @param mixed  $params  array, string or numeric data to be used in
 
     *                         execution of the statement.  Quantity of items
 
     *                         passed must match quantity of placeholders in
 
     *                         query:  meaning 1 placeholder for non-array
 
     *                         parameters or 1 placeholder per array element.
 
     *
 
     * @return array  the results as an array.  A DB_Error object on failure.
 
     *
 
     * @see DB_common::query()
 
     */
 
    function &getCol($query, $col = 0, $params = array())
 
    {
 
        $params = (array)$params;
 
        if (sizeof($params) > 0) {
 
            $sth = $this->prepare($query);
 

	
 
            if (DB::isError($sth)) {
 
                return $sth;
 
            }
 

	
 
            $res =& $this->execute($sth, $params);
 
            $this->freePrepared($sth);
 
        } else {
 
            $res =& $this->query($query);
 
        }
 

	
 
        if (DB::isError($res)) {
 
            return $res;
 
        }
 

	
 
        $fetchmode = is_int($col) ? DB_FETCHMODE_ORDERED : DB_FETCHMODE_ASSOC;
 

	
 
        if (!is_array($row = $res->fetchRow($fetchmode))) {
 
            $ret = array();
 
        } else {
 
            if (!array_key_exists($col, $row)) {
 
                $ret =& $this->raiseError(DB_ERROR_NOSUCHFIELD);
 
            } else {
 
                $ret = array($row[$col]);
 
                while (is_array($row = $res->fetchRow($fetchmode))) {
 
                    $ret[] = $row[$col];
 
                }
 
            }
 
        }
 

	
 
        $res->free();
 

	
 
        if (DB::isError($row)) {
 
            $ret = $row;
 
        }
 

	
 
        return $ret;
 
    }
 

	
 
    // }}}
 
    // {{{ getAssoc()
 

	
 
    /**
 
     * Fetches an entire query result and returns it as an
 
     * associative array using the first column as the key
 
     *
 
     * If the result set contains more than two columns, the value
 
     * will be an array of the values from column 2-n.  If the result
 
     * set contains only two columns, the returned value will be a
 
     * scalar with the value of the second column (unless forced to an
 
     * array with the $force_array parameter).  A DB error code is
 
     * returned on errors.  If the result set contains fewer than two
 
     * columns, a DB_ERROR_TRUNCATED error is returned.
 
     *
 
     * For example, if the table "mytable" contains:
 
     *
 
     * <pre>
 
     *  ID      TEXT       DATE
 
     * --------------------------------
 
     *  1       'one'      944679408
 
     *  2       'two'      944679408
 
     *  3       'three'    944679408
 
     * </pre>
 
     *
 
     * Then the call getAssoc('SELECT id,text FROM mytable') returns:
 
     * <pre>
 
     *   array(
 
     *     '1' => 'one',
 
     *     '2' => 'two',
 
     *     '3' => 'three',
 
     *   )
 
     * </pre>
 
     *
 
     * ...while the call getAssoc('SELECT id,text,date FROM mytable') returns:
 
     * <pre>
 
     *   array(
 
     *     '1' => array('one', '944679408'),
 
     *     '2' => array('two', '944679408'),
 
     *     '3' => array('three', '944679408')
 
     *   )
 
     * </pre>
 
     *
 
     * If the more than one row occurs with the same value in the
 
     * first column, the last row overwrites all previous ones by
 
     * default.  Use the $group parameter if you don't want to
 
     * overwrite like this.  Example:
 
     *
 
     * <pre>
 
     * getAssoc('SELECT category,id,name FROM mytable', false, null,
 
     *          DB_FETCHMODE_ASSOC, true) returns:
 
     *
 
     *   array(
 
     *     '1' => array(array('id' => '4', 'name' => 'number four'),
 
     *                  array('id' => '6', 'name' => 'number six')
 
     *            ),
 
     *     '9' => array(array('id' => '4', 'name' => 'number four'),
 
     *                  array('id' => '6', 'name' => 'number six')
 
     *            )
 
     *   )
 
     * </pre>
 
     *
 
     * Keep in mind that database functions in PHP usually return string
 
     * values for results regardless of the database's internal type.
 
     *
 
     * @param string $query        the SQL query
 
     * @param bool   $force_array  used only when the query returns
 
     *                              exactly two columns.  If true, the values
 
     *                              of the returned array will be one-element
 
     *                              arrays instead of scalars.
 
     * @param mixed  $params       array, string or numeric data to be used in
 
     *                              execution of the statement.  Quantity of
 
     *                              items passed must match quantity of
 
     *                              placeholders in query:  meaning 1
 
     *                              placeholder for non-array parameters or
 
     *                              1 placeholder per array element.
 
     * @param int   $fetchmode     the fetch mode to use
 
     * @param bool  $group         if true, the values of the returned array
 
     *                              is wrapped in another array.  If the same
 
     *                              key value (in the first column) repeats
 
     *                              itself, the values will be appended to
 
     *                              this array instead of overwriting the
 
     *                              existing values.
 
     *
 
     * @return array  the associative array containing the query results.
 
     *                A DB_Error object on failure.
 
     */
 
    function &getAssoc($query, $force_array = false, $params = array(),
 
                       $fetchmode = DB_FETCHMODE_DEFAULT, $group = false)
 
    {
 
        $params = (array)$params;
 
        if (sizeof($params) > 0) {
 
            $sth = $this->prepare($query);
 

	
 
            if (DB::isError($sth)) {
 
                return $sth;
 
            }
 

	
 
            $res =& $this->execute($sth, $params);
 
            $this->freePrepared($sth);
 
        } else {
 
            $res =& $this->query($query);
 
        }
 

	
 
        if (DB::isError($res)) {
 
            return $res;
 
        }
 
        if ($fetchmode == DB_FETCHMODE_DEFAULT) {
 
            $fetchmode = $this->fetchmode;
 
        }
 
        $cols = $res->numCols();
 

	
 
        if ($cols < 2) {
 
            $tmp =& $this->raiseError(DB_ERROR_TRUNCATED);
 
            return $tmp;
 
        }
 

	
 
        $results = array();
 

	
 
        if ($cols > 2 || $force_array) {
 
            // return array values
 
            // XXX this part can be optimized
 
            if ($fetchmode == DB_FETCHMODE_ASSOC) {
 
                while (is_array($row = $res->fetchRow(DB_FETCHMODE_ASSOC))) {
 
                    reset($row);
 
                    $key = current($row);
 
                    unset($row[key($row)]);
 
                    if ($group) {
 
                        $results[$key][] = $row;
 
                    } else {
 
                        $results[$key] = $row;
 
                    }
 
                }
 
            } elseif ($fetchmode == DB_FETCHMODE_OBJECT) {
 
                while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
 
                    $arr = get_object_vars($row);
 
                    $key = current($arr);
 
                    if ($group) {
 
                        $results[$key][] = $row;
 
                    } else {
 
                        $results[$key] = $row;
 
                    }
 
                }
 
            } else {
 
                while (is_array($row = $res->fetchRow(DB_FETCHMODE_ORDERED))) {
 
                    // we shift away the first element to get
 
                    // indices running from 0 again
 
                    $key = array_shift($row);
 
                    if ($group) {
 
                        $results[$key][] = $row;
 
                    } else {
 
                        $results[$key] = $row;
 
                    }
 
                }
 
            }
 
            if (DB::isError($row)) {
 
                $results = $row;
 
            }
 
        } else {
 
            // return scalar values
 
            while (is_array($row = $res->fetchRow(DB_FETCHMODE_ORDERED))) {
 
                if ($group) {
 
                    $results[$row[0]][] = $row[1];
 
                } else {
 
                    $results[$row[0]] = $row[1];
 
                }
 
            }
 
            if (DB::isError($row)) {
 
                $results = $row;
 
            }
 
        }
 

	
 
        $res->free();
 

	
 
        return $results;
 
    }
 

	
 
    // }}}
 
    // {{{ getAll()
 

	
 
    /**
 
     * Fetches all of the rows from a query result
 
     *
 
     * @param string $query      the SQL query
 
     * @param mixed  $params     array, string or numeric data to be used in
 
     *                            execution of the statement.  Quantity of
 
     *                            items passed must match quantity of
 
     *                            placeholders in query:  meaning 1
 
     *                            placeholder for non-array parameters or
 
     *                            1 placeholder per array element.
 
     * @param int    $fetchmode  the fetch mode to use:
 
     *                            + DB_FETCHMODE_ORDERED
 
     *                            + DB_FETCHMODE_ASSOC
 
     *                            + DB_FETCHMODE_ORDERED | DB_FETCHMODE_FLIPPED
 
     *                            + DB_FETCHMODE_ASSOC | DB_FETCHMODE_FLIPPED
 
     *
 
     * @return array  the nested array.  A DB_Error object on failure.
 
     */
 
    function &getAll($query, $params = array(),
 
                     $fetchmode = DB_FETCHMODE_DEFAULT)
 
    {
 
        // compat check, the params and fetchmode parameters used to
 
        // have the opposite order
 
        if (!is_array($params)) {
 
            if (is_array($fetchmode)) {
 
                if ($params === null) {
 
                    $tmp = DB_FETCHMODE_DEFAULT;
 
                } else {
 
                    $tmp = $params;
 
                }
 
                $params = $fetchmode;
 
                $fetchmode = $tmp;
 
            } elseif ($params !== null) {
 
                $fetchmode = $params;
 
                $params = array();
 
            }
 
        }
 

	
 
        if (sizeof($params) > 0) {
 
            $sth = $this->prepare($query);
 

	
 
            if (DB::isError($sth)) {
 
                return $sth;
 
            }
 

	
 
            $res =& $this->execute($sth, $params);
 
            $this->freePrepared($sth);
 
        } else {
 
            $res =& $this->query($query);
 
        }
 

	
 
        if ($res === DB_OK || DB::isError($res)) {
 
            return $res;
 
        }
 

	
 
        $results = array();
 
        while (DB_OK === $res->fetchInto($row, $fetchmode)) {
 
            if ($fetchmode & DB_FETCHMODE_FLIPPED) {
 
                foreach ($row as $key => $val) {
 
                    $results[$key][] = $val;
 
                }
 
            } else {
 
                $results[] = $row;
 
            }
 
        }
 

	
 
        $res->free();
 

	
 
        if (DB::isError($row)) {
 
            $tmp =& $this->raiseError($row);
 
            return $tmp;
 
        }
 
        return $results;
 
    }
 

	
 
    // }}}
 
    // {{{ autoCommit()
 

	
 
    /**
 
     * Enables or disables automatic commits
 
     *
 
     * @param bool $onoff  true turns it on, false turns it off
 
     *
 
     * @return int  DB_OK on success.  A DB_Error object if the driver
 
     *               doesn't support auto-committing transactions.
 
     */
 
    function autoCommit($onoff = false)
 
    {
 
        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
 
    }
 

	
 
    // }}}
 
    // {{{ commit()
 

	
 
    /**
 
     * Commits the current transaction
 
     *
 
     * @return int  DB_OK on success.  A DB_Error object on failure.
 
     */
 
    function commit()
 
    {
 
        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
 
    }
 

	
 
    // }}}
 
    // {{{ rollback()
 

	
 
    /**
 
     * Reverts the current transaction
 
     *
 
     * @return int  DB_OK on success.  A DB_Error object on failure.
 
     */
 
    function rollback()
 
    {
 
        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
 
    }
 

	
 
    // }}}
 
    // {{{ numRows()
 

	
 
    /**
 
     * Determines the number of rows in a query result
 
     *
 
     * @param resource $result  the query result idenifier produced by PHP
 
     *
 
     * @return int  the number of rows.  A DB_Error object on failure.
 
     */
 
    function numRows($result)
 
    {
 
        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
 
    }
 

	
 
    // }}}
 
    // {{{ affectedRows()
 

	
 
    /**
 
     * Determines the number of rows affected by a data maniuplation query
 
     *
 
     * 0 is returned for queries that don't manipulate data.
 
     *
 
     * @return int  the number of rows.  A DB_Error object on failure.
 
     */
 
    function affectedRows()
 
    {
 
        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
 
    }
 

	
 
    // }}}
 
    // {{{ getSequenceName()
 

	
 
    /**
 
     * Generates the name used inside the database for a sequence
 
     *
 
     * The createSequence() docblock contains notes about storing sequence
 
     * names.
 
     *
 
     * @param string $sqn  the sequence's public name
 
     *
 
     * @return string  the sequence's name in the backend
 
     *
 
     * @access protected
 
     * @see DB_common::createSequence(), DB_common::dropSequence(),
 
     *      DB_common::nextID(), DB_common::setOption()
 
     */
 
    function getSequenceName($sqn)
 
    {
 
        return sprintf($this->getOption('seqname_format'),
 
                       preg_replace('/[^a-z0-9_.]/i', '_', $sqn));
 
    }
 

	
 
    // }}}
 
    // {{{ nextId()
 

	
 
    /**
 
     * Returns the next free id in a sequence
 
     *
 
     * @param string  $seq_name  name of the sequence
 
     * @param boolean $ondemand  when true, the seqence is automatically
 
     *                            created if it does not exist
 
     *
 
     * @return int  the next id number in the sequence.
 
     *               A DB_Error object on failure.
 
     *
 
     * @see DB_common::createSequence(), DB_common::dropSequence(),
 
     *      DB_common::getSequenceName()
 
     */
 
    function nextId($seq_name, $ondemand = true)
 
    {
 
        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
 
    }
 

	
 
    // }}}
 
    // {{{ createSequence()
 

	
 
    /**
 
     * Creates a new sequence
 
     *
 
     * The name of a given sequence is determined by passing the string
 
     * provided in the <var>$seq_name</var> argument through PHP's sprintf()
 
     * function using the value from the <var>seqname_format</var> option as
 
     * the sprintf()'s format argument.
 
     *
 
     * <var>seqname_format</var> is set via setOption().
 
     *
 
     * @param string $seq_name  name of the new sequence
 
     *
 
     * @return int  DB_OK on success.  A DB_Error object on failure.
 
     *
 
     * @see DB_common::dropSequence(), DB_common::getSequenceName(),
 
     *      DB_common::nextID()
 
     */
 
    function createSequence($seq_name)
 
    {
 
        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
 
    }
 

	
 
    // }}}
 
    // {{{ dropSequence()
 

	
 
    /**
 
     * Deletes a sequence
 
     *
 
     * @param string $seq_name  name of the sequence to be deleted
 
     *
 
     * @return int  DB_OK on success.  A DB_Error object on failure.
 
     *
 
     * @see DB_common::createSequence(), DB_common::getSequenceName(),
 
     *      DB_common::nextID()
 
     */
 
    function dropSequence($seq_name)
 
    {
 
        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
 
    }
 

	
 
    // }}}
 
    // {{{ raiseError()
 

	
 
    /**
 
     * Communicates an error and invoke error callbacks, etc
 
     *
 
     * Basically a wrapper for PEAR::raiseError without the message string.
 
     *
 
     * @param mixed   integer error code, or a PEAR error object (all
 
     *                 other parameters are ignored if this parameter is
 
     *                 an object
 
     * @param int     error mode, see PEAR_Error docs
 
     * @param mixed   if error mode is PEAR_ERROR_TRIGGER, this is the
 
     *                 error level (E_USER_NOTICE etc).  If error mode is
 
     *                 PEAR_ERROR_CALLBACK, this is the callback function,
 
     *                 either as a function name, or as an array of an
 
     *                 object and method name.  For other error modes this
 
     *                 parameter is ignored.
 
     * @param string  extra debug information.  Defaults to the last
 
     *                 query and native error code.
 
     * @param mixed   native error code, integer or string depending the
 
     *                 backend
 
     *
 
     * @return object  the PEAR_Error object
 
     *
 
     * @see PEAR_Error
 
     */
 
    function &raiseError($code = DB_ERROR, $mode = null, $options = null,
 
                         $userinfo = null, $nativecode = null)
 
    {
 
        // The error is yet a DB error object
 
        if (is_object($code)) {
 
            // because we the static PEAR::raiseError, our global
 
            // handler should be used if it is set
 
            if ($mode === null && !empty($this->_default_error_mode)) {
 
                $mode    = $this->_default_error_mode;
 
                $options = $this->_default_error_options;
 
            }
 
            $tmp = PEAR::raiseError($code, null, $mode, $options,
 
                                    null, null, true);
 
            return $tmp;
 
        }
 

	
 
        if ($userinfo === null) {
 
            $userinfo = $this->last_query;
 
        }
 

	
 
        if ($nativecode) {
 
            $userinfo .= ' [nativecode=' . trim($nativecode) . ']';
 
        } else {
 
            $userinfo .= ' [DB Error: ' . DB::errorMessage($code) . ']';
 
        }
 

	
 
        $tmp = PEAR::raiseError(null, $code, $mode, $options, $userinfo,
 
                                'DB_Error', true);
 
        return $tmp;
 
    }
 

	
 
    // }}}
 
    // {{{ errorNative()
 

	
 
    /**
 
     * Gets the DBMS' native error code produced by the last query
 
     *
 
     * @return mixed  the DBMS' error code.  A DB_Error object on failure.
 
     */
 
    function errorNative()
 
    {
 
        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
 
    }
 

	
 
    // }}}
 
    // {{{ errorCode()
 

	
 
    /**
 
     * Maps native error codes to DB's portable ones
 
     *
 
     * Uses the <var>$errorcode_map</var> property defined in each driver.
 
     *
 
     * @param string|int $nativecode  the error code returned by the DBMS
 
     *
 
     * @return int  the portable DB error code.  Return DB_ERROR if the
 
     *               current driver doesn't have a mapping for the
 
     *               $nativecode submitted.
 
     */
 
    function errorCode($nativecode)
 
    {
 
        if (isset($this->errorcode_map[$nativecode])) {
 
            return $this->errorcode_map[$nativecode];
 
        }
 
        // Fall back to DB_ERROR if there was no mapping.
 
        return DB_ERROR;
 
    }
 

	
 
    // }}}
 
    // {{{ errorMessage()
 

	
 
    /**
 
     * Maps a DB error code to a textual message
 
     *
 
     * @param integer $dbcode  the DB error code
 
     *
 
     * @return string  the error message corresponding to the error code
 
     *                  submitted.  FALSE if the error code is unknown.
 
     *
 
     * @see DB::errorMessage()
 
     */
 
    function errorMessage($dbcode)
 
    {
 
        return DB::errorMessage($this->errorcode_map[$dbcode]);
 
    }
 

	
 
    // }}}
 
    // {{{ tableInfo()
 

	
 
    /**
 
     * Returns information about a table or a result set
 
     *
 
     * The format of the resulting array depends on which <var>$mode</var>
 
     * you select.  The sample output below is based on this query:
 
     * <pre>
 
     *    SELECT tblFoo.fldID, tblFoo.fldPhone, tblBar.fldId
 
     *    FROM tblFoo
 
     *    JOIN tblBar ON tblFoo.fldId = tblBar.fldId
 
     * </pre>
 
     *
 
     * <ul>
 
     * <li>
 
     *
 
     * <kbd>null</kbd> (default)
 
     *   <pre>
 
     *   [0] => Array (
 
     *       [table] => tblFoo
 
     *       [name] => fldId
 
     *       [type] => int
 
     *       [len] => 11
 
     *       [flags] => primary_key not_null
 
     *   )
 
     *   [1] => Array (
 
     *       [table] => tblFoo
 
     *       [name] => fldPhone
 
     *       [type] => string
 
     *       [len] => 20
 
     *       [flags] =>
 
     *   )
 
     *   [2] => Array (
 
     *       [table] => tblBar
 
     *       [name] => fldId
 
     *       [type] => int
 
     *       [len] => 11
 
     *       [flags] => primary_key not_null
 
     *   )
 
     *   </pre>
 
     *
 
     * </li><li>
 
     *
 
     * <kbd>DB_TABLEINFO_ORDER</kbd>
 
     *
 
     *   <p>In addition to the information found in the default output,
 
     *   a notation of the number of columns is provided by the
 
     *   <samp>num_fields</samp> element while the <samp>order</samp>
 
     *   element provides an array with the column names as the keys and
 
     *   their location index number (corresponding to the keys in the
 
     *   the default output) as the values.</p>
 
     *
 
     *   <p>If a result set has identical field names, the last one is
 
     *   used.</p>
 
     *
 
     *   <pre>
 
     *   [num_fields] => 3
 
     *   [order] => Array (
 
     *       [fldId] => 2
 
     *       [fldTrans] => 1
 
     *   )
 
     *   </pre>
 
     *
 
     * </li><li>
 
     *
 
     * <kbd>DB_TABLEINFO_ORDERTABLE</kbd>
 
     *
 
     *   <p>Similar to <kbd>DB_TABLEINFO_ORDER</kbd> but adds more
 
     *   dimensions to the array in which the table names are keys and
 
     *   the field names are sub-keys.  This is helpful for queries that
 
     *   join tables which have identical field names.</p>
 
     *
 
     *   <pre>
 
     *   [num_fields] => 3
 
     *   [ordertable] => Array (
 
     *       [tblFoo] => Array (
 
     *           [fldId] => 0
 
     *           [fldPhone] => 1
 
     *       )
 
     *       [tblBar] => Array (
 
     *           [fldId] => 2
 
     *       )
 
     *   )
 
     *   </pre>
 
     *
 
     * </li>
 
     * </ul>
 
     *
 
     * The <samp>flags</samp> element contains a space separated list
 
     * of extra information about the field.  This data is inconsistent
 
     * between DBMS's due to the way each DBMS works.
 
     *   + <samp>primary_key</samp>
 
     *   + <samp>unique_key</samp>
 
     *   + <samp>multiple_key</samp>
 
     *   + <samp>not_null</samp>
 
     *
 
     * Most DBMS's only provide the <samp>table</samp> and <samp>flags</samp>
 
     * elements if <var>$result</var> is a table name.  The following DBMS's
 
     * provide full information from queries:
 
     *   + fbsql
 
     *   + mysql
 
     *
 
     * If the 'portability' option has <samp>DB_PORTABILITY_LOWERCASE</samp>
 
     * turned on, the names of tables and fields will be lowercased.
 
     *
 
     * @param object|string  $result  DB_result object from a query or a
 
     *                                string containing the name of a table.
 
     *                                While this also accepts a query result
 
     *                                resource identifier, this behavior is
 
     *                                deprecated.
 
     * @param int  $mode   either unused or one of the tableInfo modes:
 
     *                     <kbd>DB_TABLEINFO_ORDERTABLE</kbd>,
 
     *                     <kbd>DB_TABLEINFO_ORDER</kbd> or
 
     *                     <kbd>DB_TABLEINFO_FULL</kbd> (which does both).
 
     *                     These are bitwise, so the first two can be
 
     *                     combined using <kbd>|</kbd>.
 
     *
 
     * @return array  an associative array with the information requested.
 
     *                 A DB_Error object on failure.
 
     *
 
     * @see DB_common::setOption()
 
     */
 
    function tableInfo($result, $mode = null)
 
    {
 
        /*
 
         * If the DB_<driver> class has a tableInfo() method, that one
 
         * overrides this one.  But, if the driver doesn't have one,
 
         * this method runs and tells users about that fact.
 
         */
 
        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
 
    }
 

	
 
    // }}}
 
    // {{{ getTables()
 

	
 
    /**
 
     * Lists the tables in the current database
 
     *
 
     * @return array  the list of tables.  A DB_Error object on failure.
 
     *
 
     * @deprecated Method deprecated some time before Release 1.2
 
     */
 
    function getTables()
 
    {
 
        return $this->getListOf('tables');
 
    }
 

	
 
    // }}}
 
    // {{{ getListOf()
 

	
 
    /**
 
     * Lists internal database information
 
     *
 
     * @param string $type  type of information being sought.
 
     *                       Common items being sought are:
 
     *                       tables, databases, users, views, functions
 
     *                       Each DBMS's has its own capabilities.
 
     *
 
     * @return array  an array listing the items sought.
 
     *                 A DB DB_Error object on failure.
 
     */
 
    function getListOf($type)
 
    {
 
        $sql = $this->getSpecialQuery($type);
 
        if ($sql === null) {
 
            $this->last_query = '';
 
            return $this->raiseError(DB_ERROR_UNSUPPORTED);
 
        } elseif (is_int($sql) || DB::isError($sql)) {
 
            // Previous error
 
            return $this->raiseError($sql);
 
        } elseif (is_array($sql)) {
 
            // Already the result
 
            return $sql;
 
        }
 
        // Launch this query
 
        return $this->getCol($sql);
 
    }
 

	
 
    // }}}
 
    // {{{ getSpecialQuery()
 

	
 
    /**
 
     * Obtains the query string needed for listing a given type of objects
 
     *
 
     * @param string $type  the kind of objects you want to retrieve
 
     *
 
     * @return string  the SQL query string or null if the driver doesn't
 
     *                  support the object type requested
 
     *
 
     * @access protected
 
     * @see DB_common::getListOf()
 
     */
 
    function getSpecialQuery($type)
 
    {
 
        return $this->raiseError(DB_ERROR_UNSUPPORTED);
 
    }
 

	
 
    // }}}
 
    // {{{ _rtrimArrayValues()
 

	
 
    /**
 
     * Right-trims all strings in an array
 
     *
 
     * @param array $array  the array to be trimmed (passed by reference)
 
     *
 
     * @return void
 
     *
 
     * @access protected
 
     */
 
    function _rtrimArrayValues(&$array)
 
    {
 
        foreach ($array as $key => $value) {
 
            if (is_string($value)) {
 
                $array[$key] = rtrim($value);
 
            }
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ _convertNullArrayValuesToEmpty()
 

	
 
    /**
 
     * Converts all null values in an array to empty strings
 
     *
 
     * @param array  $array  the array to be de-nullified (passed by reference)
 
     *
 
     * @return void
 
     *
 
     * @access protected
 
     */
 
    function _convertNullArrayValuesToEmpty(&$array)
 
    {
 
        foreach ($array as $key => $value) {
 
            if (is_null($value)) {
 
                $array[$key] = '';
 
            }
 
        }
 
    }
 

	
 
    // }}}
 
}
 

	
 
/*
 
 * Local variables:
 
 * tab-width: 4
 
 * c-basic-offset: 4
 
 * End:
 
 */
 

	
 
?>
components/com_morfeoshow/tpl/resources/phpFlickr/PEAR/DB/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/phpFlickr/PEAR/DB/mysql.php
Show inline comments
 
new file 100644
 
<?php
 

	
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 

	
 
/**
 
 * The PEAR DB driver for PHP's mysql extension
 
 * for interacting with MySQL databases
 
 *
 
 * PHP versions 4 and 5
 
 *
 
 * LICENSE: This source file is subject to version 3.0 of the PHP license
 
 * that is available through the world-wide-web at the following URI:
 
 * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
 
 * the PHP License and are unable to obtain it through the web, please
 
 * send a note to license@php.net so we can mail you a copy immediately.
 
 *
 
 * @category   Database
 
 * @package    DB
 
 * @author     Stig Bakken <ssb@php.net>
 
 * @author     Daniel Convissor <danielc@php.net>
 
 * @copyright  1997-2005 The PHP Group
 
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 
 * @version    CVS: $Id: mysql.php 32 2005-08-01 06:21:02Z dancoulter $
 
 * @link       http://pear.php.net/package/DB
 
 */
 

	
 
/**
 
 * Obtain the DB_common class so it can be extended from
 
 */
 
require_once 'DB/common.php';
 

	
 
/**
 
 * The methods PEAR DB uses to interact with PHP's mysql extension
 
 * for interacting with MySQL databases
 
 *
 
 * These methods overload the ones declared in DB_common.
 
 *
 
 * @category   Database
 
 * @package    DB
 
 * @author     Stig Bakken <ssb@php.net>
 
 * @author     Daniel Convissor <danielc@php.net>
 
 * @copyright  1997-2005 The PHP Group
 
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 
 * @version    Release: @package_version@
 
 * @link       http://pear.php.net/package/DB
 
 */
 
class DB_mysql extends DB_common
 
{
 
    // {{{ properties
 

	
 
    /**
 
     * The DB driver type (mysql, oci8, odbc, etc.)
 
     * @var string
 
     */
 
    var $phptype = 'mysql';
 

	
 
    /**
 
     * The database syntax variant to be used (db2, access, etc.), if any
 
     * @var string
 
     */
 
    var $dbsyntax = 'mysql';
 

	
 
    /**
 
     * The capabilities of this DB implementation
 
     *
 
     * The 'new_link' element contains the PHP version that first provided
 
     * new_link support for this DBMS.  Contains false if it's unsupported.
 
     *
 
     * Meaning of the 'limit' element:
 
     *   + 'emulate' = emulate with fetch row by number
 
     *   + 'alter'   = alter the query
 
     *   + false     = skip rows
 
     *
 
     * @var array
 
     */
 
    var $features = array(
 
        'limit'         => 'alter',
 
        'new_link'      => '4.2.0',
 
        'numrows'       => true,
 
        'pconnect'      => true,
 
        'prepare'       => false,
 
        'ssl'           => false,
 
        'transactions'  => true,
 
    );
 

	
 
    /**
 
     * A mapping of native error codes to DB error codes
 
     * @var array
 
     */
 
    var $errorcode_map = array(
 
        1004 => DB_ERROR_CANNOT_CREATE,
 
        1005 => DB_ERROR_CANNOT_CREATE,
 
        1006 => DB_ERROR_CANNOT_CREATE,
 
        1007 => DB_ERROR_ALREADY_EXISTS,
 
        1008 => DB_ERROR_CANNOT_DROP,
 
        1022 => DB_ERROR_ALREADY_EXISTS,
 
        1044 => DB_ERROR_ACCESS_VIOLATION,
 
        1046 => DB_ERROR_NODBSELECTED,
 
        1048 => DB_ERROR_CONSTRAINT,
 
        1049 => DB_ERROR_NOSUCHDB,
 
        1050 => DB_ERROR_ALREADY_EXISTS,
 
        1051 => DB_ERROR_NOSUCHTABLE,
 
        1054 => DB_ERROR_NOSUCHFIELD,
 
        1061 => DB_ERROR_ALREADY_EXISTS,
 
        1062 => DB_ERROR_ALREADY_EXISTS,
 
        1064 => DB_ERROR_SYNTAX,
 
        1091 => DB_ERROR_NOT_FOUND,
 
        1100 => DB_ERROR_NOT_LOCKED,
 
        1136 => DB_ERROR_VALUE_COUNT_ON_ROW,
 
        1142 => DB_ERROR_ACCESS_VIOLATION,
 
        1146 => DB_ERROR_NOSUCHTABLE,
 
        1216 => DB_ERROR_CONSTRAINT,
 
        1217 => DB_ERROR_CONSTRAINT,
 
    );
 

	
 
    /**
 
     * The raw database connection created by PHP
 
     * @var resource
 
     */
 
    var $connection;
 

	
 
    /**
 
     * The DSN information for connecting to a database
 
     * @var array
 
     */
 
    var $dsn = array();
 

	
 

	
 
    /**
 
     * Should data manipulation queries be committed automatically?
 
     * @var bool
 
     * @access private
 
     */
 
    var $autocommit = true;
 

	
 
    /**
 
     * The quantity of transactions begun
 
     *
 
     * {@internal  While this is private, it can't actually be designated
 
     * private in PHP 5 because it is directly accessed in the test suite.}}
 
     *
 
     * @var integer
 
     * @access private
 
     */
 
    var $transaction_opcount = 0;
 

	
 
    /**
 
     * The database specified in the DSN
 
     *
 
     * It's a fix to allow calls to different databases in the same script.
 
     *
 
     * @var string
 
     * @access private
 
     */
 
    var $_db = '';
 

	
 

	
 
    // }}}
 
    // {{{ constructor
 

	
 
    /**
 
     * This constructor calls <kbd>$this->DB_common()</kbd>
 
     *
 
     * @return void
 
     */
 
    function DB_mysql()
 
    {
 
        $this->DB_common();
 
    }
 

	
 
    // }}}
 
    // {{{ connect()
 

	
 
    /**
 
     * Connect to the database server, log in and open the database
 
     *
 
     * Don't call this method directly.  Use DB::connect() instead.
 
     *
 
     * PEAR DB's mysql driver supports the following extra DSN options:
 
     *   + new_link      If set to true, causes subsequent calls to connect()
 
     *                    to return a new connection link instead of the
 
     *                    existing one.  WARNING: this is not portable to
 
     *                    other DBMS's. Available since PEAR DB 1.7.0.
 
     *   + client_flags  Any combination of MYSQL_CLIENT_* constants.
 
     *                    Only used if PHP is at version 4.3.0 or greater.
 
     *                    Available since PEAR DB 1.7.0.
 
     *
 
     * @param array $dsn         the data source name
 
     * @param bool  $persistent  should the connection be persistent?
 
     *
 
     * @return int  DB_OK on success. A DB_Error object on failure.
 
     */
 
    function connect($dsn, $persistent = false)
 
    {
 
        if (!PEAR::loadExtension('mysql')) {
 
            return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
 
        }
 

	
 
        $this->dsn = $dsn;
 
        if ($dsn['dbsyntax']) {
 
            $this->dbsyntax = $dsn['dbsyntax'];
 
        }
 

	
 
        $params = array();
 
        if ($dsn['protocol'] && $dsn['protocol'] == 'unix') {
 
            $params[0] = ':' . $dsn['socket'];
 
        } else {
 
            $params[0] = $dsn['hostspec'] ? $dsn['hostspec']
 
                         : 'localhost';
 
            if ($dsn['port']) {
 
                $params[0] .= ':' . $dsn['port'];
 
            }
 
        }
 
        $params[] = $dsn['username'] ? $dsn['username'] : null;
 
        $params[] = $dsn['password'] ? $dsn['password'] : null;
 

	
 
        if (!$persistent) {
 
            if (isset($dsn['new_link'])
 
                && ($dsn['new_link'] == 'true' || $dsn['new_link'] === true))
 
            {
 
                $params[] = true;
 
            } else {
 
                $params[] = false;
 
            }
 
        }
 
        if (version_compare(phpversion(), '4.3.0', '>=')) {
 
            $params[] = isset($dsn['client_flags'])
 
                        ? $dsn['client_flags'] : null;
 
        }
 

	
 
        $connect_function = $persistent ? 'mysql_pconnect' : 'mysql_connect';
 

	
 
        $ini = ini_get('track_errors');
 
        $php_errormsg = '';
 
        if ($ini) {
 
            $this->connection = @call_user_func_array($connect_function,
 
                                                      $params);
 
        } else {
 
            ini_set('track_errors', 1);
 
            $this->connection = @call_user_func_array($connect_function,
 
                                                      $params);
 
            ini_set('track_errors', $ini);
 
        }
 

	
 
        if (!$this->connection) {
 
            if (($err = @mysql_error()) != '') {
 
                return $this->raiseError(DB_ERROR_CONNECT_FAILED,
 
                                         null, null, null, 
 
                                         $err);
 
            } else {
 
                return $this->raiseError(DB_ERROR_CONNECT_FAILED,
 
                                         null, null, null,
 
                                         $php_errormsg);
 
            }
 
        }
 

	
 
        if ($dsn['database']) {
 
            if (!@mysql_select_db($dsn['database'], $this->connection)) {
 
                return $this->mysqlRaiseError();
 
            }
 
            $this->_db = $dsn['database'];
 
        }
 

	
 
        return DB_OK;
 
    }
 

	
 
    // }}}
 
    // {{{ disconnect()
 

	
 
    /**
 
     * Disconnects from the database server
 
     *
 
     * @return bool  TRUE on success, FALSE on failure
 
     */
 
    function disconnect()
 
    {
 
        $ret = @mysql_close($this->connection);
 
        $this->connection = null;
 
        return $ret;
 
    }
 

	
 
    // }}}
 
    // {{{ simpleQuery()
 

	
 
    /**
 
     * Sends a query to the database server
 
     *
 
     * Generally uses mysql_query().  If you want to use
 
     * mysql_unbuffered_query() set the "result_buffering" option to 0 using
 
     * setOptions().  This option was added in Release 1.7.0.
 
     *
 
     * @param string  the SQL query string
 
     *
 
     * @return mixed  + a PHP result resrouce for successful SELECT queries
 
     *                + the DB_OK constant for other successful queries
 
     *                + a DB_Error object on failure
 
     */
 
    function simpleQuery($query)
 
    {
 
        $ismanip = DB::isManip($query);
 
        $this->last_query = $query;
 
        $query = $this->modifyQuery($query);
 
        if ($this->_db) {
 
            if (!@mysql_select_db($this->_db, $this->connection)) {
 
                return $this->mysqlRaiseError(DB_ERROR_NODBSELECTED);
 
            }
 
        }
 
        if (!$this->autocommit && $ismanip) {
 
            if ($this->transaction_opcount == 0) {
 
                $result = @mysql_query('SET AUTOCOMMIT=0', $this->connection);
 
                $result = @mysql_query('BEGIN', $this->connection);
 
                if (!$result) {
 
                    return $this->mysqlRaiseError();
 
                }
 
            }
 
            $this->transaction_opcount++;
 
        }
 
        if (!$this->options['result_buffering']) {
 
            $result = @mysql_unbuffered_query($query, $this->connection);
 
        } else {
 
            $result = @mysql_query($query, $this->connection);
 
        }
 
        if (!$result) {
 
            return $this->mysqlRaiseError();
 
        }
 
        if (is_resource($result)) {
 
            return $result;
 
        }
 
        return DB_OK;
 
    }
 

	
 
    // }}}
 
    // {{{ nextResult()
 

	
 
    /**
 
     * Move the internal mysql result pointer to the next available result
 
     *
 
     * This method has not been implemented yet.
 
     *
 
     * @param a valid sql result resource
 
     *
 
     * @return false
 
     */
 
    function nextResult($result)
 
    {
 
        return false;
 
    }
 

	
 
    // }}}
 
    // {{{ fetchInto()
 

	
 
    /**
 
     * Places a row from the result set into the given array
 
     *
 
     * Formating of the array and the data therein are configurable.
 
     * See DB_result::fetchInto() for more information.
 
     *
 
     * This method is not meant to be called directly.  Use
 
     * DB_result::fetchInto() instead.  It can't be declared "protected"
 
     * because DB_result is a separate object.
 
     *
 
     * @param resource $result    the query result resource
 
     * @param array    $arr       the referenced array to put the data in
 
     * @param int      $fetchmode how the resulting array should be indexed
 
     * @param int      $rownum    the row number to fetch (0 = first row)
 
     *
 
     * @return mixed  DB_OK on success, NULL when the end of a result set is
 
     *                 reached or on failure
 
     *
 
     * @see DB_result::fetchInto()
 
     */
 
    function fetchInto($result, &$arr, $fetchmode, $rownum = null)
 
    {
 
        if ($rownum !== null) {
 
            if (!@mysql_data_seek($result, $rownum)) {
 
                return null;
 
            }
 
        }
 
        if ($fetchmode & DB_FETCHMODE_ASSOC) {
 
            $arr = @mysql_fetch_array($result, MYSQL_ASSOC);
 
            if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
 
                $arr = array_change_key_case($arr, CASE_LOWER);
 
            }
 
        } else {
 
            $arr = @mysql_fetch_row($result);
 
        }
 
        if (!$arr) {
 
            return null;
 
        }
 
        if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
 
            /*
 
             * Even though this DBMS already trims output, we do this because
 
             * a field might have intentional whitespace at the end that
 
             * gets removed by DB_PORTABILITY_RTRIM under another driver.
 
             */
 
            $this->_rtrimArrayValues($arr);
 
        }
 
        if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
 
            $this->_convertNullArrayValuesToEmpty($arr);
 
        }
 
        return DB_OK;
 
    }
 

	
 
    // }}}
 
    // {{{ freeResult()
 

	
 
    /**
 
     * Deletes the result set and frees the memory occupied by the result set
 
     *
 
     * This method is not meant to be called directly.  Use
 
     * DB_result::free() instead.  It can't be declared "protected"
 
     * because DB_result is a separate object.
 
     *
 
     * @param resource $result  PHP's query result resource
 
     *
 
     * @return bool  TRUE on success, FALSE if $result is invalid
 
     *
 
     * @see DB_result::free()
 
     */
 
    function freeResult($result)
 
    {
 
        return @mysql_free_result($result);
 
    }
 

	
 
    // }}}
 
    // {{{ numCols()
 

	
 
    /**
 
     * Gets the number of columns in a result set
 
     *
 
     * This method is not meant to be called directly.  Use
 
     * DB_result::numCols() instead.  It can't be declared "protected"
 
     * because DB_result is a separate object.
 
     *
 
     * @param resource $result  PHP's query result resource
 
     *
 
     * @return int  the number of columns.  A DB_Error object on failure.
 
     *
 
     * @see DB_result::numCols()
 
     */
 
    function numCols($result)
 
    {
 
        $cols = @mysql_num_fields($result);
 
        if (!$cols) {
 
            return $this->mysqlRaiseError();
 
        }
 
        return $cols;
 
    }
 

	
 
    // }}}
 
    // {{{ numRows()
 

	
 
    /**
 
     * Gets the number of rows in a result set
 
     *
 
     * This method is not meant to be called directly.  Use
 
     * DB_result::numRows() instead.  It can't be declared "protected"
 
     * because DB_result is a separate object.
 
     *
 
     * @param resource $result  PHP's query result resource
 
     *
 
     * @return int  the number of rows.  A DB_Error object on failure.
 
     *
 
     * @see DB_result::numRows()
 
     */
 
    function numRows($result)
 
    {
 
        $rows = @mysql_num_rows($result);
 
        if ($rows === null) {
 
            return $this->mysqlRaiseError();
 
        }
 
        return $rows;
 
    }
 

	
 
    // }}}
 
    // {{{ autoCommit()
 

	
 
    /**
 
     * Enables or disables automatic commits
 
     *
 
     * @param bool $onoff  true turns it on, false turns it off
 
     *
 
     * @return int  DB_OK on success.  A DB_Error object if the driver
 
     *               doesn't support auto-committing transactions.
 
     */
 
    function autoCommit($onoff = false)
 
    {
 
        // XXX if $this->transaction_opcount > 0, we should probably
 
        // issue a warning here.
 
        $this->autocommit = $onoff ? true : false;
 
        return DB_OK;
 
    }
 

	
 
    // }}}
 
    // {{{ commit()
 

	
 
    /**
 
     * Commits the current transaction
 
     *
 
     * @return int  DB_OK on success.  A DB_Error object on failure.
 
     */
 
    function commit()
 
    {
 
        if ($this->transaction_opcount > 0) {
 
            if ($this->_db) {
 
                if (!@mysql_select_db($this->_db, $this->connection)) {
 
                    return $this->mysqlRaiseError(DB_ERROR_NODBSELECTED);
 
                }
 
            }
 
            $result = @mysql_query('COMMIT', $this->connection);
 
            $result = @mysql_query('SET AUTOCOMMIT=1', $this->connection);
 
            $this->transaction_opcount = 0;
 
            if (!$result) {
 
                return $this->mysqlRaiseError();
 
            }
 
        }
 
        return DB_OK;
 
    }
 

	
 
    // }}}
 
    // {{{ rollback()
 

	
 
    /**
 
     * Reverts the current transaction
 
     *
 
     * @return int  DB_OK on success.  A DB_Error object on failure.
 
     */
 
    function rollback()
 
    {
 
        if ($this->transaction_opcount > 0) {
 
            if ($this->_db) {
 
                if (!@mysql_select_db($this->_db, $this->connection)) {
 
                    return $this->mysqlRaiseError(DB_ERROR_NODBSELECTED);
 
                }
 
            }
 
            $result = @mysql_query('ROLLBACK', $this->connection);
 
            $result = @mysql_query('SET AUTOCOMMIT=1', $this->connection);
 
            $this->transaction_opcount = 0;
 
            if (!$result) {
 
                return $this->mysqlRaiseError();
 
            }
 
        }
 
        return DB_OK;
 
    }
 

	
 
    // }}}
 
    // {{{ affectedRows()
 

	
 
    /**
 
     * Determines the number of rows affected by a data maniuplation query
 
     *
 
     * 0 is returned for queries that don't manipulate data.
 
     *
 
     * @return int  the number of rows.  A DB_Error object on failure.
 
     */
 
    function affectedRows()
 
    {
 
        if (DB::isManip($this->last_query)) {
 
            return @mysql_affected_rows($this->connection);
 
        } else {
 
            return 0;
 
        }
 
     }
 

	
 
    // }}}
 
    // {{{ nextId()
 

	
 
    /**
 
     * Returns the next free id in a sequence
 
     *
 
     * @param string  $seq_name  name of the sequence
 
     * @param boolean $ondemand  when true, the seqence is automatically
 
     *                            created if it does not exist
 
     *
 
     * @return int  the next id number in the sequence.
 
     *               A DB_Error object on failure.
 
     *
 
     * @see DB_common::nextID(), DB_common::getSequenceName(),
 
     *      DB_mysql::createSequence(), DB_mysql::dropSequence()
 
     */
 
    function nextId($seq_name, $ondemand = true)
 
    {
 
        $seqname = $this->getSequenceName($seq_name);
 
        do {
 
            $repeat = 0;
 
            $this->pushErrorHandling(PEAR_ERROR_RETURN);
 
            $result = $this->query("UPDATE ${seqname} ".
 
                                   'SET id=LAST_INSERT_ID(id+1)');
 
            $this->popErrorHandling();
 
            if ($result === DB_OK) {
 
                // COMMON CASE
 
                $id = @mysql_insert_id($this->connection);
 
                if ($id != 0) {
 
                    return $id;
 
                }
 
                // EMPTY SEQ TABLE
 
                // Sequence table must be empty for some reason, so fill
 
                // it and return 1 and obtain a user-level lock
 
                $result = $this->getOne("SELECT GET_LOCK('${seqname}_lock',10)");
 
                if (DB::isError($result)) {
 
                    return $this->raiseError($result);
 
                }
 
                if ($result == 0) {
 
                    // Failed to get the lock
 
                    return $this->mysqlRaiseError(DB_ERROR_NOT_LOCKED);
 
                }
 

	
 
                // add the default value
 
                $result = $this->query("REPLACE INTO ${seqname} (id) VALUES (0)");
 
                if (DB::isError($result)) {
 
                    return $this->raiseError($result);
 
                }
 

	
 
                // Release the lock
 
                $result = $this->getOne('SELECT RELEASE_LOCK('
 
                                        . "'${seqname}_lock')");
 
                if (DB::isError($result)) {
 
                    return $this->raiseError($result);
 
                }
 
                // We know what the result will be, so no need to try again
 
                return 1;
 

	
 
            } elseif ($ondemand && DB::isError($result) &&
 
                $result->getCode() == DB_ERROR_NOSUCHTABLE)
 
            {
 
                // ONDEMAND TABLE CREATION
 
                $result = $this->createSequence($seq_name);
 
                if (DB::isError($result)) {
 
                    return $this->raiseError($result);
 
                } else {
 
                    $repeat = 1;
 
                }
 

	
 
            } elseif (DB::isError($result) &&
 
                      $result->getCode() == DB_ERROR_ALREADY_EXISTS)
 
            {
 
                // BACKWARDS COMPAT
 
                // see _BCsequence() comment
 
                $result = $this->_BCsequence($seqname);
 
                if (DB::isError($result)) {
 
                    return $this->raiseError($result);
 
                }
 
                $repeat = 1;
 
            }
 
        } while ($repeat);
 

	
 
        return $this->raiseError($result);
 
    }
 

	
 
    // }}}
 
    // {{{ createSequence()
 

	
 
    /**
 
     * Creates a new sequence
 
     *
 
     * @param string $seq_name  name of the new sequence
 
     *
 
     * @return int  DB_OK on success.  A DB_Error object on failure.
 
     *
 
     * @see DB_common::createSequence(), DB_common::getSequenceName(),
 
     *      DB_mysql::nextID(), DB_mysql::dropSequence()
 
     */
 
    function createSequence($seq_name)
 
    {
 
        $seqname = $this->getSequenceName($seq_name);
 
        $res = $this->query('CREATE TABLE ' . $seqname
 
                            . ' (id INTEGER UNSIGNED AUTO_INCREMENT NOT NULL,'
 
                            . ' PRIMARY KEY(id))');
 
        if (DB::isError($res)) {
 
            return $res;
 
        }
 
        // insert yields value 1, nextId call will generate ID 2
 
        $res = $this->query("INSERT INTO ${seqname} (id) VALUES (0)");
 
        if (DB::isError($res)) {
 
            return $res;
 
        }
 
        // so reset to zero
 
        return $this->query("UPDATE ${seqname} SET id = 0");
 
    }
 

	
 
    // }}}
 
    // {{{ dropSequence()
 

	
 
    /**
 
     * Deletes a sequence
 
     *
 
     * @param string $seq_name  name of the sequence to be deleted
 
     *
 
     * @return int  DB_OK on success.  A DB_Error object on failure.
 
     *
 
     * @see DB_common::dropSequence(), DB_common::getSequenceName(),
 
     *      DB_mysql::nextID(), DB_mysql::createSequence()
 
     */
 
    function dropSequence($seq_name)
 
    {
 
        return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
 
    }
 

	
 
    // }}}
 
    // {{{ _BCsequence()
 

	
 
    /**
 
     * Backwards compatibility with old sequence emulation implementation
 
     * (clean up the dupes)
 
     *
 
     * @param string $seqname  the sequence name to clean up
 
     *
 
     * @return bool  true on success.  A DB_Error object on failure.
 
     *
 
     * @access private
 
     */
 
    function _BCsequence($seqname)
 
    {
 
        // Obtain a user-level lock... this will release any previous
 
        // application locks, but unlike LOCK TABLES, it does not abort
 
        // the current transaction and is much less frequently used.
 
        $result = $this->getOne("SELECT GET_LOCK('${seqname}_lock',10)");
 
        if (DB::isError($result)) {
 
            return $result;
 
        }
 
        if ($result == 0) {
 
            // Failed to get the lock, can't do the conversion, bail
 
            // with a DB_ERROR_NOT_LOCKED error
 
            return $this->mysqlRaiseError(DB_ERROR_NOT_LOCKED);
 
        }
 

	
 
        $highest_id = $this->getOne("SELECT MAX(id) FROM ${seqname}");
 
        if (DB::isError($highest_id)) {
 
            return $highest_id;
 
        }
 
        // This should kill all rows except the highest
 
        // We should probably do something if $highest_id isn't
 
        // numeric, but I'm at a loss as how to handle that...
 
        $result = $this->query('DELETE FROM ' . $seqname
 
                               . " WHERE id <> $highest_id");
 
        if (DB::isError($result)) {
 
            return $result;
 
        }
 

	
 
        // If another thread has been waiting for this lock,
 
        // it will go thru the above procedure, but will have no
 
        // real effect
 
        $result = $this->getOne("SELECT RELEASE_LOCK('${seqname}_lock')");
 
        if (DB::isError($result)) {
 
            return $result;
 
        }
 
        return true;
 
    }
 

	
 
    // }}}
 
    // {{{ quoteIdentifier()
 

	
 
    /**
 
     * Quotes a string so it can be safely used as a table or column name
 
     *
 
     * MySQL can't handle the backtick character (<kbd>`</kbd>) in
 
     * table or column names.
 
     *
 
     * @param string $str  identifier name to be quoted
 
     *
 
     * @return string  quoted identifier string
 
     *
 
     * @see DB_common::quoteIdentifier()
 
     * @since Method available since Release 1.6.0
 
     */
 
    function quoteIdentifier($str)
 
    {
 
        return '`' . $str . '`';
 
    }
 

	
 
    // }}}
 
    // {{{ quote()
 

	
 
    /**
 
     * @deprecated  Deprecated in release 1.6.0
 
     */
 
    function quote($str)
 
    {
 
        return $this->quoteSmart($str);
 
    }
 

	
 
    // }}}
 
    // {{{ escapeSimple()
 

	
 
    /**
 
     * Escapes a string according to the current DBMS's standards
 
     *
 
     * @param string $str  the string to be escaped
 
     *
 
     * @return string  the escaped string
 
     *
 
     * @see DB_common::quoteSmart()
 
     * @since Method available since Release 1.6.0
 
     */
 
    function escapeSimple($str)
 
    {
 
        if (function_exists('mysql_real_escape_string')) {
 
            return @mysql_real_escape_string($str, $this->connection);
 
        } else {
 
            return @mysql_escape_string($str);
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ modifyQuery()
 

	
 
    /**
 
     * Changes a query string for various DBMS specific reasons
 
     *
 
     * This little hack lets you know how many rows were deleted
 
     * when running a "DELETE FROM table" query.  Only implemented
 
     * if the DB_PORTABILITY_DELETE_COUNT portability option is on.
 
     *
 
     * @param string $query  the query string to modify
 
     *
 
     * @return string  the modified query string
 
     *
 
     * @access protected
 
     * @see DB_common::setOption()
 
     */
 
    function modifyQuery($query)
 
    {
 
        if ($this->options['portability'] & DB_PORTABILITY_DELETE_COUNT) {
 
            // "DELETE FROM table" gives 0 affected rows in MySQL.
 
            // This little hack lets you know how many rows were deleted.
 
            if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $query)) {
 
                $query = preg_replace('/^\s*DELETE\s+FROM\s+(\S+)\s*$/',
 
                                      'DELETE FROM \1 WHERE 1=1', $query);
 
            }
 
        }
 
        return $query;
 
    }
 

	
 
    // }}}
 
    // {{{ modifyLimitQuery()
 

	
 
    /**
 
     * Adds LIMIT clauses to a query string according to current DBMS standards
 
     *
 
     * @param string $query   the query to modify
 
     * @param int    $from    the row to start to fetching (0 = the first row)
 
     * @param int    $count   the numbers of rows to fetch
 
     * @param mixed  $params  array, string or numeric data to be used in
 
     *                         execution of the statement.  Quantity of items
 
     *                         passed must match quantity of placeholders in
 
     *                         query:  meaning 1 placeholder for non-array
 
     *                         parameters or 1 placeholder per array element.
 
     *
 
     * @return string  the query string with LIMIT clauses added
 
     *
 
     * @access protected
 
     */
 
    function modifyLimitQuery($query, $from, $count, $params = array())
 
    {
 
        if (DB::isManip($query)) {
 
            return $query . " LIMIT $count";
 
        } else {
 
            return $query . " LIMIT $from, $count";
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ mysqlRaiseError()
 

	
 
    /**
 
     * Produces a DB_Error object regarding the current problem
 
     *
 
     * @param int $errno  if the error is being manually raised pass a
 
     *                     DB_ERROR* constant here.  If this isn't passed
 
     *                     the error information gathered from the DBMS.
 
     *
 
     * @return object  the DB_Error object
 
     *
 
     * @see DB_common::raiseError(),
 
     *      DB_mysql::errorNative(), DB_common::errorCode()
 
     */
 
    function mysqlRaiseError($errno = null)
 
    {
 
        if ($errno === null) {
 
            if ($this->options['portability'] & DB_PORTABILITY_ERRORS) {
 
                $this->errorcode_map[1022] = DB_ERROR_CONSTRAINT;
 
                $this->errorcode_map[1048] = DB_ERROR_CONSTRAINT_NOT_NULL;
 
                $this->errorcode_map[1062] = DB_ERROR_CONSTRAINT;
 
            } else {
 
                // Doing this in case mode changes during runtime.
 
                $this->errorcode_map[1022] = DB_ERROR_ALREADY_EXISTS;
 
                $this->errorcode_map[1048] = DB_ERROR_CONSTRAINT;
 
                $this->errorcode_map[1062] = DB_ERROR_ALREADY_EXISTS;
 
            }
 
            $errno = $this->errorCode(mysql_errno($this->connection));
 
        }
 
        return $this->raiseError($errno, null, null, null,
 
                                 @mysql_errno($this->connection) . ' ** ' .
 
                                 @mysql_error($this->connection));
 
    }
 

	
 
    // }}}
 
    // {{{ errorNative()
 

	
 
    /**
 
     * Gets the DBMS' native error code produced by the last query
 
     *
 
     * @return int  the DBMS' error code
 
     */
 
    function errorNative()
 
    {
 
        return @mysql_errno($this->connection);
 
    }
 

	
 
    // }}}
 
    // {{{ tableInfo()
 

	
 
    /**
 
     * Returns information about a table or a result set
 
     *
 
     * @param object|string  $result  DB_result object from a query or a
 
     *                                 string containing the name of a table.
 
     *                                 While this also accepts a query result
 
     *                                 resource identifier, this behavior is
 
     *                                 deprecated.
 
     * @param int            $mode    a valid tableInfo mode
 
     *
 
     * @return array  an associative array with the information requested.
 
     *                 A DB_Error object on failure.
 
     *
 
     * @see DB_common::tableInfo()
 
     */
 
    function tableInfo($result, $mode = null)
 
    {
 
        if (is_string($result)) {
 
            /*
 
             * Probably received a table name.
 
             * Create a result resource identifier.
 
             */
 
            $id = @mysql_list_fields($this->dsn['database'],
 
                                     $result, $this->connection);
 
            $got_string = true;
 
        } elseif (isset($result->result)) {
 
            /*
 
             * Probably received a result object.
 
             * Extract the result resource identifier.
 
             */
 
            $id = $result->result;
 
            $got_string = false;
 
        } else {
 
            /*
 
             * Probably received a result resource identifier.
 
             * Copy it.
 
             * Deprecated.  Here for compatibility only.
 
             */
 
            $id = $result;
 
            $got_string = false;
 
        }
 

	
 
        if (!is_resource($id)) {
 
            return $this->mysqlRaiseError(DB_ERROR_NEED_MORE_DATA);
 
        }
 

	
 
        if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
 
            $case_func = 'strtolower';
 
        } else {
 
            $case_func = 'strval';
 
        }
 

	
 
        $count = @mysql_num_fields($id);
 
        $res   = array();
 

	
 
        if ($mode) {
 
            $res['num_fields'] = $count;
 
        }
 

	
 
        for ($i = 0; $i < $count; $i++) {
 
            $res[$i] = array(
 
                'table' => $case_func(@mysql_field_table($id, $i)),
 
                'name'  => $case_func(@mysql_field_name($id, $i)),
 
                'type'  => @mysql_field_type($id, $i),
 
                'len'   => @mysql_field_len($id, $i),
 
                'flags' => @mysql_field_flags($id, $i),
 
            );
 
            if ($mode & DB_TABLEINFO_ORDER) {
 
                $res['order'][$res[$i]['name']] = $i;
 
            }
 
            if ($mode & DB_TABLEINFO_ORDERTABLE) {
 
                $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
 
            }
 
        }
 

	
 
        // free the result only if we were called on a table
 
        if ($got_string) {
 
            @mysql_free_result($id);
 
        }
 
        return $res;
 
    }
 

	
 
    // }}}
 
    // {{{ getSpecialQuery()
 

	
 
    /**
 
     * Obtains the query string needed for listing a given type of objects
 
     *
 
     * @param string $type  the kind of objects you want to retrieve
 
     *
 
     * @return string  the SQL query string or null if the driver doesn't
 
     *                  support the object type requested
 
     *
 
     * @access protected
 
     * @see DB_common::getListOf()
 
     */
 
    function getSpecialQuery($type)
 
    {
 
        switch ($type) {
 
            case 'tables':
 
                return 'SHOW TABLES';
 
            case 'users':
 
                return 'SELECT DISTINCT User FROM mysql.user';
 
            case 'databases':
 
                return 'SHOW DATABASES';
 
            default:
 
                return null;
 
        }
 
    }
 

	
 
    // }}}
 

	
 
}
 

	
 
/*
 
 * Local variables:
 
 * tab-width: 4
 
 * c-basic-offset: 4
 
 * End:
 
 */
 

	
 
?>
components/com_morfeoshow/tpl/resources/phpFlickr/PEAR/DB/pgsql.php
Show inline comments
 
new file 100644
 
<?php
 

	
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 

	
 
/**
 
 * The PEAR DB driver for PHP's pgsql extension
 
 * for interacting with PostgreSQL databases
 
 *
 
 * PHP versions 4 and 5
 
 *
 
 * LICENSE: This source file is subject to version 3.0 of the PHP license
 
 * that is available through the world-wide-web at the following URI:
 
 * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
 
 * the PHP License and are unable to obtain it through the web, please
 
 * send a note to license@php.net so we can mail you a copy immediately.
 
 *
 
 * @category   Database
 
 * @package    DB
 
 * @author     Rui Hirokawa <hirokawa@php.net>
 
 * @author     Stig Bakken <ssb@php.net>
 
 * @author     Daniel Convissor <danielc@php.net>
 
 * @copyright  1997-2005 The PHP Group
 
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 
 * @version    CVS: $Id: pgsql.php 32 2005-08-01 06:21:02Z dancoulter $
 
 * @link       http://pear.php.net/package/DB
 
 */
 

	
 
/**
 
 * Obtain the DB_common class so it can be extended from
 
 */
 
require_once 'DB/common.php';
 

	
 
/**
 
 * The methods PEAR DB uses to interact with PHP's pgsql extension
 
 * for interacting with PostgreSQL databases
 
 *
 
 * These methods overload the ones declared in DB_common.
 
 *
 
 * @category   Database
 
 * @package    DB
 
 * @author     Rui Hirokawa <hirokawa@php.net>
 
 * @author     Stig Bakken <ssb@php.net>
 
 * @author     Daniel Convissor <danielc@php.net>
 
 * @copyright  1997-2005 The PHP Group
 
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 
 * @version    Release: @package_version@
 
 * @link       http://pear.php.net/package/DB
 
 */
 
class DB_pgsql extends DB_common
 
{
 
    // {{{ properties
 

	
 
    /**
 
     * The DB driver type (mysql, oci8, odbc, etc.)
 
     * @var string
 
     */
 
    var $phptype = 'pgsql';
 

	
 
    /**
 
     * The database syntax variant to be used (db2, access, etc.), if any
 
     * @var string
 
     */
 
    var $dbsyntax = 'pgsql';
 

	
 
    /**
 
     * The capabilities of this DB implementation
 
     *
 
     * The 'new_link' element contains the PHP version that first provided
 
     * new_link support for this DBMS.  Contains false if it's unsupported.
 
     *
 
     * Meaning of the 'limit' element:
 
     *   + 'emulate' = emulate with fetch row by number
 
     *   + 'alter'   = alter the query
 
     *   + false     = skip rows
 
     *
 
     * @var array
 
     */
 
    var $features = array(
 
        'limit'         => 'alter',
 
        'new_link'      => '4.3.0',
 
        'numrows'       => true,
 
        'pconnect'      => true,
 
        'prepare'       => false,
 
        'ssl'           => true,
 
        'transactions'  => true,
 
    );
 

	
 
    /**
 
     * A mapping of native error codes to DB error codes
 
     * @var array
 
     */
 
    var $errorcode_map = array(
 
    );
 

	
 
    /**
 
     * The raw database connection created by PHP
 
     * @var resource
 
     */
 
    var $connection;
 

	
 
    /**
 
     * The DSN information for connecting to a database
 
     * @var array
 
     */
 
    var $dsn = array();
 

	
 

	
 
    /**
 
     * Should data manipulation queries be committed automatically?
 
     * @var bool
 
     * @access private
 
     */
 
    var $autocommit = true;
 

	
 
    /**
 
     * The quantity of transactions begun
 
     *
 
     * {@internal  While this is private, it can't actually be designated
 
     * private in PHP 5 because it is directly accessed in the test suite.}}
 
     *
 
     * @var integer
 
     * @access private
 
     */
 
    var $transaction_opcount = 0;
 

	
 
    /**
 
     * The number of rows affected by a data manipulation query
 
     * @var integer
 
     */
 
    var $affected = 0;
 

	
 
    /**
 
     * The current row being looked at in fetchInto()
 
     * @var array
 
     * @access private
 
     */
 
    var $row = array();
 

	
 
    /**
 
     * The number of rows in a given result set
 
     * @var array
 
     * @access private
 
     */
 
    var $_num_rows = array();
 

	
 

	
 
    // }}}
 
    // {{{ constructor
 

	
 
    /**
 
     * This constructor calls <kbd>$this->DB_common()</kbd>
 
     *
 
     * @return void
 
     */
 
    function DB_pgsql()
 
    {
 
        $this->DB_common();
 
    }
 

	
 
    // }}}
 
    // {{{ connect()
 

	
 
    /**
 
     * Connect to the database server, log in and open the database
 
     *
 
     * Don't call this method directly.  Use DB::connect() instead.
 
     *
 
     * PEAR DB's pgsql driver supports the following extra DSN options:
 
     *   + connect_timeout  How many seconds to wait for a connection to
 
     *                       be established.  Available since PEAR DB 1.7.0.
 
     *   + new_link         If set to true, causes subsequent calls to
 
     *                       connect() to return a new connection link
 
     *                       instead of the existing one.  WARNING: this is
 
     *                       not portable to other DBMS's.  Available only
 
     *                       if PHP is >= 4.3.0 and PEAR DB is >= 1.7.0.
 
     *   + options          Command line options to be sent to the server.
 
     *                       Available since PEAR DB 1.6.4.
 
     *   + service          Specifies a service name in pg_service.conf that
 
     *                       holds additional connection parameters.
 
     *                       Available since PEAR DB 1.7.0.
 
     *   + sslmode          How should SSL be used when connecting?  Values:
 
     *                       disable, allow, prefer or require.
 
     *                       Available since PEAR DB 1.7.0.
 
     *   + tty              This was used to specify where to send server
 
     *                       debug output.  Available since PEAR DB 1.6.4.
 
     *
 
     * Example of connecting to a new link via a socket:
 
     * <code>
 
     * require_once 'DB.php';
 
     * 
 
     * $dsn = 'pgsql://user:pass@unix(/tmp)/dbname?new_link=true';
 
     * $options = array(
 
     *     'portability' => DB_PORTABILITY_ALL,
 
     * );
 
     * 
 
     * $db =& DB::connect($dsn, $options);
 
     * if (PEAR::isError($db)) {
 
     *     die($db->getMessage());
 
     * }
 
     * </code>
 
     *
 
     * @param array $dsn         the data source name
 
     * @param bool  $persistent  should the connection be persistent?
 
     *
 
     * @return int  DB_OK on success. A DB_Error object on failure.
 
     *
 
     * @link http://www.postgresql.org/docs/current/static/libpq.html#LIBPQ-CONNECT
 
     */
 
    function connect($dsn, $persistent = false)
 
    {
 
        if (!PEAR::loadExtension('pgsql')) {
 
            return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
 
        }
 

	
 
        $this->dsn = $dsn;
 
        if ($dsn['dbsyntax']) {
 
            $this->dbsyntax = $dsn['dbsyntax'];
 
        }
 

	
 
        $protocol = $dsn['protocol'] ? $dsn['protocol'] : 'tcp';
 

	
 
        $params = array('');
 
        if ($protocol == 'tcp') {
 
            if ($dsn['hostspec']) {
 
                $params[0] .= 'host=' . $dsn['hostspec'];
 
            }
 
            if ($dsn['port']) {
 
                $params[0] .= ' port=' . $dsn['port'];
 
            }
 
        } elseif ($protocol == 'unix') {
 
            // Allow for pg socket in non-standard locations.
 
            if ($dsn['socket']) {
 
                $params[0] .= 'host=' . $dsn['socket'];
 
            }
 
            if ($dsn['port']) {
 
                $params[0] .= ' port=' . $dsn['port'];
 
            }
 
        }
 
        if ($dsn['database']) {
 
            $params[0] .= ' dbname=\'' . addslashes($dsn['database']) . '\'';
 
        }
 
        if ($dsn['username']) {
 
            $params[0] .= ' user=\'' . addslashes($dsn['username']) . '\'';
 
        }
 
        if ($dsn['password']) {
 
            $params[0] .= ' password=\'' . addslashes($dsn['password']) . '\'';
 
        }
 
        if (!empty($dsn['options'])) {
 
            $params[0] .= ' options=' . $dsn['options'];
 
        }
 
        if (!empty($dsn['tty'])) {
 
            $params[0] .= ' tty=' . $dsn['tty'];
 
        }
 
        if (!empty($dsn['connect_timeout'])) {
 
            $params[0] .= ' connect_timeout=' . $dsn['connect_timeout'];
 
        }
 
        if (!empty($dsn['sslmode'])) {
 
            $params[0] .= ' sslmode=' . $dsn['sslmode'];
 
        }
 
        if (!empty($dsn['service'])) {
 
            $params[0] .= ' service=' . $dsn['service'];
 
        }
 

	
 
        if (isset($dsn['new_link'])
 
            && ($dsn['new_link'] == 'true' || $dsn['new_link'] === true))
 
        {
 
            if (version_compare(phpversion(), '4.3.0', '>=')) {
 
                $params[] = PGSQL_CONNECT_FORCE_NEW;
 
            }
 
        }
 

	
 
        $connect_function = $persistent ? 'pg_pconnect' : 'pg_connect';
 

	
 
        $ini = ini_get('track_errors');
 
        $php_errormsg = '';
 
        if ($ini) {
 
            $this->connection = @call_user_func_array($connect_function,
 
                                                      $params);
 
        } else {
 
            ini_set('track_errors', 1);
 
            $this->connection = @call_user_func_array($connect_function,
 
                                                      $params);
 
            ini_set('track_errors', $ini);
 
        }
 

	
 
        if (!$this->connection) {
 
            return $this->raiseError(DB_ERROR_CONNECT_FAILED,
 
                                     null, null, null,
 
                                     $php_errormsg);
 
        }
 
        return DB_OK;
 
    }
 

	
 
    // }}}
 
    // {{{ disconnect()
 

	
 
    /**
 
     * Disconnects from the database server
 
     *
 
     * @return bool  TRUE on success, FALSE on failure
 
     */
 
    function disconnect()
 
    {
 
        $ret = @pg_close($this->connection);
 
        $this->connection = null;
 
        return $ret;
 
    }
 

	
 
    // }}}
 
    // {{{ simpleQuery()
 

	
 
    /**
 
     * Sends a query to the database server
 
     *
 
     * @param string  the SQL query string
 
     *
 
     * @return mixed  + a PHP result resrouce for successful SELECT queries
 
     *                + the DB_OK constant for other successful queries
 
     *                + a DB_Error object on failure
 
     */
 
    function simpleQuery($query)
 
    {
 
        $ismanip = DB::isManip($query);
 
        $this->last_query = $query;
 
        $query = $this->modifyQuery($query);
 
        if (!$this->autocommit && $ismanip) {
 
            if ($this->transaction_opcount == 0) {
 
                $result = @pg_exec($this->connection, 'begin;');
 
                if (!$result) {
 
                    return $this->pgsqlRaiseError();
 
                }
 
            }
 
            $this->transaction_opcount++;
 
        }
 
        $result = @pg_exec($this->connection, $query);
 
        if (!$result) {
 
            return $this->pgsqlRaiseError();
 
        }
 
        // Determine which queries that should return data, and which
 
        // should return an error code only.
 
        if ($ismanip) {
 
            $this->affected = @pg_affected_rows($result);
 
            return DB_OK;
 
        } elseif (preg_match('/^\s*\(*\s*(SELECT|EXPLAIN|SHOW)\s/si', $query)) {
 
            /* PostgreSQL commands:
 
               ABORT, ALTER, BEGIN, CLOSE, CLUSTER, COMMIT, COPY,
 
               CREATE, DECLARE, DELETE, DROP TABLE, EXPLAIN, FETCH,
 
               GRANT, INSERT, LISTEN, LOAD, LOCK, MOVE, NOTIFY, RESET,
 
               REVOKE, ROLLBACK, SELECT, SELECT INTO, SET, SHOW,
 
               UNLISTEN, UPDATE, VACUUM
 
            */
 
            $this->row[(int)$result] = 0; // reset the row counter.
 
            $numrows = $this->numRows($result);
 
            if (is_object($numrows)) {
 
                return $numrows;
 
            }
 
            $this->_num_rows[(int)$result] = $numrows;
 
            $this->affected = 0;
 
            return $result;
 
        } else {
 
            $this->affected = 0;
 
            return DB_OK;
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ nextResult()
 

	
 
    /**
 
     * Move the internal pgsql result pointer to the next available result
 
     *
 
     * @param a valid fbsql result resource
 
     *
 
     * @access public
 
     *
 
     * @return true if a result is available otherwise return false
 
     */
 
    function nextResult($result)
 
    {
 
        return false;
 
    }
 

	
 
    // }}}
 
    // {{{ fetchInto()
 

	
 
    /**
 
     * Places a row from the result set into the given array
 
     *
 
     * Formating of the array and the data therein are configurable.
 
     * See DB_result::fetchInto() for more information.
 
     *
 
     * This method is not meant to be called directly.  Use
 
     * DB_result::fetchInto() instead.  It can't be declared "protected"
 
     * because DB_result is a separate object.
 
     *
 
     * @param resource $result    the query result resource
 
     * @param array    $arr       the referenced array to put the data in
 
     * @param int      $fetchmode how the resulting array should be indexed
 
     * @param int      $rownum    the row number to fetch (0 = first row)
 
     *
 
     * @return mixed  DB_OK on success, NULL when the end of a result set is
 
     *                 reached or on failure
 
     *
 
     * @see DB_result::fetchInto()
 
     */
 
    function fetchInto($result, &$arr, $fetchmode, $rownum = null)
 
    {
 
        $result_int = (int)$result;
 
        $rownum = ($rownum !== null) ? $rownum : $this->row[$result_int];
 
        if ($rownum >= $this->_num_rows[$result_int]) {
 
            return null;
 
        }
 
        if ($fetchmode & DB_FETCHMODE_ASSOC) {
 
            $arr = @pg_fetch_array($result, $rownum, PGSQL_ASSOC);
 
            if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
 
                $arr = array_change_key_case($arr, CASE_LOWER);
 
            }
 
        } else {
 
            $arr = @pg_fetch_row($result, $rownum);
 
        }
 
        if (!$arr) {
 
            return null;
 
        }
 
        if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
 
            $this->_rtrimArrayValues($arr);
 
        }
 
        if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
 
            $this->_convertNullArrayValuesToEmpty($arr);
 
        }
 
        $this->row[$result_int] = ++$rownum;
 
        return DB_OK;
 
    }
 

	
 
    // }}}
 
    // {{{ freeResult()
 

	
 
    /**
 
     * Deletes the result set and frees the memory occupied by the result set
 
     *
 
     * This method is not meant to be called directly.  Use
 
     * DB_result::free() instead.  It can't be declared "protected"
 
     * because DB_result is a separate object.
 
     *
 
     * @param resource $result  PHP's query result resource
 
     *
 
     * @return bool  TRUE on success, FALSE if $result is invalid
 
     *
 
     * @see DB_result::free()
 
     */
 
    function freeResult($result)
 
    {
 
        if (is_resource($result)) {
 
            unset($this->row[(int)$result]);
 
            unset($this->_num_rows[(int)$result]);
 
            $this->affected = 0;
 
            return @pg_freeresult($result);
 
        }
 
        return false;
 
    }
 

	
 
    // }}}
 
    // {{{ quote()
 

	
 
    /**
 
     * @deprecated  Deprecated in release 1.6.0
 
     * @internal
 
     */
 
    function quote($str)
 
    {
 
        return $this->quoteSmart($str);
 
    }
 

	
 
    // }}}
 
    // {{{ quoteSmart()
 

	
 
    /**
 
     * Formats input so it can be safely used in a query
 
     *
 
     * @param mixed $in  the data to be formatted
 
     *
 
     * @return mixed  the formatted data.  The format depends on the input's
 
     *                 PHP type:
 
     *                 + null = the string <samp>NULL</samp>
 
     *                 + boolean = string <samp>TRUE</samp> or <samp>FALSE</samp>
 
     *                 + integer or double = the unquoted number
 
     *                 + other (including strings and numeric strings) =
 
     *                   the data escaped according to MySQL's settings
 
     *                   then encapsulated between single quotes
 
     *
 
     * @see DB_common::quoteSmart()
 
     * @since Method available since Release 1.6.0
 
     */
 
    function quoteSmart($in)
 
    {
 
        if (is_int($in) || is_double($in)) {
 
            return $in;
 
        } elseif (is_bool($in)) {
 
            return $in ? 'TRUE' : 'FALSE';
 
        } elseif (is_null($in)) {
 
            return 'NULL';
 
        } else {
 
            return "'" . $this->escapeSimple($in) . "'";
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ escapeSimple()
 

	
 
    /**
 
     * Escapes a string according to the current DBMS's standards
 
     *
 
     * {@internal PostgreSQL treats a backslash as an escape character,
 
     * so they are escaped as well.
 
     *
 
     * Not using pg_escape_string() yet because it requires PostgreSQL
 
     * to be at version 7.2 or greater.}}
 
     *
 
     * @param string $str  the string to be escaped
 
     *
 
     * @return string  the escaped string
 
     *
 
     * @see DB_common::quoteSmart()
 
     * @since Method available since Release 1.6.0
 
     */
 
    function escapeSimple($str)
 
    {
 
        return str_replace("'", "''", str_replace('\\', '\\\\', $str));
 
    }
 

	
 
    // }}}
 
    // {{{ numCols()
 

	
 
    /**
 
     * Gets the number of columns in a result set
 
     *
 
     * This method is not meant to be called directly.  Use
 
     * DB_result::numCols() instead.  It can't be declared "protected"
 
     * because DB_result is a separate object.
 
     *
 
     * @param resource $result  PHP's query result resource
 
     *
 
     * @return int  the number of columns.  A DB_Error object on failure.
 
     *
 
     * @see DB_result::numCols()
 
     */
 
    function numCols($result)
 
    {
 
        $cols = @pg_numfields($result);
 
        if (!$cols) {
 
            return $this->pgsqlRaiseError();
 
        }
 
        return $cols;
 
    }
 

	
 
    // }}}
 
    // {{{ numRows()
 

	
 
    /**
 
     * Gets the number of rows in a result set
 
     *
 
     * This method is not meant to be called directly.  Use
 
     * DB_result::numRows() instead.  It can't be declared "protected"
 
     * because DB_result is a separate object.
 
     *
 
     * @param resource $result  PHP's query result resource
 
     *
 
     * @return int  the number of rows.  A DB_Error object on failure.
 
     *
 
     * @see DB_result::numRows()
 
     */
 
    function numRows($result)
 
    {
 
        $rows = @pg_numrows($result);
 
        if ($rows === null) {
 
            return $this->pgsqlRaiseError();
 
        }
 
        return $rows;
 
    }
 

	
 
    // }}}
 
    // {{{ autoCommit()
 

	
 
    /**
 
     * Enables or disables automatic commits
 
     *
 
     * @param bool $onoff  true turns it on, false turns it off
 
     *
 
     * @return int  DB_OK on success.  A DB_Error object if the driver
 
     *               doesn't support auto-committing transactions.
 
     */
 
    function autoCommit($onoff = false)
 
    {
 
        // XXX if $this->transaction_opcount > 0, we should probably
 
        // issue a warning here.
 
        $this->autocommit = $onoff ? true : false;
 
        return DB_OK;
 
    }
 

	
 
    // }}}
 
    // {{{ commit()
 

	
 
    /**
 
     * Commits the current transaction
 
     *
 
     * @return int  DB_OK on success.  A DB_Error object on failure.
 
     */
 
    function commit()
 
    {
 
        if ($this->transaction_opcount > 0) {
 
            // (disabled) hack to shut up error messages from libpq.a
 
            //@fclose(@fopen("php://stderr", "w"));
 
            $result = @pg_exec($this->connection, 'end;');
 
            $this->transaction_opcount = 0;
 
            if (!$result) {
 
                return $this->pgsqlRaiseError();
 
            }
 
        }
 
        return DB_OK;
 
    }
 

	
 
    // }}}
 
    // {{{ rollback()
 

	
 
    /**
 
     * Reverts the current transaction
 
     *
 
     * @return int  DB_OK on success.  A DB_Error object on failure.
 
     */
 
    function rollback()
 
    {
 
        if ($this->transaction_opcount > 0) {
 
            $result = @pg_exec($this->connection, 'abort;');
 
            $this->transaction_opcount = 0;
 
            if (!$result) {
 
                return $this->pgsqlRaiseError();
 
            }
 
        }
 
        return DB_OK;
 
    }
 

	
 
    // }}}
 
    // {{{ affectedRows()
 

	
 
    /**
 
     * Determines the number of rows affected by a data maniuplation query
 
     *
 
     * 0 is returned for queries that don't manipulate data.
 
     *
 
     * @return int  the number of rows.  A DB_Error object on failure.
 
     */
 
    function affectedRows()
 
    {
 
        return $this->affected;
 
    }
 

	
 
    // }}}
 
    // {{{ nextId()
 

	
 
    /**
 
     * Returns the next free id in a sequence
 
     *
 
     * @param string  $seq_name  name of the sequence
 
     * @param boolean $ondemand  when true, the seqence is automatically
 
     *                            created if it does not exist
 
     *
 
     * @return int  the next id number in the sequence.
 
     *               A DB_Error object on failure.
 
     *
 
     * @see DB_common::nextID(), DB_common::getSequenceName(),
 
     *      DB_pgsql::createSequence(), DB_pgsql::dropSequence()
 
     */
 
    function nextId($seq_name, $ondemand = true)
 
    {
 
        $seqname = $this->getSequenceName($seq_name);
 
        $repeat = false;
 
        do {
 
            $this->pushErrorHandling(PEAR_ERROR_RETURN);
 
            $result =& $this->query("SELECT NEXTVAL('${seqname}')");
 
            $this->popErrorHandling();
 
            if ($ondemand && DB::isError($result) &&
 
                $result->getCode() == DB_ERROR_NOSUCHTABLE) {
 
                $repeat = true;
 
                $this->pushErrorHandling(PEAR_ERROR_RETURN);
 
                $result = $this->createSequence($seq_name);
 
                $this->popErrorHandling();
 
                if (DB::isError($result)) {
 
                    return $this->raiseError($result);
 
                }
 
            } else {
 
                $repeat = false;
 
            }
 
        } while ($repeat);
 
        if (DB::isError($result)) {
 
            return $this->raiseError($result);
 
        }
 
        $arr = $result->fetchRow(DB_FETCHMODE_ORDERED);
 
        $result->free();
 
        return $arr[0];
 
    }
 

	
 
    // }}}
 
    // {{{ createSequence()
 

	
 
    /**
 
     * Creates a new sequence
 
     *
 
     * @param string $seq_name  name of the new sequence
 
     *
 
     * @return int  DB_OK on success.  A DB_Error object on failure.
 
     *
 
     * @see DB_common::createSequence(), DB_common::getSequenceName(),
 
     *      DB_pgsql::nextID(), DB_pgsql::dropSequence()
 
     */
 
    function createSequence($seq_name)
 
    {
 
        $seqname = $this->getSequenceName($seq_name);
 
        $result = $this->query("CREATE SEQUENCE ${seqname}");
 
        return $result;
 
    }
 

	
 
    // }}}
 
    // {{{ dropSequence()
 

	
 
    /**
 
     * Deletes a sequence
 
     *
 
     * @param string $seq_name  name of the sequence to be deleted
 
     *
 
     * @return int  DB_OK on success.  A DB_Error object on failure.
 
     *
 
     * @see DB_common::dropSequence(), DB_common::getSequenceName(),
 
     *      DB_pgsql::nextID(), DB_pgsql::createSequence()
 
     */
 
    function dropSequence($seq_name)
 
    {
 
        return $this->query('DROP SEQUENCE '
 
                            . $this->getSequenceName($seq_name));
 
    }
 

	
 
    // }}}
 
    // {{{ modifyLimitQuery()
 

	
 
    /**
 
     * Adds LIMIT clauses to a query string according to current DBMS standards
 
     *
 
     * @param string $query   the query to modify
 
     * @param int    $from    the row to start to fetching (0 = the first row)
 
     * @param int    $count   the numbers of rows to fetch
 
     * @param mixed  $params  array, string or numeric data to be used in
 
     *                         execution of the statement.  Quantity of items
 
     *                         passed must match quantity of placeholders in
 
     *                         query:  meaning 1 placeholder for non-array
 
     *                         parameters or 1 placeholder per array element.
 
     *
 
     * @return string  the query string with LIMIT clauses added
 
     *
 
     * @access protected
 
     */
 
    function modifyLimitQuery($query, $from, $count, $params = array())
 
    {
 
        return "$query LIMIT $count OFFSET $from";
 
    }
 

	
 
    // }}}
 
    // {{{ pgsqlRaiseError()
 

	
 
    /**
 
     * Produces a DB_Error object regarding the current problem
 
     *
 
     * @param int $errno  if the error is being manually raised pass a
 
     *                     DB_ERROR* constant here.  If this isn't passed
 
     *                     the error information gathered from the DBMS.
 
     *
 
     * @return object  the DB_Error object
 
     *
 
     * @see DB_common::raiseError(),
 
     *      DB_pgsql::errorNative(), DB_pgsql::errorCode()
 
     */
 
    function pgsqlRaiseError($errno = null)
 
    {
 
        $native = $this->errorNative();
 
        if ($errno === null) {
 
            $errno = $this->errorCode($native);
 
        }
 
        return $this->raiseError($errno, null, null, null, $native);
 
    }
 

	
 
    // }}}
 
    // {{{ errorNative()
 

	
 
    /**
 
     * Gets the DBMS' native error message produced by the last query
 
     *
 
     * {@internal Error messages are used instead of error codes 
 
     * in order to support older versions of PostgreSQL.}}
 
     *
 
     * @return string  the DBMS' error message
 
     */
 
    function errorNative()
 
    {
 
        return @pg_errormessage($this->connection);
 
    }
 

	
 
    // }}}
 
    // {{{ errorCode()
 

	
 
    /**
 
     * Determines PEAR::DB error code from the database's text error message.
 
     *
 
     * @param  string  $errormsg  error message returned from the database
 
     * @return integer  an error number from a DB error constant
 
     */
 
    function errorCode($errormsg)
 
    {
 
        static $error_regexps;
 
        if (!isset($error_regexps)) {
 
            $error_regexps = array(
 
                '/(relation|sequence|table).*does not exist|class .* not found/i'
 
                    => DB_ERROR_NOSUCHTABLE,
 
                '/index .* does not exist/'
 
                    => DB_ERROR_NOT_FOUND,
 
                '/column .* does not exist/i'
 
                    => DB_ERROR_NOSUCHFIELD,
 
                '/relation .* already exists/i'
 
                    => DB_ERROR_ALREADY_EXISTS,
 
                '/(divide|division) by zero$/i'
 
                    => DB_ERROR_DIVZERO,
 
                '/pg_atoi: error in .*: can\'t parse /i'
 
                    => DB_ERROR_INVALID_NUMBER,
 
                '/invalid input syntax for( type)? (integer|numeric)/i'
 
                    => DB_ERROR_INVALID_NUMBER,
 
                '/value .* is out of range for type \w*int/i'
 
                    => DB_ERROR_INVALID_NUMBER,
 
                '/integer out of range/i'
 
                    => DB_ERROR_INVALID_NUMBER,
 
                '/value too long for type character/i'
 
                    => DB_ERROR_INVALID,
 
                '/attribute .* not found|relation .* does not have attribute/i'
 
                    => DB_ERROR_NOSUCHFIELD,
 
                '/column .* specified in USING clause does not exist in (left|right) table/i'
 
                    => DB_ERROR_NOSUCHFIELD,
 
                '/parser: parse error at or near/i'
 
                    => DB_ERROR_SYNTAX,
 
                '/syntax error at/'
 
                    => DB_ERROR_SYNTAX,
 
                '/column reference .* is ambiguous/i'
 
                    => DB_ERROR_SYNTAX,
 
                '/permission denied/'
 
                    => DB_ERROR_ACCESS_VIOLATION,
 
                '/violates not-null constraint/'
 
                    => DB_ERROR_CONSTRAINT_NOT_NULL,
 
                '/violates [\w ]+ constraint/'
 
                    => DB_ERROR_CONSTRAINT,
 
                '/referential integrity violation/'
 
                    => DB_ERROR_CONSTRAINT,
 
                '/more expressions than target columns/i'
 
                    => DB_ERROR_VALUE_COUNT_ON_ROW,
 
            );
 
        }
 
        foreach ($error_regexps as $regexp => $code) {
 
            if (preg_match($regexp, $errormsg)) {
 
                return $code;
 
            }
 
        }
 
        // Fall back to DB_ERROR if there was no mapping.
 
        return DB_ERROR;
 
    }
 

	
 
    // }}}
 
    // {{{ tableInfo()
 

	
 
    /**
 
     * Returns information about a table or a result set
 
     *
 
     * NOTE: only supports 'table' and 'flags' if <var>$result</var>
 
     * is a table name.
 
     *
 
     * @param object|string  $result  DB_result object from a query or a
 
     *                                 string containing the name of a table.
 
     *                                 While this also accepts a query result
 
     *                                 resource identifier, this behavior is
 
     *                                 deprecated.
 
     * @param int            $mode    a valid tableInfo mode
 
     *
 
     * @return array  an associative array with the information requested.
 
     *                 A DB_Error object on failure.
 
     *
 
     * @see DB_common::tableInfo()
 
     */
 
    function tableInfo($result, $mode = null)
 
    {
 
        if (is_string($result)) {
 
            /*
 
             * Probably received a table name.
 
             * Create a result resource identifier.
 
             */
 
            $id = @pg_exec($this->connection, "SELECT * FROM $result LIMIT 0");
 
            $got_string = true;
 
        } elseif (isset($result->result)) {
 
            /*
 
             * Probably received a result object.
 
             * Extract the result resource identifier.
 
             */
 
            $id = $result->result;
 
            $got_string = false;
 
        } else {
 
            /*
 
             * Probably received a result resource identifier.
 
             * Copy it.
 
             * Deprecated.  Here for compatibility only.
 
             */
 
            $id = $result;
 
            $got_string = false;
 
        }
 

	
 
        if (!is_resource($id)) {
 
            return $this->pgsqlRaiseError(DB_ERROR_NEED_MORE_DATA);
 
        }
 

	
 
        if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
 
            $case_func = 'strtolower';
 
        } else {
 
            $case_func = 'strval';
 
        }
 

	
 
        $count = @pg_numfields($id);
 
        $res   = array();
 

	
 
        if ($mode) {
 
            $res['num_fields'] = $count;
 
        }
 

	
 
        for ($i = 0; $i < $count; $i++) {
 
            $res[$i] = array(
 
                'table' => $got_string ? $case_func($result) : '',
 
                'name'  => $case_func(@pg_fieldname($id, $i)),
 
                'type'  => @pg_fieldtype($id, $i),
 
                'len'   => @pg_fieldsize($id, $i),
 
                'flags' => $got_string
 
                           ? $this->_pgFieldFlags($id, $i, $result)
 
                           : '',
 
            );
 
            if ($mode & DB_TABLEINFO_ORDER) {
 
                $res['order'][$res[$i]['name']] = $i;
 
            }
 
            if ($mode & DB_TABLEINFO_ORDERTABLE) {
 
                $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
 
            }
 
        }
 

	
 
        // free the result only if we were called on a table
 
        if ($got_string) {
 
            @pg_freeresult($id);
 
        }
 
        return $res;
 
    }
 

	
 
    // }}}
 
    // {{{ _pgFieldFlags()
 

	
 
    /**
 
     * Get a column's flags
 
     *
 
     * Supports "not_null", "default_value", "primary_key", "unique_key"
 
     * and "multiple_key".  The default value is passed through
 
     * rawurlencode() in case there are spaces in it.
 
     *
 
     * @param int $resource   the PostgreSQL result identifier
 
     * @param int $num_field  the field number
 
     *
 
     * @return string  the flags
 
     *
 
     * @access private
 
     */
 
    function _pgFieldFlags($resource, $num_field, $table_name)
 
    {
 
        $field_name = @pg_fieldname($resource, $num_field);
 

	
 
        $result = @pg_exec($this->connection, "SELECT f.attnotnull, f.atthasdef
 
                                FROM pg_attribute f, pg_class tab, pg_type typ
 
                                WHERE tab.relname = typ.typname
 
                                AND typ.typrelid = f.attrelid
 
                                AND f.attname = '$field_name'
 
                                AND tab.relname = '$table_name'");
 
        if (@pg_numrows($result) > 0) {
 
            $row = @pg_fetch_row($result, 0);
 
            $flags  = ($row[0] == 't') ? 'not_null ' : '';
 

	
 
            if ($row[1] == 't') {
 
                $result = @pg_exec($this->connection, "SELECT a.adsrc
 
                                    FROM pg_attribute f, pg_class tab, pg_type typ, pg_attrdef a
 
                                    WHERE tab.relname = typ.typname AND typ.typrelid = f.attrelid
 
                                    AND f.attrelid = a.adrelid AND f.attname = '$field_name'
 
                                    AND tab.relname = '$table_name' AND f.attnum = a.adnum");
 
                $row = @pg_fetch_row($result, 0);
 
                $num = preg_replace("/'(.*)'::\w+/", "\\1", $row[0]);
 
                $flags .= 'default_' . rawurlencode($num) . ' ';
 
            }
 
        } else {
 
            $flags = '';
 
        }
 
        $result = @pg_exec($this->connection, "SELECT i.indisunique, i.indisprimary, i.indkey
 
                                FROM pg_attribute f, pg_class tab, pg_type typ, pg_index i
 
                                WHERE tab.relname = typ.typname
 
                                AND typ.typrelid = f.attrelid
 
                                AND f.attrelid = i.indrelid
 
                                AND f.attname = '$field_name'
 
                                AND tab.relname = '$table_name'");
 
        $count = @pg_numrows($result);
 

	
 
        for ($i = 0; $i < $count ; $i++) {
 
            $row = @pg_fetch_row($result, $i);
 
            $keys = explode(' ', $row[2]);
 

	
 
            if (in_array($num_field + 1, $keys)) {
 
                $flags .= ($row[0] == 't' && $row[1] == 'f') ? 'unique_key ' : '';
 
                $flags .= ($row[1] == 't') ? 'primary_key ' : '';
 
                if (count($keys) > 1)
 
                    $flags .= 'multiple_key ';
 
            }
 
        }
 

	
 
        return trim($flags);
 
    }
 

	
 
    // }}}
 
    // {{{ getSpecialQuery()
 

	
 
    /**
 
     * Obtains the query string needed for listing a given type of objects
 
     *
 
     * @param string $type  the kind of objects you want to retrieve
 
     *
 
     * @return string  the SQL query string or null if the driver doesn't
 
     *                  support the object type requested
 
     *
 
     * @access protected
 
     * @see DB_common::getListOf()
 
     */
 
    function getSpecialQuery($type)
 
    {
 
        switch ($type) {
 
            case 'tables':
 
                return 'SELECT c.relname AS "Name"'
 
                        . ' FROM pg_class c, pg_user u'
 
                        . ' WHERE c.relowner = u.usesysid'
 
                        . " AND c.relkind = 'r'"
 
                        . ' AND NOT EXISTS'
 
                        . ' (SELECT 1 FROM pg_views'
 
                        . '  WHERE viewname = c.relname)'
 
                        . " AND c.relname !~ '^(pg_|sql_)'"
 
                        . ' UNION'
 
                        . ' SELECT c.relname AS "Name"'
 
                        . ' FROM pg_class c'
 
                        . " WHERE c.relkind = 'r'"
 
                        . ' AND NOT EXISTS'
 
                        . ' (SELECT 1 FROM pg_views'
 
                        . '  WHERE viewname = c.relname)'
 
                        . ' AND NOT EXISTS'
 
                        . ' (SELECT 1 FROM pg_user'
 
                        . '  WHERE usesysid = c.relowner)'
 
                        . " AND c.relname !~ '^pg_'";
 
            case 'schema.tables':
 
                return "SELECT schemaname || '.' || tablename"
 
                        . ' AS "Name"'
 
                        . ' FROM pg_catalog.pg_tables'
 
                        . ' WHERE schemaname NOT IN'
 
                        . " ('pg_catalog', 'information_schema', 'pg_toast')";
 
            case 'views':
 
                // Table cols: viewname | viewowner | definition
 
                return 'SELECT viewname from pg_views WHERE schemaname'
 
                        . " NOT IN ('information_schema', 'pg_catalog')";
 
            case 'users':
 
                // cols: usename |usesysid|usecreatedb|usetrace|usesuper|usecatupd|passwd  |valuntil
 
                return 'SELECT usename FROM pg_user';
 
            case 'databases':
 
                return 'SELECT datname FROM pg_database';
 
            case 'functions':
 
            case 'procedures':
 
                return 'SELECT proname FROM pg_proc WHERE proowner <> 1';
 
            default:
 
                return null;
 
        }
 
    }
 

	
 
    // }}}
 

	
 
}
 

	
 
/*
 
 * Local variables:
 
 * tab-width: 4
 
 * c-basic-offset: 4
 
 * End:
 
 */
 

	
 
?>
components/com_morfeoshow/tpl/resources/phpFlickr/PEAR/DB/storage.php
Show inline comments
 
new file 100644
 
<?php
 

	
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 

	
 
/**
 
 * Provides an object interface to a table row
 
 *
 
 * PHP versions 4 and 5
 
 *
 
 * LICENSE: This source file is subject to version 3.0 of the PHP license
 
 * that is available through the world-wide-web at the following URI:
 
 * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
 
 * the PHP License and are unable to obtain it through the web, please
 
 * send a note to license@php.net so we can mail you a copy immediately.
 
 *
 
 * @category   Database
 
 * @package    DB
 
 * @author     Stig Bakken <stig@php.net>
 
 * @copyright  1997-2005 The PHP Group
 
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 
 * @version    CVS: $Id: storage.php 32 2005-08-01 06:21:02Z dancoulter $
 
 * @link       http://pear.php.net/package/DB
 
 */
 

	
 
/**
 
 * Obtain the DB class so it can be extended from
 
 */
 
require_once 'DB.php';
 

	
 
/**
 
 * Provides an object interface to a table row
 
 *
 
 * It lets you add, delete and change rows using objects rather than SQL
 
 * statements.
 
 *
 
 * @category   Database
 
 * @package    DB
 
 * @author     Stig Bakken <stig@php.net>
 
 * @copyright  1997-2005 The PHP Group
 
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 
 * @version    Release: @package_version@
 
 * @link       http://pear.php.net/package/DB
 
 */
 
class DB_storage extends PEAR
 
{
 
    // {{{ properties
 

	
 
    /** the name of the table (or view, if the backend database supports
 
        updates in views) we hold data from */
 
    var $_table = null;
 

	
 
    /** which column(s) in the table contains primary keys, can be a
 
        string for single-column primary keys, or an array of strings
 
        for multiple-column primary keys */
 
    var $_keycolumn = null;
 

	
 
    /** DB connection handle used for all transactions */
 
    var $_dbh = null;
 

	
 
    /** an assoc with the names of database fields stored as properties
 
        in this object */
 
    var $_properties = array();
 

	
 
    /** an assoc with the names of the properties in this object that
 
        have been changed since they were fetched from the database */
 
    var $_changes = array();
 

	
 
    /** flag that decides if data in this object can be changed.
 
        objects that don't have their table's key column in their
 
        property lists will be flagged as read-only. */
 
    var $_readonly = false;
 

	
 
    /** function or method that implements a validator for fields that
 
        are set, this validator function returns true if the field is
 
        valid, false if not */
 
    var $_validator = null;
 

	
 
    // }}}
 
    // {{{ constructor
 

	
 
    /**
 
     * Constructor
 
     *
 
     * @param $table string the name of the database table
 
     *
 
     * @param $keycolumn mixed string with name of key column, or array of
 
     * strings if the table has a primary key of more than one column
 
     *
 
     * @param $dbh object database connection object
 
     *
 
     * @param $validator mixed function or method used to validate
 
     * each new value, called with three parameters: the name of the
 
     * field/column that is changing, a reference to the new value and
 
     * a reference to this object
 
     *
 
     */
 
    function DB_storage($table, $keycolumn, &$dbh, $validator = null)
 
    {
 
        $this->PEAR('DB_Error');
 
        $this->_table = $table;
 
        $this->_keycolumn = $keycolumn;
 
        $this->_dbh = $dbh;
 
        $this->_readonly = false;
 
        $this->_validator = $validator;
 
    }
 

	
 
    // }}}
 
    // {{{ _makeWhere()
 

	
 
    /**
 
     * Utility method to build a "WHERE" clause to locate ourselves in
 
     * the table.
 
     *
 
     * XXX future improvement: use rowids?
 
     *
 
     * @access private
 
     */
 
    function _makeWhere($keyval = null)
 
    {
 
        if (is_array($this->_keycolumn)) {
 
            if ($keyval === null) {
 
                for ($i = 0; $i < sizeof($this->_keycolumn); $i++) {
 
                    $keyval[] = $this->{$this->_keycolumn[$i]};
 
                }
 
            }
 
            $whereclause = '';
 
            for ($i = 0; $i < sizeof($this->_keycolumn); $i++) {
 
                if ($i > 0) {
 
                    $whereclause .= ' AND ';
 
                }
 
                $whereclause .= $this->_keycolumn[$i];
 
                if (is_null($keyval[$i])) {
 
                    // there's not much point in having a NULL key,
 
                    // but we support it anyway
 
                    $whereclause .= ' IS NULL';
 
                } else {
 
                    $whereclause .= ' = ' . $this->_dbh->quote($keyval[$i]);
 
                }
 
            }
 
        } else {
 
            if ($keyval === null) {
 
                $keyval = @$this->{$this->_keycolumn};
 
            }
 
            $whereclause = $this->_keycolumn;
 
            if (is_null($keyval)) {
 
                // there's not much point in having a NULL key,
 
                // but we support it anyway
 
                $whereclause .= ' IS NULL';
 
            } else {
 
                $whereclause .= ' = ' . $this->_dbh->quote($keyval);
 
            }
 
        }
 
        return $whereclause;
 
    }
 

	
 
    // }}}
 
    // {{{ setup()
 

	
 
    /**
 
     * Method used to initialize a DB_storage object from the
 
     * configured table.
 
     *
 
     * @param $keyval mixed the key[s] of the row to fetch (string or array)
 
     *
 
     * @return int DB_OK on success, a DB error if not
 
     */
 
    function setup($keyval)
 
    {
 
        $whereclause = $this->_makeWhere($keyval);
 
        $query = 'SELECT * FROM ' . $this->_table . ' WHERE ' . $whereclause;
 
        $sth = $this->_dbh->query($query);
 
        if (DB::isError($sth)) {
 
            return $sth;
 
        }
 
        $row = $sth->fetchRow(DB_FETCHMODE_ASSOC);
 
        if (DB::isError($row)) {
 
            return $row;
 
        }
 
        if (!$row) {
 
            return $this->raiseError(null, DB_ERROR_NOT_FOUND, null, null,
 
                                     $query, null, true);
 
        }
 
        foreach ($row as $key => $value) {
 
            $this->_properties[$key] = true;
 
            $this->$key = $value;
 
        }
 
        return DB_OK;
 
    }
 

	
 
    // }}}
 
    // {{{ insert()
 

	
 
    /**
 
     * Create a new (empty) row in the configured table for this
 
     * object.
 
     */
 
    function insert($newpk)
 
    {
 
        if (is_array($this->_keycolumn)) {
 
            $primarykey = $this->_keycolumn;
 
        } else {
 
            $primarykey = array($this->_keycolumn);
 
        }
 
        settype($newpk, "array");
 
        for ($i = 0; $i < sizeof($primarykey); $i++) {
 
            $pkvals[] = $this->_dbh->quote($newpk[$i]);
 
        }
 

	
 
        $sth = $this->_dbh->query("INSERT INTO $this->_table (" .
 
                                  implode(",", $primarykey) . ") VALUES(" .
 
                                  implode(",", $pkvals) . ")");
 
        if (DB::isError($sth)) {
 
            return $sth;
 
        }
 
        if (sizeof($newpk) == 1) {
 
            $newpk = $newpk[0];
 
        }
 
        $this->setup($newpk);
 
    }
 

	
 
    // }}}
 
    // {{{ toString()
 

	
 
    /**
 
     * Output a simple description of this DB_storage object.
 
     * @return string object description
 
     */
 
    function toString()
 
    {
 
        $info = strtolower(get_class($this));
 
        $info .= " (table=";
 
        $info .= $this->_table;
 
        $info .= ", keycolumn=";
 
        if (is_array($this->_keycolumn)) {
 
            $info .= "(" . implode(",", $this->_keycolumn) . ")";
 
        } else {
 
            $info .= $this->_keycolumn;
 
        }
 
        $info .= ", dbh=";
 
        if (is_object($this->_dbh)) {
 
            $info .= $this->_dbh->toString();
 
        } else {
 
            $info .= "null";
 
        }
 
        $info .= ")";
 
        if (sizeof($this->_properties)) {
 
            $info .= " [loaded, key=";
 
            $keyname = $this->_keycolumn;
 
            if (is_array($keyname)) {
 
                $info .= "(";
 
                for ($i = 0; $i < sizeof($keyname); $i++) {
 
                    if ($i > 0) {
 
                        $info .= ",";
 
                    }
 
                    $info .= $this->$keyname[$i];
 
                }
 
                $info .= ")";
 
            } else {
 
                $info .= $this->$keyname;
 
            }
 
            $info .= "]";
 
        }
 
        if (sizeof($this->_changes)) {
 
            $info .= " [modified]";
 
        }
 
        return $info;
 
    }
 

	
 
    // }}}
 
    // {{{ dump()
 

	
 
    /**
 
     * Dump the contents of this object to "standard output".
 
     */
 
    function dump()
 
    {
 
        foreach ($this->_properties as $prop => $foo) {
 
            print "$prop = ";
 
            print htmlentities($this->$prop);
 
            print "<br />\n";
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ &create()
 

	
 
    /**
 
     * Static method used to create new DB storage objects.
 
     * @param $data assoc. array where the keys are the names
 
     *              of properties/columns
 
     * @return object a new instance of DB_storage or a subclass of it
 
     */
 
    function &create($table, &$data)
 
    {
 
        $classname = strtolower(get_class($this));
 
        $obj =& new $classname($table);
 
        foreach ($data as $name => $value) {
 
            $obj->_properties[$name] = true;
 
            $obj->$name = &$value;
 
        }
 
        return $obj;
 
    }
 

	
 
    // }}}
 
    // {{{ loadFromQuery()
 

	
 
    /**
 
     * Loads data into this object from the given query.  If this
 
     * object already contains table data, changes will be saved and
 
     * the object re-initialized first.
 
     *
 
     * @param $query SQL query
 
     *
 
     * @param $params parameter list in case you want to use
 
     * prepare/execute mode
 
     *
 
     * @return int DB_OK on success, DB_WARNING_READ_ONLY if the
 
     * returned object is read-only (because the object's specified
 
     * key column was not found among the columns returned by $query),
 
     * or another DB error code in case of errors.
 
     */
 
// XXX commented out for now
 
/*
 
    function loadFromQuery($query, $params = null)
 
    {
 
        if (sizeof($this->_properties)) {
 
            if (sizeof($this->_changes)) {
 
                $this->store();
 
                $this->_changes = array();
 
            }
 
            $this->_properties = array();
 
        }
 
        $rowdata = $this->_dbh->getRow($query, DB_FETCHMODE_ASSOC, $params);
 
        if (DB::isError($rowdata)) {
 
            return $rowdata;
 
        }
 
        reset($rowdata);
 
        $found_keycolumn = false;
 
        while (list($key, $value) = each($rowdata)) {
 
            if ($key == $this->_keycolumn) {
 
                $found_keycolumn = true;
 
            }
 
            $this->_properties[$key] = true;
 
            $this->$key = &$value;
 
            unset($value); // have to unset, or all properties will
 
                           // refer to the same value
 
        }
 
        if (!$found_keycolumn) {
 
            $this->_readonly = true;
 
            return DB_WARNING_READ_ONLY;
 
        }
 
        return DB_OK;
 
    }
 
 */
 

	
 
    // }}}
 
    // {{{ set()
 

	
 
    /**
 
     * Modify an attriute value.
 
     */
 
    function set($property, $newvalue)
 
    {
 
        // only change if $property is known and object is not
 
        // read-only
 
        if ($this->_readonly) {
 
            return $this->raiseError(null, DB_WARNING_READ_ONLY, null,
 
                                     null, null, null, true);
 
        }
 
        if (@isset($this->_properties[$property])) {
 
            if (empty($this->_validator)) {
 
                $valid = true;
 
            } else {
 
                $valid = @call_user_func($this->_validator,
 
                                         $this->_table,
 
                                         $property,
 
                                         $newvalue,
 
                                         $this->$property,
 
                                         $this);
 
            }
 
            if ($valid) {
 
                $this->$property = $newvalue;
 
                if (empty($this->_changes[$property])) {
 
                    $this->_changes[$property] = 0;
 
                } else {
 
                    $this->_changes[$property]++;
 
                }
 
            } else {
 
                return $this->raiseError(null, DB_ERROR_INVALID, null,
 
                                         null, "invalid field: $property",
 
                                         null, true);
 
            }
 
            return true;
 
        }
 
        return $this->raiseError(null, DB_ERROR_NOSUCHFIELD, null,
 
                                 null, "unknown field: $property",
 
                                 null, true);
 
    }
 

	
 
    // }}}
 
    // {{{ &get()
 

	
 
    /**
 
     * Fetch an attribute value.
 
     *
 
     * @param string attribute name
 
     *
 
     * @return attribute contents, or null if the attribute name is
 
     * unknown
 
     */
 
    function &get($property)
 
    {
 
        // only return if $property is known
 
        if (isset($this->_properties[$property])) {
 
            return $this->$property;
 
        }
 
        $tmp = null;
 
        return $tmp;
 
    }
 

	
 
    // }}}
 
    // {{{ _DB_storage()
 

	
 
    /**
 
     * Destructor, calls DB_storage::store() if there are changes
 
     * that are to be kept.
 
     */
 
    function _DB_storage()
 
    {
 
        if (sizeof($this->_changes)) {
 
            $this->store();
 
        }
 
        $this->_properties = array();
 
        $this->_changes = array();
 
        $this->_table = null;
 
    }
 

	
 
    // }}}
 
    // {{{ store()
 

	
 
    /**
 
     * Stores changes to this object in the database.
 
     *
 
     * @return DB_OK or a DB error
 
     */
 
    function store()
 
    {
 
        foreach ($this->_changes as $name => $foo) {
 
            $params[] = &$this->$name;
 
            $vars[] = $name . ' = ?';
 
        }
 
        if ($vars) {
 
            $query = 'UPDATE ' . $this->_table . ' SET ' .
 
                implode(', ', $vars) . ' WHERE ' .
 
                $this->_makeWhere();
 
            $stmt = $this->_dbh->prepare($query);
 
            $res = $this->_dbh->execute($stmt, $params);
 
            if (DB::isError($res)) {
 
                return $res;
 
            }
 
            $this->_changes = array();
 
        }
 
        return DB_OK;
 
    }
 

	
 
    // }}}
 
    // {{{ remove()
 

	
 
    /**
 
     * Remove the row represented by this object from the database.
 
     *
 
     * @return mixed DB_OK or a DB error
 
     */
 
    function remove()
 
    {
 
        if ($this->_readonly) {
 
            return $this->raiseError(null, DB_WARNING_READ_ONLY, null,
 
                                     null, null, null, true);
 
        }
 
        $query = 'DELETE FROM ' . $this->_table .' WHERE '.
 
            $this->_makeWhere();
 
        $res = $this->_dbh->query($query);
 
        if (DB::isError($res)) {
 
            return $res;
 
        }
 
        foreach ($this->_properties as $prop => $foo) {
 
            unset($this->$prop);
 
        }
 
        $this->_properties = array();
 
        $this->_changes = array();
 
        return DB_OK;
 
    }
 

	
 
    // }}}
 
}
 

	
 
/*
 
 * Local variables:
 
 * tab-width: 4
 
 * c-basic-offset: 4
 
 * End:
 
 */
 

	
 
?>
components/com_morfeoshow/tpl/resources/phpFlickr/PEAR/HTTP/Request.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
 * Class for performing HTTP requests
 
 *
 
 * PHP versions 4 and 5
 
 * 
 
 * LICENSE:
 
 *
 
 * Copyright (c) 2002-2007, Richard Heyes
 
 * All rights reserved.
 
 *
 
 * Redistribution and use in source and binary forms, with or without
 
 * modification, are permitted provided that the following conditions
 
 * are met:
 
 *
 
 * o Redistributions of source code must retain the above copyright
 
 *   notice, this list of conditions and the following disclaimer.
 
 * o Redistributions in binary form must reproduce the above copyright
 
 *   notice, this list of conditions and the following disclaimer in the
 
 *   documentation and/or other materials provided with the distribution.
 
 * o The names of the authors may not be used to endorse or promote
 
 *   products derived from this software without specific prior written
 
 *   permission.
 
 *
 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 *
 
 * @category    HTTP
 
 * @package     HTTP_Request
 
 * @author      Richard Heyes <richard@phpguru.org>
 
 * @author      Alexey Borzov <avb@php.net>
 
 * @copyright   2002-2007 Richard Heyes
 
 * @license     http://opensource.org/licenses/bsd-license.php New BSD License
 
 * @version     CVS: $Id: Request.php 127 2008-01-17 20:21:37Z dcoulter $
 
 * @link        http://pear.php.net/package/HTTP_Request/ 
 
 */
 

	
 
/**
 
 * PEAR and PEAR_Error classes (for error handling)
 
 */
 
require_once 'PEAR.php';
 
/**
 
 * Socket class
 
 */
 
require_once 'Net/Socket.php';
 
/**
 
 * URL handling class
 
 */ 
 
require_once 'Net/URL.php';
 

	
 
/**#@+
 
 * Constants for HTTP request methods
 
 */ 
 
define('HTTP_REQUEST_METHOD_GET',     'GET',     true);
 
define('HTTP_REQUEST_METHOD_HEAD',    'HEAD',    true);
 
define('HTTP_REQUEST_METHOD_POST',    'POST',    true);
 
define('HTTP_REQUEST_METHOD_PUT',     'PUT',     true);
 
define('HTTP_REQUEST_METHOD_DELETE',  'DELETE',  true);
 
define('HTTP_REQUEST_METHOD_OPTIONS', 'OPTIONS', true);
 
define('HTTP_REQUEST_METHOD_TRACE',   'TRACE',   true);
 
/**#@-*/
 

	
 
/**#@+
 
 * Constants for HTTP request error codes
 
 */ 
 
define('HTTP_REQUEST_ERROR_FILE',             1);
 
define('HTTP_REQUEST_ERROR_URL',              2);
 
define('HTTP_REQUEST_ERROR_PROXY',            4);
 
define('HTTP_REQUEST_ERROR_REDIRECTS',        8);
 
define('HTTP_REQUEST_ERROR_RESPONSE',        16);  
 
define('HTTP_REQUEST_ERROR_GZIP_METHOD',     32);
 
define('HTTP_REQUEST_ERROR_GZIP_READ',       64);
 
define('HTTP_REQUEST_ERROR_GZIP_DATA',      128);
 
define('HTTP_REQUEST_ERROR_GZIP_CRC',       256);
 
/**#@-*/
 

	
 
/**#@+
 
 * Constants for HTTP protocol versions
 
 */
 
define('HTTP_REQUEST_HTTP_VER_1_0', '1.0', true);
 
define('HTTP_REQUEST_HTTP_VER_1_1', '1.1', true);
 
/**#@-*/
 

	
 
if (extension_loaded('mbstring') && (2 & ini_get('mbstring.func_overload'))) {
 
   /**
 
    * Whether string functions are overloaded by their mbstring equivalents 
 
    */
 
    define('HTTP_REQUEST_MBSTRING', true);
 
} else {
 
   /**
 
    * @ignore
 
    */
 
    define('HTTP_REQUEST_MBSTRING', false);
 
}
 

	
 
/**
 
 * Class for performing HTTP requests
 
 *
 
 * Simple example (fetches yahoo.com and displays it):
 
 * <code>
 
 * $a = &new HTTP_Request('http://www.yahoo.com/');
 
 * $a->sendRequest();
 
 * echo $a->getResponseBody();
 
 * </code>
 
 *
 
 * @category    HTTP
 
 * @package     HTTP_Request
 
 * @author      Richard Heyes <richard@phpguru.org>
 
 * @author      Alexey Borzov <avb@php.net>
 
 * @version     Release: 1.4.2
 
 */
 
class HTTP_Request
 
{
 
   /**#@+
 
    * @access private
 
    */
 
    /**
 
    * Instance of Net_URL
 
    * @var Net_URL
 
    */
 
    var $_url;
 

	
 
    /**
 
    * Type of request
 
    * @var string
 
    */
 
    var $_method;
 

	
 
    /**
 
    * HTTP Version
 
    * @var string
 
    */
 
    var $_http;
 

	
 
    /**
 
    * Request headers
 
    * @var array
 
    */
 
    var $_requestHeaders;
 

	
 
    /**
 
    * Basic Auth Username
 
    * @var string
 
    */
 
    var $_user;
 
    
 
    /**
 
    * Basic Auth Password
 
    * @var string
 
    */
 
    var $_pass;
 

	
 
    /**
 
    * Socket object
 
    * @var Net_Socket
 
    */
 
    var $_sock;
 
    
 
    /**
 
    * Proxy server
 
    * @var string
 
    */
 
    var $_proxy_host;
 
    
 
    /**
 
    * Proxy port
 
    * @var integer
 
    */
 
    var $_proxy_port;
 
    
 
    /**
 
    * Proxy username
 
    * @var string
 
    */
 
    var $_proxy_user;
 
    
 
    /**
 
    * Proxy password
 
    * @var string
 
    */
 
    var $_proxy_pass;
 

	
 
    /**
 
    * Post data
 
    * @var array
 
    */
 
    var $_postData;
 

	
 
   /**
 
    * Request body  
 
    * @var string
 
    */
 
    var $_body;
 

	
 
   /**
 
    * A list of methods that MUST NOT have a request body, per RFC 2616
 
    * @var array
 
    */
 
    var $_bodyDisallowed = array('TRACE');
 

	
 
   /**
 
    * Files to post 
 
    * @var array
 
    */
 
    var $_postFiles = array();
 

	
 
    /**
 
    * Connection timeout.
 
    * @var float
 
    */
 
    var $_timeout;
 
    
 
    /**
 
    * HTTP_Response object
 
    * @var HTTP_Response
 
    */
 
    var $_response;
 
    
 
    /**
 
    * Whether to allow redirects
 
    * @var boolean
 
    */
 
    var $_allowRedirects;
 
    
 
    /**
 
    * Maximum redirects allowed
 
    * @var integer
 
    */
 
    var $_maxRedirects;
 
    
 
    /**
 
    * Current number of redirects
 
    * @var integer
 
    */
 
    var $_redirects;
 

	
 
   /**
 
    * Whether to append brackets [] to array variables
 
    * @var bool
 
    */
 
    var $_useBrackets = true;
 

	
 
   /**
 
    * Attached listeners
 
    * @var array
 
    */
 
    var $_listeners = array();
 

	
 
   /**
 
    * Whether to save response body in response object property  
 
    * @var bool
 
    */
 
    var $_saveBody = true;
 

	
 
   /**
 
    * Timeout for reading from socket (array(seconds, microseconds))
 
    * @var array
 
    */
 
    var $_readTimeout = null;
 

	
 
   /**
 
    * Options to pass to Net_Socket::connect. See stream_context_create
 
    * @var array
 
    */
 
    var $_socketOptions = null;
 
   /**#@-*/
 

	
 
    /**
 
    * Constructor
 
    *
 
    * Sets up the object
 
    * @param    string  The url to fetch/access
 
    * @param    array   Associative array of parameters which can have the following keys:
 
    * <ul>
 
    *   <li>method         - Method to use, GET, POST etc (string)</li>
 
    *   <li>http           - HTTP Version to use, 1.0 or 1.1 (string)</li>
 
    *   <li>user           - Basic Auth username (string)</li>
 
    *   <li>pass           - Basic Auth password (string)</li>
 
    *   <li>proxy_host     - Proxy server host (string)</li>
 
    *   <li>proxy_port     - Proxy server port (integer)</li>
 
    *   <li>proxy_user     - Proxy auth username (string)</li>
 
    *   <li>proxy_pass     - Proxy auth password (string)</li>
 
    *   <li>timeout        - Connection timeout in seconds (float)</li>
 
    *   <li>allowRedirects - Whether to follow redirects or not (bool)</li>
 
    *   <li>maxRedirects   - Max number of redirects to follow (integer)</li>
 
    *   <li>useBrackets    - Whether to append [] to array variable names (bool)</li>
 
    *   <li>saveBody       - Whether to save response body in response object property (bool)</li>
 
    *   <li>readTimeout    - Timeout for reading / writing data over the socket (array (seconds, microseconds))</li>
 
    *   <li>socketOptions  - Options to pass to Net_Socket object (array)</li>
 
    * </ul>
 
    * @access public
 
    */
 
    function HTTP_Request($url = '', $params = array())
 
    {
 
        $this->_method         =  HTTP_REQUEST_METHOD_GET;
 
        $this->_http           =  HTTP_REQUEST_HTTP_VER_1_1;
 
        $this->_requestHeaders = array();
 
        $this->_postData       = array();
 
        $this->_body           = null;
 

	
 
        $this->_user = null;
 
        $this->_pass = null;
 

	
 
        $this->_proxy_host = null;
 
        $this->_proxy_port = null;
 
        $this->_proxy_user = null;
 
        $this->_proxy_pass = null;
 

	
 
        $this->_allowRedirects = false;
 
        $this->_maxRedirects   = 3;
 
        $this->_redirects      = 0;
 

	
 
        $this->_timeout  = null;
 
        $this->_response = null;
 

	
 
        foreach ($params as $key => $value) {
 
            $this->{'_' . $key} = $value;
 
        }
 

	
 
        if (!empty($url)) {
 
            $this->setURL($url);
 
        }
 

	
 
        // Default useragent
 
        $this->addHeader('User-Agent', 'PEAR HTTP_Request class ( http://pear.php.net/ )');
 

	
 
        // We don't do keep-alives by default
 
        $this->addHeader('Connection', 'close');
 

	
 
        // Basic authentication
 
        if (!empty($this->_user)) {
 
            $this->addHeader('Authorization', 'Basic ' . base64_encode($this->_user . ':' . $this->_pass));
 
        }
 

	
 
        // Proxy authentication (see bug #5913)
 
        if (!empty($this->_proxy_user)) {
 
            $this->addHeader('Proxy-Authorization', 'Basic ' . base64_encode($this->_proxy_user . ':' . $this->_proxy_pass));
 
        }
 

	
 
        // Use gzip encoding if possible
 
        if (HTTP_REQUEST_HTTP_VER_1_1 == $this->_http && extension_loaded('zlib')) {
 
            $this->addHeader('Accept-Encoding', 'gzip');
 
        }
 
    }
 
    
 
    /**
 
    * Generates a Host header for HTTP/1.1 requests
 
    *
 
    * @access private
 
    * @return string
 
    */
 
    function _generateHostHeader()
 
    {
 
        if ($this->_url->port != 80 AND strcasecmp($this->_url->protocol, 'http') == 0) {
 
            $host = $this->_url->host . ':' . $this->_url->port;
 

	
 
        } elseif ($this->_url->port != 443 AND strcasecmp($this->_url->protocol, 'https') == 0) {
 
            $host = $this->_url->host . ':' . $this->_url->port;
 

	
 
        } elseif ($this->_url->port == 443 AND strcasecmp($this->_url->protocol, 'https') == 0 AND strpos($this->_url->url, ':443') !== false) {
 
            $host = $this->_url->host . ':' . $this->_url->port;
 
        
 
        } else {
 
            $host = $this->_url->host;
 
        }
 

	
 
        return $host;
 
    }
 
    
 
    /**
 
    * Resets the object to its initial state (DEPRECATED).
 
    * Takes the same parameters as the constructor.
 
    *
 
    * @param  string $url    The url to be requested
 
    * @param  array  $params Associative array of parameters
 
    *                        (see constructor for details)
 
    * @access public
 
    * @deprecated deprecated since 1.2, call the constructor if this is necessary
 
    */
 
    function reset($url, $params = array())
 
    {
 
        $this->HTTP_Request($url, $params);
 
    }
 

	
 
    /**
 
    * Sets the URL to be requested
 
    *
 
    * @param  string The url to be requested
 
    * @access public
 
    */
 
    function setURL($url)
 
    {
 
        $this->_url = &new Net_URL($url, $this->_useBrackets);
 

	
 
        if (!empty($this->_url->user) || !empty($this->_url->pass)) {
 
            $this->setBasicAuth($this->_url->user, $this->_url->pass);
 
        }
 

	
 
        if (HTTP_REQUEST_HTTP_VER_1_1 == $this->_http) {
 
            $this->addHeader('Host', $this->_generateHostHeader());
 
        }
 

	
 
        // set '/' instead of empty path rather than check later (see bug #8662)
 
        if (empty($this->_url->path)) {
 
            $this->_url->path = '/';
 
        } 
 
    }
 
    
 
   /**
 
    * Returns the current request URL  
 
    *
 
    * @return   string  Current request URL
 
    * @access   public
 
    */
 
    function getUrl()
 
    {
 
        return empty($this->_url)? '': $this->_url->getUrl();
 
    }
 

	
 
    /**
 
    * Sets a proxy to be used
 
    *
 
    * @param string     Proxy host
 
    * @param int        Proxy port
 
    * @param string     Proxy username
 
    * @param string     Proxy password
 
    * @access public
 
    */
 
    function setProxy($host, $port = 8080, $user = null, $pass = null)
 
    {
 
        $this->_proxy_host = $host;
 
        $this->_proxy_port = $port;
 
        $this->_proxy_user = $user;
 
        $this->_proxy_pass = $pass;
 

	
 
        if (!empty($user)) {
 
            $this->addHeader('Proxy-Authorization', 'Basic ' . base64_encode($user . ':' . $pass));
 
        }
 
    }
 

	
 
    /**
 
    * Sets basic authentication parameters
 
    *
 
    * @param string     Username
 
    * @param string     Password
 
    */
 
    function setBasicAuth($user, $pass)
 
    {
 
        $this->_user = $user;
 
        $this->_pass = $pass;
 

	
 
        $this->addHeader('Authorization', 'Basic ' . base64_encode($user . ':' . $pass));
 
    }
 

	
 
    /**
 
    * Sets the method to be used, GET, POST etc.
 
    *
 
    * @param string     Method to use. Use the defined constants for this
 
    * @access public
 
    */
 
    function setMethod($method)
 
    {
 
        $this->_method = $method;
 
    }
 

	
 
    /**
 
    * Sets the HTTP version to use, 1.0 or 1.1
 
    *
 
    * @param string     Version to use. Use the defined constants for this
 
    * @access public
 
    */
 
    function setHttpVer($http)
 
    {
 
        $this->_http = $http;
 
    }
 

	
 
    /**
 
    * Adds a request header
 
    *
 
    * @param string     Header name
 
    * @param string     Header value
 
    * @access public
 
    */
 
    function addHeader($name, $value)
 
    {
 
        $this->_requestHeaders[strtolower($name)] = $value;
 
    }
 

	
 
    /**
 
    * Removes a request header
 
    *
 
    * @param string     Header name to remove
 
    * @access public
 
    */
 
    function removeHeader($name)
 
    {
 
        if (isset($this->_requestHeaders[strtolower($name)])) {
 
            unset($this->_requestHeaders[strtolower($name)]);
 
        }
 
    }
 

	
 
    /**
 
    * Adds a querystring parameter
 
    *
 
    * @param string     Querystring parameter name
 
    * @param string     Querystring parameter value
 
    * @param bool       Whether the value is already urlencoded or not, default = not
 
    * @access public
 
    */
 
    function addQueryString($name, $value, $preencoded = false)
 
    {
 
        $this->_url->addQueryString($name, $value, $preencoded);
 
    }    
 
    
 
    /**
 
    * Sets the querystring to literally what you supply
 
    *
 
    * @param string     The querystring data. Should be of the format foo=bar&x=y etc
 
    * @param bool       Whether data is already urlencoded or not, default = already encoded
 
    * @access public
 
    */
 
    function addRawQueryString($querystring, $preencoded = true)
 
    {
 
        $this->_url->addRawQueryString($querystring, $preencoded);
 
    }
 

	
 
    /**
 
    * Adds postdata items
 
    *
 
    * @param string     Post data name
 
    * @param string     Post data value
 
    * @param bool       Whether data is already urlencoded or not, default = not
 
    * @access public
 
    */
 
    function addPostData($name, $value, $preencoded = false)
 
    {
 
        if ($preencoded) {
 
            $this->_postData[$name] = $value;
 
        } else {
 
            $this->_postData[$name] = $this->_arrayMapRecursive('urlencode', $value);
 
        }
 
    }
 

	
 
   /**
 
    * Recursively applies the callback function to the value
 
    * 
 
    * @param    mixed   Callback function
 
    * @param    mixed   Value to process
 
    * @access   private
 
    * @return   mixed   Processed value
 
    */
 
    function _arrayMapRecursive($callback, $value)
 
    {
 
        if (!is_array($value)) {
 
            return call_user_func($callback, $value);
 
        } else {
 
            $map = array();
 
            foreach ($value as $k => $v) {
 
                $map[$k] = $this->_arrayMapRecursive($callback, $v);
 
            }
 
            return $map;
 
        }
 
    }
 

	
 
   /**
 
    * Adds a file to upload
 
    * 
 
    * This also changes content-type to 'multipart/form-data' for proper upload
 
    * 
 
    * @access public
 
    * @param  string    name of file-upload field
 
    * @param  mixed     file name(s)
 
    * @param  mixed     content-type(s) of file(s) being uploaded
 
    * @return bool      true on success
 
    * @throws PEAR_Error
 
    */
 
    function addFile($inputName, $fileName, $contentType = 'application/octet-stream')
 
    {
 
        if (!is_array($fileName) && !is_readable($fileName)) {
 
            return PEAR::raiseError("File '{$fileName}' is not readable", HTTP_REQUEST_ERROR_FILE);
 
        } elseif (is_array($fileName)) {
 
            foreach ($fileName as $name) {
 
                if (!is_readable($name)) {
 
                    return PEAR::raiseError("File '{$name}' is not readable", HTTP_REQUEST_ERROR_FILE);
 
                }
 
            }
 
        }
 
        $this->addHeader('Content-Type', 'multipart/form-data');
 
        $this->_postFiles[$inputName] = array(
 
            'name' => $fileName,
 
            'type' => $contentType
 
        );
 
        return true;
 
    }
 

	
 
    /**
 
    * Adds raw postdata (DEPRECATED)
 
    *
 
    * @param string     The data
 
    * @param bool       Whether data is preencoded or not, default = already encoded
 
    * @access public
 
    * @deprecated       deprecated since 1.3.0, method setBody() should be used instead
 
    */
 
    function addRawPostData($postdata, $preencoded = true)
 
    {
 
        $this->_body = $preencoded ? $postdata : urlencode($postdata);
 
    }
 

	
 
   /**
 
    * Sets the request body (for POST, PUT and similar requests)
 
    *
 
    * @param    string  Request body
 
    * @access   public
 
    */
 
    function setBody($body)
 
    {
 
        $this->_body = $body;
 
    }
 

	
 
    /**
 
    * Clears any postdata that has been added (DEPRECATED). 
 
    * 
 
    * Useful for multiple request scenarios.
 
    *
 
    * @access public
 
    * @deprecated deprecated since 1.2
 
    */
 
    function clearPostData()
 
    {
 
        $this->_postData = null;
 
    }
 

	
 
    /**
 
    * Appends a cookie to "Cookie:" header
 
    * 
 
    * @param string $name cookie name
 
    * @param string $value cookie value
 
    * @access public
 
    */
 
    function addCookie($name, $value)
 
    {
 
        $cookies = isset($this->_requestHeaders['cookie']) ? $this->_requestHeaders['cookie']. '; ' : '';
 
        $this->addHeader('Cookie', $cookies . $name . '=' . $value);
 
    }
 
    
 
    /**
 
    * Clears any cookies that have been added (DEPRECATED). 
 
    * 
 
    * Useful for multiple request scenarios
 
    *
 
    * @access public
 
    * @deprecated deprecated since 1.2
 
    */
 
    function clearCookies()
 
    {
 
        $this->removeHeader('Cookie');
 
    }
 

	
 
    /**
 
    * Sends the request
 
    *
 
    * @access public
 
    * @param  bool   Whether to store response body in Response object property,
 
    *                set this to false if downloading a LARGE file and using a Listener
 
    * @return mixed  PEAR error on error, true otherwise
 
    */
 
    function sendRequest($saveBody = true)
 
    {
 
        if (!is_a($this->_url, 'Net_URL')) {
 
            return PEAR::raiseError('No URL given', HTTP_REQUEST_ERROR_URL);
 
        }
 

	
 
        $host = isset($this->_proxy_host) ? $this->_proxy_host : $this->_url->host;
 
        $port = isset($this->_proxy_port) ? $this->_proxy_port : $this->_url->port;
 

	
 
        // 4.3.0 supports SSL connections using OpenSSL. The function test determines
 
        // we running on at least 4.3.0
 
        if (strcasecmp($this->_url->protocol, 'https') == 0 AND function_exists('file_get_contents') AND extension_loaded('openssl')) {
 
            if (isset($this->_proxy_host)) {
 
                return PEAR::raiseError('HTTPS proxies are not supported', HTTP_REQUEST_ERROR_PROXY);
 
            }
 
            $host = 'ssl://' . $host;
 
        }
 

	
 
        // magic quotes may fuck up file uploads and chunked response processing
 
        $magicQuotes = ini_get('magic_quotes_runtime');
 
        ini_set('magic_quotes_runtime', false);
 

	
 
        // RFC 2068, section 19.7.1: A client MUST NOT send the Keep-Alive 
 
        // connection token to a proxy server...
 
        if (isset($this->_proxy_host) && !empty($this->_requestHeaders['connection']) &&
 
            'Keep-Alive' == $this->_requestHeaders['connection'])
 
        {
 
            $this->removeHeader('connection');
 
        }
 

	
 
        $keepAlive = (HTTP_REQUEST_HTTP_VER_1_1 == $this->_http && empty($this->_requestHeaders['connection'])) ||
 
                     (!empty($this->_requestHeaders['connection']) && 'Keep-Alive' == $this->_requestHeaders['connection']);
 
        $sockets   = &PEAR::getStaticProperty('HTTP_Request', 'sockets');
 
        $sockKey   = $host . ':' . $port;
 
        unset($this->_sock);
 

	
 
        // There is a connected socket in the "static" property?
 
        if ($keepAlive && !empty($sockets[$sockKey]) &&
 
            !empty($sockets[$sockKey]->fp)) 
 
        {
 
            $this->_sock =& $sockets[$sockKey];
 
            $err = null;
 
        } else {
 
            $this->_notify('connect');
 
            $this->_sock =& new Net_Socket();
 
            $err = $this->_sock->connect($host, $port, null, $this->_timeout, $this->_socketOptions);
 
        }
 
        PEAR::isError($err) or $err = $this->_sock->write($this->_buildRequest());
 

	
 
        if (!PEAR::isError($err)) {
 
            if (!empty($this->_readTimeout)) {
 
                $this->_sock->setTimeout($this->_readTimeout[0], $this->_readTimeout[1]);
 
            }
 

	
 
            $this->_notify('sentRequest');
 

	
 
            // Read the response
 
            $this->_response = &new HTTP_Response($this->_sock, $this->_listeners);
 
            $err = $this->_response->process(
 
                $this->_saveBody && $saveBody,
 
                HTTP_REQUEST_METHOD_HEAD != $this->_method
 
            );
 

	
 
            if ($keepAlive) {
 
                $keepAlive = (isset($this->_response->_headers['content-length'])
 
                              || (isset($this->_response->_headers['transfer-encoding'])
 
                                  && strtolower($this->_response->_headers['transfer-encoding']) == 'chunked'));
 
                if ($keepAlive) {
 
                    if (isset($this->_response->_headers['connection'])) {
 
                        $keepAlive = strtolower($this->_response->_headers['connection']) == 'keep-alive';
 
                    } else {
 
                        $keepAlive = 'HTTP/'.HTTP_REQUEST_HTTP_VER_1_1 == $this->_response->_protocol;
 
                    }
 
                }
 
            }
 
        }
 

	
 
        ini_set('magic_quotes_runtime', $magicQuotes);
 

	
 
        if (PEAR::isError($err)) {
 
            return $err;
 
        }
 

	
 
        if (!$keepAlive) {
 
            $this->disconnect();
 
        // Store the connected socket in "static" property
 
        } elseif (empty($sockets[$sockKey]) || empty($sockets[$sockKey]->fp)) {
 
            $sockets[$sockKey] =& $this->_sock;
 
        }
 

	
 
        // Check for redirection
 
        if (    $this->_allowRedirects
 
            AND $this->_redirects <= $this->_maxRedirects
 
            AND $this->getResponseCode() > 300
 
            AND $this->getResponseCode() < 399
 
            AND !empty($this->_response->_headers['location'])) {
 

	
 
            
 
            $redirect = $this->_response->_headers['location'];
 

	
 
            // Absolute URL
 
            if (preg_match('/^https?:\/\//i', $redirect)) {
 
                $this->_url = &new Net_URL($redirect);
 
                $this->addHeader('Host', $this->_generateHostHeader());
 
            // Absolute path
 
            } elseif ($redirect{0} == '/') {
 
                $this->_url->path = $redirect;
 
            
 
            // Relative path
 
            } elseif (substr($redirect, 0, 3) == '../' OR substr($redirect, 0, 2) == './') {
 
                if (substr($this->_url->path, -1) == '/') {
 
                    $redirect = $this->_url->path . $redirect;
 
                } else {
 
                    $redirect = dirname($this->_url->path) . '/' . $redirect;
 
                }
 
                $redirect = Net_URL::resolvePath($redirect);
 
                $this->_url->path = $redirect;
 
                
 
            // Filename, no path
 
            } else {
 
                if (substr($this->_url->path, -1) == '/') {
 
                    $redirect = $this->_url->path . $redirect;
 
                } else {
 
                    $redirect = dirname($this->_url->path) . '/' . $redirect;
 
                }
 
                $this->_url->path = $redirect;
 
            }
 

	
 
            $this->_redirects++;
 
            return $this->sendRequest($saveBody);
 

	
 
        // Too many redirects
 
        } elseif ($this->_allowRedirects AND $this->_redirects > $this->_maxRedirects) {
 
            return PEAR::raiseError('Too many redirects', HTTP_REQUEST_ERROR_REDIRECTS);
 
        }
 

	
 
        return true;
 
    }
 

	
 
    /**
 
     * Disconnect the socket, if connected. Only useful if using Keep-Alive.
 
     *
 
     * @access public
 
     */
 
    function disconnect()
 
    {
 
        if (!empty($this->_sock) && !empty($this->_sock->fp)) {
 
            $this->_notify('disconnect');
 
            $this->_sock->disconnect();
 
        }
 
    }
 

	
 
    /**
 
    * Returns the response code
 
    *
 
    * @access public
 
    * @return mixed     Response code, false if not set
 
    */
 
    function getResponseCode()
 
    {
 
        return isset($this->_response->_code) ? $this->_response->_code : false;
 
    }
 

	
 
    /**
 
    * Returns either the named header or all if no name given
 
    *
 
    * @access public
 
    * @param string     The header name to return, do not set to get all headers
 
    * @return mixed     either the value of $headername (false if header is not present)
 
    *                   or an array of all headers
 
    */
 
    function getResponseHeader($headername = null)
 
    {
 
        if (!isset($headername)) {
 
            return isset($this->_response->_headers)? $this->_response->_headers: array();
 
        } else {
 
            $headername = strtolower($headername);
 
            return isset($this->_response->_headers[$headername]) ? $this->_response->_headers[$headername] : false;
 
        }
 
    }
 

	
 
    /**
 
    * Returns the body of the response
 
    *
 
    * @access public
 
    * @return mixed     response body, false if not set
 
    */
 
    function getResponseBody()
 
    {
 
        return isset($this->_response->_body) ? $this->_response->_body : false;
 
    }
 

	
 
    /**
 
    * Returns cookies set in response
 
    * 
 
    * @access public
 
    * @return mixed     array of response cookies, false if none are present
 
    */
 
    function getResponseCookies()
 
    {
 
        return isset($this->_response->_cookies) ? $this->_response->_cookies : false;
 
    }
 

	
 
    /**
 
    * Builds the request string
 
    *
 
    * @access private
 
    * @return string The request string
 
    */
 
    function _buildRequest()
 
    {
 
        $separator = ini_get('arg_separator.output');
 
        ini_set('arg_separator.output', '&');
 
        $querystring = ($querystring = $this->_url->getQueryString()) ? '?' . $querystring : '';
 
        ini_set('arg_separator.output', $separator);
 

	
 
        $host = isset($this->_proxy_host) ? $this->_url->protocol . '://' . $this->_url->host : '';
 
        $port = (isset($this->_proxy_host) AND $this->_url->port != 80) ? ':' . $this->_url->port : '';
 
        $path = $this->_url->path . $querystring;
 
        $url  = $host . $port . $path;
 

	
 
        if (!strlen($url)) {
 
            $url = '/';
 
        }
 

	
 
        $request = $this->_method . ' ' . $url . ' HTTP/' . $this->_http . "\r\n";
 

	
 
        if (in_array($this->_method, $this->_bodyDisallowed) ||
 
            (0 == strlen($this->_body) && (HTTP_REQUEST_METHOD_POST != $this->_method ||
 
             (empty($this->_postData) && empty($this->_postFiles)))))
 
        {
 
            $this->removeHeader('Content-Type');
 
        } else {
 
            if (empty($this->_requestHeaders['content-type'])) {
 
                // Add default content-type
 
                $this->addHeader('Content-Type', 'application/x-www-form-urlencoded');
 
            } elseif ('multipart/form-data' == $this->_requestHeaders['content-type']) {
 
                $boundary = 'HTTP_Request_' . md5(uniqid('request') . microtime());
 
                $this->addHeader('Content-Type', 'multipart/form-data; boundary=' . $boundary);
 
            }
 
        }
 

	
 
        // Request Headers
 
        if (!empty($this->_requestHeaders)) {
 
            foreach ($this->_requestHeaders as $name => $value) {
 
                $canonicalName = implode('-', array_map('ucfirst', explode('-', $name)));
 
                $request      .= $canonicalName . ': ' . $value . "\r\n";
 
            }
 
        }
 

	
 
        // No post data or wrong method, so simply add a final CRLF
 
        if (in_array($this->_method, $this->_bodyDisallowed) || 
 
            (HTTP_REQUEST_METHOD_POST != $this->_method && 0 == strlen($this->_body))) {
 

	
 
            $request .= "\r\n";
 

	
 
        // Post data if it's an array
 
        } elseif (HTTP_REQUEST_METHOD_POST == $this->_method && 
 
                  (!empty($this->_postData) || !empty($this->_postFiles))) {
 

	
 
            // "normal" POST request
 
            if (!isset($boundary)) {
 
                $postdata = implode('&', array_map(
 
                    create_function('$a', 'return $a[0] . \'=\' . $a[1];'), 
 
                    $this->_flattenArray('', $this->_postData)
 
                ));
 

	
 
            // multipart request, probably with file uploads
 
            } else {
 
                $postdata = '';
 
                if (!empty($this->_postData)) {
 
                    $flatData = $this->_flattenArray('', $this->_postData);
 
                    foreach ($flatData as $item) {
 
                        $postdata .= '--' . $boundary . "\r\n";
 
                        $postdata .= 'Content-Disposition: form-data; name="' . $item[0] . '"';
 
                        $postdata .= "\r\n\r\n" . urldecode($item[1]) . "\r\n";
 
                    }
 
                }
 
                foreach ($this->_postFiles as $name => $value) {
 
                    if (is_array($value['name'])) {
 
                        $varname       = $name . ($this->_useBrackets? '[]': '');
 
                    } else {
 
                        $varname       = $name;
 
                        $value['name'] = array($value['name']);
 
                    }
 
                    foreach ($value['name'] as $key => $filename) {
 
                        $fp   = fopen($filename, 'r');
 
                        $data = fread($fp, filesize($filename));
 
                        fclose($fp);
 
                        $basename = basename($filename);
 
                        $type     = is_array($value['type'])? @$value['type'][$key]: $value['type'];
 

	
 
                        $postdata .= '--' . $boundary . "\r\n";
 
                        $postdata .= 'Content-Disposition: form-data; name="' . $varname . '"; filename="' . $basename . '"';
 
                        $postdata .= "\r\nContent-Type: " . $type;
 
                        $postdata .= "\r\n\r\n" . $data . "\r\n";
 
                    }
 
                }
 
                $postdata .= '--' . $boundary . "--\r\n";
 
            }
 
            $request .= 'Content-Length: ' .
 
                        (HTTP_REQUEST_MBSTRING? mb_strlen($postdata, 'iso-8859-1'): strlen($postdata)) .
 
                        "\r\n\r\n";
 
            $request .= $postdata;
 

	
 
        // Explicitly set request body
 
        } elseif (0 < strlen($this->_body)) {
 

	
 
            $request .= 'Content-Length: ' .
 
                        (HTTP_REQUEST_MBSTRING? mb_strlen($this->_body, 'iso-8859-1'): strlen($this->_body)) .
 
                        "\r\n\r\n";
 
            $request .= $this->_body;
 

	
 
        // Terminate headers with CRLF on POST request with no body, too
 
        } else {
 

	
 
            $request .= "\r\n";
 
        }
 
        
 
        return $request;
 
    }
 

	
 
   /**
 
    * Helper function to change the (probably multidimensional) associative array
 
    * into the simple one.
 
    *
 
    * @param    string  name for item
 
    * @param    mixed   item's values
 
    * @return   array   array with the following items: array('item name', 'item value');
 
    * @access   private
 
    */
 
    function _flattenArray($name, $values)
 
    {
 
        if (!is_array($values)) {
 
            return array(array($name, $values));
 
        } else {
 
            $ret = array();
 
            foreach ($values as $k => $v) {
 
                if (empty($name)) {
 
                    $newName = $k;
 
                } elseif ($this->_useBrackets) {
 
                    $newName = $name . '[' . $k . ']';
 
                } else {
 
                    $newName = $name;
 
                }
 
                $ret = array_merge($ret, $this->_flattenArray($newName, $v));
 
            }
 
            return $ret;
 
        }
 
    }
 

	
 

	
 
   /**
 
    * Adds a Listener to the list of listeners that are notified of
 
    * the object's events
 
    * 
 
    * Events sent by HTTP_Request object
 
    * - 'connect': on connection to server
 
    * - 'sentRequest': after the request was sent
 
    * - 'disconnect': on disconnection from server
 
    *
 
    * Events sent by HTTP_Response object
 
    * - 'gotHeaders': after receiving response headers (headers are passed in $data)
 
    * - 'tick': on receiving a part of response body (the part is passed in $data)
 
    * - 'gzTick': on receiving a gzip-encoded part of response body (ditto)
 
    * - 'gotBody': after receiving the response body (passes the decoded body in $data if it was gzipped)
 
    *
 
    * @param    HTTP_Request_Listener   listener to attach
 
    * @return   boolean                 whether the listener was successfully attached
 
    * @access   public
 
    */
 
    function attach(&$listener)
 
    {
 
        if (!is_a($listener, 'HTTP_Request_Listener')) {
 
            return false;
 
        }
 
        $this->_listeners[$listener->getId()] =& $listener;
 
        return true;
 
    }
 

	
 

	
 
   /**
 
    * Removes a Listener from the list of listeners 
 
    * 
 
    * @param    HTTP_Request_Listener   listener to detach
 
    * @return   boolean                 whether the listener was successfully detached
 
    * @access   public
 
    */
 
    function detach(&$listener)
 
    {
 
        if (!is_a($listener, 'HTTP_Request_Listener') || 
 
            !isset($this->_listeners[$listener->getId()])) {
 
            return false;
 
        }
 
        unset($this->_listeners[$listener->getId()]);
 
        return true;
 
    }
 

	
 

	
 
   /**
 
    * Notifies all registered listeners of an event.
 
    * 
 
    * @param    string  Event name
 
    * @param    mixed   Additional data
 
    * @access   private
 
    * @see      HTTP_Request::attach()
 
    */
 
    function _notify($event, $data = null)
 
    {
 
        foreach (array_keys($this->_listeners) as $id) {
 
            $this->_listeners[$id]->update($this, $event, $data);
 
        }
 
    }
 
}
 

	
 

	
 
/**
 
 * Response class to complement the Request class
 
 *
 
 * @category    HTTP
 
 * @package     HTTP_Request
 
 * @author      Richard Heyes <richard@phpguru.org>
 
 * @author      Alexey Borzov <avb@php.net>
 
 * @version     Release: 1.4.2
 
 */
 
class HTTP_Response
 
{
 
    /**
 
    * Socket object
 
    * @var Net_Socket
 
    */
 
    var $_sock;
 

	
 
    /**
 
    * Protocol
 
    * @var string
 
    */
 
    var $_protocol;
 
    
 
    /**
 
    * Return code
 
    * @var string
 
    */
 
    var $_code;
 
    
 
    /**
 
    * Response headers
 
    * @var array
 
    */
 
    var $_headers;
 

	
 
    /**
 
    * Cookies set in response  
 
    * @var array
 
    */
 
    var $_cookies;
 

	
 
    /**
 
    * Response body
 
    * @var string
 
    */
 
    var $_body = '';
 

	
 
   /**
 
    * Used by _readChunked(): remaining length of the current chunk
 
    * @var string
 
    */
 
    var $_chunkLength = 0;
 

	
 
   /**
 
    * Attached listeners
 
    * @var array
 
    */
 
    var $_listeners = array();
 

	
 
   /**
 
    * Bytes left to read from message-body
 
    * @var null|int
 
    */
 
    var $_toRead;
 

	
 
    /**
 
    * Constructor
 
    *
 
    * @param  Net_Socket    socket to read the response from
 
    * @param  array         listeners attached to request
 
    */
 
    function HTTP_Response(&$sock, &$listeners)
 
    {
 
        $this->_sock      =& $sock;
 
        $this->_listeners =& $listeners;
 
    }
 

	
 

	
 
   /**
 
    * Processes a HTTP response
 
    * 
 
    * This extracts response code, headers, cookies and decodes body if it 
 
    * was encoded in some way
 
    *
 
    * @access public
 
    * @param  bool      Whether to store response body in object property, set
 
    *                   this to false if downloading a LARGE file and using a Listener.
 
    *                   This is assumed to be true if body is gzip-encoded.
 
    * @param  bool      Whether the response can actually have a message-body.
 
    *                   Will be set to false for HEAD requests.
 
    * @throws PEAR_Error
 
    * @return mixed     true on success, PEAR_Error in case of malformed response
 
    */
 
    function process($saveBody = true, $canHaveBody = true)
 
    {
 
        do {
 
            $line = $this->_sock->readLine();
 
            if (sscanf($line, 'HTTP/%s %s', $http_version, $returncode) != 2) {
 
                return PEAR::raiseError('Malformed response', HTTP_REQUEST_ERROR_RESPONSE);
 
            } else {
 
                $this->_protocol = 'HTTP/' . $http_version;
 
                $this->_code     = intval($returncode);
 
            }
 
            while ('' !== ($header = $this->_sock->readLine())) {
 
                $this->_processHeader($header);
 
            }
 
        } while (100 == $this->_code);
 

	
 
        $this->_notify('gotHeaders', $this->_headers);
 

	
 
        // RFC 2616, section 4.4:
 
        // 1. Any response message which "MUST NOT" include a message-body ... 
 
        // is always terminated by the first empty line after the header fields 
 
        // 3. ... If a message is received with both a
 
        // Transfer-Encoding header field and a Content-Length header field,
 
        // the latter MUST be ignored.
 
        $canHaveBody = $canHaveBody && $this->_code >= 200 && 
 
                       $this->_code != 204 && $this->_code != 304;
 

	
 
        // If response body is present, read it and decode
 
        $chunked = isset($this->_headers['transfer-encoding']) && ('chunked' == $this->_headers['transfer-encoding']);
 
        $gzipped = isset($this->_headers['content-encoding']) && ('gzip' == $this->_headers['content-encoding']);
 
        $hasBody = false;
 
        if ($canHaveBody && ($chunked || !isset($this->_headers['content-length']) || 
 
                0 != $this->_headers['content-length']))
 
        {
 
            if ($chunked || !isset($this->_headers['content-length'])) {
 
                $this->_toRead = null;
 
            } else {
 
                $this->_toRead = $this->_headers['content-length'];
 
            }
 
            while (!$this->_sock->eof() && (is_null($this->_toRead) || 0 < $this->_toRead)) {
 
                if ($chunked) {
 
                    $data = $this->_readChunked();
 
                } elseif (is_null($this->_toRead)) {
 
                    $data = $this->_sock->read(4096);
 
                } else {
 
                    $data = $this->_sock->read(min(4096, $this->_toRead));
 
                    $this->_toRead -= HTTP_REQUEST_MBSTRING? mb_strlen($data, 'iso-8859-1'): strlen($data);
 
                }
 
                if ('' == $data) {
 
                    break;
 
                } else {
 
                    $hasBody = true;
 
                    if ($saveBody || $gzipped) {
 
                        $this->_body .= $data;
 
                    }
 
                    $this->_notify($gzipped? 'gzTick': 'tick', $data);
 
                }
 
            }
 
        }
 

	
 
        if ($hasBody) {
 
            // Uncompress the body if needed
 
            if ($gzipped) {
 
                $body = $this->_decodeGzip($this->_body);
 
                if (PEAR::isError($body)) {
 
                    return $body;
 
                }
 
                $this->_body = $body;
 
                $this->_notify('gotBody', $this->_body);
 
            } else {
 
                $this->_notify('gotBody');
 
            }
 
        }
 
        return true;
 
    }
 

	
 

	
 
   /**
 
    * Processes the response header
 
    *
 
    * @access private
 
    * @param  string    HTTP header
 
    */
 
    function _processHeader($header)
 
    {
 
        if (false === strpos($header, ':')) {
 
            return;
 
        }
 
        list($headername, $headervalue) = explode(':', $header, 2);
 
        $headername  = strtolower($headername);
 
        $headervalue = ltrim($headervalue);
 
        
 
        if ('set-cookie' != $headername) {
 
            if (isset($this->_headers[$headername])) {
 
                $this->_headers[$headername] .= ',' . $headervalue;
 
            } else {
 
                $this->_headers[$headername]  = $headervalue;
 
            }
 
        } else {
 
            $this->_parseCookie($headervalue);
 
        }
 
    }
 

	
 

	
 
   /**
 
    * Parse a Set-Cookie header to fill $_cookies array
 
    *
 
    * @access private
 
    * @param  string    value of Set-Cookie header
 
    */
 
    function _parseCookie($headervalue)
 
    {
 
        $cookie = array(
 
            'expires' => null,
 
            'domain'  => null,
 
            'path'    => null,
 
            'secure'  => false
 
        );
 

	
 
        // Only a name=value pair
 
        if (!strpos($headervalue, ';')) {
 
            $pos = strpos($headervalue, '=');
 
            $cookie['name']  = trim(substr($headervalue, 0, $pos));
 
            $cookie['value'] = trim(substr($headervalue, $pos + 1));
 

	
 
        // Some optional parameters are supplied
 
        } else {
 
            $elements = explode(';', $headervalue);
 
            $pos = strpos($elements[0], '=');
 
            $cookie['name']  = trim(substr($elements[0], 0, $pos));
 
            $cookie['value'] = trim(substr($elements[0], $pos + 1));
 

	
 
            for ($i = 1; $i < count($elements); $i++) {
 
                if (false === strpos($elements[$i], '=')) {
 
                    $elName  = trim($elements[$i]);
 
                    $elValue = null;
 
                } else {
 
                    list ($elName, $elValue) = array_map('trim', explode('=', $elements[$i]));
 
                }
 
                $elName = strtolower($elName);
 
                if ('secure' == $elName) {
 
                    $cookie['secure'] = true;
 
                } elseif ('expires' == $elName) {
 
                    $cookie['expires'] = str_replace('"', '', $elValue);
 
                } elseif ('path' == $elName || 'domain' == $elName) {
 
                    $cookie[$elName] = urldecode($elValue);
 
                } else {
 
                    $cookie[$elName] = $elValue;
 
                }
 
            }
 
        }
 
        $this->_cookies[] = $cookie;
 
    }
 

	
 

	
 
   /**
 
    * Read a part of response body encoded with chunked Transfer-Encoding
 
    * 
 
    * @access private
 
    * @return string
 
    */
 
    function _readChunked()
 
    {
 
        // at start of the next chunk?
 
        if (0 == $this->_chunkLength) {
 
            $line = $this->_sock->readLine();
 
            if (preg_match('/^([0-9a-f]+)/i', $line, $matches)) {
 
                $this->_chunkLength = hexdec($matches[1]); 
 
                // Chunk with zero length indicates the end
 
                if (0 == $this->_chunkLength) {
 
                    $this->_sock->readLine(); // make this an eof()
 
                    return '';
 
                }
 
            } else {
 
                return '';
 
            }
 
        }
 
        $data = $this->_sock->read($this->_chunkLength);
 
        $this->_chunkLength -= HTTP_REQUEST_MBSTRING? mb_strlen($data, 'iso-8859-1'): strlen($data);
 
        if (0 == $this->_chunkLength) {
 
            $this->_sock->readLine(); // Trailing CRLF
 
        }
 
        return $data;
 
    }
 

	
 

	
 
   /**
 
    * Notifies all registered listeners of an event.
 
    * 
 
    * @param    string  Event name
 
    * @param    mixed   Additional data
 
    * @access   private
 
    * @see HTTP_Request::_notify()
 
    */
 
    function _notify($event, $data = null)
 
    {
 
        foreach (array_keys($this->_listeners) as $id) {
 
            $this->_listeners[$id]->update($this, $event, $data);
 
        }
 
    }
 

	
 

	
 
   /**
 
    * Decodes the message-body encoded by gzip
 
    *
 
    * The real decoding work is done by gzinflate() built-in function, this
 
    * method only parses the header and checks data for compliance with
 
    * RFC 1952  
 
    *
 
    * @access   private
 
    * @param    string  gzip-encoded data
 
    * @return   string  decoded data
 
    */
 
    function _decodeGzip($data)
 
    {
 
        if (HTTP_REQUEST_MBSTRING) {
 
            $oldEncoding = mb_internal_encoding();
 
            mb_internal_encoding('iso-8859-1');
 
        }
 
        $length = strlen($data);
 
        // If it doesn't look like gzip-encoded data, don't bother
 
        if (18 > $length || strcmp(substr($data, 0, 2), "\x1f\x8b")) {
 
            return $data;
 
        }
 
        $method = ord(substr($data, 2, 1));
 
        if (8 != $method) {
 
            return PEAR::raiseError('_decodeGzip(): unknown compression method', HTTP_REQUEST_ERROR_GZIP_METHOD);
 
        }
 
        $flags = ord(substr($data, 3, 1));
 
        if ($flags & 224) {
 
            return PEAR::raiseError('_decodeGzip(): reserved bits are set', HTTP_REQUEST_ERROR_GZIP_DATA);
 
        }
 

	
 
        // header is 10 bytes minimum. may be longer, though.
 
        $headerLength = 10;
 
        // extra fields, need to skip 'em
 
        if ($flags & 4) {
 
            if ($length - $headerLength - 2 < 8) {
 
                return PEAR::raiseError('_decodeGzip(): data too short', HTTP_REQUEST_ERROR_GZIP_DATA);
 
            }
 
            $extraLength = unpack('v', substr($data, 10, 2));
 
            if ($length - $headerLength - 2 - $extraLength[1] < 8) {
 
                return PEAR::raiseError('_decodeGzip(): data too short', HTTP_REQUEST_ERROR_GZIP_DATA);
 
            }
 
            $headerLength += $extraLength[1] + 2;
 
        }
 
        // file name, need to skip that
 
        if ($flags & 8) {
 
            if ($length - $headerLength - 1 < 8) {
 
                return PEAR::raiseError('_decodeGzip(): data too short', HTTP_REQUEST_ERROR_GZIP_DATA);
 
            }
 
            $filenameLength = strpos(substr($data, $headerLength), chr(0));
 
            if (false === $filenameLength || $length - $headerLength - $filenameLength - 1 < 8) {
 
                return PEAR::raiseError('_decodeGzip(): data too short', HTTP_REQUEST_ERROR_GZIP_DATA);
 
            }
 
            $headerLength += $filenameLength + 1;
 
        }
 
        // comment, need to skip that also
 
        if ($flags & 16) {
 
            if ($length - $headerLength - 1 < 8) {
 
                return PEAR::raiseError('_decodeGzip(): data too short', HTTP_REQUEST_ERROR_GZIP_DATA);
 
            }
 
            $commentLength = strpos(substr($data, $headerLength), chr(0));
 
            if (false === $commentLength || $length - $headerLength - $commentLength - 1 < 8) {
 
                return PEAR::raiseError('_decodeGzip(): data too short', HTTP_REQUEST_ERROR_GZIP_DATA);
 
            }
 
            $headerLength += $commentLength + 1;
 
        }
 
        // have a CRC for header. let's check
 
        if ($flags & 1) {
 
            if ($length - $headerLength - 2 < 8) {
 
                return PEAR::raiseError('_decodeGzip(): data too short', HTTP_REQUEST_ERROR_GZIP_DATA);
 
            }
 
            $crcReal   = 0xffff & crc32(substr($data, 0, $headerLength));
 
            $crcStored = unpack('v', substr($data, $headerLength, 2));
 
            if ($crcReal != $crcStored[1]) {
 
                return PEAR::raiseError('_decodeGzip(): header CRC check failed', HTTP_REQUEST_ERROR_GZIP_CRC);
 
            }
 
            $headerLength += 2;
 
        }
 
        // unpacked data CRC and size at the end of encoded data
 
        $tmp = unpack('V2', substr($data, -8));
 
        $dataCrc  = $tmp[1];
 
        $dataSize = $tmp[2];
 

	
 
        // finally, call the gzinflate() function
 
        $unpacked = @gzinflate(substr($data, $headerLength, -8), $dataSize);
 
        if (false === $unpacked) {
 
            return PEAR::raiseError('_decodeGzip(): gzinflate() call failed', HTTP_REQUEST_ERROR_GZIP_READ);
 
        } elseif ($dataSize != strlen($unpacked)) {
 
            return PEAR::raiseError('_decodeGzip(): data size check failed', HTTP_REQUEST_ERROR_GZIP_READ);
 
        } elseif ((0xffffffff & $dataCrc) != (0xffffffff & crc32($unpacked))) {
 
            return PEAR::raiseError('_decodeGzip(): data CRC check failed', HTTP_REQUEST_ERROR_GZIP_CRC);
 
        }
 
        if (HTTP_REQUEST_MBSTRING) {
 
            mb_internal_encoding($oldEncoding);
 
        }
 
        return $unpacked;
 
    }
 
} // End class HTTP_Response
 
?>
components/com_morfeoshow/tpl/resources/phpFlickr/PEAR/HTTP/Request/Listener.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
 * Listener for HTTP_Request and HTTP_Response objects
 
 *
 
 * PHP versions 4 and 5
 
 * 
 
 * LICENSE:
 
 *
 
 * Copyright (c) 2002-2007, Richard Heyes
 
 * All rights reserved.
 
 *
 
 * Redistribution and use in source and binary forms, with or without
 
 * modification, are permitted provided that the following conditions
 
 * are met:
 
 *
 
 * o Redistributions of source code must retain the above copyright
 
 *   notice, this list of conditions and the following disclaimer.
 
 * o Redistributions in binary form must reproduce the above copyright
 
 *   notice, this list of conditions and the following disclaimer in the
 
 *   documentation and/or other materials provided with the distribution.
 
 * o The names of the authors may not be used to endorse or promote
 
 *   products derived from this software without specific prior written
 
 *   permission.
 
 *
 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 *
 
 * @category    HTTP
 
 * @package     HTTP_Request
 
 * @author      Alexey Borzov <avb@php.net>
 
 * @copyright   2002-2007 Richard Heyes
 
 * @license     http://opensource.org/licenses/bsd-license.php New BSD License
 
 * @version     CVS: $Id: Listener.php 127 2008-01-17 20:21:37Z dcoulter $
 
 * @link        http://pear.php.net/package/HTTP_Request/ 
 
 */
 

	
 
/**
 
 * Listener for HTTP_Request and HTTP_Response objects
 
 *
 
 * This class implements the Observer part of a Subject-Observer
 
 * design pattern.
 
 *
 
 * @category    HTTP
 
 * @package     HTTP_Request
 
 * @author      Alexey Borzov <avb@php.net>
 
 * @version     Release: 1.4.2
 
 */
 
class HTTP_Request_Listener 
 
{
 
   /**
 
    * A listener's identifier
 
    * @var string
 
    */
 
    var $_id;
 

	
 
   /**
 
    * Constructor, sets the object's identifier
 
    *
 
    * @access public
 
    */
 
    function HTTP_Request_Listener()
 
    {
 
        $this->_id = md5(uniqid('http_request_', 1));
 
    }
 

	
 

	
 
   /**
 
    * Returns the listener's identifier
 
    *
 
    * @access public
 
    * @return string
 
    */
 
    function getId()
 
    {
 
        return $this->_id;
 
    }
 

	
 

	
 
   /**
 
    * This method is called when Listener is notified of an event
 
    *
 
    * @access   public
 
    * @param    object  an object the listener is attached to
 
    * @param    string  Event name
 
    * @param    mixed   Additional data
 
    * @abstract
 
    */
 
    function update(&$subject, $event, $data = null)
 
    {
 
        echo "Notified of event: '$event'\n";
 
        if (null !== $data) {
 
            echo "Additional data: ";
 
            var_dump($data);
 
        }
 
    }
 
}
 
?>
components/com_morfeoshow/tpl/resources/phpFlickr/PEAR/HTTP/Request/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/phpFlickr/PEAR/HTTP/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/phpFlickr/PEAR/Net/Socket.php
Show inline comments
 
new file 100644
 
<?php
 
//
 
// +----------------------------------------------------------------------+
 
// | PHP Version 4                                                        |
 
// +----------------------------------------------------------------------+
 
// | Copyright (c) 1997-2003 The PHP Group                                |
 
// +----------------------------------------------------------------------+
 
// | This source file is subject to version 2.0 of the PHP license,       |
 
// | that is bundled with this package in the file LICENSE, and is        |
 
// | available at through the world-wide-web at                           |
 
// | http://www.php.net/license/2_02.txt.                                 |
 
// | If you did not receive a copy of the PHP license and are unable to   |
 
// | obtain it through the world-wide-web, please send a note to          |
 
// | license@php.net so we can mail you a copy immediately.               |
 
// +----------------------------------------------------------------------+
 
// | Authors: Stig Bakken <ssb@php.net>                                   |
 
// |          Chuck Hagenbuch <chuck@horde.org>                           |
 
// +----------------------------------------------------------------------+
 
//
 
// $Id: Socket.php 32 2005-08-01 06:21:02Z dancoulter $
 

	
 
require_once 'PEAR.php';
 

	
 
define('NET_SOCKET_READ',  1);
 
define('NET_SOCKET_WRITE', 2);
 
define('NET_SOCKET_ERROR', 3);
 

	
 
/**
 
 * Generalized Socket class.
 
 *
 
 * @version 1.1
 
 * @author Stig Bakken <ssb@php.net>
 
 * @author Chuck Hagenbuch <chuck@horde.org>
 
 */
 
class Net_Socket extends PEAR {
 

	
 
    /**
 
     * Socket file pointer.
 
     * @var resource $fp
 
     */
 
    var $fp = null;
 

	
 
    /**
 
     * Whether the socket is blocking. Defaults to true.
 
     * @var boolean $blocking
 
     */
 
    var $blocking = true;
 

	
 
    /**
 
     * Whether the socket is persistent. Defaults to false.
 
     * @var boolean $persistent
 
     */
 
    var $persistent = false;
 

	
 
    /**
 
     * The IP address to connect to.
 
     * @var string $addr
 
     */
 
    var $addr = '';
 

	
 
    /**
 
     * The port number to connect to.
 
     * @var integer $port
 
     */
 
    var $port = 0;
 

	
 
    /**
 
     * Number of seconds to wait on socket connections before assuming
 
     * there's no more data. Defaults to no timeout.
 
     * @var integer $timeout
 
     */
 
    var $timeout = false;
 

	
 
    /**
 
     * Number of bytes to read at a time in readLine() and
 
     * readAll(). Defaults to 2048.
 
     * @var integer $lineLength
 
     */
 
    var $lineLength = 2048;
 

	
 
    /**
 
     * Connect to the specified port. If called when the socket is
 
     * already connected, it disconnects and connects again.
 
     *
 
     * @param string  $addr        IP address or host name.
 
     * @param integer $port        TCP port number.
 
     * @param boolean $persistent  (optional) Whether the connection is
 
     *                             persistent (kept open between requests
 
     *                             by the web server).
 
     * @param integer $timeout     (optional) How long to wait for data.
 
     * @param array   $options     See options for stream_context_create.
 
     *
 
     * @access public
 
     *
 
     * @return boolean | PEAR_Error  True on success or a PEAR_Error on failure.
 
     */
 
    function connect($addr, $port = 0, $persistent = null, $timeout = null, $options = null)
 
    {
 
        if (is_resource($this->fp)) {
 
            @fclose($this->fp);
 
            $this->fp = null;
 
        }
 

	
 
        if (!$addr) {
 
            return $this->raiseError('$addr cannot be empty');
 
        } elseif (strspn($addr, '.0123456789') == strlen($addr) ||
 
                  strstr($addr, '/') !== false) {
 
            $this->addr = $addr;
 
        } else {
 
            $this->addr = @gethostbyname($addr);
 
        }
 

	
 
        $this->port = $port % 65536;
 

	
 
        if ($persistent !== null) {
 
            $this->persistent = $persistent;
 
        }
 

	
 
        if ($timeout !== null) {
 
            $this->timeout = $timeout;
 
        }
 

	
 
        $openfunc = $this->persistent ? 'pfsockopen' : 'fsockopen';
 
        $errno = 0;
 
        $errstr = '';
 
        if ($options && function_exists('stream_context_create')) {
 
            if ($this->timeout) {
 
                $timeout = $this->timeout;
 
            } else {
 
                $timeout = 0;
 
            }
 
            $context = stream_context_create($options);
 
            $fp = @$openfunc($this->addr, $this->port, $errno, $errstr, $timeout, $context);
 
        } else {
 
            if ($this->timeout) {
 
                $fp = @$openfunc($this->addr, $this->port, $errno, $errstr, $this->timeout);
 
            } else {
 
                $fp = @$openfunc($this->addr, $this->port, $errno, $errstr);
 
            }
 
        }
 

	
 
        if (!$fp) {
 
            return $this->raiseError($errstr, $errno);
 
        }
 

	
 
        $this->fp = $fp;
 

	
 
        return $this->setBlocking($this->blocking);
 
    }
 

	
 
    /**
 
     * Disconnects from the peer, closes the socket.
 
     *
 
     * @access public
 
     * @return mixed true on success or an error object otherwise
 
     */
 
    function disconnect()
 
    {
 
        if (!is_resource($this->fp)) {
 
            return $this->raiseError('not connected');
 
        }
 

	
 
        @fclose($this->fp);
 
        $this->fp = null;
 
        return true;
 
    }
 

	
 
    /**
 
     * Find out if the socket is in blocking mode.
 
     *
 
     * @access public
 
     * @return boolean  The current blocking mode.
 
     */
 
    function isBlocking()
 
    {
 
        return $this->blocking;
 
    }
 

	
 
    /**
 
     * Sets whether the socket connection should be blocking or
 
     * not. A read call to a non-blocking socket will return immediately
 
     * if there is no data available, whereas it will block until there
 
     * is data for blocking sockets.
 
     *
 
     * @param boolean $mode  True for blocking sockets, false for nonblocking.
 
     * @access public
 
     * @return mixed true on success or an error object otherwise
 
     */
 
    function setBlocking($mode)
 
    {
 
        if (!is_resource($this->fp)) {
 
            return $this->raiseError('not connected');
 
        }
 

	
 
        $this->blocking = $mode;
 
        socket_set_blocking($this->fp, $this->blocking);
 
        return true;
 
    }
 

	
 
    /**
 
     * Sets the timeout value on socket descriptor,
 
     * expressed in the sum of seconds and microseconds
 
     *
 
     * @param integer $seconds  Seconds.
 
     * @param integer $microseconds  Microseconds.
 
     * @access public
 
     * @return mixed true on success or an error object otherwise
 
     */
 
    function setTimeout($seconds, $microseconds)
 
    {
 
        if (!is_resource($this->fp)) {
 
            return $this->raiseError('not connected');
 
        }
 

	
 
        return socket_set_timeout($this->fp, $seconds, $microseconds);
 
    }
 

	
 
    /**
 
     * Returns information about an existing socket resource.
 
     * Currently returns four entries in the result array:
 
     *
 
     * <p>
 
     * timed_out (bool) - The socket timed out waiting for data<br>
 
     * blocked (bool) - The socket was blocked<br>
 
     * eof (bool) - Indicates EOF event<br>
 
     * unread_bytes (int) - Number of bytes left in the socket buffer<br>
 
     * </p>
 
     *
 
     * @access public
 
     * @return mixed Array containing information about existing socket resource or an error object otherwise
 
     */
 
    function getStatus()
 
    {
 
        if (!is_resource($this->fp)) {
 
            return $this->raiseError('not connected');
 
        }
 

	
 
        return socket_get_status($this->fp);
 
    }
 

	
 
    /**
 
     * Get a specified line of data
 
     *
 
     * @access public
 
     * @return $size bytes of data from the socket, or a PEAR_Error if
 
     *         not connected.
 
     */
 
    function gets($size)
 
    {
 
        if (!is_resource($this->fp)) {
 
            return $this->raiseError('not connected');
 
        }
 

	
 
        return @fgets($this->fp, $size);
 
    }
 

	
 
    /**
 
     * Read a specified amount of data. This is guaranteed to return,
 
     * and has the added benefit of getting everything in one fread()
 
     * chunk; if you know the size of the data you're getting
 
     * beforehand, this is definitely the way to go.
 
     *
 
     * @param integer $size  The number of bytes to read from the socket.
 
     * @access public
 
     * @return $size bytes of data from the socket, or a PEAR_Error if
 
     *         not connected.
 
     */
 
    function read($size)
 
    {
 
        if (!is_resource($this->fp)) {
 
            return $this->raiseError('not connected');
 
        }
 

	
 
        return @fread($this->fp, $size);
 
    }
 

	
 
    /**
 
     * Write a specified amount of data.
 
     *
 
     * @param string  $data       Data to write.
 
     * @param integer $blocksize  Amount of data to write at once.
 
     *                            NULL means all at once.
 
     *
 
     * @access public
 
     * @return mixed true on success or an error object otherwise
 
     */
 
    function write($data, $blocksize = null)
 
    {
 
        if (!is_resource($this->fp)) {
 
            return $this->raiseError('not connected');
 
        }
 

	
 
        if (is_null($blocksize) && !OS_WINDOWS) {
 
            return fwrite($this->fp, $data);
 
        } else {
 
            if (is_null($blocksize)) {
 
                $blocksize = 1024;
 
            }
 

	
 
            $pos = 0;
 
            $size = strlen($data);
 
            while ($pos < $size) {
 
                $written = @fwrite($this->fp, substr($data, $pos, $blocksize));
 
                if ($written === false) {
 
                    return false;
 
                }
 
                $pos += $written;
 
            }
 

	
 
            return $pos;
 
        }
 
    }
 

	
 
    /**
 
     * Write a line of data to the socket, followed by a trailing "\r\n".
 
     *
 
     * @access public
 
     * @return mixed fputs result, or an error
 
     */
 
    function writeLine($data)
 
    {
 
        if (!is_resource($this->fp)) {
 
            return $this->raiseError('not connected');
 
        }
 

	
 
        return fwrite($this->fp, $data . "\r\n");
 
    }
 

	
 
    /**
 
     * Tests for end-of-file on a socket descriptor.
 
     *
 
     * @access public
 
     * @return bool
 
     */
 
    function eof()
 
    {
 
        return (is_resource($this->fp) && feof($this->fp));
 
    }
 

	
 
    /**
 
     * Reads a byte of data
 
     *
 
     * @access public
 
     * @return 1 byte of data from the socket, or a PEAR_Error if
 
     *         not connected.
 
     */
 
    function readByte()
 
    {
 
        if (!is_resource($this->fp)) {
 
            return $this->raiseError('not connected');
 
        }
 

	
 
        return ord(@fread($this->fp, 1));
 
    }
 

	
 
    /**
 
     * Reads a word of data
 
     *
 
     * @access public
 
     * @return 1 word of data from the socket, or a PEAR_Error if
 
     *         not connected.
 
     */
 
    function readWord()
 
    {
 
        if (!is_resource($this->fp)) {
 
            return $this->raiseError('not connected');
 
        }
 

	
 
        $buf = @fread($this->fp, 2);
 
        return (ord($buf[0]) + (ord($buf[1]) << 8));
 
    }
 

	
 
    /**
 
     * Reads an int of data
 
     *
 
     * @access public
 
     * @return integer  1 int of data from the socket, or a PEAR_Error if
 
     *                  not connected.
 
     */
 
    function readInt()
 
    {
 
        if (!is_resource($this->fp)) {
 
            return $this->raiseError('not connected');
 
        }
 

	
 
        $buf = @fread($this->fp, 4);
 
        return (ord($buf[0]) + (ord($buf[1]) << 8) +
 
                (ord($buf[2]) << 16) + (ord($buf[3]) << 24));
 
    }
 

	
 
    /**
 
     * Reads a zero-terminated string of data
 
     *
 
     * @access public
 
     * @return string, or a PEAR_Error if
 
     *         not connected.
 
     */
 
    function readString()
 
    {
 
        if (!is_resource($this->fp)) {
 
            return $this->raiseError('not connected');
 
        }
 

	
 
        $string = '';
 
        while (($char = @fread($this->fp, 1)) != "\x00")  {
 
            $string .= $char;
 
        }
 
        return $string;
 
    }
 

	
 
    /**
 
     * Reads an IP Address and returns it in a dot formated string
 
     *
 
     * @access public
 
     * @return Dot formated string, or a PEAR_Error if
 
     *         not connected.
 
     */
 
    function readIPAddress()
 
    {
 
        if (!is_resource($this->fp)) {
 
            return $this->raiseError('not connected');
 
        }
 

	
 
        $buf = @fread($this->fp, 4);
 
        return sprintf("%s.%s.%s.%s", ord($buf[0]), ord($buf[1]),
 
                       ord($buf[2]), ord($buf[3]));
 
    }
 

	
 
    /**
 
     * Read until either the end of the socket or a newline, whichever
 
     * comes first. Strips the trailing newline from the returned data.
 
     *
 
     * @access public
 
     * @return All available data up to a newline, without that
 
     *         newline, or until the end of the socket, or a PEAR_Error if
 
     *         not connected.
 
     */
 
    function readLine()
 
    {
 
        if (!is_resource($this->fp)) {
 
            return $this->raiseError('not connected');
 
        }
 

	
 
        $line = '';
 
        $timeout = time() + $this->timeout;
 
        while (!feof($this->fp) && (!$this->timeout || time() < $timeout)) {
 
            $line .= @fgets($this->fp, $this->lineLength);
 
            if (substr($line, -1) == "\n") {
 
                return rtrim($line, "\r\n");
 
            }
 
        }
 
        return $line;
 
    }
 

	
 
    /**
 
     * Read until the socket closes, or until there is no more data in
 
     * the inner PHP buffer. If the inner buffer is empty, in blocking
 
     * mode we wait for at least 1 byte of data. Therefore, in
 
     * blocking mode, if there is no data at all to be read, this
 
     * function will never exit (unless the socket is closed on the
 
     * remote end).
 
     *
 
     * @access public
 
     *
 
     * @return string  All data until the socket closes, or a PEAR_Error if
 
     *                 not connected.
 
     */
 
    function readAll()
 
    {
 
        if (!is_resource($this->fp)) {
 
            return $this->raiseError('not connected');
 
        }
 

	
 
        $data = '';
 
        while (!feof($this->fp)) {
 
            $data .= @fread($this->fp, $this->lineLength);
 
        }
 
        return $data;
 
    }
 

	
 
    /**
 
     * Runs the equivalent of the select() system call on the socket
 
     * with a timeout specified by tv_sec and tv_usec.
 
     *
 
     * @param integer $state    Which of read/write/error to check for.
 
     * @param integer $tv_sec   Number of seconds for timeout.
 
     * @param integer $tv_usec  Number of microseconds for timeout.
 
     *
 
     * @access public
 
     * @return False if select fails, integer describing which of read/write/error
 
     *         are ready, or PEAR_Error if not connected.
 
     */
 
    function select($state, $tv_sec, $tv_usec = 0)
 
    {
 
        if (!is_resource($this->fp)) {
 
            return $this->raiseError('not connected');
 
        }
 

	
 
        $read = null;
 
        $write = null;
 
        $except = null;
 
        if ($state & NET_SOCKET_READ) {
 
            $read[] = $this->fp;
 
        }
 
        if ($state & NET_SOCKET_WRITE) {
 
            $write[] = $this->fp;
 
        }
 
        if ($state & NET_SOCKET_ERROR) {
 
            $except[] = $this->fp;
 
        }
 
        if (false === ($sr = stream_select($read, $write, $except, $tv_sec, $tv_usec))) {
 
            return false;
 
        }
 

	
 
        $result = 0;
 
        if (count($read)) {
 
            $result |= NET_SOCKET_READ;
 
        }
 
        if (count($write)) {
 
            $result |= NET_SOCKET_WRITE;
 
        }
 
        if (count($except)) {
 
            $result |= NET_SOCKET_ERROR;
 
        }
 
        return $result;
 
    }
 

	
 
}
components/com_morfeoshow/tpl/resources/phpFlickr/PEAR/Net/URL.php
Show inline comments
 
new file 100644
 
<?php
 
// +-----------------------------------------------------------------------+
 
// | Copyright (c) 2002-2004, Richard Heyes                                |
 
// | All rights reserved.                                                  |
 
// |                                                                       |
 
// | Redistribution and use in source and binary forms, with or without    |
 
// | modification, are permitted provided that the following conditions    |
 
// | are met:                                                              |
 
// |                                                                       |
 
// | o Redistributions of source code must retain the above copyright      |
 
// |   notice, this list of conditions and the following disclaimer.       |
 
// | o Redistributions in binary form must reproduce the above copyright   |
 
// |   notice, this list of conditions and the following disclaimer in the |
 
// |   documentation and/or other materials provided with the distribution.|
 
// | o The names of the authors may not be used to endorse or promote      |
 
// |   products derived from this software without specific prior written  |
 
// |   permission.                                                         |
 
// |                                                                       |
 
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |
 
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |
 
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
 
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |
 
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
 
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |
 
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
 
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
 
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |
 
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
 
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |
 
// |                                                                       |
 
// +-----------------------------------------------------------------------+
 
// | Author: Richard Heyes <richard at php net>                            |
 
// +-----------------------------------------------------------------------+
 
//
 
// $Id: URL.php 32 2005-08-01 06:21:02Z dancoulter $
 
//
 
// Net_URL Class
 

	
 
class Net_URL
 
{
 
    /**
 
    * Full url
 
    * @var string
 
    */
 
    var $url;
 

	
 
    /**
 
    * Protocol
 
    * @var string
 
    */
 
    var $protocol;
 

	
 
    /**
 
    * Username
 
    * @var string
 
    */
 
    var $username;
 

	
 
    /**
 
    * Password
 
    * @var string
 
    */
 
    var $password;
 

	
 
    /**
 
    * Host
 
    * @var string
 
    */
 
    var $host;
 

	
 
    /**
 
    * Port
 
    * @var integer
 
    */
 
    var $port;
 

	
 
    /**
 
    * Path
 
    * @var string
 
    */
 
    var $path;
 

	
 
    /**
 
    * Query string
 
    * @var array
 
    */
 
    var $querystring;
 

	
 
    /**
 
    * Anchor
 
    * @var string
 
    */
 
    var $anchor;
 

	
 
    /**
 
    * Whether to use []
 
    * @var bool
 
    */
 
    var $useBrackets;
 

	
 
    /**
 
    * PHP4 Constructor
 
    *
 
    * @see __construct()
 
    */
 
    function Net_URL($url = null, $useBrackets = true)
 
    {
 
        $this->__construct($url, $useBrackets);
 
    }
 

	
 
    /**
 
    * PHP5 Constructor
 
    *
 
    * Parses the given url and stores the various parts
 
    * Defaults are used in certain cases
 
    *
 
    * @param string $url         Optional URL
 
    * @param bool   $useBrackets Whether to use square brackets when
 
    *                            multiple querystrings with the same name
 
    *                            exist
 
    */
 
    function __construct($url = null, $useBrackets = true)
 
    {
 
        $HTTP_SERVER_VARS  = !empty($_SERVER) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
 

	
 
        $this->useBrackets = $useBrackets;
 
        $this->url         = $url;
 
        $this->user        = '';
 
        $this->pass        = '';
 
        $this->host        = '';
 
        $this->port        = 80;
 
        $this->path        = '';
 
        $this->querystring = array();
 
        $this->anchor      = '';
 

	
 
        // Only use defaults if not an absolute URL given
 
        if (!preg_match('/^[a-z0-9]+:\/\//i', $url)) {
 

	
 
            $this->protocol    = (@$HTTP_SERVER_VARS['HTTPS'] == 'on' ? 'https' : 'http');
 

	
 
            /**
 
            * Figure out host/port
 
            */
 
            if (!empty($HTTP_SERVER_VARS['HTTP_HOST']) AND preg_match('/^(.*)(:([0-9]+))?$/U', $HTTP_SERVER_VARS['HTTP_HOST'], $matches)) {
 
                $host = $matches[1];
 
                if (!empty($matches[3])) {
 
                    $port = $matches[3];
 
                } else {
 
                    $port = $this->getStandardPort($this->protocol);
 
                }
 
            }
 

	
 
            $this->user        = '';
 
            $this->pass        = '';
 
            $this->host        = !empty($host) ? $host : (isset($HTTP_SERVER_VARS['SERVER_NAME']) ? $HTTP_SERVER_VARS['SERVER_NAME'] : 'localhost');
 
            $this->port        = !empty($port) ? $port : (isset($HTTP_SERVER_VARS['SERVER_PORT']) ? $HTTP_SERVER_VARS['SERVER_PORT'] : $this->getStandardPort($this->protocol));
 
            $this->path        = !empty($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : '/';
 
            $this->querystring = isset($HTTP_SERVER_VARS['QUERY_STRING']) ? $this->_parseRawQuerystring($HTTP_SERVER_VARS['QUERY_STRING']) : null;
 
            $this->anchor      = '';
 
        }
 

	
 
        // Parse the url and store the various parts
 
        if (!empty($url)) {
 
            $urlinfo = parse_url($url);
 

	
 
            // Default querystring
 
            $this->querystring = array();
 

	
 
            foreach ($urlinfo as $key => $value) {
 
                switch ($key) {
 
                    case 'scheme':
 
                        $this->protocol = $value;
 
                        $this->port     = $this->getStandardPort($value);
 
                        break;
 

	
 
                    case 'user':
 
                    case 'pass':
 
                    case 'host':
 
                    case 'port':
 
                        $this->$key = $value;
 
                        break;
 

	
 
                    case 'path':
 
                        if ($value{0} == '/') {
 
                            $this->path = $value;
 
                        } else {
 
                            $path = dirname($this->path) == DIRECTORY_SEPARATOR ? '' : dirname($this->path);
 
                            $this->path = sprintf('%s/%s', $path, $value);
 
                        }
 
                        break;
 

	
 
                    case 'query':
 
                        $this->querystring = $this->_parseRawQueryString($value);
 
                        break;
 

	
 
                    case 'fragment':
 
                        $this->anchor = $value;
 
                        break;
 
                }
 
            }
 
        }
 
    }
 

	
 
    /**
 
    * Returns full url
 
    *
 
    * @return string Full url
 
    * @access public
 
    */
 
    function getURL()
 
    {
 
        $querystring = $this->getQueryString();
 

	
 
        $this->url = $this->protocol . '://'
 
                   . $this->user . (!empty($this->pass) ? ':' : '')
 
                   . $this->pass . (!empty($this->user) ? '@' : '')
 
                   . $this->host . ($this->port == $this->getStandardPort($this->protocol) ? '' : ':' . $this->port)
 
                   . $this->path
 
                   . (!empty($querystring) ? '?' . $querystring : '')
 
                   . (!empty($this->anchor) ? '#' . $this->anchor : '');
 

	
 
        return $this->url;
 
    }
 

	
 
    /**
 
    * Adds a querystring item
 
    *
 
    * @param  string $name       Name of item
 
    * @param  string $value      Value of item
 
    * @param  bool   $preencoded Whether value is urlencoded or not, default = not
 
    * @access public
 
    */
 
    function addQueryString($name, $value, $preencoded = false)
 
    {
 
        if ($preencoded) {
 
            $this->querystring[$name] = $value;
 
        } else {
 
            $this->querystring[$name] = is_array($value) ? array_map('rawurlencode', $value): rawurlencode($value);
 
        }
 
    }
 

	
 
    /**
 
    * Removes a querystring item
 
    *
 
    * @param  string $name Name of item
 
    * @access public
 
    */
 
    function removeQueryString($name)
 
    {
 
        if (isset($this->querystring[$name])) {
 
            unset($this->querystring[$name]);
 
        }
 
    }
 

	
 
    /**
 
    * Sets the querystring to literally what you supply
 
    *
 
    * @param  string $querystring The querystring data. Should be of the format foo=bar&x=y etc
 
    * @access public
 
    */
 
    function addRawQueryString($querystring)
 
    {
 
        $this->querystring = $this->_parseRawQueryString($querystring);
 
    }
 

	
 
    /**
 
    * Returns flat querystring
 
    *
 
    * @return string Querystring
 
    * @access public
 
    */
 
    function getQueryString()
 
    {
 
        if (!empty($this->querystring)) {
 
            foreach ($this->querystring as $name => $value) {
 
                if (is_array($value)) {
 
                    foreach ($value as $k => $v) {
 
                        $querystring[] = $this->useBrackets ? sprintf('%s[%s]=%s', $name, $k, $v) : ($name . '=' . $v);
 
                    }
 
                } elseif (!is_null($value)) {
 
                    $querystring[] = $name . '=' . $value;
 
                } else {
 
                    $querystring[] = $name;
 
                }
 
            }
 
            $querystring = implode(ini_get('arg_separator.output'), $querystring);
 
        } else {
 
            $querystring = '';
 
        }
 

	
 
        return $querystring;
 
    }
 

	
 
    /**
 
    * Parses raw querystring and returns an array of it
 
    *
 
    * @param  string  $querystring The querystring to parse
 
    * @return array                An array of the querystring data
 
    * @access private
 
    */
 
    function _parseRawQuerystring($querystring)
 
    {
 
        $parts  = preg_split('/[' . preg_quote(ini_get('arg_separator.input'), '/') . ']/', $querystring, -1, PREG_SPLIT_NO_EMPTY);
 
        $return = array();
 

	
 
        foreach ($parts as $part) {
 
            if (strpos($part, '=') !== false) {
 
                $value = substr($part, strpos($part, '=') + 1);
 
                $key   = substr($part, 0, strpos($part, '='));
 
            } else {
 
                $value = null;
 
                $key   = $part;
 
            }
 
            if (substr($key, -2) == '[]') {
 
                $key = substr($key, 0, -2);
 
                if (@!is_array($return[$key])) {
 
                    $return[$key]   = array();
 
                    $return[$key][] = $value;
 
                } else {
 
                    $return[$key][] = $value;
 
                }
 
            } elseif (!$this->useBrackets AND !empty($return[$key])) {
 
                $return[$key]   = (array)$return[$key];
 
                $return[$key][] = $value;
 
            } else {
 
                $return[$key] = $value;
 
            }
 
        }
 

	
 
        return $return;
 
    }
 

	
 
    /**
 
    * Resolves //, ../ and ./ from a path and returns
 
    * the result. Eg:
 
    *
 
    * /foo/bar/../boo.php    => /foo/boo.php
 
    * /foo/bar/../../boo.php => /boo.php
 
    * /foo/bar/.././/boo.php => /foo/boo.php
 
    *
 
    * This method can also be called statically.
 
    *
 
    * @param  string $url URL path to resolve
 
    * @return string      The result
 
    */
 
    function resolvePath($path)
 
    {
 
        $path = explode('/', str_replace('//', '/', $path));
 

	
 
        for ($i=0; $i<count($path); $i++) {
 
            if ($path[$i] == '.') {
 
                unset($path[$i]);
 
                $path = array_values($path);
 
                $i--;
 

	
 
            } elseif ($path[$i] == '..' AND ($i > 1 OR ($i == 1 AND $path[0] != '') ) ) {
 
                unset($path[$i]);
 
                unset($path[$i-1]);
 
                $path = array_values($path);
 
                $i -= 2;
 

	
 
            } elseif ($path[$i] == '..' AND $i == 1 AND $path[0] == '') {
 
                unset($path[$i]);
 
                $path = array_values($path);
 
                $i--;
 

	
 
            } else {
 
                continue;
 
            }
 
        }
 

	
 
        return implode('/', $path);
 
    }
 

	
 
    /**
 
    * Returns the standard port number for a protocol
 
    *
 
    * @param  string  $scheme The protocol to lookup
 
    * @return integer         Port number or NULL if no scheme matches
 
    *
 
    * @author Philippe Jausions <Philippe.Jausions@11abacus.com>
 
    */
 
    function getStandardPort($scheme)
 
    {
 
        switch (strtolower($scheme)) {
 
            case 'http':    return 80;
 
            case 'https':   return 443;
 
            case 'ftp':     return 21;
 
            case 'imap':    return 143;
 
            case 'imaps':   return 993;
 
            case 'pop3':    return 110;
 
            case 'pop3s':   return 995;
 
            default:        return null;
 
       }
 
    }
 

	
 
    /**
 
    * Forces the URL to a particular protocol
 
    *
 
    * @param string  $protocol Protocol to force the URL to
 
    * @param integer $port     Optional port (standard port is used by default)
 
    */
 
    function setProtocol($protocol, $port = null)
 
    {
 
        $this->protocol = $protocol;
 
        $this->port = is_null($port) ? $this->getStandardPort() : $port;
 
    }
 

	
 
}
 
?>
components/com_morfeoshow/tpl/resources/phpFlickr/PEAR/Net/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/phpFlickr/PEAR/PEAR.php
Show inline comments
 
new file 100644
 
<?php
 
/**
 
 * PEAR, the PHP Extension and Application Repository
 
 *
 
 * PEAR class and PEAR_Error class
 
 *
 
 * PHP versions 4 and 5
 
 *
 
 * LICENSE: This source file is subject to version 3.0 of the PHP license
 
 * that is available through the world-wide-web at the following URI:
 
 * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
 
 * the PHP License and are unable to obtain it through the web, please
 
 * send a note to license@php.net so we can mail you a copy immediately.
 
 *
 
 * @category   pear
 
 * @package    PEAR
 
 * @author     Sterling Hughes <sterling@php.net>
 
 * @author     Stig Bakken <ssb@php.net>
 
 * @author     Tomas V.V.Cox <cox@idecnet.com>
 
 * @author     Greg Beaver <cellog@php.net>
 
 * @copyright  1997-2006 The PHP Group
 
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 
 * @version    CVS: $Id: PEAR.php 127 2008-01-17 20:21:37Z dcoulter $
 
 * @link       http://pear.php.net/package/PEAR
 
 * @since      File available since Release 0.1
 
 */
 

	
 
/**#@+
 
 * ERROR constants
 
 */
 
define('PEAR_ERROR_RETURN',     1);
 
define('PEAR_ERROR_PRINT',      2);
 
define('PEAR_ERROR_TRIGGER',    4);
 
define('PEAR_ERROR_DIE',        8);
 
define('PEAR_ERROR_CALLBACK',  16);
 
/**
 
 * WARNING: obsolete
 
 * @deprecated
 
 */
 
define('PEAR_ERROR_EXCEPTION', 32);
 
/**#@-*/
 
define('PEAR_ZE2', (function_exists('version_compare') &&
 
                    version_compare(zend_version(), "2-dev", "ge")));
 

	
 
if (substr(PHP_OS, 0, 3) == 'WIN') {
 
    define('OS_WINDOWS', true);
 
    define('OS_UNIX',    false);
 
    define('PEAR_OS',    'Windows');
 
} else {
 
    define('OS_WINDOWS', false);
 
    define('OS_UNIX',    true);
 
    define('PEAR_OS',    'Unix'); // blatant assumption
 
}
 

	
 
// instant backwards compatibility
 
if (!defined('PATH_SEPARATOR')) {
 
    if (OS_WINDOWS) {
 
        define('PATH_SEPARATOR', ';');
 
    } else {
 
        define('PATH_SEPARATOR', ':');
 
    }
 
}
 

	
 
$GLOBALS['_PEAR_default_error_mode']     = PEAR_ERROR_RETURN;
 
$GLOBALS['_PEAR_default_error_options']  = E_USER_NOTICE;
 
$GLOBALS['_PEAR_destructor_object_list'] = array();
 
$GLOBALS['_PEAR_shutdown_funcs']         = array();
 
$GLOBALS['_PEAR_error_handler_stack']    = array();
 

	
 
@ini_set('track_errors', true);
 

	
 
/**
 
 * Base class for other PEAR classes.  Provides rudimentary
 
 * emulation of destructors.
 
 *
 
 * If you want a destructor in your class, inherit PEAR and make a
 
 * destructor method called _yourclassname (same name as the
 
 * constructor, but with a "_" prefix).  Also, in your constructor you
 
 * have to call the PEAR constructor: $this->PEAR();.
 
 * The destructor method will be called without parameters.  Note that
 
 * at in some SAPI implementations (such as Apache), any output during
 
 * the request shutdown (in which destructors are called) seems to be
 
 * discarded.  If you need to get any debug information from your
 
 * destructor, use error_log(), syslog() or something similar.
 
 *
 
 * IMPORTANT! To use the emulated destructors you need to create the
 
 * objects by reference: $obj =& new PEAR_child;
 
 *
 
 * @category   pear
 
 * @package    PEAR
 
 * @author     Stig Bakken <ssb@php.net>
 
 * @author     Tomas V.V. Cox <cox@idecnet.com>
 
 * @author     Greg Beaver <cellog@php.net>
 
 * @copyright  1997-2006 The PHP Group
 
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 
 * @version    Release: 1.6.2
 
 * @link       http://pear.php.net/package/PEAR
 
 * @see        PEAR_Error
 
 * @since      Class available since PHP 4.0.2
 
 * @link        http://pear.php.net/manual/en/core.pear.php#core.pear.pear
 
 */
 
class PEAR
 
{
 
    // {{{ properties
 

	
 
    /**
 
     * Whether to enable internal debug messages.
 
     *
 
     * @var     bool
 
     * @access  private
 
     */
 
    var $_debug = false;
 

	
 
    /**
 
     * Default error mode for this object.
 
     *
 
     * @var     int
 
     * @access  private
 
     */
 
    var $_default_error_mode = null;
 

	
 
    /**
 
     * Default error options used for this object when error mode
 
     * is PEAR_ERROR_TRIGGER.
 
     *
 
     * @var     int
 
     * @access  private
 
     */
 
    var $_default_error_options = null;
 

	
 
    /**
 
     * Default error handler (callback) for this object, if error mode is
 
     * PEAR_ERROR_CALLBACK.
 
     *
 
     * @var     string
 
     * @access  private
 
     */
 
    var $_default_error_handler = '';
 

	
 
    /**
 
     * Which class to use for error objects.
 
     *
 
     * @var     string
 
     * @access  private
 
     */
 
    var $_error_class = 'PEAR_Error';
 

	
 
    /**
 
     * An array of expected errors.
 
     *
 
     * @var     array
 
     * @access  private
 
     */
 
    var $_expected_errors = array();
 

	
 
    // }}}
 

	
 
    // {{{ constructor
 

	
 
    /**
 
     * Constructor.  Registers this object in
 
     * $_PEAR_destructor_object_list for destructor emulation if a
 
     * destructor object exists.
 
     *
 
     * @param string $error_class  (optional) which class to use for
 
     *        error objects, defaults to PEAR_Error.
 
     * @access public
 
     * @return void
 
     */
 
    function PEAR($error_class = null)
 
    {
 
        $classname = strtolower(get_class($this));
 
        if ($this->_debug) {
 
            print "PEAR constructor called, class=$classname\n";
 
        }
 
        if ($error_class !== null) {
 
            $this->_error_class = $error_class;
 
        }
 
        while ($classname && strcasecmp($classname, "pear")) {
 
            $destructor = "_$classname";
 
            if (method_exists($this, $destructor)) {
 
                global $_PEAR_destructor_object_list;
 
                $_PEAR_destructor_object_list[] = &$this;
 
                if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
 
                    register_shutdown_function("_PEAR_call_destructors");
 
                    $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
 
                }
 
                break;
 
            } else {
 
                $classname = get_parent_class($classname);
 
            }
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ destructor
 

	
 
    /**
 
     * Destructor (the emulated type of...).  Does nothing right now,
 
     * but is included for forward compatibility, so subclass
 
     * destructors should always call it.
 
     *
 
     * See the note in the class desciption about output from
 
     * destructors.
 
     *
 
     * @access public
 
     * @return void
 
     */
 
    function _PEAR() {
 
        if ($this->_debug) {
 
            printf("PEAR destructor called, class=%s\n", strtolower(get_class($this)));
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ getStaticProperty()
 

	
 
    /**
 
    * If you have a class that's mostly/entirely static, and you need static
 
    * properties, you can use this method to simulate them. Eg. in your method(s)
 
    * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar');
 
    * You MUST use a reference, or they will not persist!
 
    *
 
    * @access public
 
    * @param  string $class  The calling classname, to prevent clashes
 
    * @param  string $var    The variable to retrieve.
 
    * @return mixed   A reference to the variable. If not set it will be
 
    *                 auto initialised to NULL.
 
    */
 
    function &getStaticProperty($class, $var)
 
    {
 
        static $properties;
 
        if (!isset($properties[$class])) {
 
            $properties[$class] = array();
 
        }
 
        if (!array_key_exists($var, $properties[$class])) {
 
            $properties[$class][$var] = null;
 
        }
 
        return $properties[$class][$var];
 
    }
 

	
 
    // }}}
 
    // {{{ registerShutdownFunc()
 

	
 
    /**
 
    * Use this function to register a shutdown method for static
 
    * classes.
 
    *
 
    * @access public
 
    * @param  mixed $func  The function name (or array of class/method) to call
 
    * @param  mixed $args  The arguments to pass to the function
 
    * @return void
 
    */
 
    function registerShutdownFunc($func, $args = array())
 
    {
 
        // if we are called statically, there is a potential
 
        // that no shutdown func is registered.  Bug #6445
 
        if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
 
            register_shutdown_function("_PEAR_call_destructors");
 
            $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
 
        }
 
        $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args);
 
    }
 

	
 
    // }}}
 
    // {{{ isError()
 

	
 
    /**
 
     * Tell whether a value is a PEAR error.
 
     *
 
     * @param   mixed $data   the value to test
 
     * @param   int   $code   if $data is an error object, return true
 
     *                        only if $code is a string and
 
     *                        $obj->getMessage() == $code or
 
     *                        $code is an integer and $obj->getCode() == $code
 
     * @access  public
 
     * @return  bool    true if parameter is an error
 
     */
 
    function isError($data, $code = null)
 
    {
 
        if (is_a($data, 'PEAR_Error')) {
 
            if (is_null($code)) {
 
                return true;
 
            } elseif (is_string($code)) {
 
                return $data->getMessage() == $code;
 
            } else {
 
                return $data->getCode() == $code;
 
            }
 
        }
 
        return false;
 
    }
 

	
 
    // }}}
 
    // {{{ setErrorHandling()
 

	
 
    /**
 
     * Sets how errors generated by this object should be handled.
 
     * Can be invoked both in objects and statically.  If called
 
     * statically, setErrorHandling sets the default behaviour for all
 
     * PEAR objects.  If called in an object, setErrorHandling sets
 
     * the default behaviour for that object.
 
     *
 
     * @param int $mode
 
     *        One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT,
 
     *        PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE,
 
     *        PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION.
 
     *
 
     * @param mixed $options
 
     *        When $mode is PEAR_ERROR_TRIGGER, this is the error level (one
 
     *        of E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR).
 
     *
 
     *        When $mode is PEAR_ERROR_CALLBACK, this parameter is expected
 
     *        to be the callback function or method.  A callback
 
     *        function is a string with the name of the function, a
 
     *        callback method is an array of two elements: the element
 
     *        at index 0 is the object, and the element at index 1 is
 
     *        the name of the method to call in the object.
 
     *
 
     *        When $mode is PEAR_ERROR_PRINT or PEAR_ERROR_DIE, this is
 
     *        a printf format string used when printing the error
 
     *        message.
 
     *
 
     * @access public
 
     * @return void
 
     * @see PEAR_ERROR_RETURN
 
     * @see PEAR_ERROR_PRINT
 
     * @see PEAR_ERROR_TRIGGER
 
     * @see PEAR_ERROR_DIE
 
     * @see PEAR_ERROR_CALLBACK
 
     * @see PEAR_ERROR_EXCEPTION
 
     *
 
     * @since PHP 4.0.5
 
     */
 

	
 
    function setErrorHandling($mode = null, $options = null)
 
    {
 
        if (isset($this) && is_a($this, 'PEAR')) {
 
            $setmode     = &$this->_default_error_mode;
 
            $setoptions  = &$this->_default_error_options;
 
        } else {
 
            $setmode     = &$GLOBALS['_PEAR_default_error_mode'];
 
            $setoptions  = &$GLOBALS['_PEAR_default_error_options'];
 
        }
 

	
 
        switch ($mode) {
 
            case PEAR_ERROR_EXCEPTION:
 
            case PEAR_ERROR_RETURN:
 
            case PEAR_ERROR_PRINT:
 
            case PEAR_ERROR_TRIGGER:
 
            case PEAR_ERROR_DIE:
 
            case null:
 
                $setmode = $mode;
 
                $setoptions = $options;
 
                break;
 

	
 
            case PEAR_ERROR_CALLBACK:
 
                $setmode = $mode;
 
                // class/object method callback
 
                if (is_callable($options)) {
 
                    $setoptions = $options;
 
                } else {
 
                    trigger_error("invalid error callback", E_USER_WARNING);
 
                }
 
                break;
 

	
 
            default:
 
                trigger_error("invalid error mode", E_USER_WARNING);
 
                break;
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ expectError()
 

	
 
    /**
 
     * This method is used to tell which errors you expect to get.
 
     * Expected errors are always returned with error mode
 
     * PEAR_ERROR_RETURN.  Expected error codes are stored in a stack,
 
     * and this method pushes a new element onto it.  The list of
 
     * expected errors are in effect until they are popped off the
 
     * stack with the popExpect() method.
 
     *
 
     * Note that this method can not be called statically
 
     *
 
     * @param mixed $code a single error code or an array of error codes to expect
 
     *
 
     * @return int     the new depth of the "expected errors" stack
 
     * @access public
 
     */
 
    function expectError($code = '*')
 
    {
 
        if (is_array($code)) {
 
            array_push($this->_expected_errors, $code);
 
        } else {
 
            array_push($this->_expected_errors, array($code));
 
        }
 
        return sizeof($this->_expected_errors);
 
    }
 

	
 
    // }}}
 
    // {{{ popExpect()
 

	
 
    /**
 
     * This method pops one element off the expected error codes
 
     * stack.
 
     *
 
     * @return array   the list of error codes that were popped
 
     */
 
    function popExpect()
 
    {
 
        return array_pop($this->_expected_errors);
 
    }
 

	
 
    // }}}
 
    // {{{ _checkDelExpect()
 

	
 
    /**
 
     * This method checks unsets an error code if available
 
     *
 
     * @param mixed error code
 
     * @return bool true if the error code was unset, false otherwise
 
     * @access private
 
     * @since PHP 4.3.0
 
     */
 
    function _checkDelExpect($error_code)
 
    {
 
        $deleted = false;
 

	
 
        foreach ($this->_expected_errors AS $key => $error_array) {
 
            if (in_array($error_code, $error_array)) {
 
                unset($this->_expected_errors[$key][array_search($error_code, $error_array)]);
 
                $deleted = true;
 
            }
 

	
 
            // clean up empty arrays
 
            if (0 == count($this->_expected_errors[$key])) {
 
                unset($this->_expected_errors[$key]);
 
            }
 
        }
 
        return $deleted;
 
    }
 

	
 
    // }}}
 
    // {{{ delExpect()
 

	
 
    /**
 
     * This method deletes all occurences of the specified element from
 
     * the expected error codes stack.
 
     *
 
     * @param  mixed $error_code error code that should be deleted
 
     * @return mixed list of error codes that were deleted or error
 
     * @access public
 
     * @since PHP 4.3.0
 
     */
 
    function delExpect($error_code)
 
    {
 
        $deleted = false;
 

	
 
        if ((is_array($error_code) && (0 != count($error_code)))) {
 
            // $error_code is a non-empty array here;
 
            // we walk through it trying to unset all
 
            // values
 
            foreach($error_code as $key => $error) {
 
                if ($this->_checkDelExpect($error)) {
 
                    $deleted =  true;
 
                } else {
 
                    $deleted = false;
 
                }
 
            }
 
            return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
 
        } elseif (!empty($error_code)) {
 
            // $error_code comes alone, trying to unset it
 
            if ($this->_checkDelExpect($error_code)) {
 
                return true;
 
            } else {
 
                return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
 
            }
 
        } else {
 
            // $error_code is empty
 
            return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ raiseError()
 

	
 
    /**
 
     * This method is a wrapper that returns an instance of the
 
     * configured error class with this object's default error
 
     * handling applied.  If the $mode and $options parameters are not
 
     * specified, the object's defaults are used.
 
     *
 
     * @param mixed $message a text error message or a PEAR error object
 
     *
 
     * @param int $code      a numeric error code (it is up to your class
 
     *                  to define these if you want to use codes)
 
     *
 
     * @param int $mode      One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT,
 
     *                  PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE,
 
     *                  PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION.
 
     *
 
     * @param mixed $options If $mode is PEAR_ERROR_TRIGGER, this parameter
 
     *                  specifies the PHP-internal error level (one of
 
     *                  E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR).
 
     *                  If $mode is PEAR_ERROR_CALLBACK, this
 
     *                  parameter specifies the callback function or
 
     *                  method.  In other error modes this parameter
 
     *                  is ignored.
 
     *
 
     * @param string $userinfo If you need to pass along for example debug
 
     *                  information, this parameter is meant for that.
 
     *
 
     * @param string $error_class The returned error object will be
 
     *                  instantiated from this class, if specified.
 
     *
 
     * @param bool $skipmsg If true, raiseError will only pass error codes,
 
     *                  the error message parameter will be dropped.
 
     *
 
     * @access public
 
     * @return object   a PEAR error object
 
     * @see PEAR::setErrorHandling
 
     * @since PHP 4.0.5
 
     */
 
    function &raiseError($message = null,
 
                         $code = null,
 
                         $mode = null,
 
                         $options = null,
 
                         $userinfo = null,
 
                         $error_class = null,
 
                         $skipmsg = false)
 
    {
 
        // The error is yet a PEAR error object
 
        if (is_object($message)) {
 
            $code        = $message->getCode();
 
            $userinfo    = $message->getUserInfo();
 
            $error_class = $message->getType();
 
            $message->error_message_prefix = '';
 
            $message     = $message->getMessage();
 
        }
 

	
 
        if (isset($this) && isset($this->_expected_errors) && sizeof($this->_expected_errors) > 0 && sizeof($exp = end($this->_expected_errors))) {
 
            if ($exp[0] == "*" ||
 
                (is_int(reset($exp)) && in_array($code, $exp)) ||
 
                (is_string(reset($exp)) && in_array($message, $exp))) {
 
                $mode = PEAR_ERROR_RETURN;
 
            }
 
        }
 
        // No mode given, try global ones
 
        if ($mode === null) {
 
            // Class error handler
 
            if (isset($this) && isset($this->_default_error_mode)) {
 
                $mode    = $this->_default_error_mode;
 
                $options = $this->_default_error_options;
 
            // Global error handler
 
            } elseif (isset($GLOBALS['_PEAR_default_error_mode'])) {
 
                $mode    = $GLOBALS['_PEAR_default_error_mode'];
 
                $options = $GLOBALS['_PEAR_default_error_options'];
 
            }
 
        }
 

	
 
        if ($error_class !== null) {
 
            $ec = $error_class;
 
        } elseif (isset($this) && isset($this->_error_class)) {
 
            $ec = $this->_error_class;
 
        } else {
 
            $ec = 'PEAR_Error';
 
        }
 
        if ($skipmsg) {
 
            $a = &new $ec($code, $mode, $options, $userinfo);
 
            return $a;
 
        } else {
 
            $a = &new $ec($message, $code, $mode, $options, $userinfo);
 
            return $a;
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ throwError()
 

	
 
    /**
 
     * Simpler form of raiseError with fewer options.  In most cases
 
     * message, code and userinfo are enough.
 
     *
 
     * @param string $message
 
     *
 
     */
 
    function &throwError($message = null,
 
                         $code = null,
 
                         $userinfo = null)
 
    {
 
        if (isset($this) && is_a($this, 'PEAR')) {
 
            $a = &$this->raiseError($message, $code, null, null, $userinfo);
 
            return $a;
 
        } else {
 
            $a = &PEAR::raiseError($message, $code, null, null, $userinfo);
 
            return $a;
 
        }
 
    }
 

	
 
    // }}}
 
    function staticPushErrorHandling($mode, $options = null)
 
    {
 
        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
 
        $def_mode    = &$GLOBALS['_PEAR_default_error_mode'];
 
        $def_options = &$GLOBALS['_PEAR_default_error_options'];
 
        $stack[] = array($def_mode, $def_options);
 
        switch ($mode) {
 
            case PEAR_ERROR_EXCEPTION:
 
            case PEAR_ERROR_RETURN:
 
            case PEAR_ERROR_PRINT:
 
            case PEAR_ERROR_TRIGGER:
 
            case PEAR_ERROR_DIE:
 
            case null:
 
                $def_mode = $mode;
 
                $def_options = $options;
 
                break;
 

	
 
            case PEAR_ERROR_CALLBACK:
 
                $def_mode = $mode;
 
                // class/object method callback
 
                if (is_callable($options)) {
 
                    $def_options = $options;
 
                } else {
 
                    trigger_error("invalid error callback", E_USER_WARNING);
 
                }
 
                break;
 

	
 
            default:
 
                trigger_error("invalid error mode", E_USER_WARNING);
 
                break;
 
        }
 
        $stack[] = array($mode, $options);
 
        return true;
 
    }
 

	
 
    function staticPopErrorHandling()
 
    {
 
        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
 
        $setmode     = &$GLOBALS['_PEAR_default_error_mode'];
 
        $setoptions  = &$GLOBALS['_PEAR_default_error_options'];
 
        array_pop($stack);
 
        list($mode, $options) = $stack[sizeof($stack) - 1];
 
        array_pop($stack);
 
        switch ($mode) {
 
            case PEAR_ERROR_EXCEPTION:
 
            case PEAR_ERROR_RETURN:
 
            case PEAR_ERROR_PRINT:
 
            case PEAR_ERROR_TRIGGER:
 
            case PEAR_ERROR_DIE:
 
            case null:
 
                $setmode = $mode;
 
                $setoptions = $options;
 
                break;
 

	
 
            case PEAR_ERROR_CALLBACK:
 
                $setmode = $mode;
 
                // class/object method callback
 
                if (is_callable($options)) {
 
                    $setoptions = $options;
 
                } else {
 
                    trigger_error("invalid error callback", E_USER_WARNING);
 
                }
 
                break;
 

	
 
            default:
 
                trigger_error("invalid error mode", E_USER_WARNING);
 
                break;
 
        }
 
        return true;
 
    }
 

	
 
    // {{{ pushErrorHandling()
 

	
 
    /**
 
     * Push a new error handler on top of the error handler options stack. With this
 
     * you can easily override the actual error handler for some code and restore
 
     * it later with popErrorHandling.
 
     *
 
     * @param mixed $mode (same as setErrorHandling)
 
     * @param mixed $options (same as setErrorHandling)
 
     *
 
     * @return bool Always true
 
     *
 
     * @see PEAR::setErrorHandling
 
     */
 
    function pushErrorHandling($mode, $options = null)
 
    {
 
        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
 
        if (isset($this) && is_a($this, 'PEAR')) {
 
            $def_mode    = &$this->_default_error_mode;
 
            $def_options = &$this->_default_error_options;
 
        } else {
 
            $def_mode    = &$GLOBALS['_PEAR_default_error_mode'];
 
            $def_options = &$GLOBALS['_PEAR_default_error_options'];
 
        }
 
        $stack[] = array($def_mode, $def_options);
 

	
 
        if (isset($this) && is_a($this, 'PEAR')) {
 
            $this->setErrorHandling($mode, $options);
 
        } else {
 
            PEAR::setErrorHandling($mode, $options);
 
        }
 
        $stack[] = array($mode, $options);
 
        return true;
 
    }
 

	
 
    // }}}
 
    // {{{ popErrorHandling()
 

	
 
    /**
 
    * Pop the last error handler used
 
    *
 
    * @return bool Always true
 
    *
 
    * @see PEAR::pushErrorHandling
 
    */
 
    function popErrorHandling()
 
    {
 
        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
 
        array_pop($stack);
 
        list($mode, $options) = $stack[sizeof($stack) - 1];
 
        array_pop($stack);
 
        if (isset($this) && is_a($this, 'PEAR')) {
 
            $this->setErrorHandling($mode, $options);
 
        } else {
 
            PEAR::setErrorHandling($mode, $options);
 
        }
 
        return true;
 
    }
 

	
 
    // }}}
 
    // {{{ loadExtension()
 

	
 
    /**
 
    * OS independant PHP extension load. Remember to take care
 
    * on the correct extension name for case sensitive OSes.
 
    *
 
    * @param string $ext The extension name
 
    * @return bool Success or not on the dl() call
 
    */
 
    function loadExtension($ext)
 
    {
 
        if (!extension_loaded($ext)) {
 
            // if either returns true dl() will produce a FATAL error, stop that
 
            if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1)) {
 
                return false;
 
            }
 
            if (OS_WINDOWS) {
 
                $suffix = '.dll';
 
            } elseif (PHP_OS == 'HP-UX') {
 
                $suffix = '.sl';
 
            } elseif (PHP_OS == 'AIX') {
 
                $suffix = '.a';
 
            } elseif (PHP_OS == 'OSX') {
 
                $suffix = '.bundle';
 
            } else {
 
                $suffix = '.so';
 
            }
 
            return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix);
 
        }
 
        return true;
 
    }
 

	
 
    // }}}
 
}
 

	
 
// {{{ _PEAR_call_destructors()
 

	
 
function _PEAR_call_destructors()
 
{
 
    global $_PEAR_destructor_object_list;
 
    if (is_array($_PEAR_destructor_object_list) &&
 
        sizeof($_PEAR_destructor_object_list))
 
    {
 
        reset($_PEAR_destructor_object_list);
 
        if (PEAR::getStaticProperty('PEAR', 'destructlifo')) {
 
            $_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list);
 
        }
 
        while (list($k, $objref) = each($_PEAR_destructor_object_list)) {
 
            $classname = get_class($objref);
 
            while ($classname) {
 
                $destructor = "_$classname";
 
                if (method_exists($objref, $destructor)) {
 
                    $objref->$destructor();
 
                    break;
 
                } else {
 
                    $classname = get_parent_class($classname);
 
                }
 
            }
 
        }
 
        // Empty the object list to ensure that destructors are
 
        // not called more than once.
 
        $_PEAR_destructor_object_list = array();
 
    }
 

	
 
    // Now call the shutdown functions
 
    if (is_array($GLOBALS['_PEAR_shutdown_funcs']) AND !empty($GLOBALS['_PEAR_shutdown_funcs'])) {
 
        foreach ($GLOBALS['_PEAR_shutdown_funcs'] as $value) {
 
            call_user_func_array($value[0], $value[1]);
 
        }
 
    }
 
}
 

	
 
// }}}
 
/**
 
 * Standard PEAR error class for PHP 4
 
 *
 
 * This class is supserseded by {@link PEAR_Exception} in PHP 5
 
 *
 
 * @category   pear
 
 * @package    PEAR
 
 * @author     Stig Bakken <ssb@php.net>
 
 * @author     Tomas V.V. Cox <cox@idecnet.com>
 
 * @author     Gregory Beaver <cellog@php.net>
 
 * @copyright  1997-2006 The PHP Group
 
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 
 * @version    Release: 1.6.2
 
 * @link       http://pear.php.net/manual/en/core.pear.pear-error.php
 
 * @see        PEAR::raiseError(), PEAR::throwError()
 
 * @since      Class available since PHP 4.0.2
 
 */
 
class PEAR_Error
 
{
 
    // {{{ properties
 

	
 
    var $error_message_prefix = '';
 
    var $mode                 = PEAR_ERROR_RETURN;
 
    var $level                = E_USER_NOTICE;
 
    var $code                 = -1;
 
    var $message              = '';
 
    var $userinfo             = '';
 
    var $backtrace            = null;
 

	
 
    // }}}
 
    // {{{ constructor
 

	
 
    /**
 
     * PEAR_Error constructor
 
     *
 
     * @param string $message  message
 
     *
 
     * @param int $code     (optional) error code
 
     *
 
     * @param int $mode     (optional) error mode, one of: PEAR_ERROR_RETURN,
 
     * PEAR_ERROR_PRINT, PEAR_ERROR_DIE, PEAR_ERROR_TRIGGER,
 
     * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION
 
     *
 
     * @param mixed $options   (optional) error level, _OR_ in the case of
 
     * PEAR_ERROR_CALLBACK, the callback function or object/method
 
     * tuple.
 
     *
 
     * @param string $userinfo (optional) additional user/debug info
 
     *
 
     * @access public
 
     *
 
     */
 
    function PEAR_Error($message = 'unknown error', $code = null,
 
                        $mode = null, $options = null, $userinfo = null)
 
    {
 
        if ($mode === null) {
 
            $mode = PEAR_ERROR_RETURN;
 
        }
 
        $this->message   = $message;
 
        $this->code      = $code;
 
        $this->mode      = $mode;
 
        $this->userinfo  = $userinfo;
 
        if (!PEAR::getStaticProperty('PEAR_Error', 'skiptrace')) {
 
            $this->backtrace = debug_backtrace();
 
            if (isset($this->backtrace[0]) && isset($this->backtrace[0]['object'])) {
 
                unset($this->backtrace[0]['object']);
 
            }
 
        }
 
        if ($mode & PEAR_ERROR_CALLBACK) {
 
            $this->level = E_USER_NOTICE;
 
            $this->callback = $options;
 
        } else {
 
            if ($options === null) {
 
                $options = E_USER_NOTICE;
 
            }
 
            $this->level = $options;
 
            $this->callback = null;
 
        }
 
        if ($this->mode & PEAR_ERROR_PRINT) {
 
            if (is_null($options) || is_int($options)) {
 
                $format = "%s";
 
            } else {
 
                $format = $options;
 
            }
 
            printf($format, $this->getMessage());
 
        }
 
        if ($this->mode & PEAR_ERROR_TRIGGER) {
 
            trigger_error($this->getMessage(), $this->level);
 
        }
 
        if ($this->mode & PEAR_ERROR_DIE) {
 
            $msg = $this->getMessage();
 
            if (is_null($options) || is_int($options)) {
 
                $format = "%s";
 
                if (substr($msg, -1) != "\n") {
 
                    $msg .= "\n";
 
                }
 
            } else {
 
                $format = $options;
 
            }
 
            die(sprintf($format, $msg));
 
        }
 
        if ($this->mode & PEAR_ERROR_CALLBACK) {
 
            if (is_callable($this->callback)) {
 
                call_user_func($this->callback, $this);
 
            }
 
        }
 
        if ($this->mode & PEAR_ERROR_EXCEPTION) {
 
            trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING);
 
            eval('$e = new Exception($this->message, $this->code);throw($e);');
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ getMode()
 

	
 
    /**
 
     * Get the error mode from an error object.
 
     *
 
     * @return int error mode
 
     * @access public
 
     */
 
    function getMode() {
 
        return $this->mode;
 
    }
 

	
 
    // }}}
 
    // {{{ getCallback()
 

	
 
    /**
 
     * Get the callback function/method from an error object.
 
     *
 
     * @return mixed callback function or object/method array
 
     * @access public
 
     */
 
    function getCallback() {
 
        return $this->callback;
 
    }
 

	
 
    // }}}
 
    // {{{ getMessage()
 

	
 

	
 
    /**
 
     * Get the error message from an error object.
 
     *
 
     * @return  string  full error message
 
     * @access public
 
     */
 
    function getMessage()
 
    {
 
        return ($this->error_message_prefix . $this->message);
 
    }
 

	
 

	
 
    // }}}
 
    // {{{ getCode()
 

	
 
    /**
 
     * Get error code from an error object
 
     *
 
     * @return int error code
 
     * @access public
 
     */
 
     function getCode()
 
     {
 
        return $this->code;
 
     }
 

	
 
    // }}}
 
    // {{{ getType()
 

	
 
    /**
 
     * Get the name of this error/exception.
 
     *
 
     * @return string error/exception name (type)
 
     * @access public
 
     */
 
    function getType()
 
    {
 
        return get_class($this);
 
    }
 

	
 
    // }}}
 
    // {{{ getUserInfo()
 

	
 
    /**
 
     * Get additional user-supplied information.
 
     *
 
     * @return string user-supplied information
 
     * @access public
 
     */
 
    function getUserInfo()
 
    {
 
        return $this->userinfo;
 
    }
 

	
 
    // }}}
 
    // {{{ getDebugInfo()
 

	
 
    /**
 
     * Get additional debug information supplied by the application.
 
     *
 
     * @return string debug information
 
     * @access public
 
     */
 
    function getDebugInfo()
 
    {
 
        return $this->getUserInfo();
 
    }
 

	
 
    // }}}
 
    // {{{ getBacktrace()
 

	
 
    /**
 
     * Get the call backtrace from where the error was generated.
 
     * Supported with PHP 4.3.0 or newer.
 
     *
 
     * @param int $frame (optional) what frame to fetch
 
     * @return array Backtrace, or NULL if not available.
 
     * @access public
 
     */
 
    function getBacktrace($frame = null)
 
    {
 
        if (defined('PEAR_IGNORE_BACKTRACE')) {
 
            return null;
 
        }
 
        if ($frame === null) {
 
            return $this->backtrace;
 
        }
 
        return $this->backtrace[$frame];
 
    }
 

	
 
    // }}}
 
    // {{{ addUserInfo()
 

	
 
    function addUserInfo($info)
 
    {
 
        if (empty($this->userinfo)) {
 
            $this->userinfo = $info;
 
        } else {
 
            $this->userinfo .= " ** $info";
 
        }
 
    }
 

	
 
    // }}}
 
    // {{{ toString()
 

	
 
    /**
 
     * Make a string representation of this object.
 
     *
 
     * @return string a string with an object summary
 
     * @access public
 
     */
 
    function toString() {
 
        $modes = array();
 
        $levels = array(E_USER_NOTICE  => 'notice',
 
                        E_USER_WARNING => 'warning',
 
                        E_USER_ERROR   => 'error');
 
        if ($this->mode & PEAR_ERROR_CALLBACK) {
 
            if (is_array($this->callback)) {
 
                $callback = (is_object($this->callback[0]) ?
 
                    strtolower(get_class($this->callback[0])) :
 
                    $this->callback[0]) . '::' .
 
                    $this->callback[1];
 
            } else {
 
                $callback = $this->callback;
 
            }
 
            return sprintf('[%s: message="%s" code=%d mode=callback '.
 
                           'callback=%s prefix="%s" info="%s"]',
 
                           strtolower(get_class($this)), $this->message, $this->code,
 
                           $callback, $this->error_message_prefix,
 
                           $this->userinfo);
 
        }
 
        if ($this->mode & PEAR_ERROR_PRINT) {
 
            $modes[] = 'print';
 
        }
 
        if ($this->mode & PEAR_ERROR_TRIGGER) {
 
            $modes[] = 'trigger';
 
        }
 
        if ($this->mode & PEAR_ERROR_DIE) {
 
            $modes[] = 'die';
 
        }
 
        if ($this->mode & PEAR_ERROR_RETURN) {
 
            $modes[] = 'return';
 
        }
 
        return sprintf('[%s: message="%s" code=%d mode=%s level=%s '.
 
                       'prefix="%s" info="%s"]',
 
                       strtolower(get_class($this)), $this->message, $this->code,
 
                       implode("|", $modes), $levels[$this->level],
 
                       $this->error_message_prefix,
 
                       $this->userinfo);
 
    }
 

	
 
    // }}}
 
}
 

	
 
/*
 
 * Local Variables:
 
 * mode: php
 
 * tab-width: 4
 
 * c-basic-offset: 4
 
 * End:
 
 */
 
?>
components/com_morfeoshow/tpl/resources/phpFlickr/PEAR/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/phpFlickr/auth.php
Show inline comments
 
new file 100644
 
<?
 
    /* Last updated with phpFlickr 1.3.1
 
     *
 
     * Edit these variables to reflect the values you need. $default_redirect 
 
     * and $permissions are only important if you are linking here instead of
 
     * using phpFlickr::auth() from another page or if you set the remember_uri
 
     * argument to false.
 
     */
 
    $api_key                 = "[your api key]";
 
    $api_secret              = "[your api secret]";
 
    $default_redirect        = "/";
 
    $permissions             = "read";
 
    $path_to_phpFlickr_class = "./";
 

	
 
    ob_start();
 
    require_once($path_to_phpFlickr_class . "phpFlickr.php");
 
    unset($_SESSION['phpFlickr_auth_token']);
 
     
 
	if (!empty($_GET['extra'])) {
 
		$redirect = $_GET['extra'];
 
	}
 
    
 
    $f = new phpFlickr($api_key, $api_secret);
 
 
 
    if (empty($_GET['frob'])) {
 
        $f->auth($permissions, false);
 
    } else {
 
        $f->auth_getToken($_GET['frob']);
 
	}
 
    
 
    if (empty($redirect)) {
 
		header("Location: " . $default_redirect);
 
    } else {
 
		header("Location: " . $redirect);
 
    }
 
 
 
?>
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/phpFlickr/getToken.php
Show inline comments
 
new file 100644
 
<?php
 
    /* Last updated with phpFlickr 1.4
 
     *
 
     * If you need your app to always login with the same user (to see your private
 
     * photos or photosets, for example), you can use this file to login and get a
 
     * token assigned so that you can hard code the token to be used.  To use this
 
     * use the phpFlickr::setToken() function whenever you create an instance of 
 
     * the class.
 
     */
 

	
 
    require_once("phpFlickr.php");
 
    $f = new phpFlickr("<api key>", "<secret>");
 
    
 
    //change this to the permissions you will need
 
    $f->auth("read");
 
    
 
    echo "Copy this token into your code: " . $_SESSION['phpFlickr_auth_token'];
 
    
 
?>
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/phpFlickr/index.html
Show inline comments
 
new file 100644
 
<html><body bgcolor="#FFFFFF"></body></html>
 
\ No newline at end of file
components/com_morfeoshow/tpl/resources/phpFlickr/phpFlickr.php
Show inline comments
 
new file 100644
 
<?php
 
/* phpFlickr Class 2.2.0
 
 * Written by Dan Coulter (dan@dancoulter.com)
 
 * Sourceforge Project Page: http://www.sourceforge.net/projects/phpflickr/
 
 * Released under GNU Lesser General Public License (http://www.gnu.org/copyleft/lgpl.html)
 
 * For more information about the class and upcoming tools and toys using it,
 
 * visit http://www.phpflickr.com/ or http://phpflickr.sourceforge.net
 
 *
 
 *	 For installation instructions, open the README.txt file packaged with this
 
 *	 class. If you don't have a copy, you can see it at:
 
 *	 http://www.phpflickr.com/README.txt
 
 *
 
 *	 Please submit all problems or questions to the Help Forum on my project page:
 
 *		 http://sourceforge.net/forum/forum.php?forum_id=469652
 
 *
 
 */
 
if (session_id() == "") {
 
	@session_start();
 
}
 

	
 
// Decides which include path delimiter to use.  Windows should be using a semi-colon
 
// and everything else should be using a colon.  If this isn't working on your system,
 
// comment out this if statement and manually set the correct value into $path_delimiter.
 
if (strpos(__FILE__, ':') !== false) {
 
	$path_delimiter = ';';
 
} else {
 
	$path_delimiter = ':';
 
}
 

	
 
// This will add the packaged PEAR files into the include path for PHP, allowing you
 
// to use them transparently.  This will prefer officially installed PEAR files if you
 
// have them.  If you want to prefer the packaged files (there shouldn't be any reason
 
// to), swap the two elements around the $path_delimiter variable.  If you don't have
 
// the PEAR packages installed, you can leave this like it is and move on.
 

	
 
ini_set('include_path', ini_get('include_path') . $path_delimiter . dirname(__FILE__) . '/PEAR');
 

	
 
// If you have problems including the default PEAR install (like if your open_basedir
 
// setting doesn't allow you to include files outside of your web root), comment out
 
// the line above and uncomment the next line:
 

	
 
// ini_set('include_path', dirname(__FILE__) . '/PEAR' . $path_delimiter . ini_get('include_path'));
 

	
 
class phpFlickr {
 
	var $api_key;
 
	var $secret;
 
	var $REST = 'http://api.flickr.com/services/rest/';
 
	var $Upload = 'http://api.flickr.com/services/upload/';
 
	var $Replace = 'http://api.flickr.com/services/replace/';
 
	var $req;
 
	var $response;
 
	var $parsed_response;
 
	var $cache = false;
 
	var $cache_db = null;
 
	var $cache_table = null;
 
	var $cache_dir = null;
 
	var $cache_expire = null;
 
	var $die_on_error;
 
	var $error_code;
 
	Var $error_msg;
 
	var $token;
 
	var $php_version;
 

	
 
	/*
 
	 * When your database cache table hits this many rows, a cleanup
 
	 * will occur to get rid of all of the old rows and cleanup the
 
	 * garbage in the table.  For most personal apps, 1000 rows should
 
	 * be more than enough.  If your site gets hit by a lot of traffic
 
	 * or you have a lot of disk space to spare, bump this number up.
 
	 * You should try to set it high enough that the cleanup only
 
	 * happens every once in a while, so this will depend on the growth
 
	 * of your table.
 
	 */
 
	var $max_cache_rows = 1000;
 

	
 
	function phpFlickr ($api_key, $secret = NULL, $die_on_error = false)
 
	{
 
		//The API Key must be set before any calls can be made.  You can
 
		//get your own at http://www.flickr.com/services/api/misc.api_keys.html
 
		$this->api_key = $api_key;
 
		$this->secret = $secret;
 
		$this->die_on_error = $die_on_error;
 
		$this->service = "flickr";
 

	
 
		//Find the PHP version and store it for future reference
 
		$this->php_version = explode("-", phpversion());
 
		$this->php_version = explode(".", $this->php_version[0]);
 

	
 
		//All calls to the API are done via the POST method using the PEAR::HTTP_Request package.
 
		require_once 'HTTP/Request.php';
 
		$this->req =& new HTTP_Request();
 
		$this->req->setMethod(HTTP_REQUEST_METHOD_POST);
 
	}
 

	
 
	function enableCache($type, $connection, $cache_expire = 600, $table = 'flickr_cache')
 
	{
 
		// Turns on caching.  $type must be either "db" (for database caching) or "fs" (for filesystem).
 
		// When using db, $connection must be a PEAR::DB connection string. Example:
 
		//	  "mysql://user:password@server/database"
 
		// If the $table, doesn't exist, it will attempt to create it.
 
		// When using file system, caching, the $connection is the folder that the web server has write
 
		// access to. Use absolute paths for best results.  Relative paths may have unexpected behavior
 
		// when you include this.  They'll usually work, you'll just want to test them.
 
		if ($type == 'db') {
 
			require_once 'DB.php';
 
			$db =& DB::connect($connection);
 
			if (PEAR::isError($db)) {
 
				die($db->getMessage());
 
			}
 

	
 
			/*
 
			 * If high performance is crucial, you can easily comment
 
			 * out this query once you've created your database table.
 
			 */
 

	
 
			$db->query("
 
				CREATE TABLE IF NOT EXISTS `$table` (
 
					`request` CHAR( 35 ) NOT NULL ,
 
					`response` MEDIUMTEXT NOT NULL ,
 
					`expiration` DATETIME NOT NULL ,
 
					INDEX ( `request` )
 
				) TYPE = MYISAM");
 

	
 
			if ($db->getOne("SELECT COUNT(*) FROM $table") > $this->max_cache_rows) {
 
				$db->query("DELETE FROM $table WHERE expiration < DATE_SUB(NOW(), INTERVAL $cache_expire second)");
 
				$db->query('OPTIMIZE TABLE ' . $this->cache_table);
 
			}
 

	
 
			$this->cache = 'db';
 
			$this->cache_db = $db;
 
			$this->cache_table = $table;
 
		} elseif ($type == 'fs') {
 
			$this->cache = 'fs';
 
			$connection = realpath($connection);
 
			$this->cache_dir = $connection;
 
			if ($dir = opendir($this->cache_dir)) {
 
				while ($file = readdir($dir)) {
 
					if (substr($file, -6) == '.cache' && ((filemtime($this->cache_dir . '/' . $file) + $cache_expire) < time()) ) {
 
						unlink($this->cache_dir . '/' . $file);
 
					}
 
				}
 
			}
 
		}
 
		$this->cache_expire = $cache_expire;
 
	}
 

	
 
	function getCached ($request)
 
	{
 
		//Checks the database or filesystem for a cached result to the request.
 
		//If there is no cache result, it returns a value of false. If it finds one,
 
		//it returns the unparsed XML.
 
		$reqhash = md5(serialize($request));
 
		if ($this->cache == 'db') {
 
			$result = $this->cache_db->getOne("SELECT response FROM " . $this->cache_table . " WHERE request = ? AND DATE_SUB(NOW(), INTERVAL " . (int) $this->cache_expire . " SECOND) < expiration", $reqhash);
 
			if (!empty($result)) {
 
				return $result;
 
			}
 
		} elseif ($this->cache == 'fs') {
 
			$file = $this->cache_dir . '/' . $reqhash . '.cache';
 
			if (file_exists($file)) {
 
				if ($this->php_version[0] > 4 || ($this->php_version[0] == 4 && $this->php_version[1] >= 3)) {
 
					return file_get_contents($file);
 
				} else {
 
					return implode('', file($file));
 
				}
 
			}
 
		}
 
		return false;
 
	}
 

	
 
	function cache ($request, $response)
 
	{
 
		//Caches the unparsed XML of a request.
 
		$reqhash = md5(serialize($request));
 
		if ($this->cache == 'db') {
 
			//$this->cache_db->query("DELETE FROM $this->cache_table WHERE request = '$reqhash'");
 
			if ($this->cache_db->getOne("SELECT COUNT(*) FROM {$this->cache_table} WHERE request = '$reqhash'")) {
 
				$sql = "UPDATE " . $this->cache_table . " SET response = ?, expiration = ? WHERE request = ?";
 
				$this->cache_db->query($sql, array($response, strftime("%Y-%m-%d %H:%M:%S"), $reqhash));
 
			} else {
 
				$sql = "INSERT INTO " . $this->cache_table . " (request, response, expiration) VALUES ('$reqhash', '" . str_replace("'", "''", $response) . "', '" . strftime("%Y-%m-%d %H:%M:%S") . "')";
 
				$this->cache_db->query($sql);
 
			}
 
		} elseif ($this->cache == "fs") {
 
			$file = $this->cache_dir . "/" . $reqhash . ".cache";
 
			$fstream = fopen($file, "w");
 
			$result = fwrite($fstream,$response);
 
			fclose($fstream);
 
			return $result;
 
		}
 
		return false;
 
	}
 

	
 
	function request ($command, $args = array(), $nocache = false)
 
	{
 
		//Sends a request to Flickr's REST endpoint via POST.
 
		$this->req->setURL($this->REST);
 
		$this->req->clearPostData();
 
		if (substr($command,0,7) != "flickr.") {
 
			$command = "flickr." . $command;
 
		}
 

	
 
		//Process arguments, including method and login data.
 
		$args = array_merge(array("method" => $command, "format" => "php_serial", "api_key" => $this->api_key), $args);
 
		if (!empty($this->token)) {
 
			$args = array_merge($args, array("auth_token" => $this->token));
 
		} elseif (!empty($_SESSION['phpFlickr_auth_token'])) {
 
			$args = array_merge($args, array("auth_token" => $_SESSION['phpFlickr_auth_token']));
 
		}
 
		ksort($args);
 
		$auth_sig = "";
 
		if (!($this->response = $this->getCached($args)) || $nocache) {
 
			foreach ($args as $key => $data) {
 
				$auth_sig .= $key . $data;
 
				$this->req->addPostData($key, $data);
 
			}
 
			if (!empty($this->secret)) {
 
				$api_sig = md5($this->secret . $auth_sig);
 
				$this->req->addPostData("api_sig", $api_sig);
 
			}
 

	
 
			$this->req->addHeader("Connection", "Keep-Alive");
 
			
 
			//Send Requests
 
			if ($this->req->sendRequest()) {
 
				$this->response = $this->req->getResponseBody();
 
				$this->cache($args, $this->response);
 
			} else {
 
				die("There has been a problem sending your command to the server.");
 
			}
 
		}
 
		/*
 
		 * Uncomment this line (and comment out the next one) if you're doing large queries
 
		 * and you're concerned about time.  This will, however, change the structure of
 
		 * the result, so be sure that you look at the results.
 
		 */
 
		//$this->parsed_response = unserialize($this->response);
 
		$this->parsed_response = $this->clean_text_nodes(unserialize($this->response));
 
		if ($this->parsed_response['stat'] == 'fail') {
 
			if ($this->die_on_error) die("The Flickr API returned the following error: #{$this->parsed_response['code']} - {$this->parsed_response['message']}");
 
			else {
 
				$this->error_code = $this->parsed_response['code'];
 
				$this->error_msg = $this->parsed_response['message'];
 
				$this->parsed_response = false;
 
			}
 
		} else {
 
			$this->error_code = false;
 
			$this->error_msg = false;
 
		}
 
		return $this->response;
 
	}
 

	
 
	function clean_text_nodes($arr) {
 
		if (!is_array($arr)) {
 
			return $arr;
 
		} elseif (count($arr) == 0) {
 
			return $arr;
 
		} elseif (count($arr) == 1 && array_key_exists('_content', $arr)) {
 
			return $arr['_content'];
 
		} else {
 
			foreach ($arr as $key => $element) {
 
				$arr[$key] = $this->clean_text_nodes($element);
 
			}
 
			return($arr);
 
		}
 
	}
 

	
 
	function setToken($token)
 
	{
 
		// Sets an authentication token to use instead of the session variable
 
		$this->token = $token;
 
	}
 

	
 
	function setProxy($server, $port)
 
	{
 
		// Sets the proxy for all phpFlickr calls.
 
		$this->req->setProxy($server, $port);
 
	}
 

	
 
	function getErrorCode()
 
	{
 
		// Returns the error code of the last call.  If the last call did not
 
		// return an error. This will return a false boolean.
 
		return $this->error_code;
 
	}
 

	
 
	function getErrorMsg()
 
	{
 
		// Returns the error message of the last call.  If the last call did not
 
		// return an error. This will return a false boolean.
 
		return $this->error_msg;
 
	}
 

	
 
	/* These functions are front ends for the flickr calls */
 

	
 
	function buildPhotoURL ($photo, $size = "Medium")
 
	{
 
		//receives an array (can use the individual photo data returned
 
		//from an API call) and returns a URL (doesn't mean that the
 
		//file size exists)
 
		$sizes = array(
 
			"square" => "_s",
 
			"thumbnail" => "_t",
 
			"small" => "_m",
 
			"medium" => "",
 
			"large" => "_b",
 
			"original" => "_o"
 
		);
 
		
 
		$size = strtolower($size);
 
		if (!array_key_exists($size, $sizes)) {
 
			$size = "medium";
 
		}
 
		
 
		if ($size == "original") {
 
			$url = "http://farm" . $photo['farm'] . ".static.flickr.com/" . $photo['server'] . "/" . $photo['id'] . "_" . $photo['originalsecret'] . "_o" . "." . $photo['originalformat'];
 
		} else {
 
			$url = "http://farm" . $photo['farm'] . ".static.flickr.com/" . $photo['server'] . "/" . $photo['id'] . "_" . $photo['secret'] . $sizes[$size] . ".jpg";
 
		}
 
		return $url;
 
	}
 

	
 
	function getFriendlyGeodata($lat, $lon) {
 
		/* I've added this method to get the friendly geodata (i.e. 'in New York, NY') that the
 
		 * website provides, but isn't available in the API. I'm providing this service as long
 
		 * as it doesn't flood my server with requests and crash it all the time.
 
		 */
 
		return unserialize(file_get_contents('http://phpflickr.com/geodata/?format=php&lat=' . $lat . '&lon=' . $lon));
 
	}
 

	
 
	function sync_upload ($photo, $title = null, $description = null, $tags = null, $is_public = null, $is_friend = null, $is_family = null) {
 
		$upload_req =& new HTTP_Request();
 
		$upload_req->setMethod(HTTP_REQUEST_METHOD_POST);
 

	
 

	
 
		$upload_req->setURL($this->Upload);
 
		$upload_req->clearPostData();
 

	
 
		//Process arguments, including method and login data.
 
		$args = array("api_key" => $this->api_key, "title" => $title, "description" => $description, "tags" => $tags, "is_public" => $is_public, "is_friend" => $is_friend, "is_family" => $is_family);
 
		if (!empty($this->email)) {
 
			$args = array_merge($args, array("email" => $this->email));
 
		}
 
		if (!empty($this->password)) {
 
			$args = array_merge($args, array("password" => $this->password));
 
		}
 
		if (!empty($this->token)) {
 
			$args = array_merge($args, array("auth_token" => $this->token));
 
		} elseif (!empty($_SESSION['phpFlickr_auth_token'])) {
 
			$args = array_merge($args, array("auth_token" => $_SESSION['phpFlickr_auth_token']));
 
		}
 

	
 
		ksort($args);
 
		$auth_sig = "";
 
		foreach ($args as $key => $data) {
 
			if ($data !== null) {
 
				$auth_sig .= $key . $data;
 
				$upload_req->addPostData($key, $data);
 
			}
 
		}
 
		if (!empty($this->secret)) {
 
			$api_sig = md5($this->secret . $auth_sig);
 
			$upload_req->addPostData("api_sig", $api_sig);
 
		}
 

	
 
		$photo = realpath($photo);
 

	
 
		$result = $upload_req->addFile("photo", $photo);
 

	
 
		if (PEAR::isError($result)) {
 
			die($result->getMessage());
 
		}
 

	
 
		//Send Requests
 
		if ($upload_req->sendRequest()) {
 
			$this->response = $upload_req->getResponseBody();
 
		} else {
 
			die("There has been a problem sending your command to the server.");
 
		}
 

	
 
		$rsp = explode("\n", $this->response);
 
		foreach ($rsp as $line) {
 
			if (ereg('<err code="([0-9]+)" msg="(.*)"', $line, $match)) {
 
				if ($this->die_on_error)
 
					die("The Flickr API returned the following error: #{$match[1]} - {$match[2]}");
 
				else {
 
					$this->error_code = $match[1];
 
					$this->error_msg = $match[2];
 
					$this->parsed_response = false;
 
					return false;
 
				}
 
			} elseif (ereg("<photoid>(.*)</photoid>", $line, $match)) {
 
				$this->error_code = false;
 
				$this->error_msg = false;
 
				return $match[1];
 
			}
 
		}
 
	}
 

	
 
	function async_upload ($photo, $title = null, $description = null, $tags = null, $is_public = null, $is_friend = null, $is_family = null) {
 
		$upload_req =& new HTTP_Request();
 
		$upload_req->setMethod(HTTP_REQUEST_METHOD_POST);
 

	
 
		$upload_req->setURL($this->Upload);
 
		$upload_req->clearPostData();
 

	
 
		//Process arguments, including method and login data.
 
		$args = array("async" => 1, "api_key" => $this->api_key, "title" => $title, "description" => $description, "tags" => $tags, "is_public" => $is_public, "is_friend" => $is_friend, "is_family" => $is_family);
 
		if (!empty($this->email)) {
 
			$args = array_merge($args, array("email" => $this->email));
 
		}
 
		if (!empty($this->password)) {
 
			$args = array_merge($args, array("password" => $this->password));
 
		}
 
		if (!empty($this->token)) {
 
			$args = array_merge($args, array("auth_token" => $this->token));
 
		} elseif (!empty($_SESSION['phpFlickr_auth_token'])) {
 
			$args = array_merge($args, array("auth_token" => $_SESSION['phpFlickr_auth_token']));
 
		}
 

	
 
		ksort($args);
 
		$auth_sig = "";
 
		foreach ($args as $key => $data) {
 
			if ($data !== null) {
 
				$auth_sig .= $key . $data;
 
				$upload_req->addPostData($key, $data);
 
			}
 
		}
 
		if (!empty($this->secret)) {
 
			$api_sig = md5($this->secret . $auth_sig);
 
			$upload_req->addPostData("api_sig", $api_sig);
 
		}
 

	
 
		$photo = realpath($photo);
 

	
 
		$result = $upload_req->addFile("photo", $photo);
 

	
 
		if (PEAR::isError($result)) {
 
			die($result->getMessage());
 
		}
 

	
 
		//Send Requests
 
		if ($upload_req->sendRequest()) {
 
			$this->response = $upload_req->getResponseBody();
 
		} else {
 
			die("There has been a problem sending your command to the server.");
 
		}
 

	
 
		$rsp = explode("\n", $this->response);
 
		foreach ($rsp as $line) {
 
			if (ereg('<err code="([0-9]+)" msg="(.*)"', $line, $match)) {
 
				if ($this->die_on_error)
 
					die("The Flickr API returned the following error: #{$match[1]} - {$match[2]}");
 
				else {
 
					$this->error_code = $match[1];
 
					$this->error_msg = $match[2];
 
					$this->parsed_response = false;
 
					return false;
 
				}
 
			} elseif (ereg("<ticketid>(.*)</", $line, $match)) {
 
				$this->error_code = false;
 
				$this->error_msg = false;
 
				return $match[1];
 
			}
 
		}
 
	}
 

	
 
	// Interface for new replace API method.
 
	function replace ($photo, $photo_id, $async = null) {
 
		$upload_req =& new HTTP_Request();
 
		$upload_req->setMethod(HTTP_REQUEST_METHOD_POST);
 

	
 
		$upload_req->setURL($this->Replace);
 
		$upload_req->clearPostData();
 

	
 
		//Process arguments, including method and login data.
 
		$args = array("api_key" => $this->api_key, "photo_id" => $photo_id, "async" => $async);
 
		if (!empty($this->email)) {
 
			$args = array_merge($args, array("email" => $this->email));
 
		}
 
		if (!empty($this->password)) {
 
			$args = array_merge($args, array("password" => $this->password));
 
		}
 
		if (!empty($this->token)) {
 
			$args = array_merge($args, array("auth_token" => $this->token));
 
		} elseif (!empty($_SESSION['phpFlickr_auth_token'])) {
 
			$args = array_merge($args, array("auth_token" => $_SESSION['phpFlickr_auth_token']));
 
		}
 

	
 
		ksort($args);
 
		$auth_sig = "";
 
		foreach ($args as $key => $data) {
 
			if ($data !== null) {
 
				$auth_sig .= $key . $data;
 
				$upload_req->addPostData($key, $data);
 
			}
 
		}
 
		if (!empty($this->secret)) {
 
			$api_sig = md5($this->secret . $auth_sig);
 
			$upload_req->addPostData("api_sig", $api_sig);
 
		}
 

	
 
		$photo = realpath($photo);
 

	
 
		$result = $upload_req->addFile("photo", $photo);
 

	
 
		if (PEAR::isError($result)) {
 
			die($result->getMessage());
 
		}
 

	
 
		//Send Requests
 
		if ($upload_req->sendRequest()) {
 
			$this->response = $upload_req->getResponseBody();
 
		} else {
 
			die("There has been a problem sending your command to the server.");
 
		}
 
		if ($async == 1)
 
			$find = 'ticketid';
 
		 else
 
			$find = 'photoid';
 

	
 
		$rsp = explode("\n", $this->response);
 
		foreach ($rsp as $line) {
 
			if (ereg('<err code="([0-9]+)" msg="(.*)"', $line, $match)) {
 
				if ($this->die_on_error)
 
					die("The Flickr API returned the following error: #{$match[1]} - {$match[2]}");
 
				else {
 
					$this->error_code = $match[1];
 
					$this->error_msg = $match[2];
 
					$this->parsed_response = false;
 
					return false;
 
				}
 
			} elseif (ereg("<" . $find . ">(.*)</", $line, $match)) {
 
				$this->error_code = false;
 
				$this->error_msg = false;
 
				return $match[1];
 
			}
 
		}
 
	}
 

	
 
	function auth ($perms = "read", $remember_uri = true)
 
	{
 
		// Redirects to Flickr's authentication piece if there is no valid token.
 
		// If remember_uri is set to false, the callback script (included) will
 
		// redirect to its default page.
 

	
 
		if (empty($_SESSION['phpFlickr_auth_token']) && empty($this->token)) {
 
			if ($remember_uri) {
 
				$redirect = $_SERVER['REQUEST_URI'];
 
			}
 
			$api_sig = md5($this->secret . "api_key" . $this->api_key . "extra" . $redirect . "perms" . $perms);
 
			if ($this->service == "23") {
 
				header("Location: http://www.23hq.com/services/auth/?api_key=" . $this->api_key . "&extra=" . $redirect . "&perms=" . $perms . "&api_sig=". $api_sig);
 
			} else {
 
				header("Location: http://www.flickr.com/services/auth/?api_key=" . $this->api_key . "&extra=" . $redirect . "&perms=" . $perms . "&api_sig=". $api_sig);
 
			}
 
			exit;
 
		} else {
 
			$tmp = $this->die_on_error;
 
			$this->die_on_error = false;
 
			$rsp = $this->auth_checkToken();
 
			if ($this->error_code !== false) {
 
				unset($_SESSION['phpFlickr_auth_token']);
 
				$this->auth($perms, $remember_uri);
 
			}
 
			$this->die_on_error = $tmp;
 
			return $rsp['perms'];
 
		}
 
	}
 

	
 
	/*******************************
 

	
 
	To use the phpFlickr::call method, pass a string containing the API method you want
 
	to use and an associative array of arguments.  For example:
 
		$result = $f->call("flickr.photos.comments.getList", array("photo_id"=>'34952612'));
 
	This method will allow you to make calls to arbitrary methods that haven't been
 
	implemented in phpFlickr yet.
 

	
 
	*******************************/
 

	
 
	function call($method, $arguments)
 
	{
 
		$this->request($method, $arguments);
 
		return $this->parsed_response ? $this->parsed_response : false;
 
	}
 

	
 
	/*
 
		These functions are the direct implementations of flickr calls.
 
		For method documentation, including arguments, visit the address
 
		included in a comment in the function.
 
	*/
 

	
 
	/* Activity methods */
 
	function activity_userComments ($per_page = NULL, $page = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.activity.userComments.html */
 
		$this->request('flickr.activity.userComments', array("per_page" => $per_page, "page" => $page));
 
		return $this->parsed_response ? $this->parsed_response['items']['item'] : false;
 
	}
 

	
 
	function activity_userPhotos ($timeframe = NULL, $per_page = NULL, $page = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.activity.userPhotos.html */
 
		$this->request('flickr.activity.userPhotos', array("timeframe" => $timeframe, "per_page" => $per_page, "page" => $page));
 
		return $this->parsed_response ? $this->parsed_response['items']['item'] : false;
 
	}
 

	
 
	/* Authentication methods */
 
	function auth_checkToken ()
 
	{
 
		/* http://www.flickr.com/services/api/flickr.auth.checkToken.html */
 
		$this->request('flickr.auth.checkToken');
 
		return $this->parsed_response ? $this->parsed_response['auth'] : false;
 
	}
 

	
 
	function auth_getFrob ()
 
	{
 
		/* http://www.flickr.com/services/api/flickr.auth.getFrob.html */
 
		$this->request('flickr.auth.getFrob');
 
		return $this->parsed_response ? $this->parsed_response['frob'] : false;
 
	}
 

	
 
	function auth_getFullToken ($mini_token)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.auth.getFullToken.html */
 
		$this->request('flickr.auth.getFullToken', array('mini_token'=>$mini_token));
 
		return $this->parsed_response ? $this->parsed_response['auth'] : false;
 
	}
 

	
 
	function auth_getToken ($frob)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.auth.getToken.html */
 
		$this->request('flickr.auth.getToken', array('frob'=>$frob));
 
		session_register('phpFlickr_auth_token');
 
		$_SESSION['phpFlickr_auth_token'] = $this->parsed_response['auth']['token'];
 
		return $this->parsed_response ? $this->parsed_response['auth'] : false;
 
	}
 

	
 
	/* Blogs methods */
 
	function blogs_getList ()
 
	{
 
		/* http://www.flickr.com/services/api/flickr.blogs.getList.html */
 
		$this->request('flickr.blogs.getList');
 
		return $this->parsed_response ? $this->parsed_response['blogs']['blog'] : false;
 
	}
 

	
 
	function blogs_postPhoto($blog_id, $photo_id, $title, $description, $blog_password = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.blogs.postPhoto.html */
 
		$this->request('flickr.blogs.postPhoto', array('blog_id'=>$blog_id, 'photo_id'=>$photo_id, 'title'=>$title, 'description'=>$description, 'blog_password'=>$blog_password), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	/* Contacts Methods */
 
	function contacts_getList ($filter = NULL, $page = NULL, $per_page = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.contacts.getList.html */
 
		$this->request('flickr.contacts.getList', array('filter'=>$filter, 'page'=>$page, 'per_page'=>$per_page));
 
		return $this->parsed_response ? $this->parsed_response['contacts'] : false;
 
	}
 

	
 
	function contacts_getPublicList($user_id, $page = NULL, $per_page = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.contacts.getPublicList.html */
 
		$this->request('flickr.contacts.getPublicList', array('user_id'=>$user_id, 'page'=>$page, 'per_page'=>$per_page));
 
		return $this->parsed_response ? $this->parsed_response['contacts'] : false;
 
	}
 

	
 
	/* Favorites Methods */
 
	function favorites_add ($photo_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.favorites.add.html */
 
		$this->request('flickr.favorites.add', array('photo_id'=>$photo_id), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function favorites_getList($user_id = NULL, $extras = NULL, $per_page = NULL, $page = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.favorites.getList.html */
 
		if (is_array($extras)) { $extras = implode(",", $extras); }
 
		$this->request("flickr.favorites.getList", array("user_id"=>$user_id, "extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
 
		return $this->parsed_response ? $this->parsed_response['photos'] : false;
 
	}
 

	
 
	function favorites_getPublicList($user_id = NULL, $extras = NULL, $per_page = NULL, $page = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.favorites.getPublicList.html */
 
		if (is_array($extras)) {
 
			$extras = implode(",", $extras);
 
		}
 
		$this->request("flickr.favorites.getPublicList", array("user_id"=>$user_id, "extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
 
		return $this->parsed_response ? $this->parsed_response['photos'] : false;
 
	}
 

	
 
	function favorites_remove($photo_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.favorites.remove.html */
 
		$this->request("flickr.favorites.remove", array("photo_id"=>$photo_id), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	/* Groups Methods */
 
	function groups_browse ($cat_id = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.groups.browse.html */
 
		$this->request("flickr.groups.browse", array("cat_id"=>$cat_id));
 
		return $this->parsed_response ? $this->parsed_response['category'] : false;
 
	}
 

	
 
	function groups_getInfo ($group_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.groups.getInfo.html */
 
		$this->request("flickr.groups.getInfo", array("group_id"=>$group_id));
 
		return $this->parsed_response ? $this->parsed_response['group'] : false;
 
	}
 

	
 
	function groups_search ($text, $per_page=NULL, $page=NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.groups.search.html */
 
		$this->request("flickr.groups.search", array("text"=>$text,"per_page"=>$per_page,"page"=>$page));
 
		return $this->parsed_response ? $this->parsed_response['groups'] : false;
 
	}
 

	
 
	/* Groups Pools Methods */
 
	function groups_pools_add ($photo_id, $group_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.groups.pools.add.html */
 
		$this->request("flickr.groups.pools.add", array("photo_id"=>$photo_id, "group_id"=>$group_id), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function groups_pools_getContext ($photo_id, $group_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.groups.pools.getContext.html */
 
		$this->request("flickr.groups.pools.getContext", array("photo_id"=>$photo_id, "group_id"=>$group_id));
 
		return $this->parsed_response ? $this->parsed_response : false;
 
	}
 

	
 
	function groups_pools_getGroups ($page = NULL, $per_page = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.groups.pools.getGroups.html */
 
		$this->request("flickr.groups.pools.getGroups", array('page'=>$page, 'per_page'=>$per_page));
 
		return $this->parsed_response ? $this->parsed_response['groups'] : false;
 
	}
 

	
 
	function groups_pools_getPhotos ($group_id, $tags = NULL, $user_id = NULL, $extras = NULL, $per_page = NULL, $page = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.groups.pools.getPhotos.html */
 
		if (is_array($extras)) {
 
			$extras = implode(",", $extras);
 
		}
 
		$this->request("flickr.groups.pools.getPhotos", array("group_id"=>$group_id, "tags"=>$tags, "user_id"=>$user_id, "extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
 
		return $this->parsed_response ? $this->parsed_response['photos'] : false;
 
	}
 

	
 
	function groups_pools_remove ($photo_id, $group_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.groups.pools.remove.html */
 
		$this->request("flickr.groups.pools.remove", array("photo_id"=>$photo_id, "group_id"=>$group_id), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	/* Interestingness methods */
 
	function interestingness_getList($date = NULL, $extras = NULL, $per_page = NULL, $page = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.interestingness.getList.html */
 
		if (is_array($extras)) {
 
			$extras = implode(",", $extras);
 
		}
 

	
 
		$this->request("flickr.interestingness.getList", array("date"=>$date, "extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
 
		return $this->parsed_response ? $this->parsed_response['photos'] : false;
 
	}
 

	
 
	/* People methods */
 
	function people_findByEmail ($find_email)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.people.findByEmail.html */
 
		$this->request("flickr.people.findByEmail", array("find_email"=>$find_email));
 
		return $this->parsed_response ? $this->parsed_response['user'] : false;
 
	}
 

	
 
	function people_findByUsername ($username)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.people.findByUsername.html */
 
		$this->request("flickr.people.findByUsername", array("username"=>$username));
 
		return $this->parsed_response ? $this->parsed_response['user'] : false;
 
	}
 

	
 
	function people_getInfo($user_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.people.getInfo.html */
 
		$this->request("flickr.people.getInfo", array("user_id"=>$user_id));
 
		return $this->parsed_response ? $this->parsed_response['person'] : false;
 
	}
 

	
 
	function people_getPublicGroups($user_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.people.getPublicGroups.html */
 
		$this->request("flickr.people.getPublicGroups", array("user_id"=>$user_id));
 
		return $this->parsed_response ? $this->parsed_response['groups']['group'] : false;
 
	}
 

	
 
	function people_getPublicPhotos($user_id, $extras = NULL, $per_page = NULL, $page = NULL) {
 
		/* http://www.flickr.com/services/api/flickr.people.getPublicPhotos.html */
 
		if (is_array($extras)) {
 
			$extras = implode(",", $extras);
 
		}
 

	
 
		$this->request("flickr.people.getPublicPhotos", array("user_id"=>$user_id, "extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
 
		return $this->parsed_response ? $this->parsed_response['photos'] : false;
 
	}
 

	
 
	function people_getUploadStatus()
 
	{
 
		/* http://www.flickr.com/services/api/flickr.people.getUploadStatus.html */
 
		/* Requires Authentication */
 
		$this->request("flickr.people.getUploadStatus");
 
		return $this->parsed_response ? $this->parsed_response['user'] : false;
 
	}
 

	
 

	
 
	/* Photos Methods */
 
	function photos_addTags ($photo_id, $tags)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.addTags.html */
 
		$this->request("flickr.photos.addTags", array("photo_id"=>$photo_id, "tags"=>$tags), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photos_delete($photo_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.delete.html */
 
		$this->request("flickr.photos.delete", array("photo_id"=>$photo_id), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photos_getAllContexts ($photo_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.getAllContexts.html */
 
		$this->request("flickr.photos.getAllContexts", array("photo_id"=>$photo_id));
 
		return $this->parsed_response ? $this->parsed_response : false;
 
	}
 

	
 
	function photos_getContactsPhotos ($count = NULL, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.getContactsPhotos.html */
 
		$this->request("flickr.photos.getContactsPhotos", array("count"=>$count, "just_friends"=>$just_friends, "single_photo"=>$single_photo, "include_self"=>$include_self, "extras"=>$extras));
 
		return $this->parsed_response ? $this->parsed_response['photos']['photo'] : false;
 
	}
 

	
 
	function photos_getContactsPublicPhotos ($user_id, $count = NULL, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.getContactsPublicPhotos.html */
 
		$this->request("flickr.photos.getContactsPublicPhotos", array("user_id"=>$user_id, "count"=>$count, "just_friends"=>$just_friends, "single_photo"=>$single_photo, "include_self"=>$include_self, "extras"=>$extras));
 
		return $this->parsed_response ? $this->parsed_response['photos']['photo'] : false;
 
	}
 

	
 
	function photos_getContext ($photo_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.getContext.html */
 
		$this->request("flickr.photos.getContext", array("photo_id"=>$photo_id));
 
		return $this->parsed_response ? $this->parsed_response : false;
 
	}
 

	
 
	function photos_getCounts ($dates = NULL, $taken_dates = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.getCounts.html */
 
		$this->request("flickr.photos.getCounts", array("dates"=>$dates, "taken_dates"=>$taken_dates));
 
		return $this->parsed_response ? $this->parsed_response['photocounts']['photocount'] : false;
 
	}
 

	
 
	function photos_getExif ($photo_id, $secret = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.getExif.html */
 
		$this->request("flickr.photos.getExif", array("photo_id"=>$photo_id, "secret"=>$secret));
 
		return $this->parsed_response ? $this->parsed_response['photo'] : false;
 
	}
 
	
 
	function photos_getFavorites($photo_id, $page = NULL, $per_page = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.getFavorites.html */
 
		$this->request("flickr.photos.getFavorites", array("photo_id"=>$photo_id, "page"=>$page, "per_page"=>$per_page));
 
		return $this->parsed_response ? $this->parsed_response['photo'] : false;
 
	}
 

	
 
	function photos_getInfo($photo_id, $secret = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.getInfo.html */
 
		$this->request("flickr.photos.getInfo", array("photo_id"=>$photo_id, "secret"=>$secret));
 
		return $this->parsed_response ? $this->parsed_response['photo'] : false;
 
	}
 

	
 
	function photos_getNotInSet($min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = NULL, $extras = NULL, $per_page = NULL, $page = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.getNotInSet.html */
 
		if (is_array($extras)) {
 
			$extras = implode(",", $extras);
 
		}
 
		$this->request("flickr.photos.getNotInSet", array("min_upload_date"=>$min_upload_date, "max_upload_date"=>$max_upload_date, "min_taken_date"=>$min_taken_date, "max_taken_date"=>$max_taken_date, "privacy_filter"=>$privacy_filter, "extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
 
		return $this->parsed_response ? $this->parsed_response['photos'] : false;
 
	}
 

	
 
	function photos_getPerms($photo_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.getPerms.html */
 
		$this->request("flickr.photos.getPerms", array("photo_id"=>$photo_id));
 
		return $this->parsed_response ? $this->parsed_response['perms'] : false;
 
	}
 

	
 
	function photos_getRecent($extras = NULL, $per_page = NULL, $page = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.getRecent.html */
 

	
 
		if (is_array($extras)) {
 
			$extras = implode(",", $extras);
 
		}
 
		$this->request("flickr.photos.getRecent", array("extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
 
		return $this->parsed_response ? $this->parsed_response['photos'] : false;
 
	}
 

	
 
	function photos_getSizes($photo_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.getSizes.html */
 
		$this->request("flickr.photos.getSizes", array("photo_id"=>$photo_id));
 
		return $this->parsed_response ? $this->parsed_response['sizes']['size'] : false;
 
	}
 

	
 
	function photos_getUntagged($min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = NULL, $extras = NULL, $per_page = NULL, $page = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.getUntagged.html */
 
		if (is_array($extras)) {
 
			$extras = implode(",", $extras);
 
		}
 
		$this->request("flickr.photos.getUntagged", array("min_upload_date"=>$min_upload_date, "max_upload_date"=>$max_upload_date, "min_taken_date"=>$min_taken_date, "max_taken_date"=>$max_taken_date, "privacy_filter"=>$privacy_filter, "extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
 
		return $this->parsed_response ? $this->parsed_response['photos'] : false;
 
	}
 

	
 
	function photos_getWithGeoData($args = NULL) {
 
		/* See the documentation included with the photos_search() function.
 
		 * I'm using the same style of arguments for this function. The only
 
		 * difference here is that this doesn't require any arguments. The
 
		 * flickr.photos.search method requires at least one search parameter.
 
		 */
 
		/* http://www.flickr.com/services/api/flickr.photos.getWithGeoData.html */
 
		if (is_null($args)) {
 
			$args = array();
 
		}
 
		$this->request("flickr.photos.getWithGeoData", $args);
 
		return $this->parsed_response ? $this->parsed_response['photos'] : false;
 
	}
 

	
 
	function photos_getWithoutGeoData($args = NULL) {
 
		/* See the documentation included with the photos_search() function.
 
		 * I'm using the same style of arguments for this function. The only
 
		 * difference here is that this doesn't require any arguments. The
 
		 * flickr.photos.search method requires at least one search parameter.
 
		 */
 
		/* http://www.flickr.com/services/api/flickr.photos.getWithoutGeoData.html */
 
		if (is_null($args)) {
 
			$args = array();
 
		}
 
		$this->request("flickr.photos.getWithoutGeoData", $args);
 
		return $this->parsed_response ? $this->parsed_response['photos'] : false;
 
	}
 

	
 
	function photos_recentlyUpdated($min_date = NULL, $extras = NULL, $per_page = NULL, $page = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.getUntagged.html */
 
		if (is_array($extras)) {
 
			$extras = implode(",", $extras);
 
		}
 
		$this->request("flickr.photos.recentlyUpdated", array("min_date"=>$min_date, "extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
 
		return $this->parsed_response ? $this->parsed_response['photos'] : false;
 
	}
 

	
 
	function photos_removeTag($tag_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.removeTag.html */
 
		$this->request("flickr.photos.removeTag", array("tag_id"=>$tag_id), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photos_search($args)
 
	{
 
		/* This function strays from the method of arguments that I've
 
		 * used in the other functions for the fact that there are just
 
		 * so many arguments to this API method. What you'll need to do
 
		 * is pass an associative array to the function containing the
 
		 * arguments you want to pass to the API.  For example:
 
		 *   $photos = $f->photos_search(array("tags"=>"brown,cow", "tag_mode"=>"any"));
 
		 * This will return photos tagged with either "brown" or "cow"
 
		 * or both. See the API documentation (link below) for a full
 
		 * list of arguments.
 
		 */
 

	
 
		/* http://www.flickr.com/services/api/flickr.photos.search.html */
 
		$this->request("flickr.photos.search", $args);
 
		return $this->parsed_response ? $this->parsed_response['photos'] : false;
 
	}
 

	
 
	function photos_setContentType ($photo_id, $content_type) {
 
		/* http://www.flickr.com/services/api/flickr.photos.setContentType.html */
 
		return $this->call('flickr.photos.setContentType', array('photo_id' => $photo_id, 'content_type' => $content_type));
 
	}
 
	
 
	function photos_setDates($photo_id, $date_posted = NULL, $date_taken = NULL, $date_taken_granularity = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.setDates.html */
 
		$this->request("flickr.photos.setDates", array("photo_id"=>$photo_id, "date_posted"=>$date_posted, "date_taken"=>$date_taken, "date_taken_granularity"=>$date_taken_granularity), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photos_setMeta($photo_id, $title, $description)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.setMeta.html */
 
		$this->request("flickr.photos.setMeta", array("photo_id"=>$photo_id, "title"=>$title, "description"=>$description), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photos_setPerms($photo_id, $is_public, $is_friend, $is_family, $perm_comment, $perm_addmeta)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.setPerms.html */
 
		$this->request("flickr.photos.setPerms", array("photo_id"=>$photo_id, "is_public"=>$is_public, "is_friend"=>$is_friend, "is_family"=>$is_family, "perm_comment"=>$perm_comment, "perm_addmeta"=>$perm_addmeta), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photos_setSafetyLevel ($photo_id, $safety_level, $hidden = null) {
 
		/* http://www.flickr.com/services/api/flickr.photos.setSafetyLevel.html */
 
		return $this->call('flickr.photos.setSafetyLevel', array('photo_id' => $photo_id, 'safety_level' => $safety_level, 'hidden' => $hidden));
 
	}
 
	
 

	
 
	function photos_setTags($photo_id, $tags)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.setTags.html */
 
		$this->request("flickr.photos.setTags", array("photo_id"=>$photo_id, "tags"=>$tags), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	/* Photos - Comments Methods */
 
	function photos_comments_addComment($photo_id, $comment_text) {
 
		/* http://www.flickr.com/services/api/flickr.photos.comments.addComment.html */
 
		$this->request("flickr.photos.comments.addComment", array("photo_id" => $photo_id, "comment_text"=>$comment_text), TRUE);
 
		return $this->parsed_response ? $this->parsed_response['comment'] : false;
 
	}
 

	
 
	function photos_comments_deleteComment($comment_id) {
 
		/* http://www.flickr.com/services/api/flickr.photos.comments.deleteComment.html */
 
		$this->request("flickr.photos.comments.deleteComment", array("comment_id" => $comment_id), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photos_comments_editComment($comment_id, $comment_text) {
 
		/* http://www.flickr.com/services/api/flickr.photos.comments.editComment.html */
 
		$this->request("flickr.photos.comments.editComment", array("comment_id" => $comment_id, "comment_text"=>$comment_text), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photos_comments_getList($photo_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.comments.getList.html */
 
		$this->request("flickr.photos.comments.getList", array("photo_id"=>$photo_id));
 
		return $this->parsed_response ? $this->parsed_response['comments'] : false;
 
	}
 

	
 
	/* Photos - Geo Methods */
 
	function photos_geo_getLocation($photo_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.geo.getLocation.html */
 
		$this->request("flickr.photos.geo.getLocation", array("photo_id"=>$photo_id));
 
		return $this->parsed_response ? $this->parsed_response['photo'] : false;
 
	}
 

	
 
	function photos_geo_getPerms($photo_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.geo.getPerms.html */
 
		$this->request("flickr.photos.geo.getPerms", array("photo_id"=>$photo_id));
 
		return $this->parsed_response ? $this->parsed_response['perms'] : false;
 
	}
 

	
 
	function photos_geo_removeLocation($photo_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.geo.removeLocation.html */
 
		$this->request("flickr.photos.geo.removeLocation", array("photo_id"=>$photo_id), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photos_geo_setLocation($photo_id, $lat, $lon, $accuracy = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.geo.setLocation.html */
 
		$this->request("flickr.photos.geo.setLocation", array("photo_id"=>$photo_id, "lat"=>$lat, "lon"=>$lon, "accuracy"=>$accuracy), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photos_geo_setPerms($photo_id, $is_public, $is_contact, $is_friend, $is_family)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.geo.setPerms.html */
 
		$this->request("flickr.photos.geo.setPerms", array("photo_id"=>$photo_id, "is_public"=>$is_public, "is_contact"=>$is_contact, "is_friend"=>$is_friend, "is_family"=>$is_family), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	/* Photos - Licenses Methods */
 
	function photos_licenses_getInfo()
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.licenses.getInfo.html */
 
		$this->request("flickr.photos.licenses.getInfo");
 
		return $this->parsed_response ? $this->parsed_response['licenses']['license'] : false;
 
	}
 

	
 
	function photos_licenses_setLicense($photo_id, $license_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.licenses.setLicense.html */
 
		/* Requires Authentication */
 
		$this->request("flickr.photos.licenses.setLicense", array("photo_id"=>$photo_id, "license_id"=>$license_id), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	/* Photos - Notes Methods */
 
	function photos_notes_add($photo_id, $note_x, $note_y, $note_w, $note_h, $note_text)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.notes.add.html */
 
		$this->request("flickr.photos.notes.add", array("photo_id" => $photo_id, "note_x" => $note_x, "note_y" => $note_y, "note_w" => $note_w, "note_h" => $note_h, "note_text" => $note_text), TRUE);
 
		return $this->parsed_response ? $this->parsed_response['note'] : false;
 
	}
 

	
 
	function photos_notes_delete($note_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.notes.delete.html */
 
		$this->request("flickr.photos.notes.delete", array("note_id" => $note_id), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photos_notes_edit($note_id, $note_x, $note_y, $note_w, $note_h, $note_text)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.notes.edit.html */
 
		$this->request("flickr.photos.notes.edit", array("note_id" => $note_id, "note_x" => $note_x, "note_y" => $note_y, "note_w" => $note_w, "note_h" => $note_h, "note_text" => $note_text), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	/* Photos - Transform Methods */
 
	function photos_transform_rotate($photo_id, $degrees)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.transform.rotate.html */
 
		$this->request("flickr.photos.transform.rotate", array("photo_id" => $photo_id, "degrees" => $degrees), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	/* Photos - Upload Methods */
 
	function photos_upload_checkTickets($tickets)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.upload.checkTickets.html */
 
		if (is_array($tickets)) {
 
			$tickets = implode(",", $tickets);
 
		}
 
		$this->request("flickr.photos.upload.checkTickets", array("tickets" => $tickets), TRUE);
 
		return $this->parsed_response ? $this->parsed_response['uploader']['ticket'] : false;
 
	}
 

	
 
	/* Photosets Methods */
 
	function photosets_addPhoto($photoset_id, $photo_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photosets.addPhoto.html */
 
		$this->request("flickr.photosets.addPhoto", array("photoset_id" => $photoset_id, "photo_id" => $photo_id), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photosets_create($title, $description, $primary_photo_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photosets.create.html */
 
		$this->request("flickr.photosets.create", array("title" => $title, "primary_photo_id" => $primary_photo_id, "description" => $description), TRUE);
 
		return $this->parsed_response ? $this->parsed_response['photoset'] : false;
 
	}
 

	
 
	function photosets_delete($photoset_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photosets.delete.html */
 
		$this->request("flickr.photosets.delete", array("photoset_id" => $photoset_id), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photosets_editMeta($photoset_id, $title, $description = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photosets.editMeta.html */
 
		$this->request("flickr.photosets.editMeta", array("photoset_id" => $photoset_id, "title" => $title, "description" => $description), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photosets_editPhotos($photoset_id, $primary_photo_id, $photo_ids)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photosets.editPhotos.html */
 
		$this->request("flickr.photosets.editPhotos", array("photoset_id" => $photoset_id, "primary_photo_id" => $primary_photo_id, "photo_ids" => $photo_ids), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photosets_getContext($photo_id, $photoset_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photosets.getContext.html */
 
		$this->request("flickr.photosets.getContext", array("photo_id" => $photo_id, "photoset_id" => $photoset_id));
 
		return $this->parsed_response ? $this->parsed_response : false;
 
	}
 

	
 
	function photosets_getInfo($photoset_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photosets.getInfo.html */
 
		$this->request("flickr.photosets.getInfo", array("photoset_id" => $photoset_id));
 
		return $this->parsed_response ? $this->parsed_response['photoset'] : false;
 
	}
 

	
 
	function photosets_getList($user_id = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photosets.getList.html */
 
		$this->request("flickr.photosets.getList", array("user_id" => $user_id));
 
		return $this->parsed_response ? $this->parsed_response['photosets'] : false;
 
	}
 

	
 
	function photosets_getPhotos($photoset_id, $extras = NULL, $privacy_filter = NULL, $per_page = NULL, $page = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photosets.getPhotos.html */
 
		$this->request("flickr.photosets.getPhotos", array("photoset_id" => $photoset_id, "extras" => $extras, "privacy_filter" => $privacy_filter, "per_page" => $per_page, "page" => $page));
 
		return $this->parsed_response ? $this->parsed_response['photoset'] : false;
 
	}
 

	
 
	function photosets_orderSets($photoset_ids)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photosets.orderSets.html */
 
		if (is_array($photoset_ids)) {
 
			$photoset_ids = implode(",", $photoset_ids);
 
		}
 
		$this->request("flickr.photosets.orderSets", array("photoset_ids" => $photoset_ids), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photosets_removePhoto($photoset_id, $photo_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photosets.removePhoto.html */
 
		$this->request("flickr.photosets.removePhoto", array("photoset_id" => $photoset_id, "photo_id" => $photo_id), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	/* Photosets Comments Methods */
 
	function photosets_comments_addComment($photoset_id, $comment_text) {
 
		/* http://www.flickr.com/services/api/flickr.photosets.comments.addComment.html */
 
		$this->request("flickr.photosets.comments.addComment", array("photoset_id" => $photoset_id, "comment_text"=>$comment_text), TRUE);
 
		return $this->parsed_response ? $this->parsed_response['comment'] : false;
 
	}
 

	
 
	function photosets_comments_deleteComment($comment_id) {
 
		/* http://www.flickr.com/services/api/flickr.photosets.comments.deleteComment.html */
 
		$this->request("flickr.photosets.comments.deleteComment", array("comment_id" => $comment_id), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photosets_comments_editComment($comment_id, $comment_text) {
 
		/* http://www.flickr.com/services/api/flickr.photosets.comments.editComment.html */
 
		$this->request("flickr.photosets.comments.editComment", array("comment_id" => $comment_id, "comment_text"=>$comment_text), TRUE);
 
		return $this->parsed_response ? true : false;
 
	}
 

	
 
	function photosets_comments_getList($photoset_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photosets.comments.getList.html */
 
		$this->request("flickr.photosets.comments.getList", array("photoset_id"=>$photoset_id));
 
		return $this->parsed_response ? $this->parsed_response['comments'] : false;
 
	}
 
	
 
	/* Places Methods */
 
	function places_resolvePlaceId ($place_id) {
 
		/* http://www.flickr.com/services/api/flickr.places.resolvePlaceId.html */
 
		$rsp = $this->call('flickr.places.resolvePlaceId', array('place_id' => $place_id));
 
		return $rsp ? $rsp['location'] : $rsp;
 
	}
 
	
 
	function places_resolvePlaceURL ($url) {
 
		/* http://www.flickr.com/services/api/flickr.places.resolvePlaceURL.html */
 
		$rsp = $this->call('flickr.places.resolvePlaceURL', array('url' => $url));
 
		return $rsp ? $rsp['location'] : $rsp;
 
	}
 

	
 
	/* Prefs Methods */
 
	function prefs_getContentType () {
 
		/* http://www.flickr.com/services/api/flickr.prefs.getContentType.html */
 
		$rsp = $this->call('flickr.prefs.getContentType', array());
 
		return $rsp ? $rsp['person'] : $rsp;
 
	}
 
	
 
	function prefs_getHidden () {
 
		/* http://www.flickr.com/services/api/flickr.prefs.getHidden.html */
 
		$rsp = $this->call('flickr.prefs.getHidden', array());
 
		return $rsp ? $rsp['person'] : $rsp;
 
	}
 
	
 
	function prefs_getPrivacy () {
 
		/* http://www.flickr.com/services/api/flickr.prefs.getPrivacy.html */
 
		$rsp = $this->call('flickr.prefs.getPrivacy', array());
 
		return $rsp ? $rsp['person'] : $rsp;
 
	}
 
	
 
	function prefs_getSafetyLevel () {
 
		/* http://www.flickr.com/services/api/flickr.prefs.getSafetyLevel.html */
 
		$rsp = $this->call('flickr.prefs.getSafetyLevel', array());
 
		return $rsp ? $rsp['person'] : $rsp;
 
	}
 

	
 
	/* Reflection Methods */
 
	function reflection_getMethodInfo($method_name)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.reflection.getMethodInfo.html */
 
		$this->request("flickr.reflection.getMethodInfo", array("method_name" => $method_name));
 
		return $this->parsed_response ? $this->parsed_response : false;
 
	}
 

	
 
	function reflection_getMethods()
 
	{
 
		/* http://www.flickr.com/services/api/flickr.reflection.getMethods.html */
 
		$this->request("flickr.reflection.getMethods");
 
		return $this->parsed_response ? $this->parsed_response['methods']['method'] : false;
 
	}
 

	
 
	/* Tags Methods */
 
	function tags_getHotList($period = NULL, $count = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.tags.getHotList.html */
 
		$this->request("flickr.tags.getHotList", array("period" => $period, "count" => $count));
 
		return $this->parsed_response ? $this->parsed_response['hottags'] : false;
 
	}
 

	
 
	function tags_getListPhoto($photo_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.tags.getListPhoto.html */
 
		$this->request("flickr.tags.getListPhoto", array("photo_id" => $photo_id));
 
		return $this->parsed_response ? $this->parsed_response['photo']['tags']['tag'] : false;
 
	}
 

	
 
	function tags_getListUser($user_id = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.tags.getListUser.html */
 
		$this->request("flickr.tags.getListUser", array("user_id" => $user_id));
 
		return $this->parsed_response ? $this->parsed_response['who']['tags']['tag'] : false;
 
	}
 

	
 
	function tags_getListUserPopular($user_id = NULL, $count = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.tags.getListUserPopular.html */
 
		$this->request("flickr.tags.getListUserPopular", array("user_id" => $user_id, "count" => $count));
 
		return $this->parsed_response ? $this->parsed_response['who']['tags']['tag'] : false;
 
	}
 

	
 
	function tags_getListUserRaw($tag)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.tags.getListUserRaw.html */
 
		$this->request("flickr.tags.getListUserRaw", array("tag" => $tag));
 
		return $this->parsed_response ? $this->parsed_response['who']['tags']['tag'][0]['raw'] : false;
 
	}
 

	
 
	function tags_getRelated($tag)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.tags.getRelated.html */
 
		$this->request("flickr.tags.getRelated", array("tag" => $tag));
 
		return $this->parsed_response ? $this->parsed_response['tags'] : false;
 
	}
 

	
 
	function test_echo($args = array())
 
	{
 
		/* http://www.flickr.com/services/api/flickr.test.echo.html */
 
		$this->request("flickr.test.echo", $args);
 
		return $this->parsed_response ? $this->parsed_response : false;
 
	}
 

	
 
	function test_login()
 
	{
 
		/* http://www.flickr.com/services/api/flickr.test.login.html */
 
		$this->request("flickr.test.login");
 
		return $this->parsed_response ? $this->parsed_response['user'] : false;
 
	}
 

	
 
	function urls_getGroup($group_id)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.urls.getGroup.html */
 
		$this->request("flickr.urls.getGroup", array("group_id"=>$group_id));
 
		return $this->parsed_response ? $this->parsed_response['group']['url'] : false;
 
	}
 

	
 
	function urls_getUserPhotos($user_id = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.urls.getUserPhotos.html */
 
		$this->request("flickr.urls.getUserPhotos", array("user_id"=>$user_id));
 
		return $this->parsed_response ? $this->parsed_response['user']['url'] : false;
 
	}
 

	
 
	function urls_getUserProfile($user_id = NULL)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.urls.getUserProfile.html */
 
		$this->request("flickr.urls.getUserProfile", array("user_id"=>$user_id));
 
		return $this->parsed_response ? $this->parsed_response['user']['url'] : false;
 
	}
 

	
 
	function urls_lookupGroup($url)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.urls.lookupGroup.html */
 
		$this->request("flickr.urls.lookupGroup", array("url"=>$url));
 
		return $this->parsed_response ? $this->parsed_response['group'] : false;
 
	}
 

	
 
	function urls_lookupUser($url)
 
	{
 
		/* http://www.flickr.com/services/api/flickr.photos.notes.edit.html */
 
		$this->request("flickr.urls.lookupUser", array("url"=>$url));
 
		return $this->parsed_response ? $this->parsed_response['user'] : false;
 
	}
 
}
 

	
 

	
 
?>
0 comments (0 inline, 0 general)