]> git.sur5r.net Git - contagged/commitdiff
JavaScript updates (migration to JQuery + Interface)
authorAndreas Gohr <gohr@cosmocode.de>
Wed, 13 Jun 2007 14:42:06 +0000 (16:42 +0200)
committerAndreas Gohr <gohr@cosmocode.de>
Wed, 13 Jun 2007 14:42:06 +0000 (16:42 +0200)
darcs-hash:20070613144206-6e07b-4685df44fbd80a81b6303950ece69f8347acdd38.gz

36 files changed:
ajax.php
init.php
scripts/gui.js [new file with mode: 0644]
scripts/interface/accordion.js [new file with mode: 0644]
scripts/interface/carousel.js [new file with mode: 0644]
scripts/interface/easing.js [new file with mode: 0644]
scripts/interface/fisheye.js [new file with mode: 0644]
scripts/interface/iautocompleter.js [new file with mode: 0644]
scripts/interface/iautoscroller.js [new file with mode: 0644]
scripts/interface/idrag.js [new file with mode: 0644]
scripts/interface/idrop.js [new file with mode: 0644]
scripts/interface/iexpander.js [new file with mode: 0644]
scripts/interface/ifx.js [new file with mode: 0644]
scripts/interface/ifxblind.js [new file with mode: 0644]
scripts/interface/ifxbounce.js [new file with mode: 0644]
scripts/interface/ifxdrop.js [new file with mode: 0644]
scripts/interface/ifxfold.js [new file with mode: 0644]
scripts/interface/ifxhighlight.js [new file with mode: 0644]
scripts/interface/ifxopenclose.js [new file with mode: 0644]
scripts/interface/ifxpulsate.js [new file with mode: 0644]
scripts/interface/ifxscale.js [new file with mode: 0644]
scripts/interface/ifxscrollto.js [new file with mode: 0644]
scripts/interface/ifxshake.js [new file with mode: 0644]
scripts/interface/ifxslide.js [new file with mode: 0644]
scripts/interface/ifxtransfer.js [new file with mode: 0644]
scripts/interface/imagebox.js [new file with mode: 0644]
scripts/interface/iresizable.js [new file with mode: 0644]
scripts/interface/iselect.js [new file with mode: 0644]
scripts/interface/islider.js [new file with mode: 0644]
scripts/interface/islideshow.js [new file with mode: 0644]
scripts/interface/isortables.js [new file with mode: 0644]
scripts/interface/itooltip.js [new file with mode: 0644]
scripts/interface/ittabs.js [new file with mode: 0644]
scripts/interface/iutil.js [new file with mode: 0644]
scripts/jquery.js [new file with mode: 0644]
templates/header.tpl

index 73101807035813425cec9ee6f64cdef14fea60a3..75a5822ed26227c8ba0c15ef9ca44c3c2ba40ffa 100644 (file)
--- a/ajax.php
+++ b/ajax.php
@@ -2,15 +2,35 @@
 require_once('init.php');
 ldap_login();
 
-header('Content-Type: text/html; charset=utf-8');
+header('Content-Type: text/xml; charset=utf-8');
 
+/*
+echo '<bla><[!CDATA[';
+print_r($_REQUEST);
+echo ']]></bla>';
+*/
+
+$FIELD = preg_replace('/entry\[/','',$_REQUEST['field']);
+$FIELD = preg_replace('/\W+/','',$FIELD);
+
+if($FIELD == 'marker'||$FIELD == 'markers'){
+  ajax_taglookup($_REQUEST['value']);
+}else{
+  ajax_lookup($FIELD,$_REQUEST['value']);
+}
+
+/*
 if(!empty($_REQUEST['taglookup'])){
   ajax_taglookup($_REQUEST['taglookup']);
+}elseif(!empty($_REQUEST['lookup']) && !empty($_REQUEST['s'])){
+  ajax_lookup($_REQUEST['lookup'],$_REQUEST['s']);
 }elseif(!empty($_REQUEST['addnote'])){
   ajax_addnote($_REQUEST['addnote'],$_REQUEST['note']);
 }elseif(!empty($_REQUEST['settags'])){
   ajax_settags($_REQUEST['settags'],$_REQUEST['tags']);
 }
+*/
+
 
 /**
  * Add a note to the existing notes
@@ -69,10 +89,11 @@ function ajax_settags($dn,$tags){
 function ajax_taglookup($tag){
   global $conf;
   global $LDAP_CON;
+  global $FIELDS;
   if(!$FIELDS['_marker']) return;
 
   $search = ldap_filterescape($tag);
-  $filter = "(&(objectClass=inetOrgPerson)('.$FIELDS['_marker'].'=$search*))";
+  $filter = "(&(objectClass=inetOrgPerson)(".$FIELDS['_marker']."=$search*))";
   $result = ldap_queryabooks($filter,$FIELDS['_marker']);
 
   if(!count($result)) return;
@@ -91,11 +112,52 @@ function ajax_taglookup($tag){
   $tags = array_unique($tags);
   sort($tags,SORT_STRING);
 
-  print '<ul>';
+  echo '<?xml version="1.0"?>'.NL;
+  echo '<ajaxresponse>'.NL;
   foreach($tags as $out){
-    print '<li>'.htmlspecialchars($out).'</li>';
+    echo '<item>'.NL;
+    echo '<value>'.htmlspecialchars($out).'</value>'.NL;
+    echo '<text>'.htmlspecialchars($out).'</text>'.NL;
+    echo '</item>'.NL;
   }
-  print '</ul>';
+  echo '</ajaxresponse>'.NL;
+}
+
+/**
+ * Do a simple lookup in any simple field
+ */
+function ajax_lookup($field,$search){
+    global $conf;
+    global $LDAP_CON;
+    global $FIELDS;
+
+    if(!$FIELDS[$field]) return;
+    $field = $FIELDS[$field];
+
+    $search = ldap_filterescape($search);
+    $filter = "(&(objectClass=inetOrgPerson)($field=$search*))";
+    $result = ldap_queryabooks($filter,$field);
+    if(!count($result)) return;
+
+    $items = array();
+    foreach ($result as $entry){
+        if(isset($entry[$field]) && !empty($entry[$field])){
+            $items[] = $entry[$field][0];
+        }
+    }
+
+    $items = array_unique($items);
+    sort($items,SORT_STRING);
+
+    echo '<?xml version="1.0"?>'.NL;
+    echo '<ajaxresponse>'.NL;
+    foreach($items as $out){
+        echo '<item>'.NL;
+        echo '<value>'.htmlspecialchars($out).'</value>'.NL;
+        echo '<text>'.htmlspecialchars($out).'</text>'.NL;
+        echo '</item>'.NL;
+    }
+    echo '</ajaxresponse>'.NL;
 }
 
 ?>
index ec981fa620969c9d7f4a3fe986743a9ee9d4d93a..657a1c6b37453f03f4eb25dd95e032c4e1887290 100644 (file)
--- a/init.php
+++ b/init.php
@@ -6,6 +6,8 @@
   require_once('template.php');
   require_once('smarty/Smarty.class.php');
 
+  define('NL',"\n");
+
   //init session
   session_name("ldapab");
   session_start();
diff --git a/scripts/gui.js b/scripts/gui.js
new file mode 100644 (file)
index 0000000..3ec99e0
--- /dev/null
@@ -0,0 +1,50 @@
+
+
+
+
+
+/**
+ * Initialize everything when DOM is ready
+ */
+$(document).ready(function() {
+
+  // autocompletion
+  $('#taglookup').Autocomplete({
+        source: 'ajax.php',
+        delay: 300,
+        helperClass: 'autocompleter',
+        selectClass: 'autocompleterSelect',
+        inputWidth: true,
+        minchars: 1,
+        //multiple: true,
+        //multipleSeperator: ','
+  });
+  $('#tageditlookup').Autocomplete({
+        source: 'ajax.php',
+        delay: 300,
+        helperClass: 'autocompleter',
+        selectClass: 'autocompleterSelect',
+        inputWidth: true,
+        minchars: 1,
+        multiple: true,
+        multipleSeperator: ','
+  });
+  // autocompletion
+  $('input.ac').Autocomplete({
+        source: 'ajax.php',
+        delay: 300,
+        helperClass: 'autocompleter',
+        selectClass: 'autocompleterSelect',
+        inputWidth: true,
+        minchars: 1,
+  });
+
+  $.ImageBox.init({
+        loaderSRC: 'pix/imagebox/loading.gif',
+        closeHTML: '<img src="pix/imagebox/close.jpg" border="0" />'
+  });
+
+  // set focus
+  if($('#searchfield')) $('#searchfield').focus();
+  if($('#firstfield')) $('#firstfield').focus();
+});
diff --git a/scripts/interface/accordion.js b/scripts/interface/accordion.js
new file mode 100644 (file)
index 0000000..a9e18d5
--- /dev/null
@@ -0,0 +1,165 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * Accordion\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ */\r
+\r
+/**\r
+ * Create an accordion from a HTML structure\r
+ *\r
+ * @example $('#myAccordion').Accordion(\r
+ *                             {\r
+ *                                     headerSelector  : 'dt',\r
+ *                                     panelSelector   : 'dd',\r
+ *                                     activeClass             : 'myAccordionActive',\r
+ *                                     hoverClass              : 'myAccordionHover',\r
+ *                                     panelHeight             : 200,\r
+ *                                     speed                   : 300\r
+ *                             }\r
+ *                     );\r
+ * @desc Converts definition list with id 'myAccordion' into an accordion width dt tags as headers and dd tags as panels\r
+ * \r
+ * @name Accordion\r
+ * @description Create an accordion from a HTML structure\r
+ * @param Hash hash A hash of parameters\r
+ * @option Integer panelHeight the pannels' height\r
+ * @option String headerSelector selector for header elements\r
+ * @option String panelSelector selector for panel elements\r
+ * @option String activeClass (optional) CSS Class for active header\r
+ * @option String hoverClass (optional) CSS Class for hovered header\r
+ * @option Function onShow (optional) callback called whenever an pannel gets active\r
+ * @option Function onHide (optional) callback called whenever an pannel gets incative\r
+ * @option Function onClick (optional) callback called just before an panel gets active\r
+ * @option Mixed speed (optional) animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+ * @option Integer crrentPanel (otional) the active panel on initialisation\r
+ *\r
+ * @type jQuery\r
+ * @cat Plugins/Interface\r
+ * @author Stefan Petre\r
+ */\r
+jQuery.iAccordion = {\r
+       build : function(options)\r
+       {\r
+               return this.each(\r
+                       function()\r
+                       {\r
+                               if (!options.headerSelector || !options.panelSelector)\r
+                                       return;\r
+                               var el = this;\r
+                               el.accordionCfg = {\r
+                                       panelHeight                     : options.panelHeight||300,\r
+                                       headerSelector          : options.headerSelector,\r
+                                       panelSelector           : options.panelSelector,\r
+                                       activeClass                     : options.activeClass||'fakeAccordionClass',\r
+                                       hoverClass                      : options.hoverClass||'fakeAccordionClass',\r
+                                       onShow                          : options.onShow && typeof options.onShow == 'function' ? options.onShow : false,\r
+                                       onHide                          : options.onShow && typeof options.onHide == 'function' ? options.onHide : false,\r
+                                       onClick                         : options.onClick && typeof options.onClick == 'function' ? options.onClick : false,\r
+                                       headers                         : jQuery(options.headerSelector, this),\r
+                                       panels                          : jQuery(options.panelSelector, this),\r
+                                       speed                           : options.speed||400,\r
+                                       currentPanel            : options.currentPanel||0\r
+                               };\r
+                               el.accordionCfg.panels\r
+                                       .hide()\r
+                                       .css('height', '1px')\r
+                                       .eq(0)\r
+                                       .css(\r
+                                               {\r
+                                                       height: el.accordionCfg.panelHeight + 'px',\r
+                                                       display: 'block'\r
+                                               }\r
+                                       )\r
+                                       .end();\r
+                                       \r
+                               el.accordionCfg.headers\r
+                               .each(\r
+                                       function(nr)\r
+                                       {\r
+                                               this.accordionPos = nr;\r
+                                       }\r
+                               )\r
+                               .hover(\r
+                                       function()\r
+                                       {\r
+                                               jQuery(this).addClass(el.accordionCfg.hoverClass);\r
+                                       },\r
+                                       function()\r
+                                       {\r
+                                               jQuery(this).removeClass(el.accordionCfg.hoverClass);\r
+                                       }\r
+                               )\r
+                               .bind(\r
+                                       'click',\r
+                                       function(e)\r
+                                       {\r
+                                               if (el.accordionCfg.currentPanel == this.accordionPos)\r
+                                                       return;\r
+                                               el.accordionCfg.headers\r
+                                                       .eq(el.accordionCfg.currentPanel)\r
+                                                       .removeClass(el.accordionCfg.activeClass)\r
+                                                       .end()\r
+                                                       .eq(this.accordionPos)\r
+                                                       .addClass(el.accordionCfg.activeClass)\r
+                                                       .end();\r
+                                               el.accordionCfg.panels\r
+                                               .eq(el.accordionCfg.currentPanel)\r
+                                                       .animate(\r
+                                                               {height:0},\r
+                                                               el.accordionCfg.speed,\r
+                                                               function()\r
+                                                               {\r
+                                                                       this.style.display = 'none';\r
+                                                                       if (el.accordionCfg.onHide) {\r
+                                                                               el.accordionCfg.onHide.apply(el, [this]);\r
+                                                                       }\r
+                                                               }\r
+                                                       )\r
+                                               .end()\r
+                                               .eq(this.accordionPos)\r
+                                                       .show()\r
+                                                       .animate (\r
+                                                               {height:el.accordionCfg.panelHeight},\r
+                                                               el.accordionCfg.speed,\r
+                                                               function()\r
+                                                               {\r
+                                                                       this.style.display = 'block';\r
+                                                                       if (el.accordionCfg.onShow) {\r
+                                                                               el.accordionCfg.onShow.apply(el, [this]);\r
+                                                                       }\r
+                                                               }\r
+                                                       )\r
+                                               .end();\r
+                                               \r
+                                               if (el.accordionCfg.onClick) {\r
+                                                       el.accordionCfg.onClick.apply(\r
+                                                               el, \r
+                                                               [\r
+                                                                       this, \r
+                                                                       el.accordionCfg.panels.get(this.accordionPos),\r
+                                                                       el.accordionCfg.headers.get(el.accordionCfg.currentPanel),\r
+                                                                       el.accordionCfg.panels.get(el.accordionCfg.currentPanel)\r
+                                                               ]\r
+                                                       );\r
+                                               }\r
+                                               el.accordionCfg.currentPanel = this.accordionPos;\r
+                                       }\r
+                               )\r
+                               .eq(0)\r
+                               .addClass(el.accordionCfg.activeClass)\r
+                               .end();\r
+                               jQuery(this)\r
+                                       .css('height', jQuery(this).css('height'))\r
+                                       .css('overflow', 'hidden');\r
+                       }\r
+               );\r
+       }\r
+};\r
+\r
+jQuery.fn.Accordion = jQuery.iAccordion.build;
\ No newline at end of file
diff --git a/scripts/interface/carousel.js b/scripts/interface/carousel.js
new file mode 100644 (file)
index 0000000..7ed1c7f
--- /dev/null
@@ -0,0 +1,257 @@
+/**
+ * Interface Elements for jQuery
+ * 3D Carousel
+ * 
+ * http://interface.eyecon.ro
+ * 
+ * Copyright (c) 2006 Stefan Petre
+ * Dual licensed under the MIT (MIT-LICENSE.txt) 
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ */
+/**
+ * Created a 3D Carousel from a list of images, with reflections and animated by mouse position
+ * 
+ * @example window.onload = 
+ *                     function()
+ *                     {
+ *                             $('#carousel').Carousel(
+ *                                     {
+ *                                             itemWidth: 110,
+ *                                             itemHeight: 62,
+ *                                             itemMinWidth: 50,
+ *                                             items: 'a',
+ *                                             reflections: .5,
+ *                                             rotationSpeed: 1.8
+ *                                     }
+ *                             );
+ *                     }
+ * HTML
+ *                     <div id="carousel">
+ *                             <a href="" title=""><img src="" width="100%" /></a>
+ *                             <a href="" title=""><img src="" width="100%" /></a>
+ *                             <a href="" title=""><img src="" width="100%" /></a>
+ *                             <a href="" title=""><img src="" width="100%" /></a>
+ *                             <a href="" title=""><img src="" width="100%" /></a>
+ *                     </div>
+ * CSS
+ *                     #carousel
+ *                     {
+ *                             width: 700px;
+ *                             height: 150px;
+ *                             background-color: #111;
+ *                             position: absolute;
+ *                             top: 200px;
+ *                             left: 100px;
+ *                     }
+ *                     #carousel a
+ *                     {
+ *                             position: absolute;
+ *                             width: 110px;
+ *                     }
+ *
+ * @desc Creates a 3D carousel from all images inside div tag with id 'carousel'
+ *
+ *
+ * @name 3D Carousel
+ * @description Created a 3D Carousel from a list of images, with reflections and animated by mouse position
+ * @param Hash hash A hash of parameters
+ * @option String items items selection
+ * @option Integer itemWidth the max width for each item
+ * @option Integer itemHeight the max height for each item
+ * @option Integer itemMinWidth the minimum width for each item, the height is automaticaly calculated to keep proportions
+ * @option Float rotationSpeed the speed for rotation animation
+ * @option Float reflectionSize the reflection size a fraction from items' height
+ *
+ * @type jQuery
+ * @cat Plugins/Interface
+ * @author Stefan Petre
+ */
+jQuery.iCarousel = {
+       
+       build : function(options)
+       {
+               return this.each(
+                       function()
+                       {
+                               var el = this;
+                               var increment = 2*Math.PI/360;
+                               var maxRotation = 2*Math.PI;
+                               if(jQuery(el).css('position') != 'relative' && jQuery(el).css('position') != 'absolute') {
+                                       jQuery(el).css('position', 'relative');
+                               }
+                               el.carouselCfg = {
+                                       items : jQuery(options.items, this),
+                                       itemWidth : options.itemWidth,
+                                       itemHeight : options.itemHeight,
+                                       itemMinWidth : options.itemMinWidth,
+                                       maxRotation : maxRotation,
+                                       size : jQuery.iUtil.getSize(this),
+                                       position : jQuery.iUtil.getPosition(this),
+                                       start : Math.PI/2,
+                                       rotationSpeed : options.rotationSpeed,
+                                       reflectionSize : options.reflections,
+                                       reflections : [],
+                                       protectRotation : false,
+                                       increment: 2*Math.PI/360
+                               };
+                               el.carouselCfg.radiusX = (el.carouselCfg.size.w - el.carouselCfg.itemWidth)/2;
+                               el.carouselCfg.radiusY =  (el.carouselCfg.size.h - el.carouselCfg.itemHeight - el.carouselCfg.itemHeight * el.carouselCfg.reflectionSize)/2;
+                               el.carouselCfg.step =  2*Math.PI/el.carouselCfg.items.size();
+                               el.carouselCfg.paddingX = el.carouselCfg.size.w/2;
+                               el.carouselCfg.paddingY = el.carouselCfg.size.h/2 - el.carouselCfg.itemHeight * el.carouselCfg.reflectionSize;
+                               var reflexions = document.createElement('div');
+                               jQuery(reflexions)
+                                       .css(
+                                               {
+                                                       position: 'absolute',
+                                                       zIndex: 1,
+                                                       top: 0,
+                                                       left: 0
+                                               }
+                                       );
+                               jQuery(el).append(reflexions);
+                               el.carouselCfg.items
+                                       .each(
+                                               function(nr)
+                                               {
+                                                       image = jQuery('img', this).get(0);
+                                                       height = parseInt(el.carouselCfg.itemHeight*el.carouselCfg.reflectionSize);
+                                                       if (jQuery.browser.msie) {
+                                                               canvas = document.createElement('img');
+                                                               jQuery(canvas).css('position', 'absolute');
+                                                               canvas.src = image.src;                         
+                                                               canvas.style.filter = 'flipv progid:DXImageTransform.Microsoft.Alpha(opacity=60, style=1, finishOpacity=0, startx=0, starty=0, finishx=0)';
+                                       
+                                                       } else {
+                                                               canvas = document.createElement('canvas');
+                                                               if (canvas.getContext) {
+                                                                       context = canvas.getContext("2d");
+                                                                       canvas.style.position = 'absolute';
+                                                                       canvas.style.height = height +'px';
+                                                                       canvas.style.width = el.carouselCfg.itemWidth+'px';
+                                                                       canvas.height = height;
+                                                                       canvas.width = el.carouselCfg.itemWidth;
+                                                                       context.save();
+                                               
+                                                                       context.translate(0,height);
+                                                                       context.scale(1,-1);
+                                                                       
+                                                                       context.drawImage(
+                                                                               image, 
+                                                                               0, 
+                                                                               0, 
+                                                                               el.carouselCfg.itemWidth, 
+                                                                               height
+                                                                       );
+                                       
+                                                                       context.restore();
+                                                                       
+                                                                       context.globalCompositeOperation = "destination-out";
+                                                                       var gradient = context.createLinearGradient(
+                                                                               0, 
+                                                                               0, 
+                                                                               0, 
+                                                                               height
+                                                                       );
+                                                                       
+                                                                       gradient.addColorStop(1, "rgba(255, 255, 255, 1)");
+                                                                       gradient.addColorStop(0, "rgba(255, 255, 255, 0.6)");
+                                               
+                                                                       context.fillStyle = gradient;
+                                                                       if (navigator.appVersion.indexOf('WebKit') != -1) {
+                                                                               context.fill();
+                                                                       } else {
+                                                                               context.fillRect(
+                                                                                       0, 
+                                                                                       0, 
+                                                                                       el.carouselCfg.itemWidth, 
+                                                                                       height
+                                                                               );
+                                                                       }
+                                                               }
+                                                       }
+                                                       
+                                                       el.carouselCfg.reflections[nr] = canvas;
+                                                       jQuery(reflexions).append(canvas);
+                                               }
+                                       )
+                                       .bind(
+                                               'mouseover',
+                                               function(e)
+                                               {
+                                                       el.carouselCfg.protectRotation = true;
+                                                       el.carouselCfg.speed = el.carouselCfg.increment*0.1 * el.carouselCfg.speed / Math.abs(el.carouselCfg.speed);
+                                                       return false;
+                                               }
+                                       )
+                                       .bind(
+                                               'mouseout',
+                                               function(e)
+                                               {
+                                                       el.carouselCfg.protectRotation = false;
+                                                       return false;
+                                               }
+                                       );
+                               jQuery.iCarousel.positionItems(el);
+                               el.carouselCfg.speed = el.carouselCfg.increment*0.2;
+                               el.carouselCfg.rotationTimer = window.setInterval(
+                                       function()
+                                       {
+                                               el.carouselCfg.start += el.carouselCfg.speed;
+                                               if (el.carouselCfg.start > maxRotation)
+                                                       el.carouselCfg.start = 0;
+                                               jQuery.iCarousel.positionItems(el);
+                                       },
+                                       20
+                               );
+                               jQuery(el)
+                                       .bind(
+                                               'mouseout',
+                                               function()
+                                               {
+                                                       el.carouselCfg.speed = el.carouselCfg.increment*0.2 * el.carouselCfg.speed / Math.abs(el.carouselCfg.speed);
+                                               }
+                                       )
+                                       .bind(
+                                               'mousemove',
+                                               function(e)
+                                               {
+                                                       if (el.carouselCfg.protectRotation == false) {
+                                                               pointer = jQuery.iUtil.getPointer(e);
+                                                               mousex =  el.carouselCfg.size.w - pointer.x + el.carouselCfg.position.x;
+                                                               el.carouselCfg.speed = el.carouselCfg.rotationSpeed * el.carouselCfg.increment * (el.carouselCfg.size.w/2 - mousex) / (el.carouselCfg.size.w/2);
+                                                       }
+                                               }
+                                       );
+                       }
+               );
+       },
+
+       positionItems : function(el)
+       {
+               el.carouselCfg.items.each(
+                       function (nr)
+                       {
+                               angle = el.carouselCfg.start+nr*el.carouselCfg.step;
+                               x = el.carouselCfg.radiusX*Math.cos(angle);
+                               y = el.carouselCfg.radiusY*Math.sin(angle) ;
+                               itemZIndex = parseInt(100*(el.carouselCfg.radiusY+y)/(2*el.carouselCfg.radiusY));
+                               parte = (el.carouselCfg.radiusY+y)/(2*el.carouselCfg.radiusY);
+                               
+                               width = parseInt((el.carouselCfg.itemWidth - el.carouselCfg.itemMinWidth) * parte + el.carouselCfg.itemMinWidth);
+                               height = parseInt(width * el.carouselCfg.itemHeight / el.carouselCfg.itemWidth);
+                               this.style.top = el.carouselCfg.paddingY + y - height/2 + "px";
+                       this.style.left = el.carouselCfg.paddingX + x - width/2 + "px";
+                       this.style.width = width + "px";
+                       this.style.height = height + "px";
+                       this.style.zIndex = itemZIndex;
+                               el.carouselCfg.reflections[nr].style.top = parseInt(el.carouselCfg.paddingY + y + height - 1 - height/2) + "px";
+                               el.carouselCfg.reflections[nr].style.left = parseInt(el.carouselCfg.paddingX + x - width/2) + "px";
+                               el.carouselCfg.reflections[nr].style.width = width + "px";
+                               el.carouselCfg.reflections[nr].style.height = parseInt(height * el.carouselCfg.reflectionSize) + "px";
+                       }
+               );
+       }
+};
+jQuery.fn.Carousel = jQuery.iCarousel.build;
\ No newline at end of file
diff --git a/scripts/interface/easing.js b/scripts/interface/easing.js
new file mode 100644 (file)
index 0000000..7b074cf
--- /dev/null
@@ -0,0 +1,124 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * Easing formulas\r
+ *\r
+ * http://interface.eyecon.ro\r
+ *\r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt)\r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ */\r
\r
+/**\r
+ * Starting with jQuery 1.1  the fx function accepts easing formulas that can be used with .animation() and most of FX plugins from Interface. The object can be extended to accept new easing formulas\r
+ */\r
\r
+ jQuery.extend({       \r
+       /**\r
+        *\r
+        * @param Integer p period step in animation\r
+        * @param Integer n current time\r
+        * @param Mixed firstNum begin value\r
+        * @param Mixed delta change in\r
+        * @param Integer duration duration\r
+        */\r
+       easing :  {\r
+               linear: function(p, n, firstNum, delta, duration) {\r
+                       return ((-Math.cos(p*Math.PI)/2) + 0.5) * delta + firstNum;\r
+               },\r
+               \r
+               easein: function(p, n, firstNum, delta, duration) {\r
+                       return delta*(n/=duration)*n*n + firstNum;\r
+               },\r
+               \r
+               easeout: function(p, n, firstNum, delta, duration) {\r
+                       return -delta * ((n=n/duration-1)*n*n*n - 1) + firstNum;\r
+               },\r
+               \r
+               easeboth: function(p, n, firstNum, delta, duration) {\r
+                       if ((n/=duration/2) < 1)\r
+                               return delta/2*n*n*n*n + firstNum;\r
+                               return -delta/2 * ((n-=2)*n*n*n - 2) + firstNum;\r
+               },\r
+               \r
+               bounceout: function(p, n, firstNum, delta, duration) {\r
+                       if ((n/=duration) < (1/2.75)) {\r
+                               return delta*(7.5625*n*n) + firstNum;\r
+                       } else if (n < (2/2.75)) {\r
+                               return delta*(7.5625*(n-=(1.5/2.75))*n + .75) + firstNum;\r
+                       } else if (n < (2.5/2.75)) {\r
+                               return delta*(7.5625*(n-=(2.25/2.75))*n + .9375) + firstNum;\r
+                       } else {\r
+                               return delta*(7.5625*(n-=(2.625/2.75))*n + .984375) + firstNum;\r
+                       }\r
+               },\r
+               \r
+               bouncein: function(p, n, firstNum, delta, duration) {\r
+                       if (jQuery.easing.bounceout)\r
+                               return delta - jQuery.easing.bounceout (p, duration - n, 0, delta, duration) + firstNum;\r
+                       return firstNum + delta;\r
+               },\r
+               \r
+               bounceboth: function(p, n, firstNum, delta, duration) {\r
+                       if (jQuery.easing.bouncein && jQuery.easing.bounceout)\r
+                               if (n < duration/2)\r
+                                       return jQuery.easing.bouncein(p, n*2, 0, delta, duration) * .5 + firstNum;\r
+                               return jQuery.easing.bounceout(p, n*2-duration, 0, delta, duration) * .5 + delta*.5 + firstNum; \r
+                       return firstNum + delta;\r
+               },\r
+               \r
+               elasticin: function(p, n, firstNum, delta, duration) {\r
+                       var a, s;\r
+                       if (n == 0)\r
+                               return firstNum;\r
+                       if ((n/=duration)==1)\r
+                               return firstNum+delta;\r
+                       a = delta * 0.3;\r
+                       p=duration*.3;\r
+                       if (a < Math.abs(delta)) {\r
+                               a=delta;\r
+                               s=p/4;\r
+                       } else { \r
+                               s = p/(2*Math.PI) * Math.asin (delta/a);\r
+                       }\r
+                       return -(a*Math.pow(2,10*(n-=1)) * Math.sin( (n*duration-s)*(2*Math.PI)/p )) + firstNum; \r
+               },\r
+               \r
+               elasticout:function(p, n, firstNum, delta, duration) {\r
+                       var a, s;\r
+                       if (n==0)\r
+                               return firstNum;\r
+                       if ((n/=duration/2)==2)\r
+                               return firstNum + delta;\r
+                       a = delta * 0.3;\r
+                       p=duration*.3;\r
+                       if (a < Math.abs(delta)){\r
+                               a = delta;\r
+                               s=p/4;\r
+                       } else { \r
+                               s = p/(2*Math.PI) * Math.asin (delta/a);\r
+                       }\r
+                       return a*Math.pow(2,-10*n) * Math.sin( (n*duration-s)*(2*Math.PI)/p ) + delta + firstNum;\r
+               },\r
+               \r
+               elasticboth: function(p, n, firstNum, delta, duration) {\r
+                       var a, s;\r
+                       if (n==0)\r
+                               return firstNum;\r
+                       if ((n/=duration/2)==2)\r
+                               return firstNum + delta;\r
+                       a = delta * 0.3;\r
+                       p=duration*.3;\r
+                       if (a < Math.abs(delta)){\r
+                               a = delta;\r
+                               s=p/4;\r
+                       } else { \r
+                               s = p/(2*Math.PI) * Math.asin (delta/a);\r
+                       }\r
+                       if (n < 1) {\r
+                               return -.5*(a*Math.pow(2,10*(n-=1)) * Math.sin( (n*duration-s)*(2*Math.PI)/p )) + firstNum;\r
+                       }\r
+                       return a*Math.pow(2,-10*(n-=1)) * Math.sin( (n*duration-s)*(2*Math.PI)/p )*.5 + delta + firstNum; \r
+               }\r
+       }\r
+});
\ No newline at end of file
diff --git a/scripts/interface/fisheye.js b/scripts/interface/fisheye.js
new file mode 100644 (file)
index 0000000..28079b4
--- /dev/null
@@ -0,0 +1,142 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * Fisheye menu\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ */\r
+\r
+/**\r
+ * Build a Fisheye menu from a list of links\r
+ *\r
+ * @name Fisheye\r
+ * @description Build a Fisheye menu from a list of links\r
+ * @param Hash hash A hash of parameters\r
+ * @option String items items selection\r
+ * @option String container container element\r
+ * @option Integer itemWidth the minimum width for each item\r
+ * @option Integer maxWidth the maximum width for each item\r
+ * @option String itemsText selection of element that contains the text for each item\r
+ * @option Integer proximity the distance from element that make item to interact\r
+ * @option String valign vertical alignment\r
+ * @option String halign horizontal alignment\r
+ *\r
+ * @type jQuery\r
+ * @cat Plugins/Interface\r
+ * @author Stefan Petre\r
+ */\r
+jQuery.iFisheye = {\r
+       \r
+       build : function(options)\r
+       {\r
+       \r
+               return this.each(\r
+                       function()\r
+                       {\r
+                               var el = this;\r
+                               el.fisheyeCfg = {\r
+                                       items : jQuery(options.items, this),\r
+                                       container: jQuery(options.container, this),\r
+                                       pos : jQuery.iUtil.getPosition(this),\r
+                                       itemWidth: options.itemWidth,\r
+                                       itemsText: options.itemsText,\r
+                                       proximity: options.proximity,\r
+                                       valign: options.valign,\r
+                                       halign: options.halign,\r
+                                       maxWidth : options.maxWidth\r
+                               };\r
+                               jQuery.iFisheye.positionContainer(el, 0);\r
+                               jQuery(window).bind(\r
+                                       'resize',\r
+                                       function()\r
+                                       {\r
+                                               el.fisheyeCfg.pos = jQuery.iUtil.getPosition(el);\r
+                                               jQuery.iFisheye.positionContainer(el, 0);\r
+                                               jQuery.iFisheye.positionItems(el);\r
+                                       }\r
+                               );\r
+                               jQuery.iFisheye.positionItems(el);\r
+                               el.fisheyeCfg.items\r
+                                       .bind(\r
+                                               'mouseover',\r
+                                               function()\r
+                                               {\r
+                                                       jQuery(el.fisheyeCfg.itemsText, this).get(0).style.display = 'block';\r
+                                               }\r
+                                       )\r
+                                       .bind(\r
+                                               'mouseout',\r
+                                               function()\r
+                                               {\r
+                                                       jQuery(el.fisheyeCfg.itemsText, this).get(0).style.display = 'none';\r
+                                               }\r
+                                       );\r
+                               jQuery(document).bind(\r
+                                       'mousemove',\r
+                                       function(e)\r
+                                       {\r
+                                               var pointer = jQuery.iUtil.getPointer(e);\r
+                                               var toAdd = 0;\r
+                                               if (el.fisheyeCfg.halign && el.fisheyeCfg.halign == 'center')\r
+                                                       var posx = pointer.x - el.fisheyeCfg.pos.x - (el.offsetWidth - el.fisheyeCfg.itemWidth * el.fisheyeCfg.items.size())/2 - el.fisheyeCfg.itemWidth/2;\r
+                                               else if (el.fisheyeCfg.halign && el.fisheyeCfg.halign == 'right')\r
+                                                       var posx = pointer.x - el.fisheyeCfg.pos.x - el.offsetWidth + el.fisheyeCfg.itemWidth * el.fisheyeCfg.items.size();\r
+                                               else \r
+                                                       var posx = pointer.x - el.fisheyeCfg.pos.x;\r
+                                               var posy = Math.pow(pointer.y - el.fisheyeCfg.pos.y - el.offsetHeight/2,2);\r
+                                               el.fisheyeCfg.items.each(\r
+                                                       function(nr)\r
+                                                       {\r
+                                                               distance = Math.sqrt(\r
+                                                                       Math.pow(posx - nr*el.fisheyeCfg.itemWidth, 2)\r
+                                                                       + posy\r
+                                                               );\r
+                                                               distance -= el.fisheyeCfg.itemWidth/2;\r
+                                                               \r
+                                                               distance = distance < 0 ? 0 : distance;\r
+                                                               distance = distance > el.fisheyeCfg.proximity ? el.fisheyeCfg.proximity : distance;\r
+                                                               distance = el.fisheyeCfg.proximity - distance;\r
+                                                               \r
+                                                               extraWidth = el.fisheyeCfg.maxWidth * distance/el.fisheyeCfg.proximity;\r
+                                                               \r
+                                                               this.style.width = el.fisheyeCfg.itemWidth + extraWidth + 'px';\r
+                                                               this.style.left = el.fisheyeCfg.itemWidth * nr + toAdd + 'px';\r
+                                                               toAdd += extraWidth;\r
+                                                       }\r
+                                               );\r
+                                               jQuery.iFisheye.positionContainer(el, toAdd);\r
+                                       }\r
+                               );\r
+                       }\r
+               )\r
+       },\r
+       \r
+       positionContainer : function(el, toAdd)\r
+       {\r
+               if (el.fisheyeCfg.halign)\r
+                       if (el.fisheyeCfg.halign == 'center')\r
+                               el.fisheyeCfg.container.get(0).style.left = (el.offsetWidth - el.fisheyeCfg.itemWidth * el.fisheyeCfg.items.size())/2 - toAdd/2 + 'px';\r
+                       else if (el.fisheyeCfg.halign == 'left')\r
+                               el.fisheyeCfg.container.get(0).style.left =  - toAdd/el.fisheyeCfg.items.size() + 'px';\r
+                       else if (el.fisheyeCfg.halign == 'right')\r
+                               el.fisheyeCfg.container.get(0).style.left =  (el.offsetWidth - el.fisheyeCfg.itemWidth * el.fisheyeCfg.items.size()) - toAdd/2 + 'px';\r
+               el.fisheyeCfg.container.get(0).style.width = el.fisheyeCfg.itemWidth * el.fisheyeCfg.items.size() + toAdd + 'px';\r
+       },\r
+       \r
+       positionItems : function(el)\r
+       {\r
+               el.fisheyeCfg.items.each(\r
+                       function(nr)\r
+                       {\r
+                               this.style.width = el.fisheyeCfg.itemWidth + 'px';\r
+                               this.style.left = el.fisheyeCfg.itemWidth * nr + 'px';\r
+                       }\r
+               );\r
+       }\r
+};\r
+\r
+jQuery.fn.Fisheye = jQuery.iFisheye.build;
\ No newline at end of file
diff --git a/scripts/interface/iautocompleter.js b/scripts/interface/iautocompleter.js
new file mode 100644 (file)
index 0000000..c7e34da
--- /dev/null
@@ -0,0 +1,537 @@
+/**
+ * Interface Elements for jQuery
+ * Autocompleter
+ * 
+ * http://interface.eyecon.ro
+ * 
+ * Copyright (c) 2006 Stefan Petre
+ * Dual licensed under the MIT (MIT-LICENSE.txt) 
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *  
+ */
+
+/**
+ * Attach AJAX driven autocomplete/sugestion box to text input fields.
+ *
+ * 
+ * 
+ * @name Autocomplete
+ * @description Attach AJAX driven autocomplete/sugestion box to text input fields.
+ * @param Hash hash A hash of parameters
+ * @option String source the URL to request
+ * @option Integer delay (optional) the delayed time to start the AJAX request
+ * @option Boolean autofill (optional) when true the first sugested value fills the input
+ * @option String helperClass (optional) the CSS class applied to sugestion box
+ * @option String selectClass (optional) the CSS class applied to selected/hovered item
+ * @option Integer minchars (optional) the number of characters needed before starting AJAX request
+ * @option Hash fx (optional) {type:[slide|blind|fade]; duration: integer} the fx type to apply to sugestion box and duration for that fx
+ * @option Function onSelect (optional) A function to be executed whenever an item it is selected
+ * @option Function onShow (optional) A function to be executed whenever the suggection box is displayed
+ * @option Function onHide (optional) A function to be executed whenever the suggection box is hidden
+ * @option Function onHighlight (optional) A function to be executed whenever an item it is highlighted
+ *
+ * @type jQuery
+ * @cat Plugins/Interface
+ * @author Stefan Petre
+ */
+jQuery.iAuto = {
+       helper : null,
+       content : null,
+       iframe: null,
+       timer : null,
+       lastValue: null,
+       currentValue: null,
+       subject: null,
+       selectedItem : null,
+       items: null,
+       
+       empty : function()
+       {
+               jQuery.iAuto.content.empty();
+               if (jQuery.iAuto.iframe) {
+                       jQuery.iAuto.iframe.hide();
+               }
+       },
+
+       clear : function()
+       {
+               jQuery.iAuto.items = null;
+               jQuery.iAuto.selectedItem = null;
+               jQuery.iAuto.lastValue = jQuery.iAuto.subject.value;
+               if(jQuery.iAuto.helper.css('display') == 'block') {
+                       if (jQuery.iAuto.subject.autoCFG.fx) {
+                               switch(jQuery.iAuto.subject.autoCFG.fx.type) {
+                                       case 'fade':
+                                               jQuery.iAuto.helper.fadeOut(jQuery.iAuto.subject.autoCFG.fx.duration, jQuery.iAuto.empty);
+                                               break;
+                                       case 'slide':
+                                               jQuery.iAuto.helper.SlideOutUp(jQuery.iAuto.subject.autoCFG.fx.duration, jQuery.iAuto.empty);
+                                               break;
+                                       case 'blind':
+                                               jQuery.iAuto.helper.BlindUp(jQuery.iAuto.subject.autoCFG.fx.duration, jQuery.iAuto.empty);
+                                               break;
+                               }
+                       } else {
+                               jQuery.iAuto.helper.hide();
+                       }
+                       if (jQuery.iAuto.subject.autoCFG.onHide)
+                               jQuery.iAuto.subject.autoCFG.onHide.apply(jQuery.iAuto.subject, [jQuery.iAuto.helper, jQuery.iAuto.iframe]);
+               } else {
+                       jQuery.iAuto.empty();
+               }
+               window.clearTimeout(jQuery.iAuto.timer);
+       },
+
+       update : function ()
+       {
+               var subject = jQuery.iAuto.subject;
+               var subjectValue = jQuery.iAuto.getFieldValues(subject);
+               //var selectionStart = jQuery.iAuto.getSelectionStart(subject);
+               if (subject && subjectValue.item != jQuery.iAuto.lastValue && subjectValue.item.length >= subject.autoCFG.minchars) {
+                       jQuery.iAuto.lastValue = subjectValue.item;
+                       jQuery.iAuto.currentValue = subjectValue.item;
+
+                       data = {
+                               field: jQuery(subject).attr('name')||'field',
+                               value: subjectValue.item
+                       };
+
+                       jQuery.ajax(
+                               {
+                                       type: 'POST',
+                                       data: jQuery.param(data),
+                                       success: function(xml)
+                                       {
+                                               subject.autoCFG.lastSuggestion = jQuery('item',xml);
+                                               size = subject.autoCFG.lastSuggestion.size();
+                                               if (size > 0) {
+                                                       var toWrite = '';
+                                                       subject.autoCFG.lastSuggestion.each(
+                                                               function(nr)
+                                                               {
+                                                                       toWrite += '<li rel="' + jQuery('value', this).text() + '" dir="' + nr + '" style="cursor: default;">' + jQuery('text', this).text() + '</li>';
+                                                               }
+                                                       );
+                                                       if (subject.autoCFG.autofill) {
+                                                               var valueToAdd = jQuery('value', subject.autoCFG.lastSuggestion.get(0)).text();
+                                                               subject.value = subjectValue.pre + valueToAdd + subject.autoCFG.multipleSeparator + subjectValue.post;
+                                                               jQuery.iAuto.selection(
+                                                                       subject, 
+                                                                       subjectValue.item.length != valueToAdd.length ? (subjectValue.pre.length + subjectValue.item.length) : valueToAdd.length,
+                                                                       subjectValue.item.length != valueToAdd.length ? (subjectValue.pre.length + valueToAdd.length) : valueToAdd.length
+                                                               );
+                                                       }
+                                                       
+                                                       if (size > 0) {
+                                                               jQuery.iAuto.writeItems(subject, toWrite);
+                                                       } else {
+                                                               jQuery.iAuto.clear();
+                                                       }
+                                               } else {
+                                                       jQuery.iAuto.clear();
+                                               }
+                                       },
+                                       url : subject.autoCFG.source
+                               }
+                       );
+               }
+       },
+       
+       writeItems : function(subject, toWrite)
+       {
+               jQuery.iAuto.content.html(toWrite);
+               jQuery.iAuto.items = jQuery('li', jQuery.iAuto.content.get(0));
+               jQuery.iAuto.items
+                       .mouseover(jQuery.iAuto.hoverItem)
+                       .bind('click', jQuery.iAuto.clickItem);
+               var position = jQuery.iUtil.getPosition(subject);
+               var size = jQuery.iUtil.getSize(subject);
+               jQuery.iAuto.helper
+                       .css('top', position.y + size.hb + 'px')
+                       .css('left', position.x +  'px')
+                       .addClass(subject.autoCFG.helperClass);
+               if (jQuery.iAuto.iframe) {
+                       jQuery.iAuto.iframe
+                               .css('display', 'block')
+                               .css('top', position.y + size.hb + 'px')
+                               .css('left', position.x +  'px')
+                               .css('width', jQuery.iAuto.helper.css('width'))
+                               .css('height', jQuery.iAuto.helper.css('height'));
+               }
+               jQuery.iAuto.selectedItem = 0;
+               jQuery.iAuto.items.get(0).className = subject.autoCFG.selectClass;
+               jQuery.iAuto.applyOn(subject,subject.autoCFG.lastSuggestion.get(0), 'onHighlight');
+               
+               if (jQuery.iAuto.helper.css('display') == 'none') {
+                       if (subject.autoCFG.inputWidth) {
+                               var borders = jQuery.iUtil.getPadding(subject, true);
+                               var paddings = jQuery.iUtil.getBorder(subject, true);
+                               jQuery.iAuto.helper.css('width', subject.offsetWidth - (jQuery.boxModel ? (borders.l + borders.r + paddings.l + paddings.r) : 0 ) + 'px');
+                       }
+                       if (subject.autoCFG.fx) {
+                               switch(subject.autoCFG.fx.type) {
+                                       case 'fade':
+                                               jQuery.iAuto.helper.fadeIn(subject.autoCFG.fx.duration);
+                                               break;
+                                       case 'slide':
+                                               jQuery.iAuto.helper.SlideInUp(subject.autoCFG.fx.duration);
+                                               break;
+                                       case 'blind':
+                                               jQuery.iAuto.helper.BlindDown(subject.autoCFG.fx.duration);
+                                               break;
+                               }
+                       } else {
+                               jQuery.iAuto.helper.show();
+                       }
+                       
+                       if (jQuery.iAuto.subject.autoCFG.onShow)
+                               jQuery.iAuto.subject.autoCFG.onShow.apply(jQuery.iAuto.subject, [jQuery.iAuto.helper, jQuery.iAuto.iframe]);
+               }
+       },
+       
+       checkCache : function()
+       {
+               var subject = this;
+               if (subject.autoCFG.lastSuggestion) {
+                       
+                       jQuery.iAuto.lastValue = subject.value;
+                       jQuery.iAuto.currentValue = subject.value;
+                       
+                       var toWrite = '';
+                       subject.autoCFG.lastSuggestion.each(
+                               function(nr)
+                               {
+                                       value = jQuery('value', this).text().toLowerCase();
+                                       inputValue = subject.value.toLowerCase();
+                                       if (value.indexOf(inputValue) == 0) {
+                                               toWrite += '<li rel="' + jQuery('value', this).text() + '" dir="' + nr + '" style="cursor: default;">' + jQuery('text', this).text() + '</li>';
+                                       }
+                               }
+                       );
+                       
+                       if (toWrite != '') {
+                               jQuery.iAuto.writeItems(subject, toWrite);
+                               
+                               this.autoCFG.inCache = true;
+                               return;
+                       }
+               }
+               subject.autoCFG.lastSuggestion = null;
+               this.autoCFG.inCache = false;
+       },
+
+       selection : function(field, start, end)
+       {
+               if (field.createTextRange) {
+                       var selRange = field.createTextRange();
+                       selRange.collapse(true);
+                       selRange.moveStart("character", start);
+                       selRange.moveEnd("character", - end + start);
+                       selRange.select();
+               } else if (field.setSelectionRange) {
+                       field.setSelectionRange(start, end);
+               } else {
+                       if (field.selectionStart) {
+                               field.selectionStart = start;
+                               field.selectionEnd = end;
+                       }
+               }
+               field.focus();
+       },
+       
+       getSelectionStart : function(field)
+       {
+               if (field.selectionStart)
+                       return field.selectionStart;
+               else if(field.createTextRange) {
+                       var selRange = document.selection.createRange();
+                       var selRange2 = selRange.duplicate();
+                       return 0 - selRange2.moveStart('character', -100000);
+                       //result.end = result.start + range.text.length;
+                       /*var selRange = document.selection.createRange();
+                       var isCollapsed = selRange.compareEndPoints("StartToEnd", selRange) == 0;
+                       if (!isCollapsed)
+                               selRange.collapse(true);
+                       var bookmark = selRange.getBookmark();
+                       return bookmark.charCodeAt(2) - 2;*/
+               }
+       },
+       
+       getFieldValues : function(field)
+       {
+               var fieldData = {
+                       value: field.value,
+                       pre: '',
+                       post: '',
+                       item: ''
+               };
+               
+               if(field.autoCFG.multiple) {
+                       var finishedPre = false;
+                       var selectionStart = jQuery.iAuto.getSelectionStart(field)||0;
+                       var chunks = fieldData.value.split(field.autoCFG.multipleSeparator);
+                       for (var i=0; i<chunks.length; i++) {
+                               if(
+                                       (fieldData.pre.length + chunks[i].length >= selectionStart
+                                        || 
+                                       selectionStart == 0)
+                                        && 
+                                       !finishedPre 
+                               ) {
+                                       if (fieldData.pre.length <= selectionStart)
+                                               fieldData.item = chunks[i];
+                                       else 
+                                               fieldData.post += chunks[i] + (chunks[i] != '' ? field.autoCFG.multipleSeparator : '');
+                                       finishedPre = true;
+                               } else if (finishedPre){
+                                       fieldData.post += chunks[i] + (chunks[i] != '' ? field.autoCFG.multipleSeparator : '');
+                               }
+                               if(!finishedPre) {
+                                       fieldData.pre += chunks[i] + (chunks.length > 1 ? field.autoCFG.multipleSeparator : '');
+                               }
+                       }
+               } else {
+                       fieldData.item = fieldData.value;
+               }
+               return fieldData;
+       },
+       
+       autocomplete : function(e)
+       {
+               window.clearTimeout(jQuery.iAuto.timer);
+               var subject = jQuery.iAuto.getFieldValues(this);
+                               
+               var pressedKey = e.charCode || e.keyCode || -1;
+               if (/13|27|35|36|38|40|9/.test(pressedKey) && jQuery.iAuto.items) {
+                       if (window.event) {
+                               window.event.cancelBubble = true;
+                               window.event.returnValue = false;
+                       } else {
+                               e.preventDefault();
+                               e.stopPropagation();
+                       }
+                       if (jQuery.iAuto.selectedItem != null) 
+                               jQuery.iAuto.items.get(jQuery.iAuto.selectedItem||0).className = '';
+                       else
+                               jQuery.iAuto.selectedItem = -1;
+                       switch(pressedKey) {
+                               //enter
+                               case 9:
+                               case 13:
+                                       if (jQuery.iAuto.selectedItem == -1)
+                                               jQuery.iAuto.selectedItem = 0;
+                                       var selectedItem = jQuery.iAuto.items.get(jQuery.iAuto.selectedItem||0);
+                                       var valueToAdd = selectedItem.getAttribute('rel');
+                                       this.value = subject.pre + valueToAdd + this.autoCFG.multipleSeparator + subject.post;
+                                       jQuery.iAuto.lastValue = subject.item;
+                                       jQuery.iAuto.selection(
+                                               this, 
+                                               subject.pre.length + valueToAdd.length + this.autoCFG.multipleSeparator.length, 
+                                               subject.pre.length + valueToAdd.length + this.autoCFG.multipleSeparator.length
+                                       );
+                                       jQuery.iAuto.clear();
+                                       if (this.autoCFG.onSelect) {
+                                               iteration = parseInt(selectedItem.getAttribute('dir'))||0;
+                                               jQuery.iAuto.applyOn(this,this.autoCFG.lastSuggestion.get(iteration), 'onSelect');
+                                       }
+                                       if (this.scrollIntoView)
+                                               this.scrollIntoView(false);
+                                       return pressedKey != 13;
+                                       break;
+                               //escape
+                               case 27:
+                                       this.value = subject.pre + jQuery.iAuto.lastValue + this.autoCFG.multipleSeparator + subject.post;
+                                       this.autoCFG.lastSuggestion = null;
+                                       jQuery.iAuto.clear();
+                                       if (this.scrollIntoView)
+                                               this.scrollIntoView(false);
+                                       return false;
+                                       break;
+                               //end
+                               case 35:
+                                       jQuery.iAuto.selectedItem = jQuery.iAuto.items.size() - 1;
+                                       break;
+                               //home
+                               case 36:
+                                       jQuery.iAuto.selectedItem = 0;
+                                       break;
+                               //up
+                               case 38:
+                                       jQuery.iAuto.selectedItem --;
+                                       if (jQuery.iAuto.selectedItem < 0)
+                                               jQuery.iAuto.selectedItem = jQuery.iAuto.items.size() - 1;
+                                       break;
+                               case 40:
+                                       jQuery.iAuto.selectedItem ++;
+                                       if (jQuery.iAuto.selectedItem == jQuery.iAuto.items.size())
+                                               jQuery.iAuto.selectedItem = 0;
+                                       break;
+                       }
+                       jQuery.iAuto.applyOn(this,this.autoCFG.lastSuggestion.get(jQuery.iAuto.selectedItem||0), 'onHighlight');
+                       jQuery.iAuto.items.get(jQuery.iAuto.selectedItem||0).className = this.autoCFG.selectClass;
+                       if (jQuery.iAuto.items.get(jQuery.iAuto.selectedItem||0).scrollIntoView)
+                               jQuery.iAuto.items.get(jQuery.iAuto.selectedItem||0).scrollIntoView(false);
+                       if(this.autoCFG.autofill) {
+                               var valToAdd = jQuery.iAuto.items.get(jQuery.iAuto.selectedItem||0).getAttribute('rel');
+                               this.value = subject.pre + valToAdd + this.autoCFG.multipleSeparator + subject.post;
+                               if(jQuery.iAuto.lastValue.length != valToAdd.length)
+                                       jQuery.iAuto.selection(
+                                               this, 
+                                               subject.pre.length + jQuery.iAuto.lastValue.length, 
+                                               subject.pre.length + valToAdd.length
+                                       );
+                       }
+                       return false;
+               }
+               jQuery.iAuto.checkCache.apply(this);
+               
+               if (this.autoCFG.inCache == false) {
+                       if (subject.item != jQuery.iAuto.lastValue && subject.item.length >= this.autoCFG.minchars)
+                               jQuery.iAuto.timer = window.setTimeout(jQuery.iAuto.update, this.autoCFG.delay);
+                       if (jQuery.iAuto.items) {
+                               jQuery.iAuto.clear();
+                       }
+               }
+               return true;
+       },
+
+       applyOn: function(field, item, type)
+       {
+               if (field.autoCFG[type]) {
+                       var data = {};
+                       childs = item.getElementsByTagName('*');
+                       for(i=0; i<childs.length; i++){
+                               data[childs[i].tagName] = childs[i].firstChild.nodeValue;
+                       }
+                       field.autoCFG[type].apply(field,[data]);
+               }
+       },
+       
+       hoverItem : function(e)
+       {
+               if (jQuery.iAuto.items) {
+                       if (jQuery.iAuto.selectedItem != null) 
+                               jQuery.iAuto.items.get(jQuery.iAuto.selectedItem||0).className = '';
+                       jQuery.iAuto.items.get(jQuery.iAuto.selectedItem||0).className = '';
+                       jQuery.iAuto.selectedItem = parseInt(this.getAttribute('dir'))||0;
+                       jQuery.iAuto.items.get(jQuery.iAuto.selectedItem||0).className = jQuery.iAuto.subject.autoCFG.selectClass;
+               }
+       },
+
+       clickItem : function(event)
+       {       
+               window.clearTimeout(jQuery.iAuto.timer);
+               
+               event = event || jQuery.event.fix( window.event );
+               event.preventDefault();
+               event.stopPropagation();
+               var subject = jQuery.iAuto.getFieldValues(jQuery.iAuto.subject);
+               var valueToAdd = this.getAttribute('rel');
+               jQuery.iAuto.subject.value = subject.pre + valueToAdd + jQuery.iAuto.subject.autoCFG.multipleSeparator + subject.post;
+               jQuery.iAuto.lastValue = this.getAttribute('rel');
+               jQuery.iAuto.selection(
+                       jQuery.iAuto.subject, 
+                       subject.pre.length + valueToAdd.length + jQuery.iAuto.subject.autoCFG.multipleSeparator.length, 
+                       subject.pre.length + valueToAdd.length + jQuery.iAuto.subject.autoCFG.multipleSeparator.length
+               );
+               jQuery.iAuto.clear();
+               if (jQuery.iAuto.subject.autoCFG.onSelect) {
+                       iteration = parseInt(this.getAttribute('dir'))||0;
+                       jQuery.iAuto.applyOn(jQuery.iAuto.subject,jQuery.iAuto.subject.autoCFG.lastSuggestion.get(iteration), 'onSelect');
+               }
+
+               return false;
+       },
+
+       protect : function(e)
+       {
+               pressedKey = e.charCode || e.keyCode || -1;
+               if (/13|27|35|36|38|40/.test(pressedKey) && jQuery.iAuto.items) {
+                       if (window.event) {
+                               window.event.cancelBubble = true;
+                               window.event.returnValue = false;
+                       } else {
+                               e.preventDefault();
+                               e.stopPropagation();
+                       }
+                       return false;
+               }
+       },
+
+       build : function(options)
+       {
+               if (!options.source || !jQuery.iUtil) {
+                       return;
+               }
+
+               if (!jQuery.iAuto.helper) {
+                       if (jQuery.browser.msie) {
+                               jQuery('body', document).append('<iframe style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" id="autocompleteIframe" src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
+                               jQuery.iAuto.iframe = jQuery('#autocompleteIframe');
+                       }
+                       jQuery('body', document).append('<div id="autocompleteHelper" style="position: absolute; top: 0; left: 0; z-index: 30001; display: none;"><ul style="margin: 0;padding: 0; list-style: none; z-index: 30002;">&nbsp;</ul></div>');
+                       jQuery.iAuto.helper = jQuery('#autocompleteHelper');
+                       jQuery.iAuto.content = jQuery('ul', jQuery.iAuto.helper);
+               }
+
+               return this.each(
+                       function()
+                       {
+                //modified for contagged: accept textareas, too
+                               if (! ((this.tagName == 'INPUT' && this.getAttribute('type') == 'text' ) || this.tagName == 'TEXTAREA'))
+                                       return;
+                               this.autoCFG = {};
+                               this.autoCFG.source = options.source;
+                               this.autoCFG.minchars = Math.abs(parseInt(options.minchars)||1);
+                               this.autoCFG.helperClass = options.helperClass ? options.helperClass : '';
+                               this.autoCFG.selectClass = options.selectClass ? options.selectClass : '';
+                               this.autoCFG.onSelect = options.onSelect && options.onSelect.constructor == Function ? options.onSelect : null;
+                               this.autoCFG.onShow = options.onShow && options.onShow.constructor == Function ? options.onShow : null;
+                               this.autoCFG.onHide = options.onHide && options.onHide.constructor == Function ? options.onHide : null;
+                               this.autoCFG.onHighlight = options.onHighlight && options.onHighlight.constructor == Function ? options.onHighlight : null;
+                               this.autoCFG.inputWidth = options.inputWidth||false;
+                               this.autoCFG.multiple = options.multiple||false;
+                               this.autoCFG.multipleSeparator = this.autoCFG.multiple ? (options.multipleSeparator||', '):'';
+                               this.autoCFG.autofill = options.autofill ? true : false;
+                               this.autoCFG.delay = Math.abs(parseInt(options.delay)||1000);
+                               if (options.fx && options.fx.constructor == Object) {
+                                       if (!options.fx.type || !/fade|slide|blind/.test(options.fx.type)) {
+                                               options.fx.type = 'slide';
+                                       }
+                                       if (options.fx.type == 'slide' && !jQuery.fx.slide)
+                                               return;
+                                       if (options.fx.type == 'blind' && !jQuery.fx.BlindDirection)
+                                               return;
+
+                                       options.fx.duration = Math.abs(parseInt(options.fx.duration)||400);
+                                       if (options.fx.duration > this.autoCFG.delay) {
+                                               options.fx.duration = this.autoCFG.delay - 100;
+                                       }
+                                       this.autoCFG.fx = options.fx;
+                               }
+                               this.autoCFG.lastSuggestion = null;
+                               this.autoCFG.inCache = false;
+
+                               jQuery(this)
+                                       .attr('autocomplete', 'off')
+                                       .focus(
+                                               function()
+                                               {
+                                                       jQuery.iAuto.subject = this;
+                                                       jQuery.iAuto.lastValue = this.value;
+                                               }
+                                       )
+                                       .keypress(jQuery.iAuto.protect)
+                                       .keyup(jQuery.iAuto.autocomplete)
+                                       
+                                       .blur(
+                                               function()
+                                               {
+                                                       jQuery.iAuto.timer = window.setTimeout(jQuery.iAuto.clear, 200);
+                                               }
+                                       );
+                       }
+               );
+       }
+};
+jQuery.fn.Autocomplete = jQuery.iAuto.build;
diff --git a/scripts/interface/iautoscroller.js b/scripts/interface/iautoscroller.js
new file mode 100644 (file)
index 0000000..0f55623
--- /dev/null
@@ -0,0 +1,112 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * Autoscroller\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ */\r
+\r
+/**\r
+ * Utility object that helps to make custom autoscrollers.\r
+ * \r
+ * @example\r
+ *             $('div.dragMe').Draggable(\r
+ *                     {\r
+ *                             onStart : function()\r
+ *                             {\r
+ *                                     $.iAutoscroller.start(this, document.getElementsByTagName('body'));\r
+ *                             },\r
+ *                             onStop : function()\r
+ *                             {\r
+ *                                     $.iAutoscroller.stop();\r
+ *                             }\r
+ *                     }\r
+ *             );\r
+ *\r
+ * @description Utility object that helps to make custom autoscrollers\r
+ * @type jQuery\r
+ * @cat Plugins/Interface\r
+ * @author Stefan Petre\r
+ */\r
+\r
+jQuery.iAutoscroller = {\r
+       timer: null,\r
+       elToScroll: null,\r
+       elsToScroll: null,\r
+       step: 10,\r
+       /**\r
+        * This is called to start autoscrolling\r
+        * @param DOMElement el the element used as reference\r
+        * @param Array els collection of elements to scroll\r
+        * @param Integer step the pixels scroll on each step\r
+        * @param Integer interval miliseconds between each step\r
+        */\r
+       start: function(el, els, step, interval)\r
+       {\r
+               jQuery.iAutoscroller.elToScroll = el;\r
+               jQuery.iAutoscroller.elsToScroll = els;\r
+               jQuery.iAutoscroller.step = parseInt(step)||10;\r
+               jQuery.iAutoscroller.timer = window.setInterval(jQuery.iAutoscroller.doScroll, parseInt(interval)||40);\r
+       },\r
+       \r
+       //private function\r
+       doScroll : function()\r
+       {\r
+               for (i=0;i<jQuery.iAutoscroller.elsToScroll.length; i++) {\r
+                               if(!jQuery.iAutoscroller.elsToScroll[i].parentData) {\r
+                                       jQuery.iAutoscroller.elsToScroll[i].parentData = jQuery.extend(\r
+                                               jQuery.iUtil.getPositionLite(jQuery.iAutoscroller.elsToScroll[i]),\r
+                                               jQuery.iUtil.getSizeLite(jQuery.iAutoscroller.elsToScroll[i]),\r
+                                               jQuery.iUtil.getScroll(jQuery.iAutoscroller.elsToScroll[i])\r
+                                       );\r
+                               } else {\r
+                                       jQuery.iAutoscroller.elsToScroll[i].parentData.t = jQuery.iAutoscroller.elsToScroll[i].scrollTop;\r
+                                       jQuery.iAutoscroller.elsToScroll[i].parentData.l = jQuery.iAutoscroller.elsToScroll[i].scrollLeft;\r
+                               }\r
+                               \r
+                               if (jQuery.iAutoscroller.elToScroll.dragCfg && jQuery.iAutoscroller.elToScroll.dragCfg.init == true) {\r
+                                       elementData = {\r
+                                               x : jQuery.iAutoscroller.elToScroll.dragCfg.nx,\r
+                                               y : jQuery.iAutoscroller.elToScroll.dragCfg.ny,\r
+                                               wb : jQuery.iAutoscroller.elToScroll.dragCfg.oC.wb,\r
+                                               hb : jQuery.iAutoscroller.elToScroll.dragCfg.oC.hb\r
+                                       };\r
+                               } else {\r
+                                       elementData = jQuery.extend(\r
+                                               jQuery.iUtil.getPositionLite(jQuery.iAutoscroller.elToScroll),\r
+                                               jQuery.iUtil.getSizeLite(jQuery.iAutoscroller.elToScroll)\r
+                                       );\r
+                               }\r
+                               if (\r
+                                       jQuery.iAutoscroller.elsToScroll[i].parentData.t > 0\r
+                                        && \r
+                                       jQuery.iAutoscroller.elsToScroll[i].parentData.y + jQuery.iAutoscroller.elsToScroll[i].parentData.t > elementData.y) {\r
+                                       jQuery.iAutoscroller.elsToScroll[i].scrollTop -= jQuery.iAutoscroller.step;\r
+                               } else if (jQuery.iAutoscroller.elsToScroll[i].parentData.t <= jQuery.iAutoscroller.elsToScroll[i].parentData.h && jQuery.iAutoscroller.elsToScroll[i].parentData.t + jQuery.iAutoscroller.elsToScroll[i].parentData.hb < elementData.y + elementData.hb) {\r
+                                       jQuery.iAutoscroller.elsToScroll[i].scrollTop += jQuery.iAutoscroller.step;\r
+                               }\r
+                               if (jQuery.iAutoscroller.elsToScroll[i].parentData.l > 0 && jQuery.iAutoscroller.elsToScroll[i].parentData.x + jQuery.iAutoscroller.elsToScroll[i].parentData.l > elementData.x) {\r
+                                       jQuery.iAutoscroller.elsToScroll[i].scrollLeft -= jQuery.iAutoscroller.step;\r
+                               } else if (jQuery.iAutoscroller.elsToScroll[i].parentData.l <= jQuery.iAutoscroller.elsToScroll[i].parentData.wh && jQuery.iAutoscroller.elsToScroll[i].parentData.l + jQuery.iAutoscroller.elsToScroll[i].parentData.wb < elementData.x + elementData.wb) {\r
+                                       jQuery.iAutoscroller.elsToScroll[i].scrollLeft += jQuery.iAutoscroller.step;\r
+                               }\r
+               }\r
+       },\r
+       /**\r
+        * This is called to stop autoscrolling\r
+        */\r
+       stop: function()\r
+       {\r
+               window.clearInterval(jQuery.iAutoscroller.timer);\r
+               jQuery.iAutoscroller.elToScroll = null;\r
+               jQuery.iAutoscroller.elsToScroll = null;\r
+               for (i in jQuery.iAutoscroller.elsToScroll) {\r
+                       jQuery.iAutoscroller.elsToScroll[i].parentData = null;\r
+               }\r
+       }\r
+};
\ No newline at end of file
diff --git a/scripts/interface/idrag.js b/scripts/interface/idrag.js
new file mode 100644 (file)
index 0000000..d4b2c72
--- /dev/null
@@ -0,0 +1,588 @@
+/**
+ * Interface Elements for jQuery
+ * Draggable
+ *
+ * http://interface.eyecon.ro
+ *
+ * Copyright (c) 2006 Stefan Petre
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ */
+/**
+ * Create a draggable element with a number of advanced options including callback, Google Maps type draggables,
+ * reversion, ghosting, and grid dragging.
+ * 
+ * @name Draggable
+ * @descr Creates draggable elements that can be moved across the page.
+ * @param Hash hash A hash of parameters. All parameters are optional.
+ * @option String handle (optional) The jQuery selector matching the handle that starts the draggable
+ * @option DOMElement handle (optional) The DOM Element of the handle that starts the draggable
+ * @option Boolean revert (optional) When true, on stop-drag the element returns to initial position
+ * @option Boolean ghosting (optional) When true, a copy of the element is moved
+ * @option Integer zIndex (optional) zIndex depth for the element while it is being dragged
+ * @option Float opacity (optional) A number between 0 and 1 that indicates the opacity of the element while being dragged
+ * @option Integer grid (optional) (optional) A number of pixels indicating the grid that the element should snap to
+ * @option Array grid (optional) A number of x-pixels and y-pixels indicating the grid that the element should snap to
+ * @option Integer fx (optional) Duration for the effect (like ghosting or revert) applied to the draggable
+ * @option String containment (optional) Define the zone where the draggable can be moved. 'parent' moves it inside parent
+ *                           element, while 'document' prevents it from leaving the document and forcing additional
+ *                           scrolling
+ * @option Array containment An 4-element array (left, top, width, height) indicating the containment of the element
+ * @option String axis (optional) Set an axis: vertical (with 'vertically') or horizontal (with 'horizontally')
+ * @option Function onStart (optional) Callback function triggered when the dragging starts
+ * @option Function onStop (optional) Callback function triggered when the dragging stops
+ * @option Function onChange (optional) Callback function triggered when the dragging stop *and* the element was moved at least
+ *                          one pixel
+ * @option Function onDrag (optional) Callback function triggered while the element is dragged. Receives two parameters: x and y
+ *                        coordinates. You can return an object with new coordinates {x: x, y: y} so this way you can
+ *                        interact with the dragging process (for instance, build your containment)
+ * @option Boolean insideParent Forces the element to remain inside its parent when being dragged (like Google Maps)
+ * @option Integer snapDistance (optional) The element is not moved unless it is dragged more than snapDistance. You can prevent
+ *                             accidental dragging and keep regular clicking enabled (for links or form elements, 
+ *                             for instance)
+ * @option Object cursorAt (optional) The dragged element is moved to the cursor position with the offset specified. Accepts value
+ *                        for top, left, right and bottom offset. Basically, this forces the cursor to a particular
+ *                        position during the entire drag operation.
+ * @option Boolean autoSize (optional) When true, the drag helper is resized to its content, instead of the dragged element's sizes
+ * @option String frameClass (optional) When is set the cloned element is hidden so only a frame is dragged
+ * @type jQuery
+ * @cat Plugins/Interface
+ * @author Stefan Petre
+ */
+
+jQuery.iDrag = {
+       helper : null,
+       dragged: null,
+       destroy : function()
+       {
+               return this.each(
+                       function ()
+                       {
+                               if (this.isDraggable) {
+                                       this.dragCfg.dhe.unbind('mousedown', jQuery.iDrag.draginit);
+                                       this.dragCfg = null;
+                                       this.isDraggable = false;
+                                       if(jQuery.browser.msie) {
+                                               this.unselectable = "off";
+                                       } else {
+                                               this.style.MozUserSelect = '';
+                                               this.style.KhtmlUserSelect = '';
+                                               this.style.userSelect = '';
+                                       }
+                               }
+                       }
+               );
+       },
+       draginit : function (e)
+       {
+               if (jQuery.iDrag.dragged != null) {
+                       jQuery.iDrag.dragstop(e);
+                       return false;
+               }
+               var elm = this.dragElem;
+               jQuery(document)
+                       .bind('mousemove', jQuery.iDrag.dragmove)
+                       .bind('mouseup', jQuery.iDrag.dragstop);
+               elm.dragCfg.pointer = jQuery.iUtil.getPointer(e);
+               elm.dragCfg.currentPointer = elm.dragCfg.pointer;
+               elm.dragCfg.init = false;
+               elm.dragCfg.fromHandler = this != this.dragElem;
+               jQuery.iDrag.dragged = elm;
+               if (elm.dragCfg.si && this != this.dragElem) {
+                               parentPos = jQuery.iUtil.getPosition(elm.parentNode);
+                               sliderSize = jQuery.iUtil.getSize(elm);
+                               sliderPos = {
+                                       x : parseInt(jQuery.css(elm,'left')) || 0,
+                                       y : parseInt(jQuery.css(elm,'top')) || 0
+                               };
+                               dx = elm.dragCfg.currentPointer.x - parentPos.x - sliderSize.wb/2 - sliderPos.x;
+                               dy = elm.dragCfg.currentPointer.y - parentPos.y - sliderSize.hb/2 - sliderPos.y;
+                               jQuery.iSlider.dragmoveBy(elm, [dx, dy]);
+               }
+               return jQuery.selectKeyHelper||false;
+       },
+
+       dragstart : function(e)
+       {
+               var elm = jQuery.iDrag.dragged;
+               elm.dragCfg.init = true;
+
+               var dEs = elm.style;
+
+               elm.dragCfg.oD = jQuery.css(elm,'display');
+               elm.dragCfg.oP = jQuery.css(elm,'position');
+               if (!elm.dragCfg.initialPosition)
+                       elm.dragCfg.initialPosition = elm.dragCfg.oP;
+
+               elm.dragCfg.oR = {
+                       x : parseInt(jQuery.css(elm,'left')) || 0,
+                       y : parseInt(jQuery.css(elm,'top')) || 0
+               };
+               elm.dragCfg.diffX = 0;
+               elm.dragCfg.diffY = 0;
+               if (jQuery.browser.msie) {
+                       var oldBorder = jQuery.iUtil.getBorder(elm, true);
+                       elm.dragCfg.diffX = oldBorder.l||0;
+                       elm.dragCfg.diffY = oldBorder.t||0;
+               }
+
+               elm.dragCfg.oC = jQuery.extend(
+                       jQuery.iUtil.getPosition(elm),
+                       jQuery.iUtil.getSize(elm)
+               );
+               if (elm.dragCfg.oP != 'relative' && elm.dragCfg.oP != 'absolute') {
+                       dEs.position = 'relative';
+               }
+
+               jQuery.iDrag.helper.empty();
+               var clonedEl = elm.cloneNode(true);
+               
+               jQuery(clonedEl).css(
+                       {
+                               display:        'block',
+                               left:           '0px',
+                               top:            '0px'
+                       }
+               );
+               clonedEl.style.marginTop = '0';
+               clonedEl.style.marginRight = '0';
+               clonedEl.style.marginBottom = '0';
+               clonedEl.style.marginLeft = '0';
+               jQuery.iDrag.helper.append(clonedEl);
+               
+               var dhs = jQuery.iDrag.helper.get(0).style;
+
+               if (elm.dragCfg.autoSize) {
+                       dhs.width = 'auto';
+                       dhs.height = 'auto';
+               } else {
+                       dhs.height = elm.dragCfg.oC.hb + 'px';
+                       dhs.width = elm.dragCfg.oC.wb + 'px';
+               }
+
+               dhs.display = 'block';
+               dhs.marginTop = '0px';
+               dhs.marginRight = '0px';
+               dhs.marginBottom = '0px';
+               dhs.marginLeft = '0px';
+
+               //remeasure the clone to check if the size was changed by user's functions
+               jQuery.extend(
+                       elm.dragCfg.oC,
+                       jQuery.iUtil.getSize(clonedEl)
+               );
+
+               if (elm.dragCfg.cursorAt) {
+                       if (elm.dragCfg.cursorAt.left) {
+                               elm.dragCfg.oR.x += elm.dragCfg.pointer.x - elm.dragCfg.oC.x - elm.dragCfg.cursorAt.left;
+                               elm.dragCfg.oC.x = elm.dragCfg.pointer.x - elm.dragCfg.cursorAt.left;
+                       }
+                       if (elm.dragCfg.cursorAt.top) {
+                               elm.dragCfg.oR.y += elm.dragCfg.pointer.y - elm.dragCfg.oC.y - elm.dragCfg.cursorAt.top;
+                               elm.dragCfg.oC.y = elm.dragCfg.pointer.y - elm.dragCfg.cursorAt.top;
+                       }
+                       if (elm.dragCfg.cursorAt.right) {
+                               elm.dragCfg.oR.x += elm.dragCfg.pointer.x - elm.dragCfg.oC.x -elm.dragCfg.oC.hb + elm.dragCfg.cursorAt.right;
+                               elm.dragCfg.oC.x = elm.dragCfg.pointer.x - elm.dragCfg.oC.wb + elm.dragCfg.cursorAt.right;
+                       }
+                       if (elm.dragCfg.cursorAt.bottom) {
+                               elm.dragCfg.oR.y += elm.dragCfg.pointer.y - elm.dragCfg.oC.y - elm.dragCfg.oC.hb + elm.dragCfg.cursorAt.bottom;
+                               elm.dragCfg.oC.y = elm.dragCfg.pointer.y - elm.dragCfg.oC.hb + elm.dragCfg.cursorAt.bottom;
+                       }
+               }
+               elm.dragCfg.nx = elm.dragCfg.oR.x;
+               elm.dragCfg.ny = elm.dragCfg.oR.y;
+
+               if (elm.dragCfg.insideParent || elm.dragCfg.containment == 'parent') {
+                       parentBorders = jQuery.iUtil.getBorder(elm.parentNode, true);
+                       elm.dragCfg.oC.x = elm.offsetLeft + (jQuery.browser.msie ? 0 : jQuery.browser.opera ? -parentBorders.l : parentBorders.l);
+                       elm.dragCfg.oC.y = elm.offsetTop + (jQuery.browser.msie ? 0 : jQuery.browser.opera ? -parentBorders.t : parentBorders.t);
+                       jQuery(elm.parentNode).append(jQuery.iDrag.helper.get(0));
+               }
+               if (elm.dragCfg.containment) {
+                       jQuery.iDrag.getContainment(elm);
+                       elm.dragCfg.onDragModifier.containment = jQuery.iDrag.fitToContainer;
+               }
+
+               if (elm.dragCfg.si) {
+                       jQuery.iSlider.modifyContainer(elm);
+               }
+
+               dhs.left = elm.dragCfg.oC.x - elm.dragCfg.diffX + 'px';
+               dhs.top = elm.dragCfg.oC.y - elm.dragCfg.diffY + 'px';
+               //resize the helper to fit the clone
+               dhs.width = elm.dragCfg.oC.wb + 'px';
+               dhs.height = elm.dragCfg.oC.hb + 'px';
+
+               jQuery.iDrag.dragged.dragCfg.prot = false;
+
+               if (elm.dragCfg.gx) {
+                       elm.dragCfg.onDragModifier.grid = jQuery.iDrag.snapToGrid;
+               }
+               if (elm.dragCfg.zIndex != false) {
+                       jQuery.iDrag.helper.css('zIndex', elm.dragCfg.zIndex);
+               }
+               if (elm.dragCfg.opacity) {
+                       jQuery.iDrag.helper.css('opacity', elm.dragCfg.opacity);
+                       if (window.ActiveXObject) {
+                               jQuery.iDrag.helper.css('filter', 'alpha(opacity=' + elm.dragCfg.opacity * 100 + ')');
+                       }
+               }
+
+               if(elm.dragCfg.frameClass) {
+                       jQuery.iDrag.helper.addClass(elm.dragCfg.frameClass);
+                       jQuery.iDrag.helper.get(0).firstChild.style.display = 'none';
+               }
+               if (elm.dragCfg.onStart)
+                       elm.dragCfg.onStart.apply(elm, [clonedEl, elm.dragCfg.oR.x, elm.dragCfg.oR.y]);
+               if (jQuery.iDrop && jQuery.iDrop.count > 0 ){
+                       jQuery.iDrop.highlight(elm);
+               }
+               if (elm.dragCfg.ghosting == false) {
+                       dEs.display = 'none';
+               }
+               return false;
+       },
+
+       getContainment : function(elm)
+       {
+               if (elm.dragCfg.containment.constructor == String) {
+                       if (elm.dragCfg.containment == 'parent') {
+                               elm.dragCfg.cont = jQuery.extend(
+                                       {x:0,y:0},
+                                       jQuery.iUtil.getSize(elm.parentNode)
+                               );
+                               var contBorders = jQuery.iUtil.getBorder(elm.parentNode, true);
+                               elm.dragCfg.cont.w = elm.dragCfg.cont.wb - contBorders.l - contBorders.r;
+                               elm.dragCfg.cont.h = elm.dragCfg.cont.hb - contBorders.t - contBorders.b;
+                       } else if (elm.dragCfg.containment == 'document') {
+                               var clnt = jQuery.iUtil.getClient();
+                               elm.dragCfg.cont = {
+                                       x : 0,
+                                       y : 0,
+                                       w : clnt.w,
+                                       h : clnt.h
+                               };
+                       }
+               } else if (elm.dragCfg.containment.constructor == Array) {
+                       elm.dragCfg.cont = {
+                               x : parseInt(elm.dragCfg.containment[0])||0,
+                               y : parseInt(elm.dragCfg.containment[1])||0,
+                               w : parseInt(elm.dragCfg.containment[2])||0,
+                               h : parseInt(elm.dragCfg.containment[3])||0
+                       };
+               }
+               elm.dragCfg.cont.dx = elm.dragCfg.cont.x - elm.dragCfg.oC.x;
+               elm.dragCfg.cont.dy = elm.dragCfg.cont.y - elm.dragCfg.oC.y;
+       },
+
+       hidehelper : function(dragged)
+       {
+               if (dragged.dragCfg.insideParent || dragged.dragCfg.containment == 'parent') {
+                       jQuery('body', document).append(jQuery.iDrag.helper.get(0));
+               }
+               jQuery.iDrag.helper.empty().hide().css('opacity', 1);
+               if (window.ActiveXObject) {
+                       jQuery.iDrag.helper.css('filter', 'alpha(opacity=100)');
+               }
+       },
+
+       dragstop : function(e)
+       {
+
+               jQuery(document)
+                       .unbind('mousemove', jQuery.iDrag.dragmove)
+                       .unbind('mouseup', jQuery.iDrag.dragstop);
+
+               if (jQuery.iDrag.dragged == null) {
+                       return;
+               }
+               var dragged = jQuery.iDrag.dragged;
+
+               jQuery.iDrag.dragged = null;
+
+               if (dragged.dragCfg.init == false) {
+                       return false;
+               }
+               if (dragged.dragCfg.so == true) {
+                       jQuery(dragged).css('position', dragged.dragCfg.oP);
+               }
+               var dEs = dragged.style;
+
+               if (dragged.si) {
+                       jQuery.iDrag.helper.css('cursor', 'move');
+               }
+               if(dragged.dragCfg.frameClass) {
+                       jQuery.iDrag.helper.removeClass(dragged.dragCfg.frameClass);
+               }
+
+               if (dragged.dragCfg.revert == false) {
+                       if (dragged.dragCfg.fx > 0) {
+                               if (!dragged.dragCfg.axis || dragged.dragCfg.axis == 'horizontally') {
+                                       var x = new jQuery.fx(dragged,{duration:dragged.dragCfg.fx}, 'left');
+                                       x.custom(dragged.dragCfg.oR.x,dragged.dragCfg.nRx);
+                               }
+                               if (!dragged.dragCfg.axis || dragged.dragCfg.axis == 'vertically') {
+                                       var y = new jQuery.fx(dragged,{duration:dragged.dragCfg.fx}, 'top');
+                                       y.custom(dragged.dragCfg.oR.y,dragged.dragCfg.nRy);
+                               }
+                       } else {
+                               if (!dragged.dragCfg.axis || dragged.dragCfg.axis == 'horizontally')
+                                       dragged.style.left = dragged.dragCfg.nRx + 'px';
+                               if (!dragged.dragCfg.axis || dragged.dragCfg.axis == 'vertically')
+                                       dragged.style.top = dragged.dragCfg.nRy + 'px';
+                       }
+                       jQuery.iDrag.hidehelper(dragged);
+                       if (dragged.dragCfg.ghosting == false) {
+                               jQuery(dragged).css('display', dragged.dragCfg.oD);
+                       }
+               } else if (dragged.dragCfg.fx > 0) {
+                       dragged.dragCfg.prot = true;
+                       var dh = false;
+                       if(jQuery.iDrop && jQuery.iSort && dragged.dragCfg.so) {
+                               dh = jQuery.iUtil.getPosition(jQuery.iSort.helper.get(0));
+                       }
+                       jQuery.iDrag.helper.animate(
+                               {
+                                       left : dh ? dh.x : dragged.dragCfg.oC.x,
+                                       top : dh ? dh.y : dragged.dragCfg.oC.y
+                               },
+                               dragged.dragCfg.fx,
+                               function()
+                               {
+                                       dragged.dragCfg.prot = false;
+                                       if (dragged.dragCfg.ghosting == false) {
+                                               dragged.style.display = dragged.dragCfg.oD;
+                                       }
+                                       jQuery.iDrag.hidehelper(dragged);
+                               }
+                       );
+               } else {
+                       jQuery.iDrag.hidehelper(dragged);
+                       if (dragged.dragCfg.ghosting == false) {
+                               jQuery(dragged).css('display', dragged.dragCfg.oD);
+                       }
+               }
+
+               if (jQuery.iDrop && jQuery.iDrop.count > 0 ){
+                       jQuery.iDrop.checkdrop(dragged);
+               }
+               if (jQuery.iSort && dragged.dragCfg.so) {
+                       jQuery.iSort.check(dragged);
+               }
+               if (dragged.dragCfg.onChange && (dragged.dragCfg.nRx != dragged.dragCfg.oR.x || dragged.dragCfg.nRy != dragged.dragCfg.oR.y)){
+                       dragged.dragCfg.onChange.apply(dragged, dragged.dragCfg.lastSi||[0,0,dragged.dragCfg.nRx,dragged.dragCfg.nRy]);
+               }
+               if (dragged.dragCfg.onStop)
+                       dragged.dragCfg.onStop.apply(dragged);
+               return false;
+       },
+
+       snapToGrid : function(x, y, dx, dy)
+       {
+               if (dx != 0)
+                       dx = parseInt((dx + (this.dragCfg.gx * dx/Math.abs(dx))/2)/this.dragCfg.gx) * this.dragCfg.gx;
+               if (dy != 0)
+                       dy = parseInt((dy + (this.dragCfg.gy * dy/Math.abs(dy))/2)/this.dragCfg.gy) * this.dragCfg.gy;
+               return {
+                       dx : dx,
+                       dy : dy,
+                       x: 0,
+                       y: 0
+               };
+       },
+
+       fitToContainer : function(x, y, dx, dy)
+       {
+               dx = Math.min(
+                               Math.max(dx,this.dragCfg.cont.dx),
+                               this.dragCfg.cont.w + this.dragCfg.cont.dx - this.dragCfg.oC.wb
+                       );
+               dy = Math.min(
+                               Math.max(dy,this.dragCfg.cont.dy),
+                               this.dragCfg.cont.h + this.dragCfg.cont.dy - this.dragCfg.oC.hb
+                       );
+
+               return {
+                       dx : dx,
+                       dy : dy,
+                       x: 0,
+                       y: 0
+               }
+       },
+
+       dragmove : function(e)
+       {
+               if (jQuery.iDrag.dragged == null || jQuery.iDrag.dragged.dragCfg.prot == true) {
+                       return;
+               }
+
+               var dragged = jQuery.iDrag.dragged;
+
+               dragged.dragCfg.currentPointer = jQuery.iUtil.getPointer(e);
+               if (dragged.dragCfg.init == false) {
+                       distance = Math.sqrt(Math.pow(dragged.dragCfg.pointer.x - dragged.dragCfg.currentPointer.x, 2) + Math.pow(dragged.dragCfg.pointer.y - dragged.dragCfg.currentPointer.y, 2));
+                       if (distance < dragged.dragCfg.snapDistance){
+                               return;
+                       } else {
+                               jQuery.iDrag.dragstart(e);
+                       }
+               }
+
+               var dx = dragged.dragCfg.currentPointer.x - dragged.dragCfg.pointer.x;
+               var dy = dragged.dragCfg.currentPointer.y - dragged.dragCfg.pointer.y;
+
+               for (var i in dragged.dragCfg.onDragModifier) {
+                       var newCoords = dragged.dragCfg.onDragModifier[i].apply(dragged, [dragged.dragCfg.oR.x + dx, dragged.dragCfg.oR.y + dy, dx, dy]);
+                       if (newCoords && newCoords.constructor == Object) {
+                               dx = i != 'user' ? newCoords.dx : (newCoords.x - dragged.dragCfg.oR.x);
+                               dy = i != 'user' ? newCoords.dy : (newCoords.y - dragged.dragCfg.oR.y);
+                       }
+               }
+
+               dragged.dragCfg.nx = dragged.dragCfg.oC.x + dx - dragged.dragCfg.diffX;
+               dragged.dragCfg.ny = dragged.dragCfg.oC.y + dy - dragged.dragCfg.diffY;
+
+               if (dragged.dragCfg.si && (dragged.dragCfg.onSlide || dragged.dragCfg.onChange)) {
+                       jQuery.iSlider.onSlide(dragged, dragged.dragCfg.nx, dragged.dragCfg.ny);
+               }
+
+               if(dragged.dragCfg.onDrag)
+                       dragged.dragCfg.onDrag.apply(dragged, [dragged.dragCfg.oR.x + dx, dragged.dragCfg.oR.y + dy]);
+                       
+               if (!dragged.dragCfg.axis || dragged.dragCfg.axis == 'horizontally') {
+                       dragged.dragCfg.nRx = dragged.dragCfg.oR.x + dx;
+                       jQuery.iDrag.helper.get(0).style.left = dragged.dragCfg.nx + 'px';
+               }
+               if (!dragged.dragCfg.axis || dragged.dragCfg.axis == 'vertically') {
+                       dragged.dragCfg.nRy = dragged.dragCfg.oR.y + dy;
+                       jQuery.iDrag.helper.get(0).style.top = dragged.dragCfg.ny + 'px';
+               }
+               
+               if (jQuery.iDrop && jQuery.iDrop.count > 0 ){
+                       jQuery.iDrop.checkhover(dragged);
+               }
+               return false;
+       },
+
+       build : function(o)
+       {
+               if (!jQuery.iDrag.helper) {
+                       jQuery('body',document).append('<div id="dragHelper"></div>');
+                       jQuery.iDrag.helper = jQuery('#dragHelper');
+                       var el = jQuery.iDrag.helper.get(0);
+                       var els = el.style;
+                       els.position = 'absolute';
+                       els.display = 'none';
+                       els.cursor = 'move';
+                       els.listStyle = 'none';
+                       els.overflow = 'hidden';
+                       if (window.ActiveXObject) {
+                               el.unselectable = "on";
+                       } else {
+                               els.mozUserSelect = 'none';
+                               els.userSelect = 'none';
+                               els.KhtmlUserSelect = 'none';
+                       }
+               }
+               if (!o) {
+                       o = {};
+               }
+               return this.each(
+                       function()
+                       {
+                               if (this.isDraggable || !jQuery.iUtil)
+                                       return;
+                               if (window.ActiveXObject) {
+                                       this.onselectstart = function(){return false;};
+                                       this.ondragstart = function(){return false;};
+                               }
+                               var el = this;
+                               var dhe = o.handle ? jQuery(this).find(o.handle) : jQuery(this);
+                               if(jQuery.browser.msie) {
+                                       dhe.each(
+                                               function()
+                                               {
+                                                       this.unselectable = "on";
+                                               }
+                                       );
+                               } else {
+                                       dhe.css('-moz-user-select', 'none');
+                                       dhe.css('user-select', 'none');
+                                       dhe.css('-khtml-user-select', 'none');
+                               }
+                               this.dragCfg = {
+                                       dhe: dhe,
+                                       revert : o.revert ? true : false,
+                                       ghosting : o.ghosting ? true : false,
+                                       so : o.so ? o.so : false,
+                                       si : o.si ? o.si : false,
+                                       insideParent : o.insideParent ? o.insideParent : false,
+                                       zIndex : o.zIndex ? parseInt(o.zIndex)||0 : false,
+                                       opacity : o.opacity ? parseFloat(o.opacity) : false,
+                                       fx : parseInt(o.fx)||null,
+                                       hpc : o.hpc ? o.hpc : false,
+                                       onDragModifier : {},
+                                       pointer : {},
+                                       onStart : o.onStart && o.onStart.constructor == Function ? o.onStart : false,
+                                       onStop : o.onStop && o.onStop.constructor == Function ? o.onStop : false,
+                                       onChange : o.onChange && o.onChange.constructor == Function ? o.onChange : false,
+                                       axis : /vertically|horizontally/.test(o.axis) ? o.axis : false,
+                                       snapDistance : o.snapDistance ? parseInt(o.snapDistance)||0 : 0,
+                                       cursorAt: o.cursorAt ? o.cursorAt : false,
+                                       autoSize : o.autoSize ? true : false,
+                                       frameClass : o.frameClass || false
+                                       
+                               };
+                               if (o.onDragModifier && o.onDragModifier.constructor == Function)
+                                       this.dragCfg.onDragModifier.user = o.onDragModifier;
+                               if (o.onDrag && o.onDrag.constructor == Function)
+                                       this.dragCfg.onDrag = o.onDrag;
+                               if (o.containment && ((o.containment.constructor == String && (o.containment == 'parent' || o.containment == 'document')) || (o.containment.constructor == Array && o.containment.length == 4) )) {
+                                       this.dragCfg.containment = o.containment;
+                               }
+                               if(o.fractions) {
+                                       this.dragCfg.fractions = o.fractions;
+                               }
+                               if(o.grid){
+                                       if(typeof o.grid == 'number'){
+                                               this.dragCfg.gx = parseInt(o.grid)||1;
+                                               this.dragCfg.gy = parseInt(o.grid)||1;
+                                       } else if (o.grid.length == 2) {
+                                               this.dragCfg.gx = parseInt(o.grid[0])||1;
+                                               this.dragCfg.gy = parseInt(o.grid[1])||1;
+                                       }
+                               }
+                               if (o.onSlide && o.onSlide.constructor == Function) {
+                                       this.dragCfg.onSlide = o.onSlide;
+                               }
+
+                               this.isDraggable = true;
+                               dhe.each(
+                                       function(){
+                                               this.dragElem = el;
+                                       }
+                               );
+                               dhe.bind('mousedown', jQuery.iDrag.draginit);
+                       }
+               )
+       }
+};
+
+/**
+ * Destroy an existing draggable on a collection of elements
+ * 
+ * @name DraggableDestroy
+ * @descr Destroy a draggable
+ * @type jQuery
+ * @cat Plugins/Interface
+ * @example $('#drag2').DraggableDestroy();
+ */
+
+jQuery.fn.extend(
+       {
+               DraggableDestroy : jQuery.iDrag.destroy,
+               Draggable : jQuery.iDrag.build
+       }
+);
\ No newline at end of file
diff --git a/scripts/interface/idrop.js b/scripts/interface/idrop.js
new file mode 100644 (file)
index 0000000..ede4e64
--- /dev/null
@@ -0,0 +1,323 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * Droppables\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ */\r
+\r
+/**\r
+ * With the Draggables plugin, Droppable allows you to create drop zones for draggable elements.\r
+ *\r
+ * @name Droppable\r
+ * @cat Plugins/Interface\r
+ * @param Hash options A hash of options\r
+ * @option String accept The class name for draggables to get accepted by the droppable (mandatory)\r
+ * @option String activeclass When an acceptable draggable is moved, the droppable gets this class\r
+ * @option String hoverclass When an acceptable draggable is inside the droppable, the droppable gets\r
+ *                           this class\r
+ * @option String tolerance  Choose from 'pointer', 'intersect', or 'fit'. The pointer options means\r
+ *                           that the pointer must be inside the droppable in order for the draggable\r
+ *                           to be dropped. The intersect option means that the draggable must intersect\r
+ *                           the droppable. The fit option means that the entire draggable must be\r
+ *                           inside the droppable.\r
+ * @option Function onDrop   When an acceptable draggable is dropped on a droppable, this callback is\r
+ *                           called. It passes the draggable DOMElement as a parameter.\r
+ * @option Function onHover  When an acceptable draggable is hovered over a droppable, this callback\r
+ *                           is called. It passes the draggable DOMElement as a parameter.\r
+ * @option Function onOut    When an acceptable draggable leaves a droppable, this callback is called.\r
+ *                           It passes the draggable DOMElement as a parameter.\r
+ * @example                  $('#dropzone1').Droppable(\r
+ *                             {\r
+ *                               accept : 'dropaccept', \r
+ *                               activeclass: 'dropzoneactive', \r
+ *                               hoverclass:   'dropzonehover',\r
+ *                               ondrop:       function (drag) {\r
+ *                                              alert(this); //the droppable\r
+ *                                              alert(drag); //the draggable\r
+ *                                        },\r
+ *                               fit: true\r
+ *                             }\r
+ *                           )\r
+ */\r
+\r
+jQuery.iDrop = {\r
+       fit : function (zonex, zoney, zonew, zoneh)\r
+       {\r
+               return  zonex <= jQuery.iDrag.dragged.dragCfg.nx && \r
+                               (zonex + zonew) >= (jQuery.iDrag.dragged.dragCfg.nx + jQuery.iDrag.dragged.dragCfg.oC.w) &&\r
+                               zoney <= jQuery.iDrag.dragged.dragCfg.ny && \r
+                               (zoney + zoneh) >= (jQuery.iDrag.dragged.dragCfg.ny + jQuery.iDrag.dragged.dragCfg.oC.h) ? true :false;\r
+       },\r
+       intersect : function (zonex, zoney, zonew, zoneh)\r
+       {\r
+               return  ! ( zonex > (jQuery.iDrag.dragged.dragCfg.nx + jQuery.iDrag.dragged.dragCfg.oC.w)\r
+                               || (zonex + zonew) < jQuery.iDrag.dragged.dragCfg.nx \r
+                               || zoney > (jQuery.iDrag.dragged.dragCfg.ny + jQuery.iDrag.dragged.dragCfg.oC.h) \r
+                               || (zoney + zoneh) < jQuery.iDrag.dragged.dragCfg.ny\r
+                               ) ? true :false;\r
+       },\r
+       pointer : function (zonex, zoney, zonew, zoneh)\r
+       {\r
+               return  zonex < jQuery.iDrag.dragged.dragCfg.currentPointer.x\r
+                               && (zonex + zonew) > jQuery.iDrag.dragged.dragCfg.currentPointer.x \r
+                               && zoney < jQuery.iDrag.dragged.dragCfg.currentPointer.y \r
+                               && (zoney + zoneh) > jQuery.iDrag.dragged.dragCfg.currentPointer.y\r
+                               ? true :false;\r
+       },\r
+       overzone : false,\r
+       highlighted : {},\r
+       count : 0,\r
+       zones : {},\r
+       \r
+       highlight : function (elm)\r
+       {\r
+               if (jQuery.iDrag.dragged == null) {\r
+                       return;\r
+               }\r
+               var i;\r
+               jQuery.iDrop.highlighted = {};\r
+               var oneIsSortable = false;\r
+               for (i in jQuery.iDrop.zones) {\r
+                       if (jQuery.iDrop.zones[i] != null) {\r
+                               var iEL = jQuery.iDrop.zones[i].get(0);\r
+                               if (jQuery(jQuery.iDrag.dragged).is('.' + iEL.dropCfg.a)) {\r
+                                       if (iEL.dropCfg.m == false) {\r
+                                               iEL.dropCfg.p = jQuery.extend(\r
+                                                       jQuery.iUtil.getPositionLite(iEL),\r
+                                                       jQuery.iUtil.getSizeLite(iEL)\r
+                                               );//jQuery.iUtil.getPos(iEL);\r
+                                               iEL.dropCfg.m = true;\r
+                                       }\r
+                                       if (iEL.dropCfg.ac) {\r
+                                               jQuery.iDrop.zones[i].addClass(iEL.dropCfg.ac);\r
+                                       }\r
+                                       jQuery.iDrop.highlighted[i] = jQuery.iDrop.zones[i];\r
+                                       //if (jQuery.iSort && jQuery.iDrag.dragged.dragCfg.so) {\r
+                                       if (jQuery.iSort && iEL.dropCfg.s && jQuery.iDrag.dragged.dragCfg.so) {\r
+                                               iEL.dropCfg.el = jQuery('.' + iEL.dropCfg.a, iEL);\r
+                                               elm.style.display = 'none';\r
+                                               jQuery.iSort.measure(iEL);\r
+                                               iEL.dropCfg.os = jQuery.iSort.serialize(jQuery.attr(iEL, 'id')).hash;\r
+                                               elm.style.display = elm.dragCfg.oD;\r
+                                               oneIsSortable = true;\r
+                                       }\r
+                                       if (iEL.dropCfg.onActivate) {\r
+                                               iEL.dropCfg.onActivate.apply(jQuery.iDrop.zones[i].get(0), [jQuery.iDrag.dragged]);\r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+               //if (jQuery.iSort && jQuery.iDrag.dragged.dragCfg.so) {\r
+               if (oneIsSortable) {\r
+                       jQuery.iSort.start();\r
+               }\r
+       },\r
+       /**\r
+        * remeasure the droppable\r
+        * \r
+        * useful when the positions/dimensions for droppables \r
+        * are changed while dragging a element\r
+        * \r
+        * this works for sortables too but with a greate processor \r
+        * penality because remeasures each sort items too\r
+        */\r
+       remeasure : function()\r
+       {\r
+               jQuery.iDrop.highlighted = {};\r
+               for (i in jQuery.iDrop.zones) {\r
+                       if (jQuery.iDrop.zones[i] != null) {\r
+                               var iEL = jQuery.iDrop.zones[i].get(0);\r
+                               if (jQuery(jQuery.iDrag.dragged).is('.' + iEL.dropCfg.a)) {\r
+                                       iEL.dropCfg.p = jQuery.extend(\r
+                                               jQuery.iUtil.getPositionLite(iEL),\r
+                                               jQuery.iUtil.getSizeLite(iEL)\r
+                                       );\r
+                                       if (iEL.dropCfg.ac) {\r
+                                               jQuery.iDrop.zones[i].addClass(iEL.dropCfg.ac);\r
+                                       }\r
+                                       jQuery.iDrop.highlighted[i] = jQuery.iDrop.zones[i];\r
+                                       \r
+                                       if (jQuery.iSort && iEL.dropCfg.s && jQuery.iDrag.dragged.dragCfg.so) {\r
+                                               iEL.dropCfg.el = jQuery('.' + iEL.dropCfg.a, iEL);\r
+                                               elm.style.display = 'none';\r
+                                               jQuery.iSort.measure(iEL);\r
+                                               elm.style.display = elm.dragCfg.oD;\r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+       },\r
+       \r
+       checkhover : function (e)\r
+       {\r
+               if (jQuery.iDrag.dragged == null) {\r
+                       return;\r
+               }\r
+               jQuery.iDrop.overzone = false;\r
+               var i;\r
+               var applyOnHover = false;\r
+               var hlt = 0;\r
+               for (i in jQuery.iDrop.highlighted)\r
+               {\r
+                       var iEL = jQuery.iDrop.highlighted[i].get(0);\r
+                       if ( \r
+                                       jQuery.iDrop.overzone == false\r
+                                        && \r
+                                       jQuery.iDrop[iEL.dropCfg.t](\r
+                                               iEL.dropCfg.p.x, \r
+                                               iEL.dropCfg.p.y, \r
+                                               iEL.dropCfg.p.wb, \r
+                                               iEL.dropCfg.p.hb\r
+                                       )\r
+                                        \r
+                       ) {\r
+                               if (iEL.dropCfg.hc && iEL.dropCfg.h == false) {\r
+                                       jQuery.iDrop.highlighted[i].addClass(iEL.dropCfg.hc);\r
+                               }\r
+                               //chec if onHover function has to be called\r
+                               if (iEL.dropCfg.h == false &&iEL.dropCfg.onHover) {\r
+                                       applyOnHover = true;\r
+                               }\r
+                               iEL.dropCfg.h = true;\r
+                               jQuery.iDrop.overzone = iEL;\r
+                               //if(jQuery.iSort && jQuery.iDrag.dragged.dragCfg.so) {\r
+                               if(jQuery.iSort && iEL.dropCfg.s && jQuery.iDrag.dragged.dragCfg.so) {\r
+                                       jQuery.iSort.helper.get(0).className = iEL.dropCfg.shc;\r
+                                       jQuery.iSort.checkhover(iEL);\r
+                               }\r
+                               hlt ++;\r
+                       } else if(iEL.dropCfg.h == true) {\r
+                               //onOut function\r
+                               if (iEL.dropCfg.onOut) {\r
+                                       iEL.dropCfg.onOut.apply(iEL, [e, jQuery.iDrag.helper.get(0).firstChild, iEL.dropCfg.fx]);\r
+                               }\r
+                               if (iEL.dropCfg.hc) {\r
+                                       jQuery.iDrop.highlighted[i].removeClass(iEL.dropCfg.hc);\r
+                               }\r
+                               iEL.dropCfg.h = false;\r
+                       }\r
+               }\r
+               if (jQuery.iSort && !jQuery.iDrop.overzone && jQuery.iDrag.dragged.so) {\r
+                       jQuery.iSort.helper.get(0).style.display = 'none';\r
+                       //jQuery('body').append(jQuery.iSort.helper.get(0));\r
+               }\r
+               //call onhover\r
+               if(applyOnHover) {\r
+                       jQuery.iDrop.overzone.dropCfg.onHover.apply(jQuery.iDrop.overzone, [e, jQuery.iDrag.helper.get(0).firstChild]);\r
+               }\r
+       },\r
+       checkdrop : function (e)\r
+       {\r
+               var i;\r
+               for (i in jQuery.iDrop.highlighted) {\r
+                       var iEL = jQuery.iDrop.highlighted[i].get(0);\r
+                       if (iEL.dropCfg.ac) {\r
+                               jQuery.iDrop.highlighted[i].removeClass(iEL.dropCfg.ac);\r
+                       }\r
+                       if (iEL.dropCfg.hc) {\r
+                               jQuery.iDrop.highlighted[i].removeClass(iEL.dropCfg.hc);\r
+                       }\r
+                       if(iEL.dropCfg.s) {\r
+                               jQuery.iSort.changed[jQuery.iSort.changed.length] = i;\r
+                       }\r
+                       if (iEL.dropCfg.onDrop && iEL.dropCfg.h == true) {\r
+                               iEL.dropCfg.h = false;\r
+                               iEL.dropCfg.onDrop.apply(iEL, [e, iEL.dropCfg.fx]);\r
+                       }\r
+                       iEL.dropCfg.m = false;\r
+                       iEL.dropCfg.h  = false;\r
+               }\r
+               jQuery.iDrop.highlighted = {};\r
+       },\r
+       destroy : function()\r
+       {\r
+               return this.each(\r
+                       function()\r
+                       {\r
+                               if (this.isDroppable) {\r
+                                       if (this.dropCfg.s) {\r
+                                               id = jQuery.attr(this,'id');\r
+                                               jQuery.iSort.collected[id] = null;\r
+                                               jQuery('.' + this.dropCfg.a, this).DraggableDestroy();\r
+                                       }\r
+                                       jQuery.iDrop.zones['d' + this.idsa] = null;\r
+                                       this.isDroppable = false;\r
+                                       this.f = null;\r
+                               }\r
+                       }\r
+               );\r
+       },\r
+       build : function (o)\r
+       {\r
+               return this.each(\r
+                       function()\r
+                       {\r
+                               if (this.isDroppable == true || !o.accept || !jQuery.iUtil || !jQuery.iDrag){\r
+                                       return;\r
+                               }\r
+                               this.dropCfg = {\r
+                                       a : o.accept,\r
+                                       ac: o.activeclass||false, \r
+                                       hc:     o.hoverclass||false,\r
+                                       shc: o.helperclass||false,\r
+                                       onDrop: o.ondrop||o.onDrop||false,\r
+                                       onHover: o.onHover||o.onhover||false,\r
+                                       onOut: o.onOut||o.onout||false,\r
+                                       onActivate: o.onActivate||false,\r
+                                       t: o.tolerance && ( o.tolerance == 'fit' || o.tolerance == 'intersect') ? o.tolerance : 'pointer',\r
+                                       fx: o.fx ? o.fx : false,\r
+                                       m: false,\r
+                                       h: false\r
+                               };\r
+                               if (o.sortable == true && jQuery.iSort) {\r
+                                       id = jQuery.attr(this,'id');\r
+                                       jQuery.iSort.collected[id] = this.dropCfg.a;\r
+                                       this.dropCfg.s = true;\r
+                                       if(o.onChange) {\r
+                                               this.dropCfg.onChange = o.onChange;\r
+                                               this.dropCfg.os = jQuery.iSort.serialize(id).hash;\r
+                                       }\r
+                               }\r
+                               this.isDroppable = true;\r
+                               this.idsa = parseInt(Math.random() * 10000);\r
+                               jQuery.iDrop.zones['d' + this.idsa] = jQuery(this);\r
+                               jQuery.iDrop.count ++;\r
+                       }\r
+               );\r
+       }\r
+};\r
+\r
+/**\r
+ * Destroy an existing droppable on a collection of elements\r
+ * \r
+ * @name DroppableDestroy\r
+ * @descr Destroy a droppable\r
+ * @type jQuery\r
+ * @cat Plugins/Interface\r
+ * @example $('#drag2').DroppableDestroy();\r
+ */\r
+\r
+jQuery.fn.extend(\r
+       {\r
+               DroppableDestroy : jQuery.iDrop.destroy,\r
+               Droppable : jQuery.iDrop.build\r
+       }\r
+);\r
+\r
\r
+/**\r
+ * Recalculate all Droppables\r
+ *\r
+ * @name $.recallDroppables\r
+ * @type jQuery\r
+ * @cat Plugins/Interface\r
+ * @example $.recallDroppable();\r
+ */\r
+\r
+jQuery.recallDroppables = jQuery.iDrop.remeasure;
\ No newline at end of file
diff --git a/scripts/interface/iexpander.js b/scripts/interface/iexpander.js
new file mode 100644 (file)
index 0000000..64d2f19
--- /dev/null
@@ -0,0 +1,114 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * Expander\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ */\r
\r
+/**\r
+ * Expands text and textarea elements while new characters are typed to the a miximum width\r
+ *\r
+ * @name Expander\r
+ * @description Expands text and textarea elements while new characters are typed to the a miximum width\r
+ * @param Mixed limit integer if only expands in width, array if expands in width and height\r
+ * @type jQuery\r
+ * @cat Plugins/Interface\r
+ * @author Stefan Petre\r
+ */\r
+\r
+jQuery.iExpander =\r
+{\r
+       helper : null,\r
+       expand : function()\r
+       {\r
+               \r
+               text = this.value;\r
+               if (!text)\r
+                       return;\r
+               style = {\r
+                       fontFamily: jQuery(this).css('fontFamily')||'',\r
+                       fontSize: jQuery(this).css('fontSize')||'',\r
+                       fontWeight: jQuery(this).css('fontWeight')||'',\r
+                       fontStyle: jQuery(this).css('fontStyle')||'',\r
+                       fontStretch: jQuery(this).css('fontStretch')||'',\r
+                       fontVariant: jQuery(this).css('fontVariant')||'',\r
+                       letterSpacing: jQuery(this).css('letterSpacing')||'',\r
+                       wordSpacing: jQuery(this).css('wordSpacing')||''\r
+               };\r
+               jQuery.iExpander.helper.css(style);\r
+               html = jQuery.iExpander.htmlEntities(text);\r
+               html = html.replace(new RegExp( "\\n", "g" ), "<br />");\r
+               jQuery.iExpander.helper.html('pW');\r
+               spacer = jQuery.iExpander.helper.get(0).offsetWidth;\r
+               jQuery.iExpander.helper.html(html);\r
+               width = jQuery.iExpander.helper.get(0).offsetWidth + spacer;\r
+               if (this.Expander.limit && width > this.Expander.limit[0]) {\r
+                       width = this.Expander.limit[0];\r
+               }\r
+               this.style.width = width + 'px';\r
+               if (this.tagName == 'TEXTAREA') {\r
+                       height = jQuery.iExpander.helper.get(0).offsetHeight + spacer;\r
+                       if (this.Expander.limit && height > this.Expander.limit[1]) {\r
+                               height = this.Expander.limit[1];\r
+                       }\r
+                       this.style.height = height + 'px';\r
+               }\r
+       },\r
+       htmlEntities : function(text)\r
+       { \r
+               entities = {\r
+                       '&':'&amp;',\r
+                       '<':'&lt;',\r
+                       '>':'&gt;',\r
+                       '"':'&quot;'\r
+               };\r
+               for(i in entities) {\r
+                       text = text.replace(new RegExp(i,'g'),entities[i]);\r
+               }\r
+               return text;\r
+       },\r
+       build : function(limit)\r
+       {\r
+               if (jQuery.iExpander.helper == null) {\r
+                       jQuery('body', document).append('<div id="expanderHelper" style="position: absolute; top: 0; left: 0; visibility: hidden;"></div>');\r
+                       jQuery.iExpander.helper = jQuery('#expanderHelper');\r
+               }\r
+               return this.each(\r
+                       function()\r
+                       {\r
+                               if (/TEXTAREA|INPUT/.test(this.tagName)) {\r
+                                       if (this.tagName == 'INPUT') {\r
+                                               elType = this.getAttribute('type');\r
+                                               if (!/text|password/.test(elType)) {\r
+                                                       return;\r
+                                               }\r
+                                       }\r
+                                       if (limit && (limit.constructor == Number || (limit.constructor == Array && limit.length == 2))) {\r
+                                               if (limit.constructor == Number)\r
+                                                       limit = [limit, limit];\r
+                                               else {\r
+                                                       limit[0] = parseInt(limit[0])||400;\r
+                                                       limit[1] = parseInt(limit[1])||400;\r
+                                               }\r
+                                               this.Expander = {\r
+                                                       limit : limit\r
+                                               };\r
+                                       }\r
+                                       jQuery(this)\r
+                                               .blur(jQuery.iExpander.expand)\r
+                                               .keyup(jQuery.iExpander.expand)\r
+                                               .keypress(jQuery.iExpander.expand);\r
+                                       jQuery.iExpander.expand.apply(this);\r
+                               }\r
+                       }\r
+               );                      \r
+       }\r
+};\r
+\r
+jQuery.fn.Autoexpand = jQuery.iExpander.build;
\ No newline at end of file
diff --git a/scripts/interface/ifx.js b/scripts/interface/ifx.js
new file mode 100644 (file)
index 0000000..3c94c4b
--- /dev/null
@@ -0,0 +1,490 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * FX\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ */\r
+\r
+/**\r
+ * Validates elements that can be animated\r
+ */\r
+jQuery.fxCheckTag = function(e)\r
+{\r
+       if (/^tr$|^td$|^tbody$|^caption$|^thead$|^tfoot$|^col$|^colgroup$|^th$|^body$|^header$|^script$|^frame$|^frameset$|^option$|^optgroup$|^meta$/i.test(e.nodeName) )\r
+               return false;\r
+       else \r
+               return true;\r
+};\r
+\r
+/**\r
+ * Destroy the wrapper used for some animations\r
+ */\r
+jQuery.fx.destroyWrapper = function(e, old)\r
+{\r
+       var c = e.firstChild;\r
+       var cs = c.style;\r
+       cs.position = old.position;\r
+       cs.marginTop = old.margins.t;\r
+       cs.marginLeft = old.margins.l;\r
+       cs.marginBottom = old.margins.b;\r
+       cs.marginRight = old.margins.r;\r
+       cs.top = old.top + 'px';\r
+       cs.left = old.left + 'px';\r
+       e.parentNode.insertBefore(c, e);\r
+       e.parentNode.removeChild(e);\r
+};\r
+\r
+/**\r
+ * Builds a wrapper used for some animations\r
+ */\r
+jQuery.fx.buildWrapper = function(e)\r
+{\r
+       if (!jQuery.fxCheckTag(e))\r
+               return false;\r
+       var t = jQuery(e);\r
+       var es = e.style;\r
+       var restoreStyle = false;\r
+       \r
+       if (t.css('display') == 'none') {\r
+               oldVisibility = t.css('visibility');\r
+               t.css('visibility', 'hidden').show();\r
+               restoreStyle = true;\r
+       }\r
+       var oldStyle = {};\r
+       oldStyle.position = t.css('position');\r
+       oldStyle.sizes = jQuery.iUtil.getSize(e);\r
+       oldStyle.margins = jQuery.iUtil.getMargins(e);\r
+       \r
+       var oldFloat = e.currentStyle ? e.currentStyle.styleFloat : t.css('float');\r
+       oldStyle.top = parseInt(t.css('top'))||0;\r
+       oldStyle.left = parseInt(t.css('left'))||0;\r
+       var wid = 'w_' + parseInt(Math.random() * 10000);\r
+       var wr = document.createElement(/^img$|^br$|^input$|^hr$|^select$|^textarea$|^object$|^iframe$|^button$|^form$|^table$|^ul$|^dl$|^ol$/i.test(e.nodeName) ? 'div' : e.nodeName);\r
+       jQuery.attr(wr,'id', wid);\r
+       var wrapEl = jQuery(wr).addClass('fxWrapper');\r
+       var wrs = wr.style;\r
+       var top = 0;\r
+       var left = 0;\r
+       if (oldStyle.position == 'relative' || oldStyle.position == 'absolute'){\r
+               top = oldStyle.top;\r
+               left = oldStyle.left;\r
+       }\r
+       \r
+       wrs.top = top + 'px';\r
+       wrs.left = left + 'px';\r
+       wrs.position = oldStyle.position != 'relative' && oldStyle.position != 'absolute' ? 'relative' : oldStyle.position;\r
+       wrs.height = oldStyle.sizes.hb + 'px';\r
+       wrs.width = oldStyle.sizes.wb + 'px';\r
+       wrs.marginTop = oldStyle.margins.t;\r
+       wrs.marginRight = oldStyle.margins.r;\r
+       wrs.marginBottom = oldStyle.margins.b;\r
+       wrs.marginLeft = oldStyle.margins.l;\r
+       wrs.overflow = 'hidden';\r
+       if (jQuery.browser.msie) {\r
+               wrs.styleFloat = oldFloat;\r
+       } else {\r
+               wrs.cssFloat = oldFloat;\r
+       }\r
+       if (jQuery.browser == "msie") {\r
+               es.filter = "alpha(opacity=" + 0.999*100 + ")";\r
+       }\r
+       es.opacity = 0.999;\r
+       //t.wrap(wr);\r
+       e.parentNode.insertBefore(wr, e);\r
+       wr.appendChild(e);\r
+       es.marginTop = '0px';\r
+       es.marginRight = '0px';\r
+       es.marginBottom = '0px';\r
+       es.marginLeft = '0px';\r
+       es.position = 'absolute';\r
+       es.listStyle = 'none';\r
+       es.top = '0px';\r
+       es.left = '0px';\r
+       if (restoreStyle) {\r
+               t.hide();\r
+               es.visibility = oldVisibility;\r
+       }\r
+       return {oldStyle:oldStyle, wrapper:jQuery(wr)};\r
+};\r
+\r
+/**\r
+ * named colors\r
+ */\r
+jQuery.fx.namedColors = {\r
+       aqua:[0,255,255],\r
+       azure:[240,255,255],\r
+       beige:[245,245,220],\r
+       black:[0,0,0],\r
+       blue:[0,0,255],\r
+       brown:[165,42,42],\r
+       cyan:[0,255,255],\r
+       darkblue:[0,0,139],\r
+       darkcyan:[0,139,139],\r
+       darkgrey:[169,169,169],\r
+       darkgreen:[0,100,0],\r
+       darkkhaki:[189,183,107],\r
+       darkmagenta:[139,0,139],\r
+       darkolivegreen:[85,107,47],\r
+       darkorange:[255,140,0],\r
+       darkorchid:[153,50,204],\r
+       darkred:[139,0,0],\r
+       darksalmon:[233,150,122],\r
+       darkviolet:[148,0,211],\r
+       fuchsia:[255,0,255],\r
+       gold:[255,215,0],\r
+       green:[0,128,0],\r
+       indigo:[75,0,130],\r
+       khaki:[240,230,140],\r
+       lightblue:[173,216,230],\r
+       lightcyan:[224,255,255],\r
+       lightgreen:[144,238,144],\r
+       lightgrey:[211,211,211],\r
+       lightpink:[255,182,193],\r
+       lightyellow:[255,255,224],\r
+       lime:[0,255,0],\r
+       magenta:[255,0,255],\r
+       maroon:[128,0,0],\r
+       navy:[0,0,128],\r
+       olive:[128,128,0],\r
+       orange:[255,165,0],\r
+       pink:[255,192,203],\r
+       purple:[128,0,128],\r
+       red:[255,0,0],\r
+       silver:[192,192,192],\r
+       white:[255,255,255],\r
+       yellow:[255,255,0]\r
+};\r
+\r
+/**\r
+ * parses a color to an object for reg, green and blue\r
+ */\r
+jQuery.fx.parseColor = function(color, notColor)\r
+{\r
+       if (jQuery.fx.namedColors[color]) \r
+               return {\r
+                       r: jQuery.fx.namedColors[color][0],\r
+                       g: jQuery.fx.namedColors[color][1],\r
+                       b: jQuery.fx.namedColors[color][2]\r
+               };\r
+       else if (result = /^rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)$/.exec(color))\r
+               return {\r
+                       r: parseInt(result[1]),\r
+                       g: parseInt(result[2]),\r
+                       b: parseInt(result[3])\r
+               };\r
+       else if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)$/.exec(color)) \r
+               return {\r
+                       r: parseFloat(result[1])*2.55,\r
+                       g: parseFloat(result[2])*2.55,\r
+                       b: parseFloat(result[3])*2.55\r
+               };\r
+       else if (result = /^#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/.exec(color))\r
+               return {\r
+                       r: parseInt("0x"+ result[1] + result[1]),\r
+                       g: parseInt("0x" + result[2] + result[2]),\r
+                       b: parseInt("0x" + result[3] + result[3])\r
+               };\r
+       else if (result = /^#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/.exec(color))\r
+               return {\r
+                       r: parseInt("0x" + result[1]),\r
+                       g: parseInt("0x" + result[2]),\r
+                       b: parseInt("0x" + result[3])\r
+               };\r
+       else\r
+               return notColor == true ? false : {r: 255, g: 255, b: 255};\r
+};\r
+/**\r
+ * CSS rules that can be animated\r
+ */\r
+jQuery.fx.cssProps = {\r
+       borderBottomWidth:1,\r
+       borderLeftWidth:1,\r
+       borderRightWidth:1,\r
+       borderTopWidth:1,\r
+       bottom:1,\r
+       fontSize:1,\r
+       height:1,\r
+       left:1,\r
+       letterSpacing:1,\r
+       lineHeight:1,\r
+       marginBottom:1,\r
+       marginLeft:1,\r
+       marginRight:1,\r
+       marginTop:1,\r
+       maxHeight:1,\r
+       maxWidth:1,\r
+       minHeight:1,\r
+       minWidth:1,\r
+       opacity:1,\r
+       outlineOffset:1,\r
+       outlineWidth:1,\r
+       paddingBottom:1,\r
+       paddingLeft:1,\r
+       paddingRight:1,\r
+       paddingTop:1,\r
+       right:1,\r
+       textIndent:1,\r
+       top:1,\r
+    width:1,\r
+       zIndex:1\r
+};\r
+/**\r
+ * CSS color rules that can be animated\r
+ */\r
+jQuery.fx.colorCssProps = {\r
+       backgroundColor:1,\r
+       borderBottomColor:1,\r
+       borderLeftColor:1,\r
+       borderRightColor:1,\r
+       borderTopColor:1,\r
+       color:1,\r
+       outlineColor:1\r
+};\r
+\r
+jQuery.fx.cssSides = ['Top', 'Right', 'Bottom', 'Left'];\r
+jQuery.fx.cssSidesEnd = {\r
+       'borderWidth': ['border', 'Width'],\r
+       'borderColor': ['border', 'Color'],\r
+       'margin': ['margin', ''],\r
+       'padding': ['padding', '']\r
+};\r
+\r
+/**\r
+ * Overwrite animation to use new FX function\r
+ */\r
+jQuery.fn.extend({\r
+       \r
+       animate: function( prop, speed, easing, callback ) {\r
+               return this.queue(function(){\r
+                       var opt = jQuery.speed(speed, easing, callback);\r
+                       var e = new jQuery.fxe( this, opt, prop );\r
+                       \r
+               });\r
+       },\r
+       pause: function(speed, callback) {\r
+               return this.queue(function(){\r
+                       var opt = jQuery.speed(speed, callback);\r
+                       var e = new jQuery.pause( this, opt );\r
+               });\r
+       },\r
+       stop : function(step) {\r
+               return this.each(function(){\r
+                       if (this.animationHandler)\r
+                               jQuery.stopAnim(this, step);\r
+                       \r
+               });\r
+       },\r
+       stopAll : function(step) {\r
+               return this.each(function(){\r
+                       if (this.animationHandler)\r
+                               jQuery.stopAnim(this, step);\r
+                       if ( this.queue && this.queue['fx'] )\r
+                               this.queue.fx = [];\r
+               });\r
+       }\r
+});\r
+/**\r
+ * Improved FXC function that aniamtes collection of properties per timer. Accepts inline styles and class names to animate\r
+ */\r
+jQuery.extend({\r
+       pause: function(elem, options)\r
+       {\r
+               var z = this, values;\r
+               z.step = function()\r
+               {\r
+                       if ( jQuery.isFunction( options.complete ) )\r
+                               options.complete.apply( elem );\r
+               };\r
+               z.timer=setInterval(function(){z.step();},options.duration);\r
+               elem.animationHandler = z;\r
+       },\r
+       easing :  {\r
+               linear: function(p, n, firstNum, delta, duration) {\r
+                       return ((-Math.cos(p*Math.PI)/2) + 0.5) * delta + firstNum;\r
+               }\r
+       },\r
+       fxe: function( elem, options, prop ){\r
+               var z = this, values;\r
+\r
+               // The styles\r
+               var y = elem.style;\r
+               var oldOverflow = jQuery.css(elem, "overflow");\r
+               var oldDisplay= jQuery.css(elem, "display");\r
+               var props = {};\r
+               z.startTime = (new Date()).getTime();\r
+               options.easing = options.easing && jQuery.easing[options.easing] ? options.easing : 'linear';\r
+               \r
+               z.getValues = function(tp, vp)\r
+               {\r
+                       if (jQuery.fx.cssProps[tp]) {\r
+                               if (vp == 'show' || vp == 'hide' || vp == 'toggle') {\r
+                                       if ( !elem.orig ) elem.orig = {};\r
+                                       var r = parseFloat( jQuery.curCSS(elem, tp) );\r
+                                       elem.orig[tp] = r && r > -10000 ? r : (parseFloat( jQuery.css(elem,tp) )||0);\r
+                                       vp = vp == 'toggle' ? ( oldDisplay == 'none' ? 'show' : 'hide') : vp;\r
+                                       options[vp] = true;\r
+                                       props[tp] = vp == 'show' ? [0, elem.orig[tp]] : [elem.orig[tp], 0];\r
+                                       if (tp != 'opacity')\r
+                                               y[tp] = props[tp][0] + (tp != 'zIndex' && tp != 'fontWeight' ? 'px':'');\r
+                                       else\r
+                                               jQuery.attr(y, "opacity", props[tp][0]);\r
+                               } else {\r
+                                       props[tp] = [parseFloat( jQuery.curCSS(elem, tp) ), parseFloat(vp)||0];\r
+                               }\r
+                       } else if (jQuery.fx.colorCssProps[tp])\r
+                               props[tp] = [jQuery.fx.parseColor(jQuery.curCSS(elem, tp)), jQuery.fx.parseColor(vp)];\r
+                       else if(/^margin$|padding$|border$|borderColor$|borderWidth$/i.test(tp)) {\r
+                               var m = vp.replace(/\s+/g, ' ').replace(/rgb\s*\(\s*/g,'rgb(').replace(/\s*,\s*/g,',').replace(/\s*\)/g,')').match(/([^\s]+)/g);\r
+                               switch(tp){\r
+                                       case 'margin':\r
+                                       case 'padding':\r
+                                       case 'borderWidth':\r
+                                       case 'borderColor':\r
+                                               m[3] = m[3]||m[1]||m[0];\r
+                                               m[2] = m[2]||m[0];\r
+                                               m[1] = m[1]||m[0];\r
+                                               for(var i = 0; i < jQuery.fx.cssSides.length; i++) {\r
+                                                       var nmp = jQuery.fx.cssSidesEnd[tp][0] + jQuery.fx.cssSides[i] + jQuery.fx.cssSidesEnd[tp][1];\r
+                                                       props[nmp] = tp == 'borderColor' ?\r
+                                                               [jQuery.fx.parseColor(jQuery.curCSS(elem, nmp)), jQuery.fx.parseColor(m[i])]\r
+                                                               : [parseFloat( jQuery.curCSS(elem, nmp) ), parseFloat(m[i])];\r
+                                               }\r
+                                               break;\r
+                                       case 'border':\r
+                                               for(var i = 0; i< m.length; i++) {\r
+                                                       var floatVal = parseFloat(m[i]);\r
+                                                       var sideEnd = !isNaN(floatVal) ? 'Width' : (!/transparent|none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset/i.test(m[i]) ? 'Color' : false);\r
+                                                       if (sideEnd) {\r
+                                                               for(var j = 0; j < jQuery.fx.cssSides.length; j++) {\r
+                                                                       nmp = 'border' + jQuery.fx.cssSides[j] + sideEnd;\r
+                                                                       props[nmp] = sideEnd == 'Color' ?\r
+                                                               [jQuery.fx.parseColor(jQuery.curCSS(elem, nmp)), jQuery.fx.parseColor(m[i])]\r
+                                                               : [parseFloat( jQuery.curCSS(elem, nmp) ), floatVal];\r
+                                                               }\r
+                                                       } else {\r
+                                                               y['borderStyle'] = m[i];\r
+                                                       }\r
+                                               }\r
+                                               break;\r
+                               }\r
+                       } else {\r
+                               y[tp] = vp;\r
+                       }\r
+                       return false;\r
+               };\r
+               \r
+               for(p in prop) {\r
+                       if (p == 'style') {\r
+                               var newStyles = jQuery.parseStyle(prop[p]);\r
+                               for (np in newStyles) {\r
+                                       this.getValues(np, newStyles[np]);\r
+                               }\r
+                       } else if (p == 'className') {\r
+                               if (document.styleSheets)\r
+                                       for (var i=0; i<document.styleSheets.length; i++){\r
+                                               var cssRules = document.styleSheets[i].cssRules||document.styleSheets[i].rules||null;\r
+                                               if (cssRules) {\r
+                                                       for (var j=0; j<cssRules.length; j++) {\r
+                                                               if(cssRules[j].selectorText == '.' + prop[p]) {\r
+                                                                       var rule = new RegExp('\.' + prop[p] + ' {');\r
+                                                                       var styles = cssRules[j].style.cssText;\r
+                                                                       var newStyles = jQuery.parseStyle(styles.replace(rule, '').replace(/}/g, ''));\r
+                                                                       for (np in newStyles) {\r
+                                                                               this.getValues(np, newStyles[np]);\r
+                                                                       }\r
+                                                               }\r
+                                                       }\r
+                                               }\r
+                                       }\r
+                       } else {\r
+                               this.getValues(p, prop[p]);\r
+                       }\r
+               }\r
+               y.display = oldDisplay == 'none' ? 'block' : oldDisplay;\r
+               y.overflow = 'hidden';\r
+               \r
+               /*if (options.show)\r
+                       y.display = "";*/\r
+               \r
+               z.step = function(){\r
+                       var t = (new Date()).getTime();\r
+                       if (t > options.duration + z.startTime) {\r
+                               clearInterval(z.timer);\r
+                               z.timer = null;\r
+                               for (p in props) {\r
+                                       if ( p == "opacity" )\r
+                                               jQuery.attr(y, "opacity", props[p][1]);\r
+                                       else if (typeof props[p][1] == 'object')\r
+                                               y[p] = 'rgb(' + props[p][1].r +',' + props[p][1].g +',' + props[p][1].b +')';\r
+                                       else \r
+                                               y[p] = props[p][1] + (p != 'zIndex' && p != 'fontWeight' ? 'px':'');\r
+                               }\r
+                               if ( options.hide || options.show )\r
+                                       for ( var p in elem.orig )\r
+                                               if (p == "opacity")\r
+                                                       jQuery.attr(y, p, elem.orig[p]);\r
+                                               else\r
+                                                       y[p] = "";\r
+                               y.display = options.hide ? 'none' : (oldDisplay !='none' ? oldDisplay : 'block');\r
+                               y.overflow = oldOverflow;\r
+                               elem.animationHandler = null;\r
+                               if ( jQuery.isFunction( options.complete ) )\r
+                                       options.complete.apply( elem );\r
+                       } else {\r
+                               var n = t - this.startTime;\r
+                               var pr = n / options.duration;\r
+                               for (p in props) {\r
+                                       if (typeof props[p][1] == 'object') {\r
+                                               y[p] = 'rgb('\r
+                                               + parseInt(jQuery.easing[options.easing](pr, n,  props[p][0].r, (props[p][1].r-props[p][0].r), options.duration))\r
+                                               + ','\r
+                                               + parseInt(jQuery.easing[options.easing](pr, n,  props[p][0].g, (props[p][1].g-props[p][0].g), options.duration))\r
+                                               + ','\r
+                                               + parseInt(jQuery.easing[options.easing](pr, n,  props[p][0].b, (props[p][1].b-props[p][0].b), options.duration))\r
+                                               +')';\r
+                                       } else {\r
+                                               var pValue = jQuery.easing[options.easing](pr, n,  props[p][0], (props[p][1]-props[p][0]), options.duration);\r
+                                               if ( p == "opacity" )\r
+                                                       jQuery.attr(y, "opacity", pValue);\r
+                                               else \r
+                                                       y[p] = pValue + (p != 'zIndex' && p != 'fontWeight' ? 'px':'');\r
+                                       }\r
+                               }\r
+\r
+                       }\r
+               };\r
+       z.timer=setInterval(function(){z.step();},13);\r
+       elem.animationHandler = z;\r
+       },\r
+       stopAnim: function(elem, step)\r
+       {\r
+               if (step)\r
+                       elem.animationHandler.startTime -= 100000000;\r
+               else {\r
+                       window.clearInterval(elem.animationHandler.timer);\r
+                       elem.animationHandler = null;\r
+                       jQuery.dequeue(elem, "fx");\r
+               }\r
+       }\r
+}\r
+);\r
+\r
+jQuery.parseStyle = function(styles) {\r
+       var newStyles = {};\r
+       if (typeof styles == 'string') {\r
+               styles = styles.toLowerCase().split(';');\r
+               for(var i=0; i< styles.length; i++){\r
+                       rule = styles[i].split(':');\r
+                       if (rule.length == 2) {\r
+                               newStyles[jQuery.trim(rule[0].replace(/\-(\w)/g,function(m,c){return c.toUpperCase();}))] = jQuery.trim(rule[1]);\r
+                       }\r
+               }\r
+       }\r
+       return newStyles;\r
+};
\ No newline at end of file
diff --git a/scripts/interface/ifxblind.js b/scripts/interface/ifxblind.js
new file mode 100644 (file)
index 0000000..d8a7c29
--- /dev/null
@@ -0,0 +1,212 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * FX - blind\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ */\r
\r
+/**\r
+ * Applies a blinding animation to element\r
+ */\r
+jQuery.fn.extend(\r
+       {\r
+               /**\r
+                * @name BlindUp\r
+                * @description blinds the element up\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               BlindUp : function (speed, callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.BlindDirection(this, speed, callback, 'up', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name BlindDown\r
+                * @description blinds the element down\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               BlindDown : function (speed, callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.BlindDirection(this, speed, callback, 'down', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name BlindToggleVertically\r
+                * @description blinds the element up or down\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               BlindToggleVertically : function (speed, callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.BlindDirection(this, speed, callback, 'togglever', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name BlindLeft\r
+                * @description blinds the element left\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               BlindLeft : function (speed, callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.BlindDirection(this, speed, callback, 'left', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name BlindRight\r
+                * @description blinds the element right\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               BlindRight : function (speed, callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.BlindDirection(this, speed, callback, 'right', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name BlindToggleHorizontally\r
+                * @description blinds the element left and right\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               BlindToggleHorizontally : function (speed, callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.BlindDirection(this, speed, callback, 'togglehor', easing);\r
+                       });\r
+               }\r
+       }\r
+);\r
+\r
+jQuery.fx.BlindDirection = function (e, speed, callback, direction, easing)\r
+{\r
+       if (!jQuery.fxCheckTag(e)) {\r
+               jQuery.dequeue(e, 'interfaceFX');\r
+               return false;\r
+       }\r
+       var z = this;\r
+       z.el = jQuery(e);\r
+       z.size = jQuery.iUtil.getSize(e);\r
+       z.easing = typeof callback == 'string' ? callback : easing||null;\r
+       if (!e.ifxFirstDisplay)\r
+               e.ifxFirstDisplay = z.el.css('display');\r
+       if ( direction == 'togglever') {\r
+               direction = z.el.css('display') == 'none' ? 'down' : 'up';\r
+       } else if (direction == 'togglehor') {\r
+               direction = z.el.css('display') == 'none' ? 'right' : 'left';\r
+       }\r
+       z.el.show();\r
+       z.speed = speed;\r
+       z.callback = typeof callback == 'function' ? callback : null;\r
+       z.fx = jQuery.fx.buildWrapper(e);\r
+       z.direction = direction;\r
+       z.complete = function()\r
+       {\r
+               if (z.callback && z.callback.constructor == Function) {\r
+                       z.callback.apply(z.el.get(0));\r
+               }\r
+               if(z.direction == 'down' || z.direction == 'right'){\r
+                       z.el.css('display', z.el.get(0).ifxFirstDisplay == 'none' ? 'block' : z.el.get(0).ifxFirstDisplay);\r
+               } else {\r
+                       z.el.hide();\r
+               }\r
+               jQuery.fx.destroyWrapper(z.fx.wrapper.get(0), z.fx.oldStyle);\r
+               jQuery.dequeue(z.el.get(0), 'interfaceFX');\r
+       };\r
+       switch (z.direction) {\r
+               case 'up':\r
+                       fxh = new jQuery.fx(\r
+                               z.fx.wrapper.get(0),\r
+                               jQuery.speed(\r
+                                       z.speed,\r
+                                       z.easing,\r
+                                       z.complete\r
+                               ),\r
+                               'height'\r
+                       );\r
+                       fxh.custom(z.fx.oldStyle.sizes.hb, 0);\r
+               break;\r
+               case 'down':\r
+                       z.fx.wrapper.css('height', '1px');\r
+                       z.el.show();\r
+                       fxh = new jQuery.fx(\r
+                               z.fx.wrapper.get(0),\r
+                               jQuery.speed(\r
+                                       z.speed,\r
+                                       z.easing,\r
+                                       z.complete\r
+                               ),\r
+                               'height'\r
+                       );\r
+                       fxh.custom(0, z.fx.oldStyle.sizes.hb);\r
+               break;\r
+               case 'left':\r
+                       fxh = new jQuery.fx(\r
+                               z.fx.wrapper.get(0),\r
+                               jQuery.speed(\r
+                                       z.speed,\r
+                                       z.easing,\r
+                                       z.complete\r
+                               ),\r
+                               'width'\r
+                       );\r
+                       fxh.custom(z.fx.oldStyle.sizes.wb, 0);\r
+               break;\r
+               case 'right':\r
+                       z.fx.wrapper.css('width', '1px');\r
+                       z.el.show();\r
+                       fxh = new jQuery.fx(\r
+                               z.fx.wrapper.get(0),\r
+                               jQuery.speed(\r
+                                       z.speed,\r
+                                       z.easing,\r
+                                       z.complete\r
+                               ),\r
+                               'width'\r
+                       );\r
+                       fxh.custom(0, z.fx.oldStyle.sizes.wb);\r
+               break;\r
+       }\r
+};
\ No newline at end of file
diff --git a/scripts/interface/ifxbounce.js b/scripts/interface/ifxbounce.js
new file mode 100644 (file)
index 0000000..e8fc132
--- /dev/null
@@ -0,0 +1,89 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * FX - bounce\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ */\r
+\r
+/**\r
+ * @name Bounce\r
+ * @description makes the element to bounce\r
+ * @param Integer hight the hight in pxels for element to jumps to\r
+ * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+ * @type jQuery\r
+ * @cat Plugins/Interface\r
+ * @author Stefan Petre\r
+ */\r
+jQuery.fn.Bounce = function (hight, callback) {\r
+       return this.queue('interfaceFX', function(){\r
+               if (!jQuery.fxCheckTag(this)) {\r
+                       jQuery.dequeue(this, 'interfaceFX');\r
+                       return false;\r
+               }\r
+               var e = new jQuery.fx.iBounce(this, hight, callback);\r
+               e.bounce();\r
+       });\r
+};\r
+jQuery.fx.iBounce = function (e, hight, callback)\r
+{\r
+       var z = this;\r
+       z.el = jQuery(e);\r
+       z.el.show();\r
+       z.callback = callback;\r
+       z.hight = parseInt(hight)||40;\r
+       z.oldStyle = {};\r
+       z.oldStyle.position = z.el.css('position');\r
+       z.oldStyle.top = parseInt(z.el.css('top'))||0;\r
+       z.oldStyle.left = parseInt(z.el.css('left'))||0;\r
+       \r
+       if (z.oldStyle.position != 'relative' && z.oldStyle.position != 'absolute') {\r
+               z.el.css('position', 'relative');\r
+       }\r
+       \r
+       z.times = 5;\r
+       z.cnt = 1;\r
+       \r
+       z.bounce = function ()\r
+       {\r
+               z.cnt ++;\r
+               z.e = new jQuery.fx(\r
+                       z.el.get(0), \r
+                       {\r
+                        duration: 120,\r
+                        complete : function ()\r
+                        {\r
+                               z.e = new jQuery.fx(\r
+                                       z.el.get(0), \r
+                                       {\r
+                                               duration: 80,\r
+                                               complete : function ()\r
+                                               {\r
+                                                       z.hight = parseInt(z.hight/2);\r
+                                                       if (z.cnt <= z.times)\r
+                                                               z.bounce();\r
+                                                       else {\r
+                                                               z.el.css('position', z.oldStyle.position).css('top', z.oldStyle.top + 'px').css('left', z.oldStyle.left + 'px');\r
+                                                               jQuery.dequeue(z.el.get(0), 'interfaceFX');\r
+                                                               if (z.callback && z.callback.constructor == Function) {\r
+                                                                       z.callback.apply(z.el.get(0));\r
+                                                               }\r
+                                                       }\r
+                                               }\r
+                                       },\r
+                                       'top'\r
+                               );\r
+                               z.e.custom (z.oldStyle.top-z.hight, z.oldStyle.top);\r
+                        }\r
+                       }, \r
+                       'top'\r
+               );\r
+               z.e.custom (z.oldStyle.top, z.oldStyle.top-z.hight);\r
+       };\r
+               \r
+};
\ No newline at end of file
diff --git a/scripts/interface/ifxdrop.js b/scripts/interface/ifxdrop.js
new file mode 100644 (file)
index 0000000..c51e317
--- /dev/null
@@ -0,0 +1,300 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * FX - drop\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ */\r
+\r
+/**\r
+ * Applies a dropping effect to element\r
+ */\r
+jQuery.fn.extend(\r
+       {\r
+               /**\r
+                * @name DropOutDown\r
+                * @description drops the element out down\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               DropOutDown : function (speed, callback, easing) {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.DropOutDirectiont(this, speed, callback, 'down', 'out', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name DropInDown\r
+                * @description drops the element in down\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               DropInDown : function (speed, callback, easing) {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.DropOutDirectiont(this,  speed, callback, 'down', 'in', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name DropToggleDown\r
+                * @description drops the element in/out down\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               DropToggleDown : function (speed, callback, easing) {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.DropOutDirectiont(this,  speed, callback, 'down', 'toggle', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name DropOutUp\r
+                * @description drops the element out up\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               DropOutUp : function (speed, callback, easing) {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.DropOutDirectiont(this, speed, callback, 'up', 'out', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name DropInUp\r
+                * @description drops the element in up\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               DropInUp : function (speed, callback, easing) {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.DropOutDirectiont(this,  speed, callback, 'up', 'in', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name DropToggleUp\r
+                * @description drops the element in/out up\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               DropToggleUp : function (speed, callback, easing) {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.DropOutDirectiont(this,  speed, callback, 'up', 'toggle', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name DropOutLeft\r
+                * @description drops the element out left\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               DropOutLeft : function (speed, callback, easing) {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.DropOutDirectiont(this, speed, callback, 'left', 'out', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name DropInLeft\r
+                * @description drops the element in left\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               DropInLeft : function (speed, callback, easing) {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.DropOutDirectiont(this,  speed, callback, 'left', 'in', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name DropToggleLeft\r
+                * @description drops the element in/out left\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               DropToggleLeft : function (speed, callback, easing) {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.DropOutDirectiont(this,  speed, callback, 'left', 'toggle', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name DropOutRight\r
+                * @description drops the element out right\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               DropOutRight : function (speed, callback, easing) {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.DropOutDirectiont(this, speed, callback, 'right', 'out', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name DropInRight\r
+                * @description drops the element in right\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               DropInRight : function (speed, callback, easing) {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.DropOutDirectiont(this,  speed, callback, 'right', 'in', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name DropToggleRight\r
+                * @description drops the element in/out right\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               DropToggleRight : function (speed, callback, easing) {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.DropOutDirectiont(this,  speed, callback, 'right', 'toggle', easing);\r
+                       });\r
+               }\r
+       }\r
+);\r
+\r
+jQuery.fx.DropOutDirectiont = function (e, speed, callback, direction, type, easing)\r
+{\r
+       if (!jQuery.fxCheckTag(e)) {\r
+               jQuery.dequeue(e, 'interfaceFX');\r
+               return false;\r
+       }\r
+       var z = this;\r
+       z.el = jQuery(e);\r
+       z.easing = typeof callback == 'string' ? callback : easing||null;\r
+       z.oldStyle = {};\r
+       z.oldStyle.position = z.el.css('position');\r
+       z.oldStyle.top = z.el.css('top');\r
+       z.oldStyle.left = z.el.css('left');\r
+       if (!e.ifxFirstDisplay)\r
+               e.ifxFirstDisplay = z.el.css('display');\r
+       if ( type == 'toggle') {\r
+               type = z.el.css('display') == 'none' ? 'in' : 'out';\r
+       }\r
+       z.el.show();\r
+       \r
+       if (z.oldStyle.position != 'relative' && z.oldStyle.position != 'absolute') {\r
+               z.el.css('position', 'relative');\r
+       }\r
+       z.type = type;\r
+       callback = typeof callback == 'function' ? callback : null;\r
+       /*sizes = ['em','px','pt','%'];\r
+       for(i in sizes) {\r
+               if (z.oldStyle.top.indexOf(sizes[i])>0) {\r
+                       z.topUnit = sizes[1];\r
+                       z.topSize = parseFloat(z.oldStyle.top)||0;\r
+               }\r
+               if (z.oldStyle.left.indexOf(sizes[i])>0) {\r
+                       z.leftUnit = sizes[1];\r
+                       z.leftSize = parseFloat(z.oldStyle.left)||0;\r
+               }\r
+       }*/\r
+       \r
+       directionIncrement = 1;\r
+       switch (direction){\r
+               case 'up':\r
+                       z.e = new jQuery.fx(z.el.get(0), jQuery.speed(speed - 15, z.easing,callback), 'top');\r
+                       z.point = parseFloat(z.oldStyle.top)||0;\r
+                       z.unit = z.topUnit;\r
+                       directionIncrement = -1;\r
+               break;\r
+               case 'down':\r
+                       z.e = new jQuery.fx(z.el.get(0), jQuery.speed(speed - 15, z.easing,callback), 'top');\r
+                       z.point = parseFloat(z.oldStyle.top)||0;\r
+                       z.unit = z.topUnit;\r
+               break;\r
+               case 'right':\r
+                       z.e = new jQuery.fx(z.el.get(0), jQuery.speed(speed - 15, z.easing,callback), 'left');\r
+                       z.point = parseFloat(z.oldStyle.left)||0;\r
+                       z.unit = z.leftUnit;\r
+               break;\r
+               case 'left':\r
+                       z.e = new jQuery.fx(z.el.get(0), jQuery.speed(speed - 15, z.easing,callback), 'left');\r
+                       z.point = parseFloat(z.oldStyle.left)||0;\r
+                       z.unit = z.leftUnit;\r
+                       directionIncrement = -1;\r
+               break;\r
+       }\r
+       z.e2 = new jQuery.fx(\r
+               z.el.get(0),\r
+               jQuery.speed\r
+               (\r
+                       speed, z.easing,\r
+                       function()\r
+                       {\r
+                               z.el.css(z.oldStyle);\r
+                               if (z.type == 'out') {\r
+                                       z.el.css('display', 'none');\r
+                               } else \r
+                                       z.el.css('display', z.el.get(0).ifxFirstDisplay == 'none' ? 'block' : z.el.get(0).ifxFirstDisplay);\r
+                               \r
+                               jQuery.dequeue(z.el.get(0), 'interfaceFX');\r
+                       }\r
+                ),\r
+               'opacity'\r
+       );\r
+       if (type == 'in') {\r
+               z.e.custom(z.point+ 100*directionIncrement, z.point);\r
+               z.e2.custom(0,1);\r
+       } else {\r
+               z.e.custom(z.point, z.point + 100*directionIncrement);\r
+               z.e2.custom(1,0);\r
+       }\r
+};
\ No newline at end of file
diff --git a/scripts/interface/ifxfold.js b/scripts/interface/ifxfold.js
new file mode 100644 (file)
index 0000000..a3f8d30
--- /dev/null
@@ -0,0 +1,157 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * FX - fold\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ */\r
+\r
+/**\r
+ * Applies a folding animation to element\r
+ */\r
+jQuery.fn.extend(\r
+       {\r
+               /**\r
+                * @name Fold\r
+                * @description folds the element\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Integer height the height in pixels to fold element to\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               Fold : function (speed, height, callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.DoFold(this, speed, height, callback, 'fold', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name UnFold\r
+                * @description unfolds the element\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Integer height the height in pixels to unfold element to\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               UnFold : function (speed, height, callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.DoFold(this, speed, height, callback, 'unfold', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name FoldToggle\r
+                * @description folds/unfolds the element\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Integer height the height in pixels to folds/unfolds element to\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               FoldToggle : function (speed, height, callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.DoFold(this, speed, height, callback, 'toggle', easing);\r
+                       });\r
+               }\r
+       }\r
+);\r
+\r
+jQuery.fx.DoFold = function (e, speed, height, callback, type, easing)\r
+{\r
+       if (!jQuery.fxCheckTag(e)) {\r
+               jQuery.dequeue(e, 'interfaceFX');\r
+               return false;\r
+       }\r
+       var z = this;\r
+       z.el = jQuery(e);\r
+       z.easing = typeof callback == 'string' ? callback : easing||null;\r
+       z.callback = typeof callback == 'function' ? callback : null;\r
+       if ( type == 'toggle') {\r
+               type = z.el.css('display') == 'none' ? 'unfold' : 'fold';\r
+       }\r
+       //z.el.show();\r
+       z.speed = speed;\r
+       z.height = height && height.constructor == Number ? height : 20;\r
+       z.fx = jQuery.fx.buildWrapper(e);\r
+       z.type = type;\r
+       z.complete = function()\r
+       {\r
+               if (z.callback && z.callback.constructor == Function) {\r
+                       z.callback.apply(z.el.get(0));\r
+               }\r
+               if(z.type == 'unfold'){\r
+                       z.el.show();\r
+               } else {\r
+                       z.el.hide();\r
+               }\r
+               jQuery.fx.destroyWrapper(z.fx.wrapper.get(0), z.fx.oldStyle);\r
+               jQuery.dequeue(z.el.get(0), 'interfaceFX');\r
+       };\r
+       if ( z.type == 'unfold') {\r
+               z.el.show();\r
+               z.fx.wrapper.css('height', z.height + 'px').css('width', '1px');\r
+               \r
+               z.ef = new jQuery.fx(\r
+                               z.fx.wrapper.get(0),\r
+                               jQuery.speed (\r
+                                       z.speed,\r
+                                       z.easing,\r
+                                       function()\r
+                                       {\r
+                                               z.ef = new jQuery.fx(\r
+                                                       z.fx.wrapper.get(0),\r
+                                                       jQuery.speed(\r
+                                                               z.speed,\r
+                                                               z.easing, \r
+                                                               z.complete\r
+                                                       ),\r
+                                                       'height'\r
+                                               );\r
+                                               z.ef.custom(z.height, z.fx.oldStyle.sizes.hb);\r
+                                       }\r
+                               ), \r
+                               'width'\r
+                       );\r
+               z.ef.custom(0, z.fx.oldStyle.sizes.wb);\r
+       } else {\r
+               z.ef = new jQuery.fx(\r
+                               z.fx.wrapper.get(0),\r
+                               jQuery.speed(\r
+                                       z.speed,\r
+                                       z.easing,\r
+                                       function()\r
+                                       {\r
+                                               z.ef = new jQuery.fx(\r
+                                                       z.fx.wrapper.get(0),\r
+                                                       jQuery.speed(\r
+                                                               z.speed,\r
+                                                               z.easing,\r
+                                                               z.complete\r
+                                                       ),\r
+                                                       'width'\r
+                                               );\r
+                                               z.ef.custom(z.fx.oldStyle.sizes.wb, 0);\r
+                                       }\r
+                               ), \r
+                               'height'\r
+                       );\r
+               z.ef.custom(z.fx.oldStyle.sizes.hb, z.height);\r
+       }\r
+};\r
+\r
diff --git a/scripts/interface/ifxhighlight.js b/scripts/interface/ifxhighlight.js
new file mode 100644 (file)
index 0000000..fa2eb33
--- /dev/null
@@ -0,0 +1,64 @@
+/**
+ * Interface Elements for jQuery
+ * FX - Highlight
+ * 
+ * http://interface.eyecon.ro
+ * 
+ * Copyright (c) 2006 Stefan Petre
+ * Dual licensed under the MIT (MIT-LICENSE.txt) 
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *   
+ *
+ */
+
+
+/**
+ * @name Highlight
+ * @description Animates the backgroudn color to create a highlight animation
+ * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
+ * @param String color color to highlight from
+ * @param Function callback (optional) A function to be executed whenever the animation completes.
+ * @param String easing (optional) The name of the easing effect that you want to use.
+ * @type jQuery
+ * @cat Plugins/Interface
+ * @author Stefan Petre
+ */
+jQuery.fn.Highlight = function(speed, color, callback, easing) {
+       return this.queue(
+               'interfaceColorFX',
+               function()
+               {
+                       this.oldStyleAttr = jQuery(this).attr("style") || '';
+                       easing = typeof callback == 'string' ? callback : easing||null;
+                       callback = typeof callback == 'function' ? callback : null;
+                       var oldColor = jQuery(this).css('backgroundColor');
+                       var parentEl = this.parentNode;
+                       while(oldColor == 'transparent' && parentEl) {
+                               oldColor = jQuery(parentEl).css('backgroundColor');
+                               parentEl = parentEl.parentNode;
+                       }
+                       jQuery(this).css('backgroundColor', color);
+                       
+                       
+                       /* In IE, style is a object.. */
+                       if(typeof this.oldStyleAttr == 'object') this.oldStyleAttr = this.oldStyleAttr["cssText"];
+                       
+                       jQuery(this).animate(
+                               {'backgroundColor':oldColor},
+                               speed,
+                               easing,
+                               function() {
+                                       jQuery.dequeue(this, 'interfaceColorFX');
+                                       if(typeof jQuery(this).attr("style") == 'object') {
+                                               jQuery(this).attr("style")["cssText"] = "";
+                                               jQuery(this).attr("style")["cssText"] = this.oldStyleAttr;
+                                       } else {
+                                               jQuery(this).attr("style", this.oldStyleAttr);  
+                                       }
+                                       if (callback)
+                                               callback.apply(this);
+                               }
+                       );
+               }
+       );
+};
\ No newline at end of file
diff --git a/scripts/interface/ifxopenclose.js b/scripts/interface/ifxopenclose.js
new file mode 100644 (file)
index 0000000..8b017d1
--- /dev/null
@@ -0,0 +1,227 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * FX - open/close/switch\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ */\r
+\r
+/**\r
+ * Applies an open/close animation to element\r
+ */\r
+jQuery.fn.extend(\r
+       {\r
+               /**\r
+                * @name CloseVertically\r
+                * @description closes the element vertically\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               CloseVertically : function (speed, callback, easing) {\r
+                       return this.queue('interfaceFX', function(){\r
+                               new jQuery.fx.OpenClose(this, speed, callback, 'vertically', 'close', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name CloseHorizontally\r
+                * @description closes the element horizontally\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               CloseHorizontally : function (speed, callback, easing) {\r
+                       return this.queue('interfaceFX', function(){\r
+                               new jQuery.fx.OpenClose(this, speed, callback, 'horizontally', 'close', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name SwitchHorizontally\r
+                * @description opens/closes the element horizontally\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               SwitchHorizontally : function (speed, callback, easing) \r
+               {\r
+                       return this.queue('interfaceFX', function(){\r
+                               if (jQuery.css(this, 'display') == 'none') {\r
+                                       new jQuery.fx.OpenClose(this, speed, callback, 'horizontally', 'open', easing);\r
+                               } else {\r
+                                       new jQuery.fx.OpenClose(this, speed, callback, 'horizontally', 'close', easing);\r
+                               }\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name SwitchVertically\r
+                * @description opens/closes the element vertically\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               SwitchVertically : function (speed, callback, easing) \r
+               {\r
+                       return this.queue('interfaceFX', function(){\r
+                               if (jQuery.css(this, 'display') == 'none') {\r
+                                       new jQuery.fx.OpenClose(this, speed, callback, 'vertically', 'open', easing);\r
+                               } else {\r
+                                       new jQuery.fx.OpenClose(this, speed, callback, 'vertically', 'close', easing);\r
+                               }\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name OpenVertically\r
+                * @description opens the element vertically\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               OpenVertically : function (speed, callback, easing) {\r
+                       return this.queue('interfaceFX', function(){\r
+                               new jQuery.fx.OpenClose(this, speed, callback, 'vertically', 'open', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name OpenHorizontally\r
+                * @description opens the element horizontally\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               OpenHorizontally : function (speed, callback, easing) {\r
+                       return this.queue('interfaceFX', function(){\r
+                               new jQuery.fx.OpenClose(this, speed, callback, 'horizontally', 'open', easing);\r
+                       });\r
+               }\r
+       }\r
+);\r
+\r
+jQuery.fx.OpenClose = function (e, speed, callback, direction, type, easing)\r
+{\r
+       if (!jQuery.fxCheckTag(e)) {\r
+               jQuery.dequeue(e, 'interfaceFX');\r
+               return false;\r
+       }\r
+       var z = this;\r
+       var restoreStyle = false;\r
+       z.el = jQuery(e);\r
+       z.easing = typeof callback == 'string' ? callback : easing||null;\r
+       z.callback = typeof callback == 'function' ? callback : null;\r
+       z.type = type;\r
+       z.speed = speed;\r
+       z.oldP = jQuery.iUtil.getSize(e);\r
+       z.oldStyle = {};\r
+       z.oldStyle.position = z.el.css('position');\r
+       z.oldStyle.display = z.el.css('display');\r
+       if (z.oldStyle.display == 'none') {\r
+               oldVisibility = z.el.css('visibility');\r
+               z.el.show();\r
+               restoreStyle = true;\r
+       }\r
+       z.oldStyle.top = z.el.css('top');\r
+       z.oldStyle.left = z.el.css('left');\r
+       if (restoreStyle) {\r
+               z.el.hide();\r
+               z.el.css('visibility', oldVisibility);\r
+       }\r
+       z.oldStyle.width = z.oldP.w + 'px';\r
+       z.oldStyle.height = z.oldP.h + 'px';\r
+       z.oldStyle.overflow = z.el.css('overflow');\r
+       z.oldP.top = parseInt(z.oldStyle.top)||0;\r
+       z.oldP.left = parseInt(z.oldStyle.left)||0;\r
+       //z.el.show();\r
+       \r
+       if (z.oldStyle.position != 'relative' && z.oldStyle.position != 'absolute') {\r
+               z.el.css('position', 'relative');\r
+       }\r
+       z.el.css('overflow', 'hidden')\r
+               .css('height', type == 'open' && direction == 'vertically' ? 1 : z.oldP.h + 'px')\r
+               .css('width', type == 'open' && direction == 'horizontally' ? 1 : z.oldP.w + 'px');\r
+       \r
+       z.complete = function()\r
+       {\r
+               z.el.css(z.oldStyle);\r
+               if (z.type == 'close')\r
+                       z.el.hide();\r
+               else \r
+                       z.el.show();\r
+               jQuery.dequeue(z.el.get(0), 'interfaceFX');\r
+       };\r
+       \r
+       switch (direction) {\r
+               case 'vertically':\r
+                       z.eh = new jQuery.fx(\r
+                               z.el.get(0),\r
+                               jQuery.speed(speed-15, z.easing, callback),\r
+                               'height'\r
+                       );\r
+                       z.et = new jQuery.fx(\r
+                               z.el.get(0),\r
+                               jQuery.speed(\r
+                                       z.speed,\r
+                                       z.easing,\r
+                                       z.complete\r
+                               ),\r
+                               'top'\r
+                       );\r
+                       if (z.type == 'close') {\r
+                               z.eh.custom(z.oldP.h,0);\r
+                               z.et.custom(z.oldP.top, z.oldP.top + z.oldP.h/2);\r
+                       } else {\r
+                               z.eh.custom(0, z.oldP.h);\r
+                               z.et.custom(z.oldP.top + z.oldP.h/2, z.oldP.top);\r
+                       }\r
+               break;\r
+               case 'horizontally':\r
+                       z.eh = new jQuery.fx(\r
+                               z.el.get(0),\r
+                               jQuery.speed(speed-15, z.easing, callback),\r
+                               'width'\r
+                       );\r
+                       z.et = new jQuery.fx(\r
+                               z.el.get(0),\r
+                               jQuery.speed(\r
+                                       z.speed,\r
+                                       z.easing,\r
+                                       z.complete\r
+                               ),\r
+                               'left'\r
+                       );\r
+                       if (z.type == 'close') {\r
+                               z.eh.custom(z.oldP.w,0);\r
+                               z.et.custom(z.oldP.left, z.oldP.left + z.oldP.w/2);\r
+                       } else {\r
+                               z.eh.custom(0, z.oldP.w);\r
+                               z.et.custom(z.oldP.left + z.oldP.w/2, z.oldP.left);\r
+                       }\r
+               break;\r
+       }\r
+};
\ No newline at end of file
diff --git a/scripts/interface/ifxpulsate.js b/scripts/interface/ifxpulsate.js
new file mode 100644 (file)
index 0000000..fa14d70
--- /dev/null
@@ -0,0 +1,77 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * FX - pulsate\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ */\r
\r
+/**\r
+ * @name Bounce\r
+ * @description makes the element to pulsate\r
+ * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+ * @param Integer times how many times to pulsate\r
+ * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+ * @type jQuery\r
+ * @cat Plugins/Interface\r
+ * @author Stefan Petre\r
+ */\r
+jQuery.fn.Pulsate = function(speed, times, callback) {\r
+       return this.queue('interfaceFX',function(){\r
+               if (!jQuery.fxCheckTag(this)) {\r
+                       jQuery.dequeue(this, 'interfaceFX');\r
+                       return false;\r
+               }\r
+               var fx = new jQuery.fx.Pulsate(this, speed, times, callback);\r
+               fx.pulse();\r
+       });\r
+};\r
+\r
+jQuery.fx.Pulsate = function (el, speed, times, callback)\r
+{      \r
+       var z = this;\r
+       z.times = times;\r
+       z.cnt = 1;\r
+       z.el = el;\r
+       z.speed = speed;\r
+       z.callback = callback;\r
+       jQuery(z.el).show();\r
+       z.pulse = function()\r
+       {\r
+               z.cnt ++;\r
+               z.e = new jQuery.fx(\r
+                       z.el, \r
+                       jQuery.speed(\r
+                               z.speed, \r
+                               function(){\r
+                                       z.ef = new jQuery.fx(\r
+                                               z.el, \r
+                                               jQuery.speed(\r
+                                                       z.speed,\r
+                                                       function()\r
+                                                       {\r
+                                                               if (z.cnt <= z.times)\r
+                                                                       z.pulse();\r
+                                                               else {\r
+                                                                       jQuery.dequeue(z.el, 'interfaceFX');\r
+                                                                       if (z.callback && z.callback.constructor == Function) {\r
+                                                                               z.callback.apply(z.el);\r
+                                                                       }\r
+                                                               }\r
+                                                       }\r
+                                               ), \r
+                                               'opacity'\r
+                                       );\r
+                                       z.ef.custom(0,1);\r
+                               }\r
+                       ), \r
+                       'opacity'\r
+               );\r
+               z.e.custom(1,0);\r
+       };\r
+};\r
diff --git a/scripts/interface/ifxscale.js b/scripts/interface/ifxscale.js
new file mode 100644 (file)
index 0000000..81d3cf1
--- /dev/null
@@ -0,0 +1,290 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * FX - scale/grow/shrink/puff\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ */\r
+/**\r
+ * Applies a scallign animation to element\r
+ */\r
+jQuery.fn.extend(\r
+       {\r
+               /**\r
+                * @name Grow\r
+                * @description scales the element from 0 to intitial size\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               Grow : function(speed, callback, easing) {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.Scale(this, speed, 1, 100, true, callback, 'grow', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name Shrink\r
+                * @description scales the element from intitial size to 0\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               Shrink : function(speed, callback, easing) {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.Scale(this, speed, 100, 1, true, callback, 'shrink', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name Puff\r
+                * @description makes element to dispear by scalling to 150% and fading it out\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               Puff : function(speed, callback, easing) {\r
+                       return this.queue('interfaceFX',function(){\r
+                               var easing = easing || 'easeout';\r
+                               new jQuery.fx.Scale(this, speed, 100, 150, true, callback, 'puff', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name Scale\r
+                * @description scales the element\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Integer from initial scalling procentage\r
+                * @param Integer to final scalling procentage\r
+                * @param Boolean reastore whatever to restore the initital scalling procentage when animation ends\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               Scale : function(speed, from, to, restore, callback, easing) {\r
+                       return this.queue('interfaceFX',function(){\r
+                               new jQuery.fx.Scale(this, speed, from, to, restore, callback, 'Scale', easing);\r
+                       });\r
+               }\r
+       }\r
+);\r
+\r
+jQuery.fx.Scale = function (e, speed, from, to, restore, callback, type, easing)\r
+{\r
+       if (!jQuery.fxCheckTag(e)) {\r
+               jQuery.dequeue(e, 'interfaceFX');\r
+               return false;\r
+       }\r
+       var z = this;\r
+       z.el = jQuery(e);\r
+       z.from = parseInt(from) || 100;\r
+       z.to = parseInt(to) || 100;\r
+       z.easing = typeof callback == 'string' ? callback : easing||null;\r
+       z.callback = typeof callback == 'function' ? callback : null;\r
+       z.duration = jQuery.speed(speed).duration;\r
+       z.restore = restore|| null;\r
+       z.oldP = jQuery.iUtil.getSize(e);\r
+       z.oldStyle = {\r
+               width: z.el.css('width'),\r
+               height: z.el.css('height'),\r
+               fontSize: z.el.css('fontSize')||'100%',\r
+               position : z.el.css('position'),\r
+               display : z.el.css('display'),\r
+               top : z.el.css('top'),\r
+               left : z.el.css('left'),\r
+               overflow : z.el.css('overflow'),\r
+               borderTopWidth : z.el.css('borderTopWidth'),\r
+               borderRightWidth : z.el.css('borderRightWidth'),\r
+               borderBottomWidth : z.el.css('borderBottomWidth'),\r
+               borderLeftWidth : z.el.css('borderLeftWidth'),\r
+               paddingTop : z.el.css('paddingTop'),\r
+               paddingRight : z.el.css('paddingRight'),\r
+               paddingBottom : z.el.css('paddingBottom'),\r
+               paddingLeft : z.el.css('paddingLeft')\r
+       };\r
+       z.width = parseInt(z.oldStyle.width)||e.offsetWidth||0;\r
+       z.height = parseInt(z.oldStyle.height)||e.offsetHeight||0;\r
+       z.top = parseInt(z.oldStyle.top)||0;\r
+       z.left = parseInt(z.oldStyle.left)||0;\r
+       sizes = ['em','px','pt','%'];\r
+       for(i in sizes) {\r
+               if (z.oldStyle.fontSize.indexOf(sizes[i])>0) {\r
+                       z.fontUnit = sizes[i];\r
+                       z.fontSize = parseFloat(z.oldStyle.fontSize);\r
+               }\r
+               if (z.oldStyle.borderTopWidth.indexOf(sizes[i])>0) {\r
+                       z.borderTopUnit = sizes[i];\r
+                       z.borderTopSize = parseFloat(z.oldStyle.borderTopWidth)||0;\r
+               }\r
+               if (z.oldStyle.borderRightWidth.indexOf(sizes[i])>0) {\r
+                       z.borderRightUnit = sizes[i];\r
+                       z.borderRightSize = parseFloat(z.oldStyle.borderRightWidth)||0;\r
+               }\r
+               if (z.oldStyle.borderBottomWidth.indexOf(sizes[i])>0) {\r
+                       z.borderBottomUnit = sizes[i];\r
+                       z.borderBottomSize = parseFloat(z.oldStyle.borderBottomWidth)||0;\r
+               }\r
+               if (z.oldStyle.borderLeftWidth.indexOf(sizes[i])>0) {\r
+                       z.borderLeftUnit = sizes[i];\r
+                       z.borderLeftSize = parseFloat(z.oldStyle.borderLeftWidth)||0;\r
+               }\r
+               if (z.oldStyle.paddingTop.indexOf(sizes[i])>0) {\r
+                       z.paddingTopUnit = sizes[i];\r
+                       z.paddingTopSize = parseFloat(z.oldStyle.paddingTop)||0;\r
+               }\r
+               if (z.oldStyle.paddingRight.indexOf(sizes[i])>0) {\r
+                       z.paddingRightUnit = sizes[i];\r
+                       z.paddingRightSize = parseFloat(z.oldStyle.paddingRight)||0;\r
+               }\r
+               if (z.oldStyle.paddingBottom.indexOf(sizes[i])>0) {\r
+                       z.paddingBottomUnit = sizes[i];\r
+                       z.paddingBottomSize = parseFloat(z.oldStyle.paddingBottom)||0;\r
+               }\r
+               if (z.oldStyle.paddingLeft.indexOf(sizes[i])>0) {\r
+                       z.paddingLeftUnit = sizes[i];\r
+                       z.paddingLeftSize = parseFloat(z.oldStyle.paddingLeft)||0;\r
+               }\r
+       }\r
+       \r
+       \r
+       if (z.oldStyle.position != 'relative' && z.oldStyle.position != 'absolute') {\r
+               z.el.css('position', 'relative');\r
+       }\r
+       z.el.css('overflow', 'hidden');\r
+       z.type = type;\r
+       switch(z.type)\r
+       {\r
+               case 'grow':\r
+                       z.startTop = z.top + z.oldP.h/2;\r
+                       z.endTop = z.top;\r
+                       z.startLeft = z.left + z.oldP.w/2;\r
+                       z.endLeft = z.left;\r
+                       break;\r
+               case 'shrink':\r
+                       z.endTop = z.top + z.oldP.h/2;\r
+                       z.startTop = z.top;\r
+                       z.endLeft = z.left + z.oldP.w/2;\r
+                       z.startLeft = z.left;\r
+                       break;\r
+               case 'puff':\r
+                       z.endTop = z.top - z.oldP.h/4;\r
+                       z.startTop = z.top;\r
+                       z.endLeft = z.left - z.oldP.w/4;\r
+                       z.startLeft = z.left;\r
+                       break;\r
+       }\r
+       z.firstStep = false;\r
+       z.t=(new Date).getTime();\r
+       z.clear = function(){clearInterval(z.timer);z.timer=null;};\r
+       z.step = function(){\r
+               if (z.firstStep == false) {\r
+                       z.el.show();\r
+                       z.firstStep = true;\r
+               }\r
+               var t = (new Date).getTime();\r
+               var n = t - z.t;\r
+               var p = n / z.duration;\r
+               if (t >= z.duration+z.t) {\r
+                       setTimeout(\r
+                               function(){\r
+                                               o = 1;  \r
+                                       if (z.type) {\r
+                                               t = z.endTop;\r
+                                               l = z.endLeft;\r
+                                               if (z.type == 'puff')\r
+                                                       o = 0;\r
+                                       }\r
+                                       z.zoom(z.to, l, t, true, o);\r
+                               },\r
+                               13\r
+                       );\r
+                       z.clear();\r
+               } else {\r
+                       o = 1;\r
+                       if (!jQuery.easing || !jQuery.easing[z.easing]) {\r
+                               s = ((-Math.cos(p*Math.PI)/2) + 0.5) * (z.to-z.from) + z.from;\r
+                       } else {\r
+                               s = jQuery.easing[z.easing](p, n, z.from, (z.to-z.from), z.duration);\r
+                       }\r
+                       if (z.type) {\r
+                               if (!jQuery.easing || !jQuery.easing[z.easing]) {\r
+                                       t = ((-Math.cos(p*Math.PI)/2) + 0.5) * (z.endTop-z.startTop) + z.startTop;\r
+                                       l = ((-Math.cos(p*Math.PI)/2) + 0.5) * (z.endLeft-z.startLeft) + z.startLeft;\r
+                                       if (z.type == 'puff')\r
+                                               o = ((-Math.cos(p*Math.PI)/2) + 0.5) * (-0.9999) + 0.9999;\r
+                               } else {\r
+                                       t = jQuery.easing[z.easing](p, n, z.startTop, (z.endTop-z.startTop), z.duration);\r
+                                       l = jQuery.easing[z.easing](p, n, z.startLeft, (z.endLeft-z.startLeft), z.duration);\r
+                                       if (z.type == 'puff')\r
+                                               o = jQuery.easing[z.easing](p, n, 0.9999, -0.9999, z.duration);\r
+                               }\r
+                       }\r
+                       z.zoom(s, l, t, false, o);\r
+               }\r
+       };\r
+       z.timer=setInterval(function(){z.step();},13);\r
+       z.zoom = function(percent, left, top, finish, opacity)\r
+       {\r
+               z.el\r
+                       .css('height', z.height * percent/100 + 'px')\r
+                       .css('width', z.width * percent/100 + 'px')\r
+                       .css('left', left + 'px')\r
+                       .css('top', top + 'px')\r
+                       .css('fontSize', z.fontSize * percent /100 + z.fontUnit);\r
+               if (z.borderTopSize)\r
+                       z.el.css('borderTopWidth', z.borderTopSize * percent /100 + z.borderTopUnit);\r
+               if (z.borderRightSize)\r
+                       z.el.css('borderRightWidth', z.borderRightSize * percent /100 + z.borderRightUnit);\r
+               if (z.borderBottomSize)\r
+                       z.el.css('borderBottomWidth', z.borderBottomSize * percent /100 + z.borderBottomUnit);\r
+               if (z.borderLeftSize)\r
+                       z.el.css('borderLeftWidth', z.borderLeftSize * percent /100 + z.borderLeftUnit);\r
+               if (z.paddingTopSize)\r
+                       z.el.css('paddingTop', z.paddingTopSize * percent /100 + z.paddingTopUnit);\r
+               if (z.paddingRightSize)\r
+                       z.el.css('paddingRight', z.paddingRightSize * percent /100 + z.paddingRightUnit);\r
+               if (z.paddingBottomSize)\r
+                       z.el.css('paddingBottom', z.paddingBottomSize * percent /100 + z.paddingBottomUnit);\r
+               if (z.paddingLeftSize)\r
+                       z.el.css('paddingLeft', z.paddingLeftSize * percent /100 + z.paddingLeftUnit);\r
+               if (z.type == 'puff') {\r
+                       if (window.ActiveXObject)\r
+                               z.el.get(0).style.filter = "alpha(opacity=" + opacity*100 + ")";\r
+                       z.el.get(0).style.opacity = opacity;\r
+               }\r
+               if (finish){\r
+                       if (z.restore){\r
+                               z.el.css(z.oldStyle);\r
+                       }\r
+                       if (z.type == 'shrink' || z.type == 'puff'){\r
+                               z.el.css('display', 'none');\r
+                               if (z.type == 'puff') {\r
+                                       if (window.ActiveXObject)\r
+                                               z.el.get(0).style.filter = "alpha(opacity=" + 100 + ")";\r
+                                       z.el.get(0).style.opacity = 1;\r
+                               }\r
+                       }else \r
+                               z.el.css('display', 'block');\r
+                       if (z.callback)\r
+                               z.callback.apply(z.el.get(0));\r
+                       \r
+                       jQuery.dequeue(z.el.get(0), 'interfaceFX');\r
+               }\r
+       };\r
+};
\ No newline at end of file
diff --git a/scripts/interface/ifxscrollto.js b/scripts/interface/ifxscrollto.js
new file mode 100644 (file)
index 0000000..c24a245
--- /dev/null
@@ -0,0 +1,111 @@
+/**
+ * Interface Elements for jQuery
+ * FX - scroll to
+ * 
+ * http://interface.eyecon.ro
+ * 
+ * Copyright (c) 2006 Stefan Petre
+ * Dual licensed under the MIT (MIT-LICENSE.txt) 
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *   
+ *
+ */
+/**
+ * Applies a scrolling effect to document until the element gets into viewport
+ */
+jQuery.fn.extend (
+       {
+               /**
+                * @name ScrollTo
+                * @description scrolls the document until the lement gets into viewport
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
+                * @param String axis (optional) whatever to scroll on vertical, horizontal or both axis ['vertical'|'horizontal'|null]
+                * @param String easing (optional) The name of the easing effect that you want to use.
+                * @type jQuery
+                * @cat Plugins/Interface
+                * @author Stefan Petre
+                */
+               ScrollTo : function(speed, axis, easing) {
+                       o = jQuery.speed(speed);
+                       return this.queue('interfaceFX',function(){
+                               new jQuery.fx.ScrollTo(this, o, axis, easing);
+                       });
+               },
+               /**
+                * @name ScrollToAnchors
+                * @description all links to '#elementId' will animate scroll
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
+                * @param String axis (optional) whatever to scroll on vertical, horizontal or both axis ['vertical'|'horizontal'|null]
+                * @param String easing (optional) The name of the easing effect that you want to use.
+                * @type jQuery
+                * @cat Plugins/Interface
+                * @author Stefan Petre
+                */
+               /*inspired by David Maciejewski www.macx.de*/
+               ScrollToAnchors : function(speed, axis, easing) {
+                       return this.each(
+                               function()
+                               {
+                                       jQuery('a[@href*="#"]', this).click(
+                                               function(e)
+                                               {
+                                                       parts = this.href.split('#');
+                                                       jQuery('#' + parts[1]).ScrollTo(speed, axis, easing);
+                                                       return false;
+                                               }
+                                       );
+                               }
+                       )
+               }
+       }
+);
+
+jQuery.fx.ScrollTo = function (e, o, axis, easing)
+{
+       var z = this;
+       z.o = o;
+       z.e = e;
+       z.axis = /vertical|horizontal/.test(axis) ? axis : false;
+       z.easing = easing;
+       p = jQuery.iUtil.getPosition(e);
+       s = jQuery.iUtil.getScroll();
+       z.clear = function(){clearInterval(z.timer);z.timer=null;jQuery.dequeue(z.e, 'interfaceFX');};
+       z.t=(new Date).getTime();
+       s.h = s.h > s.ih ? (s.h - s.ih) : s.h;
+       s.w = s.w > s.iw ? (s.w - s.iw) : s.w;
+       z.endTop = p.y > s.h ? s.h : p.y;
+       z.endLeft = p.x > s.w ? s.w : p.x;
+       z.startTop = s.t;
+       z.startLeft = s.l;
+       z.step = function(){
+               var t = (new Date).getTime();
+               var n = t - z.t;
+               var p = n / z.o.duration;
+               if (t >= z.o.duration+z.t) {
+                       z.clear();
+                       setTimeout(function(){z.scroll(z.endTop, z.endLeft)},13);
+               } else {
+                       if (!z.axis || z.axis == 'vertical') {
+                               if (!jQuery.easing || !jQuery.easing[z.easing]) {
+                                       st = ((-Math.cos(p*Math.PI)/2) + 0.5) * (z.endTop-z.startTop) + z.startTop;
+                               } else {
+                                       st = jQuery.easing[z.easing](p, n, z.startTop, (z.endTop - z.startTop), z.o.duration);
+                               }
+                       } else {
+                               st = z.startTop;
+                       }
+                       if (!z.axis || z.axis == 'horizontal') {
+                               if (!jQuery.easing || !jQuery.easing[z.easing]) {
+                                       sl = ((-Math.cos(p*Math.PI)/2) + 0.5) * (z.endLeft-z.startLeft) + z.startLeft;
+                               } else {
+                                       sl = jQuery.easing[z.easing](p, n, z.startLeft, (z.endLeft - z.startLeft), z.o.duration);
+                               }
+                       } else {
+                               sl = z.startLeft;
+                       }
+                       z.scroll(st, sl);
+               }
+       };
+       z.scroll = function (t, l){window.scrollTo(l, t);};
+       z.timer=setInterval(function(){z.step();},13);
+};
\ No newline at end of file
diff --git a/scripts/interface/ifxshake.js b/scripts/interface/ifxshake.js
new file mode 100644 (file)
index 0000000..0fbf2ab
--- /dev/null
@@ -0,0 +1,97 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * FX - shake\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ */\r
+\r
+/**\r
+ * @name Shake\r
+ * @description makes the element to shake\r
+ * @param Integer times how many tomes to shake the element\r
+ * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+ * @type jQuery\r
+ * @cat Plugins/Interface\r
+ * @author Stefan Petre\r
+ */\r
+jQuery.fn.Shake = function (times, callback) {\r
+       return this.queue('interfaceFX',function(){\r
+               if (!jQuery.fxCheckTag(this)) {\r
+                       jQuery.dequeue(this, 'interfaceFX');\r
+                       return false;\r
+               }\r
+               var e = new jQuery.fx.Shake(this, times, callback);\r
+               e.shake();\r
+       });\r
+};\r
+jQuery.fx.Shake = function (e, times, callback)\r
+{\r
+       var z = this;\r
+       z.el = jQuery(e);\r
+       z.el.show();\r
+       z.times = parseInt(times)||3;\r
+       z.callback = callback;\r
+       z.cnt = 1;\r
+       z.oldStyle = {};\r
+       z.oldStyle.position = z.el.css('position');\r
+       z.oldStyle.top = parseInt(z.el.css('top'))||0;\r
+       z.oldStyle.left = parseInt(z.el.css('left'))||0;\r
+       \r
+       if (z.oldStyle.position != 'relative' && z.oldStyle.position != 'absolute') {\r
+               z.el.css('position', 'relative');\r
+       }\r
+       \r
+       z.shake = function ()\r
+       {\r
+               z.cnt ++;\r
+               \r
+               z.e = new jQuery.fx(\r
+                       z.el.get(0), \r
+                       {\r
+                               duration: 60,\r
+                               complete : function ()\r
+                               {\r
+                                       z.e = new jQuery.fx(\r
+                                               z.el.get(0), \r
+                                                {\r
+                                                        duration: 60,\r
+                                                        complete : function ()\r
+                                                        {\r
+                                                               z.e = new jQuery.fx(\r
+                                                                       e,\r
+                                                                       {\r
+                                                                               duration: 60, \r
+                                                                               complete: function(){\r
+                                                                                       if (z.cnt <= z.times)\r
+                                                                                               z.shake();\r
+                                                                                       else {\r
+                                                                                               z.el.css('position', z.oldStyle.position).css('top', z.oldStyle.top + 'px').css('left', z.oldStyle.left + 'px');\r
+                                                                                               jQuery.dequeue(z.el.get(0), 'interfaceFX');\r
+                                                                                               if (z.callback && z.callback.constructor == Function) {\r
+                                                                                                       z.callback.apply(z.el.get(0));\r
+                                                                                               }\r
+                                                                                       }\r
+                                                                               }\r
+                                                                       },\r
+                                                                       'left'\r
+                                                               );\r
+                                                               z.e.custom (z.oldStyle.left-20, z.oldStyle.left);\r
+                                                        }\r
+                                               },\r
+                                               'left'\r
+                                       );\r
+                                       z.e.custom (z.oldStyle.left+20, z.oldStyle.left-20);\r
+                               }\r
+                       },\r
+                       'left'\r
+               );\r
+               z.e.custom (z.oldStyle.left, z.oldStyle.left+20);\r
+       };\r
+               \r
+};
\ No newline at end of file
diff --git a/scripts/interface/ifxslide.js b/scripts/interface/ifxslide.js
new file mode 100644 (file)
index 0000000..b1cdb62
--- /dev/null
@@ -0,0 +1,349 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * FX - slide\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ */\r
+\r
+/**\r
+ * Slides the element\r
+ */\r
+jQuery.fn.extend(\r
+       {\r
+               /**\r
+                * @name SlideInUp\r
+                * @description slides the element in up\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               SlideInUp : function (speed,callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX', function(){\r
+                               new jQuery.fx.slide(this, speed, callback, 'up', 'in', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name SlideOutUp\r
+                * @description slides the element out up\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               SlideOutUp : function (speed,callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX', function(){\r
+                               new jQuery.fx.slide(this, speed, callback, 'up', 'out', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name SlideToggleUp\r
+                * @description slides the element in/out up\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               SlideToggleUp : function (speed,callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX', function(){\r
+                               new jQuery.fx.slide(this, speed, callback, 'up', 'toggle', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name SlideInDown\r
+                * @description slides the element in down\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               SlideInDown : function (speed,callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX', function(){\r
+                               new jQuery.fx.slide(this, speed, callback, 'down', 'in', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name SlideOutDown\r
+                * @description slides the element out down\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               SlideOutDown : function (speed,callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX', function(){\r
+                               new jQuery.fx.slide(this, speed, callback, 'down', 'out', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name SlideToggleDown\r
+                * @description slides the element in/out down\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               SlideToggleDown : function (speed,callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX', function(){\r
+                               new jQuery.fx.slide(this, speed, callback, 'down', 'toggle', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name SlideInLeft\r
+                * @description slides the element in left\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               SlideInLeft : function (speed,callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX', function(){\r
+                               new jQuery.fx.slide(this, speed, callback, 'left', 'in', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name SlideOutLeft\r
+                * @description slides the element out left\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               SlideOutLeft :  function (speed,callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX', function(){\r
+                               new jQuery.fx.slide(this, speed, callback, 'left', 'out', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name SlideToggleLeft\r
+                * @description slides the element in/out left\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               SlideToggleLeft : function (speed,callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX', function(){\r
+                               new jQuery.fx.slide(this, speed, callback, 'left', 'toggle', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name SlideInRight\r
+                * @description slides the element in right\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               SlideInRight : function (speed,callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX', function(){\r
+                               new jQuery.fx.slide(this, speed, callback, 'right', 'in', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name SlideOutRight\r
+                * @description slides the element out right\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               SlideOutRight : function (speed,callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX', function(){\r
+                               new jQuery.fx.slide(this, speed, callback, 'right', 'out', easing);\r
+                       });\r
+               },\r
+               \r
+               /**\r
+                * @name SlideToggleRight\r
+                * @description slides the element in/out right\r
+                * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+                * @param Function callback (optional) A function to be executed whenever the animation completes.\r
+                * @param String easing (optional) The name of the easing effect that you want to use.\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               SlideToggleRight : function (speed,callback, easing)\r
+               {\r
+                       return this.queue('interfaceFX', function(){\r
+                               new jQuery.fx.slide(this, speed, callback, 'right', 'toggle', easing);\r
+                       });\r
+               }\r
+       }\r
+);\r
+\r
+jQuery.fx.slide = function(e, speed, callback, direction, type, easing)\r
+{\r
+       if (!jQuery.fxCheckTag(e)) {\r
+               jQuery.dequeue(e, 'interfaceFX');\r
+               return false;\r
+       }\r
+       var z = this;\r
+       z.el = jQuery(e);\r
+       z.easing = typeof callback == 'string' ? callback : easing||null;\r
+       z.callback = typeof callback == 'function' ? callback : null;\r
+       if ( type == 'toggle') {\r
+               type = z.el.css('display') == 'none' ? 'in' : 'out';\r
+       }\r
+       if (!e.ifxFirstDisplay)\r
+               e.ifxFirstDisplay = z.el.css('display');\r
+       z.el.show();\r
+       \r
+       z.speed = speed;\r
+       z.fx = jQuery.fx.buildWrapper(e);\r
+       \r
+       z.type = type;\r
+       z.direction = direction;\r
+       z.complete = function()\r
+       {\r
+               if(z.type == 'out')\r
+                       z.el.css('visibility', 'hidden');\r
+               jQuery.fx.destroyWrapper(z.fx.wrapper.get(0), z.fx.oldStyle);\r
+               if(z.type == 'in'){\r
+                       z.el.css('display', z.el.get(0).ifxFirstDisplay == 'none' ? 'block' : z.el.get(0).ifxFirstDisplay);\r
+               } else {\r
+                       z.el.css('display', 'none');\r
+                       z.el.css('visibility', 'visible');\r
+               }\r
+               if (z.callback && z.callback.constructor == Function) {\r
+                       z.callback.apply(z.el.get(0));\r
+               }\r
+               jQuery.dequeue(z.el.get(0), 'interfaceFX');\r
+       };\r
+       switch (z.direction) {\r
+               case 'up':\r
+                       z.ef = new jQuery.fx(\r
+                               z.el.get(0), \r
+                               jQuery.speed(\r
+                                       z.speed,\r
+                                       z.easing,\r
+                                       z.complete\r
+                               ),\r
+                               'top'\r
+                       );\r
+                       z.efx = new jQuery.fx(\r
+                               z.fx.wrapper.get(0), \r
+                               jQuery.speed(\r
+                                       z.speed,\r
+                                       z.easing\r
+                               ),\r
+                               'height'\r
+                       );\r
+                       if (z.type == 'in') {\r
+                               z.ef.custom (-z.fx.oldStyle.sizes.hb, 0);\r
+                               z.efx.custom(0, z.fx.oldStyle.sizes.hb);\r
+                       } else {\r
+                               z.ef.custom (0, -z.fx.oldStyle.sizes.hb);\r
+                               z.efx.custom (z.fx.oldStyle.sizes.hb, 0);\r
+                       }\r
+               break;\r
+               case 'down':\r
+                       z.ef = new jQuery.fx(\r
+                               z.el.get(0), \r
+                               jQuery.speed(\r
+                                       z.speed,\r
+                                       z.easing,\r
+                                       z.complete\r
+                               ),\r
+                               'top'\r
+                       );\r
+                       if (z.type == 'in') {\r
+                               z.ef.custom (z.fx.oldStyle.sizes.hb, 0);\r
+                       } else {\r
+                               z.ef.custom (0, z.fx.oldStyle.sizes.hb);\r
+                       }\r
+               break;\r
+               case 'left':\r
+                       z.ef = new jQuery.fx(\r
+                               z.el.get(0), \r
+                               jQuery.speed(\r
+                                       z.speed,\r
+                                       z.easing,\r
+                                       z.complete\r
+                               ),\r
+                               'left'\r
+                       );\r
+                       z.efx = new jQuery.fx(\r
+                               z.fx.wrapper.get(0), \r
+                               jQuery.speed(\r
+                                       z.speed,\r
+                                       z.easing\r
+                               ),\r
+                               'width'\r
+                       );\r
+                       if (z.type == 'in') {\r
+                               z.ef.custom (-z.fx.oldStyle.sizes.wb, 0);\r
+                               z.efx.custom (0, z.fx.oldStyle.sizes.wb);\r
+                       } else {\r
+                               z.ef.custom (0, -z.fx.oldStyle.sizes.wb);\r
+                               z.efx.custom (z.fx.oldStyle.sizes.wb, 0);\r
+                       }\r
+               break;\r
+               case 'right':\r
+                       z.ef = new jQuery.fx(\r
+                               z.el.get(0), \r
+                               jQuery.speed(\r
+                                       z.speed,\r
+                                       z.easing,\r
+                                       z.complete\r
+                               ),\r
+                               'left'\r
+                       );\r
+                       if (z.type == 'in') {\r
+                               z.ef.custom (z.fx.oldStyle.sizes.wb, 0);\r
+                       } else {\r
+                               z.ef.custom (0, z.fx.oldStyle.sizes.wb);\r
+                       }\r
+               break;\r
+       }\r
+};\r
diff --git a/scripts/interface/ifxtransfer.js b/scripts/interface/ifxtransfer.js
new file mode 100644 (file)
index 0000000..5bb1fac
--- /dev/null
@@ -0,0 +1,123 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * FX - transfer\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ */\r
+\r
+jQuery.transferHelper = null;\r
+/**\r
+ * \r
+ * @name TransferTo\r
+ * @description Animates an new build element to simulate a transfer action from one element to other\r
+ * @param Hash hash A hash of parameters\r
+ * @option Mixed to DOMElement or element ID to transfer to\r
+ * @option String className CSS class to apply to transfer element\r
+ * @option String duration animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']\r
+ * @option Function callback (optional) A function to be executed whenever the animation completes.\r
+ *\r
+ * @type jQuery\r
+ * @cat Plugins/Interface\r
+ * @author Stefan Petre\r
+ */\r
+jQuery.fn.TransferTo = function(o)\r
+{\r
+       return this.queue('interfaceFX', function(){\r
+               new jQuery.fx.itransferTo(this, o);\r
+       });\r
+};\r
+jQuery.fx.itransferTo = function(e, o)\r
+{\r
+       \r
+       if(jQuery.transferHelper == null)\r
+       {\r
+               jQuery('body', document).append('<div id="transferHelper"></div>');\r
+               jQuery.transferHelper = jQuery('#transferHelper');\r
+       }\r
+       jQuery.transferHelper.css('display', 'block').css('position', 'absolute');\r
+       \r
+       var z = this;\r
+       z.el = jQuery(e);\r
+       if(!o || !o.to) {\r
+               return;\r
+       }\r
+       \r
+       if (o.to.constructor == String && document.getElementById(o.to)) {\r
+               o.to = document.getElementById(o.to);\r
+       } else if ( !o.to.childNodes ) {\r
+               return;\r
+       }\r
+       \r
+       if (!o.duration) {\r
+               o.duration = 500;\r
+       }\r
+       z.duration = o.duration;\r
+       z.to = o.to;\r
+       z.classname = o.className;\r
+       z.complete = o.complete;\r
+       if (z.classname) {\r
+               jQuery.transferHelper.addClass(z.classname);\r
+       }\r
+       z.diffWidth = 0;\r
+       z.diffHeight = 0;\r
+       \r
+       if(jQuery.boxModel) {\r
+               z.diffWidth = (parseInt(jQuery.transferHelper.css('borderLeftWidth')) || 0 )\r
+                                       + (parseInt(jQuery.transferHelper.css('borderRightWidth')) || 0)\r
+                                       + (parseInt(jQuery.transferHelper.css('paddingLeft')) || 0)\r
+                                       + (parseInt(jQuery.transferHelper.css('paddingRight')) || 0);\r
+               z.diffHeight = (parseInt(jQuery.transferHelper.css('borderTopWidth')) || 0 )\r
+                                       + (parseInt(jQuery.transferHelper.css('borderBottomWidth')) || 0)\r
+                                       + (parseInt(jQuery.transferHelper.css('paddingTop')) || 0)\r
+                                       + (parseInt(jQuery.transferHelper.css('paddingBottom')) || 0);\r
+       }\r
+       z.start = jQuery.extend(\r
+               jQuery.iUtil.getPosition(z.el.get(0)),\r
+               jQuery.iUtil.getSize(z.el.get(0))\r
+       );\r
+       z.end = jQuery.extend(\r
+               jQuery.iUtil.getPosition(z.to),\r
+               jQuery.iUtil.getSize(z.to)\r
+       );\r
+       z.start.wb -= z.diffWidth;\r
+       z.start.hb -= z.diffHeight;\r
+       z.end.wb -= z.diffWidth;\r
+       z.end.hb -= z.diffHeight;\r
+       z.callback = o.complete;\r
+\r
+       // Execute the transfer\r
+       jQuery.transferHelper\r
+               .css('width', z.start.wb + 'px')\r
+               .css('height', z.start.hb + 'px')\r
+               .css('top', z.start.y + 'px')\r
+               .css('left', z.start.x + 'px')\r
+               .animate(\r
+                       {\r
+                               top: z.end.y,\r
+                               left: z.end.x,\r
+                               width: z.end.wb,\r
+                               height: z.end.hb\r
+                       },\r
+                       z.duration,\r
+                       function()\r
+                       {\r
+                               // Set correct classname\r
+                               if(z.classname)\r
+                                       jQuery.transferHelper.removeClass(z.classname);\r
+                               jQuery.transferHelper.css('display', 'none');\r
+       \r
+                               // Callback\r
+                               if (z.complete && z.complete.constructor == Function) {\r
+                                       z.complete.apply(z.el.get(0), [z.to]);\r
+                               }\r
+                               // Done\r
+                               jQuery.dequeue(z.el.get(0), 'interfaceFX');\r
+                       }\r
+               );\r
+};
\ No newline at end of file
diff --git a/scripts/interface/imagebox.js b/scripts/interface/imagebox.js
new file mode 100644 (file)
index 0000000..6f056d1
--- /dev/null
@@ -0,0 +1,595 @@
+/**
+ * Interface Elements for jQuery
+ * ImageBox
+ * 
+ * http://interface.eyecon.ro
+ * 
+ * Copyright (c) 2006 Stefan Petre
+ * Dual licensed under the MIT (MIT-LICENSE.txt) 
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ */
+
+/**
+ * This a jQuery equivalent for Lightbox2. Alternative to image popups that will display images in an overlay. All links that have attribute 'rel' starting with 'imagebox' and link to an image will display the image inside the page. Galleries can by build buy giving the value 'imagebox-galname' to attribute 'rel'. Attribute 'title' will be used as caption.
+ * Keyboard navigation:
+ *  -  next image: arrow right, page down, 'n' key, space
+ *  -  previous image: arrow left, page up, 'p' key, backspace
+ *  -  close: escape
+ *
+ * CSS
+ *     #ImageBoxOverlay
+ *     {
+ *             background-color: #000;
+ *     }
+ *     #ImageBoxCaption
+ *     {
+ *             background-color: #F4F4EC;
+ *     }
+ *     #ImageBoxContainer
+ *     {
+ *             width: 250px;
+ *             height: 250px;
+ *             background-color: #F4F4EC;
+ *     }
+ *     #ImageBoxCaptionText
+ *     {
+ *             font-weight: bold;
+ *             padding-bottom: 5px;
+ *             font-size: 13px;
+ *             color: #000;
+ *     }
+ *     #ImageBoxCaptionImages
+ *     {
+ *             margin: 0;
+ *     }
+ *     #ImageBoxNextImage
+ *     {
+ *             background-image: url(images/imagebox/spacer.gif);
+ *             background-color: transparent;
+ *     }
+ *     #ImageBoxPrevImage
+ *     {
+ *             background-image: url(images/imagebox/spacer.gif);
+ *             background-color: transparent;
+ *     }
+ *     #ImageBoxNextImage:hover
+ *     {
+ *             background-image: url(images/imagebox/next_image.jpg);
+ *             background-repeat:      no-repeat;
+ *             background-position: right top;
+ *     }
+ *     #ImageBoxPrevImage:hover
+ *     {
+ *             background-image: url(images/imagebox/prev_image.jpg);
+ *             background-repeat:      no-repeat;
+ *             background-position: left bottom;
+ *     }
+ * 
+ * @name Imagebox
+ * @description This a jQuery equivalent for Lightbox2. Alternative to image popups that will display images in an overlay. All links that have attribute 'rel' starting with 'imagebox' and link to an image will display the image inside the page. Galleries can by build buy giving the value 'imagebox-galname' to attribute 'rel'. Attribute 'title' will be used as caption.
+ * @param Hash hash A hash of parameters
+ * @option Integer border border width
+ * @option String loaderSRC path to loading image
+ * @option String closeHTML path to close overlay image
+ * @option Float overlayOpacity opacity for overlay
+ * @option String textImage when a galalry it is build then the iteration is displayed
+ * @option String textImageFrom when a galalry it is build then the iteration is displayed
+ * @option Integer fadeDuration fade duration in miliseconds
+ *
+ * @type jQuery
+ * @cat Plugins/Interface
+ * @author Stefan Petre
+ */
+jQuery.ImageBox = {
+       options : {
+               border                          : 10,
+               loaderSRC                       : 'images/loading.gif',
+               closeHTML                       : '<img src="images/close.jpg" />',
+               overlayOpacity          : 0.8,
+               textImage                       : 'Showing image',
+               textImageFrom           : 'from',
+               fadeDuration            : 400
+       },
+       imageLoaded : false,
+       firstResize : false,
+       currentRel : null,
+       animationInProgress : false,
+       opened : false,
+       
+       keyPressed : function(event)
+       {
+               if(!jQuery.ImageBox.opened || jQuery.ImageBox.animationInProgress)
+                       return;
+               var pressedKey = event.charCode || event.keyCode || -1;
+               switch (pressedKey)
+               {
+                       //end
+                       case 35:
+                               if (jQuery.ImageBox.currentRel)
+                                       jQuery.ImageBox.start(null, jQuery('a[@rel=' + jQuery.ImageBox.currentRel+ ']:last').get(0));
+                       break;
+                       //home
+                       case 36:
+                               if (jQuery.ImageBox.currentRel)
+                                       jQuery.ImageBox.start(null, jQuery('a[@rel=' + jQuery.ImageBox.currentRel+ ']:first').get(0));
+                       break;
+                       //left
+                       case 37:
+                       //backspace
+                       case 8:
+                       //page up
+                       case 33:
+                       //p
+                       case 80:
+                       case 112:
+                               var prevEl = jQuery('#ImageBoxPrevImage');
+                               if(prevEl.get(0).onclick != null) {
+                                       prevEl.get(0).onclick.apply(prevEl.get(0));
+                               }
+                       break;
+                       //up
+                       case 38:
+                       break;
+                       //right
+                       case 39:
+                       //page down
+                       case 34:
+                       //space
+                       case 32:
+                       //n
+                       case 110:
+                       case 78:
+                               var nextEl = jQuery('#ImageBoxNextImage');
+                               if(nextEl.get(0).onclick != null) {
+                                       nextEl.get(0).onclick.apply(nextEl.get(0));
+                               }
+                       break;
+                       //down;
+                       case 40:
+                       break;
+                       //escape
+                       case 27:
+                               jQuery.ImageBox.hideImage();
+                       break;
+               }
+       },
+       
+       init : function(options)
+       {
+               if (options)
+                       jQuery.extend(jQuery.ImageBox.options, options);
+               if (window.event) {
+                       jQuery('body',document).bind('keyup', jQuery.ImageBox.keyPressed);
+               } else {
+                       jQuery(document).bind('keyup', jQuery.ImageBox.keyPressed);
+               }
+               jQuery('a').each(
+                       function()
+                       {
+                               el                              = jQuery(this);
+                               relAttr                 = el.attr('rel')||'';
+                               hrefAttr                = el.attr('href')||'';
+                               imageTypes              = /\.jpg|\.jpeg|\.png|\.gif|\.bmp/g;
+                               if (hrefAttr.toLowerCase().match(imageTypes) != null && relAttr.toLowerCase().indexOf('imagebox') == 0) {
+                                       el.bind('click', jQuery.ImageBox.start);
+                               }
+                       }
+               );
+               if (jQuery.browser.msie) {
+                       iframe = document.createElement('iframe');
+                       jQuery(iframe)
+                               .attr(
+                                       {
+                                               id                      : 'ImageBoxIframe',
+                                               src                     : 'javascript:false;',
+                                               frameborder     : 'no',
+                                               scrolling       : 'no'
+                                       }
+                               )
+                               .css (
+                                       {
+                                               display         : 'none',
+                                               position        : 'absolute',
+                                               top                     : '0',
+                                               left            : '0',
+                                               filter          : 'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'
+                                       }
+                               );
+                       jQuery('body').append(iframe);
+               }
+               
+               overlay = document.createElement('div');
+               jQuery(overlay)
+                       .attr('id', 'ImageBoxOverlay')
+                       .css(
+                               {
+                                       position        : 'absolute',
+                                       display         : 'none',
+                                       top                     : '0',
+                                       left            : '0',
+                                       opacity         : 0
+                               }
+                       )
+                       .append(document.createTextNode(' '))
+                       .bind('click', jQuery.ImageBox.hideImage);
+               
+               captionText = document.createElement('div');
+               jQuery(captionText)
+                       .attr('id', 'ImageBoxCaptionText')
+                       .css(
+                               {
+                                       paddingLeft             : jQuery.ImageBox.options.border + 'px'
+                               }
+                       )
+                       .append(document.createTextNode(' '));
+                       
+               captionImages = document.createElement('div');
+               jQuery(captionImages)
+                       .attr('id', 'ImageBoxCaptionImages')
+                       .css(
+                               {
+                                       paddingLeft             : jQuery.ImageBox.options.border + 'px',
+                                       paddingBottom   : jQuery.ImageBox.options.border + 'px'
+                               }
+                       )
+                       .append(document.createTextNode(' '));
+                       
+               closeEl = document.createElement('a');
+               jQuery(closeEl)
+                       .attr(
+                               {
+                                       id                      : 'ImageBoxClose',
+                                       href            : '#'
+                               }
+                       )
+                       .css(
+                               {
+                                       position        : 'absolute',
+                                       right           : jQuery.ImageBox.options.border + 'px',
+                                       top                     : '0'
+                               }
+                       )
+                       .append(jQuery.ImageBox.options.closeHTML)
+                       .bind('click', jQuery.ImageBox.hideImage);
+                       
+               captionEl = document.createElement('div');
+               jQuery(captionEl)
+                       .attr('id', 'ImageBoxCaption')
+                       .css(
+                               {
+                                       position        : 'relative',
+                                       textAlign       : 'left',
+                                       margin          : '0 auto',
+                                       zIndex          : 1
+                               }
+                       )
+                       .append(captionText)
+                       .append(captionImages)
+                       .append(closeEl);
+               
+               loader = document.createElement('img');
+               loader.src = jQuery.ImageBox.options.loaderSRC;
+               jQuery(loader)
+                       .attr('id', 'ImageBoxLoader')
+                       .css(
+                               {
+                                       position        : 'absolute'
+                               }
+                       );
+                       
+               prevImage = document.createElement('a');
+               jQuery(prevImage)
+                       .attr(
+                               {
+                                       id                      : 'ImageBoxPrevImage',
+                                       href            : '#'
+                               }
+                       )
+                       .css(
+                               {
+                                       position                : 'absolute',
+                                       display                 : 'none',
+                                       overflow                : 'hidden',
+                                       textDecoration  : 'none'
+                               }
+                       )
+                       .append(document.createTextNode(' '));
+                       
+               nextImage = document.createElement('a');
+               jQuery(nextImage)
+                       .attr(
+                               {
+                                       id                      : 'ImageBoxNextImage',
+                                       href            : '#'
+                               }
+                       )
+                       .css(
+                               {
+                                       position                : 'absolute',
+                                       overflow                : 'hidden',
+                                       textDecoration  : 'none'
+                               }
+                       )
+                       .append(document.createTextNode(' '));
+               
+               container = document.createElement('div');
+               jQuery(container)
+                       .attr('id', 'ImageBoxContainer')
+                       .css(
+                               {
+                                       display         : 'none',
+                                       position        : 'relative',
+                                       overflow        : 'hidden',
+                                       textAlign       : 'left',
+                                       margin          : '0 auto',
+                                       top                     : '0',
+                                       left            : '0',
+                                       zIndex          : 2
+                               }
+                       )
+                       .append([loader, prevImage, nextImage]);
+               
+               outerContainer = document.createElement('div');
+               jQuery(outerContainer)
+                       .attr('id', 'ImageBoxOuterContainer')
+                       .css(
+                               {
+                                       display         : 'none',
+                                       position        : 'absolute',
+                                       overflow        : 'hidden',
+                                       top                     : '0',
+                                       left            : '0',
+                                       textAlign       : 'center',
+                                       backgroundColor : 'transparent',
+                                       lineHeigt       : '0'
+                               }
+                       )
+                       .append([container,captionEl]);
+               
+               jQuery('body')
+                       .append(overlay)
+                       .append(outerContainer);
+       },
+       
+       start : function(e, elm)
+       {
+               el = elm ? jQuery(elm) : jQuery(this);
+               linkRel =  el.attr('rel');
+               var totalImages, iteration, prevImage, nextImage;
+               if (linkRel != 'imagebox') {
+                       jQuery.ImageBox.currentRel = linkRel;
+                       gallery = jQuery('a[@rel=' + linkRel + ']');
+                       totalImages = gallery.size();
+                       iteration = gallery.index(elm ? elm : this);
+                       prevImage = gallery.get(iteration - 1);
+                       nextImage = gallery.get(iteration + 1);
+               }
+               imageSrc =  el.attr('href');
+               captionText = el.attr('title');
+               pageSize = jQuery.iUtil.getScroll();
+               overlay = jQuery('#ImageBoxOverlay');
+               if (!jQuery.ImageBox.opened) {
+                       jQuery.ImageBox.opened = true;
+                       if (jQuery.browser.msie) {
+                               jQuery('#ImageBoxIframe')
+                                       .css ('height', Math.max(pageSize.ih,pageSize.h) + 'px')
+                                       .css ('width', Math.max(pageSize.iw,pageSize.w) + 'px')
+                                       .show();
+                       }
+                       overlay
+                               .css ('height', Math.max(pageSize.ih,pageSize.h) + 'px')
+                               .css ('width', Math.max(pageSize.iw,pageSize.w) + 'px')
+                               .show()
+                               .fadeTo( 
+                                       300,
+                                       jQuery.ImageBox.options.overlayOpacity,
+                                       function()
+                                       {
+                                               jQuery.ImageBox.loadImage(
+                                                       imageSrc, 
+                                                       captionText, 
+                                                       pageSize, 
+                                                       totalImages, 
+                                                       iteration,
+                                                       prevImage,
+                                                       nextImage
+                                               );
+                                       }
+                               );
+                       jQuery('#ImageBoxOuterContainer').css ('width', Math.max(pageSize.iw,pageSize.w) + 'px');
+               } else {
+                       jQuery('#ImageBoxPrevImage').get(0).onclick = null;
+                       jQuery('#ImageBoxNextImage').get(0).onclick = null;
+                       jQuery.ImageBox.loadImage(
+                               imageSrc, 
+                               captionText, 
+                               pageSize, 
+                               totalImages, 
+                               iteration,
+                               prevImage,
+                               nextImage
+                       );
+               }
+               return false;
+       },
+               
+       loadImage : function(imageSrc, captiontext, pageSize, totalImages, iteration, prevImage, nextImage)
+       {
+               jQuery('#ImageBoxCurrentImage').remove();
+               prevImageEl = jQuery('#ImageBoxPrevImage');
+               prevImageEl.hide();
+               nextImageEl = jQuery('#ImageBoxNextImage');
+               nextImageEl.hide();
+               loader = jQuery('#ImageBoxLoader');
+               container = jQuery('#ImageBoxContainer');
+               outerContainer = jQuery('#ImageBoxOuterContainer');
+               captionEl = jQuery('#ImageBoxCaption').css('visibility', 'hidden');
+               jQuery('#ImageBoxCaptionText').html(captionText);
+               jQuery.ImageBox.animationInProgress = true;
+               if (totalImages)
+                       jQuery('#ImageBoxCaptionImages').html(
+                               jQuery.ImageBox.options.textImage 
+                               + ' ' + (iteration + 1) + ' '
+                               + jQuery.ImageBox.options.textImageFrom  
+                               + ' ' + totalImages
+                       );
+               if (prevImage) {
+                       prevImageEl.get(0).onclick = function()
+                       {
+                               this.blur();
+                               jQuery.ImageBox.start(null, prevImage);
+                               return false;
+                       };
+               }
+               if (nextImage) {
+                       nextImageEl.get(0).onclick =function()
+                       {
+                               this.blur();
+                               jQuery.ImageBox.start(null, nextImage);
+                               return false;
+                       };
+               }
+               loader.show();
+               containerSize = jQuery.iUtil.getSize(container.get(0));
+               containerW = Math.max(containerSize.wb, loader.get(0).width + jQuery.ImageBox.options.border * 2);
+               containerH = Math.max(containerSize.hb, loader.get(0).height + jQuery.ImageBox.options.border * 2);
+               loader
+                       .css(
+                               {
+                                       left    : (containerW - loader.get(0).width)/2 + 'px',
+                                       top             : (containerH - loader.get(0).height)/2 + 'px'
+                               }
+                       );
+               container
+                       .css(
+                               {
+                                       width   : containerW + 'px',
+                                       height  : containerH + 'px'
+                               }
+                       )
+                       .show();
+               clientSize = jQuery.iUtil.getClient();
+               outerContainer
+                       .css('top', pageSize.t +  (clientSize.h / 15) + 'px');
+               if (outerContainer.css('display') == 'none') {
+                       outerContainer
+                               .show()
+                               .fadeIn(
+                                       jQuery.ImageBox.options.fadeDuration
+                               );
+               }
+               imageEl = new Image;
+               jQuery(imageEl)
+                       .attr('id', 'ImageBoxCurrentImage')
+                       .bind('load', 
+                       function()
+                       {
+                               containerW = imageEl.width + jQuery.ImageBox.options.border * 2;
+                               containerH = imageEl.height + jQuery.ImageBox.options.border * 2;
+                               loader.hide();
+                               container.animate(
+                                       {
+                                               height          : containerH
+                                       },
+                                       containerSize.hb != containerH ? jQuery.ImageBox.options.fadeDuration : 1,
+                                       function()
+                                       {
+                                               container.animate(
+                                                       {
+                                                               width           : containerW
+                                                       },
+                                                       containerSize.wb != containerW ? jQuery.ImageBox.options.fadeDuration : 1,
+                                                       function()
+                                                       {
+                                                               container.prepend(imageEl);
+                                                               jQuery(imageEl)
+                                                                       .css(
+                                                                               {
+                                                                                       position        : 'absolute',
+                                                                                       left            : jQuery.ImageBox.options.border + 'px',
+                                                                                       top                     : jQuery.ImageBox.options.border + 'px'
+                                                                               }
+                                                                       )
+                                                                       .fadeIn(
+                                                                               jQuery.ImageBox.options.fadeDuration,
+                                                                               function()
+                                                                               {
+                                                                                       captionSize = jQuery.iUtil.getSize(captionEl.get(0));
+                                                                                       if (prevImage) {
+                                                                                               prevImageEl
+                                                                                                       .css(
+                                                                                                               {
+                                                                                                                       left    : jQuery.ImageBox.options.border + 'px',
+                                                                                                                       top             : jQuery.ImageBox.options.border + 'px',
+                                                                                                                       width   : containerW/2 - jQuery.ImageBox.options.border * 3 + 'px',
+                                                                                                                       height  : containerH - jQuery.ImageBox.options.border * 2 + 'px'
+                                                                                                               }
+                                                                                                       )
+                                                                                                       .show();
+                                                                                       }
+                                                                                       if (nextImage) {
+                                                                                               nextImageEl
+                                                                                                       .css(
+                                                                                                               {
+                                                                                                                       left    : containerW/2 + jQuery.ImageBox.options.border * 2 + 'px',
+                                                                                                                       top             : jQuery.ImageBox.options.border + 'px',
+                                                                                                                       width   : containerW/2 - jQuery.ImageBox.options.border * 3 + 'px',
+                                                                                                                       height  : containerH - jQuery.ImageBox.options.border * 2 + 'px'
+                                                                                                               }
+                                                                                                       )
+                                                                                                       .show();
+                                                                                       }
+                                                                                       captionEl
+                                                                                               .css(
+                                                                                                       {
+                                                                                                               width           : containerW + 'px',
+                                                                                                               top                     : - captionSize.hb + 'px',
+                                                                                                               visibility      : 'visible'
+                                                                                                       }
+                                                                                               )
+                                                                                               .animate(
+                                                                                                       {
+                                                                                                               top             : -1
+                                                                                                       },
+                                                                                                       jQuery.ImageBox.options.fadeDuration,
+                                                                                                       function()
+                                                                                                       {
+                                                                                                               jQuery.ImageBox.animationInProgress = false;
+                                                                                                       }
+                                                                                               );
+                                                                               }
+                                                                       );
+                                                       }
+                                               );
+                                       }
+                               );
+                       }
+               );
+               imageEl.src = imageSrc;
+                       
+       },
+       
+       hideImage : function()
+       {
+               jQuery('#ImageBoxCurrentImage').remove();
+               jQuery('#ImageBoxOuterContainer').hide();
+               jQuery('#ImageBoxCaption').css('visibility', 'hidden');
+               jQuery('#ImageBoxOverlay').fadeTo(
+                       300, 
+                       0, 
+                       function(){
+                               jQuery(this).hide();
+                               if (jQuery.browser.msie) {
+                                       jQuery('#ImageBoxIframe').hide();
+                               }
+                       }
+               );
+               jQuery('#ImageBoxPrevImage').get(0).onclick = null;
+               jQuery('#ImageBoxNextImage').get(0).onclick = null;
+               jQuery.ImageBox.currentRel = null;
+               jQuery.ImageBox.opened = false;
+               jQuery.ImageBox.animationInProgress = false;
+               return false;
+       }
+};
\ No newline at end of file
diff --git a/scripts/interface/iresizable.js b/scripts/interface/iresizable.js
new file mode 100644 (file)
index 0000000..18bc6ba
--- /dev/null
@@ -0,0 +1,453 @@
+/**
+ * Interface Elements for jQuery
+ * Resizable
+ *
+ * http://interface.eyecon.ro
+ *
+ * Copyright (c) 2006 Stefan Petre
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ *
+ */
+
+jQuery.iResize = {
+       resizeElement: null,
+       resizeDirection: null,
+       dragged: null,
+       pointer: null,
+       sizes: null,
+       position: null,
+       /**
+        * internal: Start function
+        */
+       startDrag: function(e) {
+               jQuery.iResize.dragged = (this.dragEl) ? this.dragEl: this;
+               jQuery.iResize.pointer = jQuery.iUtil.getPointer(e);
+
+               // Save original size
+               jQuery.iResize.sizes = {
+                       width: parseInt(jQuery(jQuery.iResize.dragged).css('width')) || 0,
+                       height: parseInt(jQuery(jQuery.iResize.dragged).css('height')) || 0
+               };
+
+               // Save original position
+               jQuery.iResize.position = {
+                       top: parseInt(jQuery(jQuery.iResize.dragged).css('top')) || 0,
+                       left: parseInt(jQuery(jQuery.iResize.dragged).css('left')) || 0
+               };
+
+               // Assign event handlers
+               jQuery(document)
+                       .bind('mousemove', jQuery.iResize.moveDrag)
+                       .bind('mouseup', jQuery.iResize.stopDrag);
+
+               // Callback?
+               if (typeof jQuery.iResize.dragged.resizeOptions.onDragStart === 'function') {
+                       jQuery.iResize.dragged.resizeOptions.onDragStart.apply(jQuery.iResize.dragged);
+               }
+               return false;
+       },
+       /**
+        * internal: Stop function
+        */
+       stopDrag: function(e) {
+               // Unbind event handlers
+               jQuery(document)
+                       .unbind('mousemove', jQuery.iResize.moveDrag)
+                       .unbind('mouseup', jQuery.iResize.stopDrag);
+
+               // Callback?
+               if (typeof jQuery.iResize.dragged.resizeOptions.onDragStop === 'function') {
+                       jQuery.iResize.dragged.resizeOptions.onDragStop.apply(jQuery.iResize.dragged);
+               }
+
+               // Remove dragged element
+               jQuery.iResize.dragged = null;
+       },
+       /**
+        * internal: Move function
+        */
+       moveDrag: function(e) {
+               if (!jQuery.iResize.dragged) {
+                       return;
+               }
+
+               pointer = jQuery.iUtil.getPointer(e);
+
+               // Calculate new positions
+               newTop = jQuery.iResize.position.top - jQuery.iResize.pointer.y + pointer.y;
+               newLeft = jQuery.iResize.position.left - jQuery.iResize.pointer.x + pointer.x;
+               newTop = Math.max(
+                                               Math.min(newTop, jQuery.iResize.dragged.resizeOptions.maxBottom - jQuery.iResize.sizes.height),
+                                               jQuery.iResize.dragged.resizeOptions.minTop
+                                       );
+               newLeft = Math.max(
+                                               Math.min(newLeft, jQuery.iResize.dragged.resizeOptions.maxRight- jQuery.iResize.sizes.width),
+                                               jQuery.iResize.dragged.resizeOptions.minLeft
+                                       );
+
+               // Callback
+               if (typeof jQuery.iResize.dragged.resizeOptions.onDrag === 'function') {
+                       var newPos = jQuery.iResize.dragged.resizeOptions.onDrag.apply(jQuery.iResize.dragged, [newLeft, newTop]);
+                       if (typeof newPos == 'array' && newPos.length == 2) {
+                               newLeft = newPos[0];
+                               newTop = newPos[1];
+                       }
+               }
+
+               // Update the element
+               jQuery.iResize.dragged.style.top = newTop + 'px';
+               jQuery.iResize.dragged.style.left = newLeft + 'px';
+
+               return false;
+       },
+       start: function(e) {
+               // Bind event handlers
+               jQuery(document)
+                       .bind('mousemove', jQuery.iResize.move)
+                       .bind('mouseup', jQuery.iResize.stop);
+
+               // Initialize resizable
+               jQuery.iResize.resizeElement = this.resizeElement;
+               jQuery.iResize.resizeDirection = this.resizeDirection;
+               jQuery.iResize.pointer = jQuery.iUtil.getPointer(e);
+               jQuery.iResize.sizes = {
+                               width: parseInt(jQuery(this.resizeElement).css('width'))||0,
+                               height: parseInt(jQuery(this.resizeElement).css('height'))||0
+                       };
+               jQuery.iResize.position = {
+                               top: parseInt(jQuery(this.resizeElement).css('top'))||0,
+                               left: parseInt(jQuery(this.resizeElement).css('left'))||0
+                       };
+
+               // Callback function
+               if (jQuery.iResize.resizeElement.resizeOptions.onStart) {
+                       jQuery.iResize.resizeElement.resizeOptions.onStart.apply(jQuery.iResize.resizeElement, [this]);
+               }
+
+               return false;
+       },
+       stop: function() {
+               // Unbind event handlers
+               jQuery(document)
+                       .unbind('mousemove', jQuery.iResize.move)
+                       .unbind('mouseup', jQuery.iResize.stop);
+
+               // Callback function
+               if (jQuery.iResize.resizeElement.resizeOptions.onStop) {
+                       jQuery.iResize.resizeElement.resizeOptions.onStop.apply(jQuery.iResize.resizeElement, [jQuery.iResize.resizeDirection]);
+               }
+
+               // Unbind
+               jQuery.iResize.resizeElement = null;
+               jQuery.iResize.resizeDirection = null;
+       },
+       getWidth: function(dx, side) {
+               return Math.min(
+                                               Math.max(jQuery.iResize.sizes.width + dx * side, jQuery.iResize.resizeElement.resizeOptions.minWidth),
+                                               jQuery.iResize.resizeElement.resizeOptions.maxWidth
+                                       );
+       },
+       getHeight: function(dy, side) {
+               return Math.min(
+                                               Math.max(jQuery.iResize.sizes.height + dy * side, jQuery.iResize.resizeElement.resizeOptions.minHeight),
+                                               jQuery.iResize.resizeElement.resizeOptions.maxHeight
+                                       );
+       },
+       getHeightMinMax: function(height) {
+               return Math.min(
+                                               Math.max(height, jQuery.iResize.resizeElement.resizeOptions.minHeight),
+                                               jQuery.iResize.resizeElement.resizeOptions.maxHeight
+                                       );
+       },
+       move: function(e) {
+               if (jQuery.iResize.resizeElement == null) {
+                       return;
+               }
+
+               pointer = jQuery.iUtil.getPointer(e);
+               dx = pointer.x - jQuery.iResize.pointer.x;
+               dy = pointer.y - jQuery.iResize.pointer.y;
+
+               newSizes = {
+                               width: jQuery.iResize.sizes.width,
+                               height: jQuery.iResize.sizes.height
+                       };
+               newPosition = {
+                               top: jQuery.iResize.position.top,
+                               left: jQuery.iResize.position.left
+                       };
+
+               switch (jQuery.iResize.resizeDirection){
+                       case 'e':
+                               newSizes.width = jQuery.iResize.getWidth(dx,1);
+                               break;
+                       case 'se':
+                               newSizes.width = jQuery.iResize.getWidth(dx,1);
+                               newSizes.height = jQuery.iResize.getHeight(dy,1);
+                               break;
+                       case 'w':
+                               newSizes.width = jQuery.iResize.getWidth(dx,-1);
+                               newPosition.left = jQuery.iResize.position.left - newSizes.width + jQuery.iResize.sizes.width;
+                               break;
+                       case 'sw':
+                               newSizes.width = jQuery.iResize.getWidth(dx,-1);
+                               newPosition.left = jQuery.iResize.position.left - newSizes.width + jQuery.iResize.sizes.width;
+                               newSizes.height = jQuery.iResize.getHeight(dy,1);
+                               break;
+                       case 'nw':
+                               newSizes.height = jQuery.iResize.getHeight(dy,-1);
+                               newPosition.top = jQuery.iResize.position.top - newSizes.height + jQuery.iResize.sizes.height;
+                               newSizes.width = jQuery.iResize.getWidth(dx,-1);
+                               newPosition.left = jQuery.iResize.position.left - newSizes.width + jQuery.iResize.sizes.width;
+                               break;
+                       case 'n':
+                               newSizes.height = jQuery.iResize.getHeight(dy,-1);
+                               newPosition.top = jQuery.iResize.position.top - newSizes.height + jQuery.iResize.sizes.height;
+                               break;
+                       case 'ne':
+                               newSizes.height = jQuery.iResize.getHeight(dy,-1);
+                               newPosition.top = jQuery.iResize.position.top - newSizes.height + jQuery.iResize.sizes.height;
+                               newSizes.width = jQuery.iResize.getWidth(dx,1);
+                               break;
+                       case 's':
+                               newSizes.height = jQuery.iResize.getHeight(dy,1);
+                               break;
+               }
+
+               if (jQuery.iResize.resizeElement.resizeOptions.ratio) {
+                       if (jQuery.iResize.resizeDirection == 'n' || jQuery.iResize.resizeDirection == 's')
+                               nWidth = newSizes.height * jQuery.iResize.resizeElement.resizeOptions.ratio;
+                       else
+                               nWidth = newSizes.width;
+                       nHeight = jQuery.iResize.getHeightMinMax(nWidth * jQuery.iResize.resizeElement.resizeOptions.ratio);
+                       nWidth = nHeight / jQuery.iResize.resizeElement.resizeOptions.ratio;
+
+                       switch (jQuery.iResize.resizeDirection){
+                               case 'n':
+                               case 'nw':
+                               case 'ne':
+                                       newPosition.top += newSizes.height - nHeight;
+                               break;
+                       }
+
+                       switch (jQuery.iResize.resizeDirection){
+                               case 'nw':
+                               case 'w':
+                               case 'sw':
+                                       newPosition.left += newSizes.width - nWidth;
+                               break;
+                       }
+
+                       newSizes.height = nHeight;
+                       newSizes.width = nWidth;
+               }
+
+               if (newPosition.top < jQuery.iResize.resizeElement.resizeOptions.minTop) {
+                       nHeight = newSizes.height + newPosition.top - jQuery.iResize.resizeElement.resizeOptions.minTop;
+                       newPosition.top = jQuery.iResize.resizeElement.resizeOptions.minTop;
+
+                       if (jQuery.iResize.resizeElement.resizeOptions.ratio) {
+                               nWidth = nHeight / jQuery.iResize.resizeElement.resizeOptions.ratio;
+                               switch (jQuery.iResize.resizeDirection){
+                                       case 'nw':
+                                       case 'w':
+                                       case 'sw':
+                                               newPosition.left += newSizes.width - nWidth;
+                                       break;
+                               }
+                               newSizes.width = nWidth;
+                       }
+                       newSizes.height = nHeight;
+               }
+
+               if (newPosition.left < jQuery.iResize.resizeElement.resizeOptions.minLeft ) {
+                       nWidth = newSizes.width + newPosition.left - jQuery.iResize.resizeElement.resizeOptions.minLeft;
+                       newPosition.left = jQuery.iResize.resizeElement.resizeOptions.minLeft;
+
+                       if (jQuery.iResize.resizeElement.resizeOptions.ratio) {
+                               nHeight = nWidth * jQuery.iResize.resizeElement.resizeOptions.ratio;
+                               switch (jQuery.iResize.resizeDirection){
+                                       case 'n':
+                                       case 'nw':
+                                       case 'ne':
+                                               newPosition.top += newSizes.height - nHeight;
+                                       break;
+                               }
+                               newSizes.height = nHeight;
+                       }
+                       newSizes.width = nWidth;
+               }
+
+               if (newPosition.top + newSizes.height > jQuery.iResize.resizeElement.resizeOptions.maxBottom) {
+                       newSizes.height = jQuery.iResize.resizeElement.resizeOptions.maxBottom - newPosition.top;
+                       if (jQuery.iResize.resizeElement.resizeOptions.ratio) {
+                               newSizes.width = newSizes.height / jQuery.iResize.resizeElement.resizeOptions.ratio;
+                       }
+
+               }
+
+               if (newPosition.left + newSizes.width > jQuery.iResize.resizeElement.resizeOptions.maxRight) {
+                       newSizes.width = jQuery.iResize.resizeElement.resizeOptions.maxRight - newPosition.left;
+                       if (jQuery.iResize.resizeElement.resizeOptions.ratio) {
+                               newSizes.height = newSizes.width * jQuery.iResize.resizeElement.resizeOptions.ratio;
+                       }
+
+               }
+
+               var newDimensions = false;
+               if (jQuery.iResize.resizeElement.resizeOptions.onResize) {
+                       newDimensions = jQuery.iResize.resizeElement.resizeOptions.onResize.apply( jQuery.iResize.resizeElement, [ newSizes, newPosition ] );
+                       if (newDimensions) {
+                               if (newDimensions.sizes) {
+                                       jQuery.extend(newSizes, newDimensions.sizes);
+                               }
+
+                               if (newDimensions.position) {
+                                       jQuery.extend(newPosition, newDimensions.position);
+                               }
+                       }
+               }
+                       elS = jQuery.iResize.resizeElement.style;
+                       elS.left = newPosition.left + 'px';
+                       elS.top = newPosition.top + 'px';
+                       elS.width = newSizes.width + 'px';
+                       elS.height = newSizes.height + 'px';
+
+               return false;
+       },
+       /**
+        * Builds the resizable
+        */
+       build: function(options) {
+               if (!options || !options.handlers || options.handlers.constructor != Object) {
+                       return;
+               }
+
+               return this.each(
+                       function() {
+                               var el = this;
+                               el.resizeOptions = options;
+                               el.resizeOptions.minWidth = options.minWidth || 10;
+                               el.resizeOptions.minHeight = options.minHeight || 10;
+                               el.resizeOptions.maxWidth = options.maxWidth || 3000;
+                               el.resizeOptions.maxHeight = options.maxHeight || 3000;
+                               el.resizeOptions.minTop = options.minTop || -1000;
+                               el.resizeOptions.minLeft = options.minLeft || -1000;
+                               el.resizeOptions.maxRight = options.maxRight || 3000;
+                               el.resizeOptions.maxBottom = options.maxBottom || 3000;
+                               elPosition = jQuery(el).css('position');
+                               if (!(elPosition == 'relative' || elPosition == 'absolute')) {
+                                       el.style.position = 'relative';
+                               }
+
+                               directions = /n|ne|e|se|s|sw|w|nw/g;
+                               for (i in el.resizeOptions.handlers) {
+                                       if (i.toLowerCase().match(directions) != null) {
+                                               if (el.resizeOptions.handlers[i].constructor == String) {
+                                                       handle = jQuery(el.resizeOptions.handlers[i]);
+                                                       if (handle.size() > 0) {
+                                                               el.resizeOptions.handlers[i] = handle.get(0);
+                                                       }
+                                               }
+
+                                               if (el.resizeOptions.handlers[i].tagName) {
+                                                       el.resizeOptions.handlers[i].resizeElement = el;
+                                                       el.resizeOptions.handlers[i].resizeDirection = i;
+                                                       jQuery(el.resizeOptions.handlers[i]).bind('mousedown', jQuery.iResize.start);
+                                               }
+                                       }
+                               }
+
+                               if (el.resizeOptions.dragHandle) {
+                                       if (typeof el.resizeOptions.dragHandle === 'string') {
+                                               handleEl = jQuery(el.resizeOptions.dragHandle);
+                                               if (handleEl.size() > 0) {
+                                                       handleEl.each(function() {
+                                                                       this.dragEl = el;
+                                                               });
+                                                       handleEl.bind('mousedown', jQuery.iResize.startDrag);
+                                               }
+                                       } else if (el.resizeOptions.dragHandle == true) {
+                                               jQuery(this).bind('mousedown', jQuery.iResize.startDrag);
+                                       }
+                               }
+                       }
+               );
+       },
+       /**
+        * Destroys the resizable
+        */
+       destroy: function() {
+               return this.each(
+                       function() {
+                               var el = this;
+
+                               // Unbind the handlers
+                               for (i in el.resizeOptions.handlers) {
+                                       el.resizeOptions.handlers[i].resizeElement = null;
+                                       el.resizeOptions.handlers[i].resizeDirection = null;
+                                       jQuery(el.resizeOptions.handlers[i]).unbind('mousedown', jQuery.iResize.start);
+                               }
+
+                               // Remove the draghandle
+                               if (el.resizeOptions.dragHandle) {
+                                       if (typeof el.resizeOptions.dragHandle === 'string') {
+                                               handle = jQuery(el.resizeOptions.dragHandle);
+                                               if (handle.size() > 0) {
+                                                       handle.unbind('mousedown', jQuery.iResize.startDrag);
+                                               }
+                                       } else if (el.resizeOptions.dragHandle == true) {
+                                               jQuery(this).unbind('mousedown', jQuery.iResize.startDrag);
+                                       }
+                               }
+
+                               // Reset the options
+                               el.resizeOptions = null;
+                       }
+               );
+       }
+};
+
+
+jQuery.fn.extend ({
+               /**
+                * Create a resizable element with a number of advanced options including callback, dragging
+                * 
+                * @name Resizable
+                * @description Create a resizable element with a number of advanced options including callback, dragging
+                * @param Hash hash A hash of parameters. All parameters are optional.
+                * @option Hash handlers hash with keys for each resize direction (e, es, s, sw, w, nw, n) and value string selection
+                * @option Integer minWidth (optional) the minimum width that element can be resized to
+                * @option Integer maxWidth (optional) the maximum width that element can be resized to
+                * @option Integer minHeight (optional) the minimum height that element can be resized to
+                * @option Integer maxHeight (optional) the maximum height that element can be resized to
+                * @option Integer minTop (optional) the minmum top position to wich element can be moved to
+                * @option Integer minLeft (optional) the minmum left position to wich element can be moved to
+                * @option Integer maxRight (optional) the maximum right position to wich element can be moved to
+                * @option Integer maxBottom (optional) the maximum bottom position to wich element can be moved to
+                * @option Float ratio (optional) the ratio between width and height to constrain elements sizes to that ratio
+                * @option Mixed dragHandle (optional) true to make the element draggable, string selection for drag handle
+                * @option Function onDragStart (optional) A function to be executed whenever the dragging starts
+                * @option Function onDragStop (optional) A function to be executed whenever the dragging stops
+                * @option Function onDrag (optional) A function to be executed whenever the element is dragged
+                * @option Function onStart (optional) A function to be executed whenever the element starts to be resized
+                * @option Function onStop (optional) A function to be executed whenever the element stops to be resized
+                * @option Function onResize (optional) A function to be executed whenever the element is resized
+                * @type jQuery
+                * @cat Plugins/Interface
+                * @author Stefan Petre
+                */
+               Resizable: jQuery.iResize.build,
+               /**
+                * Destroy a resizable
+                * 
+                * @name ResizableDestroy
+                * @description Destroy a resizable
+                * @type jQuery
+                * @cat Plugins/Interface
+                * @author Stefan Petre
+                */
+               ResizableDestroy: jQuery.iResize.destroy
+       });
\ No newline at end of file
diff --git a/scripts/interface/iselect.js b/scripts/interface/iselect.js
new file mode 100644 (file)
index 0000000..554d0f6
--- /dev/null
@@ -0,0 +1,275 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * Selectables\r
+ *\r
+ * http://interface.eyecon.ro\r
+ *\r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt)\r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ *\r
+ */\r
+\r
+jQuery.selectHelper = null;\r
+jQuery.selectKeyHelper = false;\r
+jQuery.selectdrug = null;\r
+jQuery.selectCurrent = [];     // For current selection\r
+jQuery.selectKeyDown = function(e) {\r
+       var pressedKey = e.charCode || e.keyCode || -1;\r
+       if (pressedKey == 17 || pressedKey == 16) {\r
+               jQuery.selectKeyHelper = true;\r
+       }\r
+};\r
+jQuery.selectKeyUp = function(e) {\r
+       jQuery.selectKeyHelper = false;\r
+};\r
+jQuery.selectstart = function(e) {\r
+       this.f.pointer = jQuery.iUtil.getPointer(e);\r
+       this.f.pos = jQuery.extend(\r
+               jQuery.iUtil.getPosition(this), \r
+               jQuery.iUtil.getSize(this)\r
+       );\r
+       \r
+       this.f.scr = jQuery.iUtil.getScroll(this);\r
+       this.f.pointer.x -= this.f.pos.x;\r
+       this.f.pointer.y -= this.f.pos.y;\r
+       jQuery(this).append(jQuery.selectHelper.get(0));\r
+       if (this.f.hc)\r
+               jQuery.selectHelper.addClass(this.f.hc).css('display','block');\r
+       jQuery.selectHelper.css(\r
+               {\r
+                       display: 'block',\r
+                       width: '0px',\r
+                       height: '0px'\r
+               }\r
+       );\r
+       if (this.f.o) {\r
+               jQuery.selectHelper.css('opacity', this.f.o);\r
+       }\r
+\r
+       jQuery.selectdrug = this;\r
+       jQuery.selectedone = false;\r
+       jQuery.selectCurrent = [];      // For current selection state\r
+       this.f.el.each(\r
+               function ()\r
+               {\r
+                       this.pos = {\r
+                               x: this.offsetLeft + (this.currentStyle && !jQuery.browser.opera ?parseInt(this.currentStyle.borderLeftWidth)||0:0) + (jQuery.selectdrug.scrollLeft||0), \r
+                               y: this.offsetTop + (this.currentStyle && !jQuery.browser.opera ?parseInt(this.currentStyle.borderTopWidth)||0:0) + (jQuery.selectdrug.scrollTop||0),\r
+                               wb: this.offsetWidth,\r
+                               hb: this.offsetHeight\r
+                       };\r
+                       if (this.s == true) {\r
+                               if (jQuery.selectKeyHelper == false) {\r
+                                       this.s = false;\r
+                                       jQuery(this).removeClass(jQuery.selectdrug.f.sc);\r
+                               } else {\r
+                                       jQuery.selectedone = true;\r
+\r
+                                       // Save current state\r
+                                       jQuery.selectCurrent[jQuery.selectCurrent.length] = jQuery.attr(this,'id');\r
+                               }\r
+                       }\r
+               }\r
+       );\r
+       jQuery.selectcheck.apply(this, [e]);\r
+       jQuery(document)\r
+               .bind('mousemove', jQuery.selectcheck)\r
+               .bind('mouseup', jQuery.selectstop);\r
+       return false;\r
+};\r
+jQuery.selectcheck = function(e)\r
+{\r
+       if(!jQuery.selectdrug)\r
+               return;\r
+       jQuery.selectcheckApply.apply(jQuery.selectdrug, [e]);\r
+};\r
+jQuery.selectcheckApply = function(e)\r
+{\r
+       if(!jQuery.selectdrug)\r
+               return;\r
+       var pointer = jQuery.iUtil.getPointer(e);\r
+       \r
+       var scr = jQuery.iUtil.getScroll(jQuery.selectdrug);\r
+       pointer.x += scr.l - this.f.scr.l - this.f.pos.x;\r
+       pointer.y += scr.t - this.f.scr.t - this.f.pos.y;\r
+       \r
+       var sx = Math.min(pointer.x, this.f.pointer.x);\r
+       var sw = Math.min(Math.abs(pointer.x - this.f.pointer.x), Math.abs(this.f.scr.w - sx));\r
+       var sy = Math.min(pointer.y, this.f.pointer.y);\r
+       var sh = Math.min(Math.abs(pointer.y - this.f.pointer.y), Math.abs(this.f.scr.h - sy));\r
+       if (this.scrollTop > 0 && pointer.y - 20 < this.scrollTop) {\r
+               var diff = Math.min(scr.t, 10);\r
+               sy -= diff;\r
+               sh += diff;\r
+               this.scrollTop -= diff;\r
+       } else if (this.scrollTop+ this.f.pos.h < this.f.scr.h && pointer.y + 20 > this.scrollTop + this.f.pos.h) {\r
+               var diff = Math.min(this.f.scr.h - this.scrollTop, 10);\r
+               this.scrollTop += diff;\r
+               if (this.scrollTop != scr.t)\r
+                       sh += diff;\r
+       }\r
+       if (this.scrollLeft > 0 && pointer.x - 20 < this.scrollLeft) {\r
+               var diff = Math.min(scr.l, 10);\r
+               sx -= diff;\r
+               sw += diff;\r
+               this.scrollLeft -= diff;\r
+       } else if (this.scrollLeft+ this.f.pos.w < this.f.scr.w && pointer.x + 20 > this.scrollLeft + this.f.pos.w) {\r
+               var diff = Math.min(this.f.scr.w - this.scrollLeft, 10);\r
+               this.scrollLeft += diff;\r
+               if (this.scrollLeft != scr.l)\r
+                       sw += diff;\r
+       }\r
+       jQuery.selectHelper.css(\r
+               {\r
+                       left:   sx + 'px',\r
+                       top:    sy + 'px',\r
+                       width:  sw + 'px',\r
+                       height: sh + 'px'\r
+               }\r
+       );\r
+       jQuery.selectHelper.l = sx + this.f.scr.l;\r
+       jQuery.selectHelper.t = sy + this.f.scr.t;\r
+       jQuery.selectHelper.r = jQuery.selectHelper.l + sw;\r
+       jQuery.selectHelper.b = jQuery.selectHelper.t + sh;\r
+       jQuery.selectedone = false;\r
+       this.f.el.each(\r
+               function () {\r
+                       // Locate the current element in the current selection\r
+                       iIndex = jQuery.selectCurrent.indexOf(jQuery.attr(this, 'id'));\r
+                       // In case we are currently OVER an item\r
+                       if (\r
+                               ! ( this.pos.x > jQuery.selectHelper.r\r
+                               || (this.pos.x + this.pos.wb) < jQuery.selectHelper.l\r
+                               || this.pos.y > jQuery.selectHelper.b\r
+                               || (this.pos.y + this.pos.hb) < jQuery.selectHelper.t\r
+                               )\r
+                       )\r
+                       {\r
+                               jQuery.selectedone = true;\r
+                               if (this.s != true) {\r
+                                       this.s = true;\r
+                                       jQuery(this).addClass(jQuery.selectdrug.f.sc);\r
+                               }\r
+\r
+                               // Check to see if this item was previously selected, if so, unselect it\r
+                               if (iIndex != -1) {\r
+                                       this.s = false;\r
+                                       jQuery(this).removeClass(jQuery.selectdrug.f.sc);\r
+                               }\r
+                       } else if (\r
+                                               (this.s == true) &&\r
+                                               (iIndex == -1)\r
+                                       ) {\r
+                               // If the item was marked as selected, but it was not selected when you started dragging unselect it.\r
+                               this.s = false;\r
+                               jQuery(this).removeClass(jQuery.selectdrug.f.sc);\r
+                       } else if (\r
+                                               (!this.s) &&\r
+                                               (jQuery.selectKeyHelper == true) &&\r
+                                               (iIndex != -1)\r
+                                       ) {\r
+                               // Reselect the item if:\r
+                               // - we ARE multiselecting,\r
+                               // - dragged over an allready selected object (so it got unselected)\r
+                               // - But then dragged the selection out of it again.\r
+                               this.s = true;\r
+                               jQuery(this).addClass(jQuery.selectdrug.f.sc);\r
+                       }\r
+               }\r
+       );\r
+       return false;\r
+};\r
+jQuery.selectstop = function(e)\r
+{\r
+       if(!jQuery.selectdrug)\r
+               return;\r
+       jQuery.selectstopApply.apply(jQuery.selectdrug, [e]);\r
+};\r
+jQuery.selectstopApply = function(e)\r
+{\r
+       jQuery(document)\r
+               .unbind('mousemove', jQuery.selectcheck)\r
+               .unbind('mouseup', jQuery.selectstop);\r
+       if(!jQuery.selectdrug)\r
+               return;\r
+       jQuery.selectHelper.css('display','none');\r
+       if (this.f.hc)\r
+               jQuery.selectHelper.removeClass(this.f.hc);\r
+       jQuery.selectdrug = false;\r
+       jQuery('body').append(jQuery.selectHelper.get(0));\r
+       //\r
+       // In case we have selected some new items..\r
+       if (jQuery.selectedone == true) {\r
+               if (this.f.onselect)\r
+                       this.f.onselect(jQuery.Selectserialize(jQuery.attr(this,'id')));\r
+       } else {\r
+               if (this.f.onselectstop)\r
+                       this.f.onselectstop(jQuery.Selectserialize(jQuery.attr(this,'id')));\r
+       }\r
+       // Reset current selection\r
+       jQuery.selectCurrent = [];\r
+};\r
+\r
+jQuery.Selectserialize = function(s)\r
+{\r
+       var h = '';\r
+       var o = [];\r
+       if (a = jQuery('#' + s)) {\r
+               a.get(0).f.el.each(\r
+                       function ()\r
+                       {\r
+                               if (this.s == true) {\r
+                                       if (h.length > 0) {\r
+                                               h += '&';\r
+                                       }\r
+                                       h += s + '[]=' + jQuery.attr(this,'id');\r
+                                       o[o.length] = jQuery.attr(this,'id');\r
+                               }\r
+                       }\r
+               );\r
+       }\r
+       return {hash:h, o:o};\r
+};\r
+jQuery.fn.Selectable = function(o)\r
+{\r
+       if (!jQuery.selectHelper) {\r
+               jQuery('body',document).append('<div id="selectHelper"></div>').bind('keydown', jQuery.selectKeyDown).bind('keyup', jQuery.selectKeyUp);\r
+               jQuery.selectHelper = jQuery('#selectHelper');\r
+               jQuery.selectHelper.css(\r
+                       {\r
+                               position:       'absolute',\r
+                               display:        'none'\r
+                       }\r
+               );\r
+\r
+               if (window.event) {\r
+                       jQuery('body',document).bind('keydown', jQuery.selectKeyDown).bind('keyup', jQuery.selectKeyUp);\r
+               } else {\r
+                       jQuery(document).bind('keydown', jQuery.selectKeyDown).bind('keyup', jQuery.selectKeyUp);\r
+               }\r
+       }\r
+\r
+    if (!o) {\r
+               o = {};\r
+       }\r
+    return this.each(\r
+               function()\r
+               {\r
+                       if (this.isSelectable)\r
+                               return;\r
+                       this.isSelectable = true;\r
+                       this.f = {\r
+                               a : o.accept,\r
+                               o : o.opacity ? parseFloat(o.opacity) : false,\r
+                               sc : o.selectedclass ? o.selectedclass : false,\r
+                               hc : o.helperclass ? o.helperclass : false,\r
+                               onselect : o.onselect ? o.onselect : false,\r
+                               onselectstop : o.onselectstop ? o.onselectstop : false\r
+                       };\r
+                       this.f.el = jQuery('.' + o.accept);\r
+                       jQuery(this).bind('mousedown', jQuery.selectstart).css('position', 'relative');\r
+               }\r
+       );\r
+};
\ No newline at end of file
diff --git a/scripts/interface/islider.js b/scripts/interface/islider.js
new file mode 100644 (file)
index 0000000..997337d
--- /dev/null
@@ -0,0 +1,301 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * Slider\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ */\r
+\r
+jQuery.iSlider = {\r
+       tabindex : 1,\r
+       set : function (values)\r
+       {\r
+               var values = values;\r
+               return this.each(\r
+                       function()\r
+                       {\r
+                               this.slideCfg.sliders.each(\r
+                                       function (key) \r
+                                       { \r
+                                               jQuery.iSlider.dragmoveBy(this,values[key]);\r
+                                       }\r
+                               );\r
+                       }\r
+               );\r
+       },\r
+       \r
+       get : function()\r
+       {\r
+               var values = [];\r
+               this.each(\r
+                       function(slider)\r
+                       {\r
+                               if (this.isSlider) {\r
+                                       values[slider] = [];\r
+                                       var elm = this;\r
+                                       var sizes = jQuery.iUtil.getSize(this);\r
+                                       this.slideCfg.sliders.each(\r
+                                               function (key) \r
+                                               {\r
+                                                       var x = this.offsetLeft;\r
+                                                       var y = this.offsetTop;\r
+                                                       xproc = parseInt(x * 100 / (sizes.w - this.offsetWidth));\r
+                                                       yproc = parseInt(y * 100 / (sizes.h - this.offsetHeight));\r
+                                                       values[slider][key] = [xproc||0, yproc||0, x||0, y||0];\r
+                                               }\r
+                                       );\r
+                               }\r
+                       }\r
+               );\r
+               return values;\r
+       },\r
+       \r
+       modifyContainer : function (elm)\r
+       {\r
+               elm.dragCfg.containerMaxx = elm.dragCfg.cont.w - elm.dragCfg.oC.wb;\r
+               elm.dragCfg.containerMaxy = elm.dragCfg.cont.h - elm.dragCfg.oC.hb;\r
+               if (elm.SliderContainer.slideCfg.restricted ) {\r
+                       next = elm.SliderContainer.slideCfg.sliders.get(elm.SliderIteration+1);\r
+                       if (next) {\r
+                               elm.dragCfg.cont.w = (parseInt(jQuery(next).css('left'))||0) + elm.dragCfg.oC.wb;\r
+                               elm.dragCfg.cont.h = (parseInt(jQuery(next).css('top'))||0) + elm.dragCfg.oC.hb;\r
+                       }\r
+                       prev = elm.SliderContainer.slideCfg.sliders.get(elm.SliderIteration-1);\r
+                       if (prev) {\r
+                               var prevLeft = parseInt(jQuery(prev).css('left'))||0;\r
+                               var prevTop = parseInt(jQuery(prev).css('left'))||0;\r
+                               elm.dragCfg.cont.x += prevLeft;\r
+                               elm.dragCfg.cont.y += prevTop;\r
+                               elm.dragCfg.cont.w -= prevLeft;\r
+                               elm.dragCfg.cont.h -= prevTop;\r
+                       }\r
+               }\r
+               elm.dragCfg.maxx = elm.dragCfg.cont.w - elm.dragCfg.oC.wb;\r
+               elm.dragCfg.maxy = elm.dragCfg.cont.h - elm.dragCfg.oC.hb;\r
+               if(elm.dragCfg.fractions) {\r
+                       elm.dragCfg.gx = ((elm.dragCfg.cont.w - elm.dragCfg.oC.wb)/elm.dragCfg.fractions) || 1;\r
+                       elm.dragCfg.gy = ((elm.dragCfg.cont.h - elm.dragCfg.oC.hb)/elm.dragCfg.fractions) || 1;\r
+                       elm.dragCfg.fracW = elm.dragCfg.maxx / elm.dragCfg.fractions;\r
+                       elm.dragCfg.fracH = elm.dragCfg.maxy / elm.dragCfg.fractions;\r
+               }\r
+               \r
+               elm.dragCfg.cont.dx = elm.dragCfg.cont.x - elm.dragCfg.oR.x;\r
+               elm.dragCfg.cont.dy = elm.dragCfg.cont.y - elm.dragCfg.oR.y;\r
+               \r
+               jQuery.iDrag.helper.css('cursor', 'default');\r
+       },\r
+       \r
+       onSlide : function(elm, x, y)\r
+       {\r
+               if (elm.dragCfg.fractions) {\r
+                               xfrac = parseInt(x/elm.dragCfg.fracW);\r
+                               xproc = xfrac * 100 / elm.dragCfg.fractions;\r
+                               yfrac = parseInt(y/elm.dragCfg.fracH);\r
+                               yproc = yfrac * 100 / elm.dragCfg.fractions;\r
+               } else {\r
+                       xproc = parseInt(x * 100 / elm.dragCfg.containerMaxx);\r
+                       yproc = parseInt(y * 100 / elm.dragCfg.containerMaxy);\r
+               }\r
+               elm.dragCfg.lastSi = [xproc||0, yproc||0, x||0, y||0];\r
+               if (elm.dragCfg.onSlide)\r
+                       elm.dragCfg.onSlide.apply(elm, elm.dragCfg.lastSi);\r
+       },\r
+       \r
+       dragmoveByKey : function (event)\r
+       {\r
+               pressedKey = event.charCode || event.keyCode || -1;\r
+               \r
+               switch (pressedKey)\r
+               {\r
+                       //end\r
+                       case 35:\r
+                               jQuery.iSlider.dragmoveBy(this.dragElem, [2000, 2000] );\r
+                       break;\r
+                       //home\r
+                       case 36:\r
+                               jQuery.iSlider.dragmoveBy(this.dragElem, [-2000, -2000] );\r
+                       break;\r
+                       //left\r
+                       case 37:\r
+                               jQuery.iSlider.dragmoveBy(this.dragElem, [-this.dragElem.dragCfg.gx||-1, 0] );\r
+                       break;\r
+                       //up\r
+                       case 38:\r
+                               jQuery.iSlider.dragmoveBy(this.dragElem, [0, -this.dragElem.dragCfg.gy||-1] );\r
+                       break;\r
+                       //right\r
+                       case 39:\r
+                               jQuery.iSlider.dragmoveBy(this.dragElem, [this.dragElem.dragCfg.gx||1, 0] );\r
+                       break;\r
+                       //down;\r
+                       case 40:\r
+                               jQuery.iDrag.dragmoveBy(this.dragElem, [0, this.dragElem.dragCfg.gy||1] );\r
+                       break;\r
+               }\r
+       },\r
+       \r
+       dragmoveBy : function (elm, position) \r
+       {\r
+               if (!elm.dragCfg) {\r
+                       return;\r
+               }\r
+               \r
+               elm.dragCfg.oC = jQuery.extend(\r
+                       jQuery.iUtil.getPosition(elm),\r
+                       jQuery.iUtil.getSize(elm)\r
+               );\r
+               \r
+               elm.dragCfg.oR = {\r
+                       x : parseInt(jQuery.css(elm, 'left'))||0,\r
+                       y : parseInt(jQuery.css(elm, 'top'))||0\r
+               };\r
+               \r
+               elm.dragCfg.oP = jQuery.css(elm, 'position');\r
+               if (elm.dragCfg.oP != 'relative' && elm.dragCfg.oP != 'absolute') {\r
+                       elm.style.position = 'relative';\r
+               }\r
+               \r
+               jQuery.iDrag.getContainment(elm);\r
+               jQuery.iSlider.modifyContainer(elm);            \r
+               \r
+               dx = parseInt(position[0]) || 0;\r
+               dy = parseInt(position[1]) || 0;\r
+               \r
+               nx = elm.dragCfg.oR.x + dx;\r
+               ny = elm.dragCfg.oR.y + dy;\r
+               if(elm.dragCfg.fractions) {\r
+                       newCoords = jQuery.iDrag.snapToGrid.apply(elm, [nx, ny, dx, dy]);\r
+                       if (newCoords.constructor == Object) {\r
+                               dx = newCoords.dx;\r
+                               dy = newCoords.dy;\r
+                       }\r
+                       nx = elm.dragCfg.oR.x + dx;\r
+                       ny = elm.dragCfg.oR.y + dy;\r
+               }\r
+               \r
+               newCoords = jQuery.iDrag.fitToContainer.apply(elm, [nx, ny, dx, dy]);\r
+               if (newCoords && newCoords.constructor == Object) {\r
+                       dx = newCoords.dx;\r
+                       dy = newCoords.dy;\r
+               }\r
+               \r
+               nx = elm.dragCfg.oR.x + dx;\r
+               ny = elm.dragCfg.oR.y + dy;\r
+               \r
+               if (elm.dragCfg.si && (elm.dragCfg.onSlide || elm.dragCfg.onChange)) {\r
+                       jQuery.iSlider.onSlide(elm, nx, ny);\r
+               }\r
+               nx = !elm.dragCfg.axis || elm.dragCfg.axis == 'horizontally' ? nx : elm.dragCfg.oR.x||0;\r
+               ny = !elm.dragCfg.axis || elm.dragCfg.axis == 'vertically' ? ny : elm.dragCfg.oR.y||0;\r
+               elm.style.left = nx + 'px';\r
+               elm.style.top = ny + 'px';\r
+       },\r
+       \r
+       build : function(o) {\r
+               return this.each(\r
+                       function()\r
+                       {\r
+                               if (this.isSlider == true || !o.accept || !jQuery.iUtil || !jQuery.iDrag || !jQuery.iDrop){\r
+                                       return;\r
+                               }\r
+                               toDrag = jQuery(o.accept, this);\r
+                               if (toDrag.size() == 0) {\r
+                                       return;\r
+                               }\r
+                               var params = {\r
+                                       containment: 'parent',\r
+                                       si : true,\r
+                                       onSlide : o.onSlide && o.onSlide.constructor == Function ? o.onSlide : null,\r
+                                       onChange : o.onChange && o.onChange.constructor == Function ? o.onChange : null,\r
+                                       handle: this,\r
+                                       opacity: o.opacity||false\r
+                               };\r
+                               if (o.fractions && parseInt(o.fractions)) {\r
+                                       params.fractions = parseInt(o.fractions)||1;\r
+                                       params.fractions = params.fractions > 0 ? params.fractions : 1;\r
+                               }\r
+                               if (toDrag.size() == 1)\r
+                                       toDrag.Draggable(params);\r
+                               else {\r
+                                       jQuery(toDrag.get(0)).Draggable(params);\r
+                                       params.handle = null;\r
+                                       toDrag.Draggable(params);\r
+                               }\r
+                               toDrag.keydown(jQuery.iSlider.dragmoveByKey);\r
+                               toDrag.attr('tabindex',jQuery.iSlider.tabindex++);      \r
+                               \r
+                               this.isSlider = true;\r
+                               this.slideCfg = {};\r
+                               this.slideCfg.onslide = params.onslide;\r
+                               this.slideCfg.fractions = params.fractions;\r
+                               this.slideCfg.sliders = toDrag;\r
+                               this.slideCfg.restricted = o.restricted ? true : false;\r
+                               sliderEl = this;\r
+                               sliderEl.slideCfg.sliders.each(\r
+                                       function(nr)\r
+                                       {\r
+                                               this.SliderIteration = nr;\r
+                                               this.SliderContainer = sliderEl;\r
+                                       }\r
+                               );\r
+                               if (o.values && o.values.constructor == Array) {\r
+                                       for (i = o.values.length -1; i>=0;i--) {\r
+                                               if (o.values[i].constructor == Array && o.values[i].length == 2) {\r
+                                                       el = this.slideCfg.sliders.get(i);\r
+                                                       if (el.tagName) {\r
+                                                               jQuery.iSlider.dragmoveBy(el, o.values[i]);\r
+                                                       }\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+               );\r
+       }\r
+};\r
+jQuery.fn.extend(\r
+       {\r
+               /**\r
+                * Create a slider width options\r
+                * \r
+                * @name Slider\r
+                * @description Create a slider width options\r
+                * @param Hash hash A hash of parameters. All parameters are optional.\r
+                * @option Mixed accepts string to select slider indicators or DOMElement slider indicator\r
+                * @option Integer factions (optional) number of sgments to divide and snap slider\r
+                * @option Function onSlide (optional) A function to be executed whenever slider indicator it is moved\r
+                * @option Function onChanged (optional) A function to be executed whenever slider indicator was moved\r
+                * @option Array values (optional) Initial values for slider indicators\r
+                * @option Boolean restricted (optional) if true the slider indicator can not be moved beyond adjacent indicators\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               Slider : jQuery.iSlider.build,\r
+               /**\r
+                * Set value/position for slider indicators\r
+                * \r
+                * @name SliderSetValues\r
+                * @description Set value/position for slider indicators\r
+                * @param Array values array width values for each indicator\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               SliderSetValues : jQuery.iSlider.set,\r
+               /**\r
+                * Get value/position for slider indicators\r
+                * \r
+                * @name SliderSetValues\r
+                * @description Get value/position for slider indicators\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               SliderGetValues : jQuery.iSlider.get\r
+       }\r
+);
\ No newline at end of file
diff --git a/scripts/interface/islideshow.js b/scripts/interface/islideshow.js
new file mode 100644 (file)
index 0000000..6e8a9b3
--- /dev/null
@@ -0,0 +1,422 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * Slideshow\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ */\r
+\r
+\r
+/**\r
+ * Creates an image slideshow. The slideshow can autoplay slides, each image can have caption, navigation links: next, prev, each slide. A page may have more then one slideshow, eachone working independently. Each slide can be bookmarked. The source images can be defined by JavaScript in slideshow options or by HTML placing images inside container.\r
+ *\r
+ * \r
+ * \r
+ * @name Slideshow\r
+ * @description Creates an image slideshow. The slideshow can autoplay slides, each image can have caption, navigation links: next, prev, each slide. A page may have more then one slideshow, eachone working independently. Each slide can be bookmarked. The source images can be defined by JavaScript in slideshow options or by HTML placing images inside container.\r
+ * @param Hash hash A hash of parameters\r
+ * @option String container container ID\r
+ * @option String loader path to loading indicator image\r
+ * @option String linksPosition (optional) images links position ['top'|'bottom'|null]\r
+ * @option String linksClass (optional) images links cssClass\r
+ * @option String linksSeparator (optional) images links separator\r
+ * @option Integer fadeDuration fade animation duration in miliseconds\r
+ * @option String activeLinkClass (optional) active image link CSS class\r
+ * @option String nextslideClass (optional) next image CSS class\r
+ * @option String prevslideClass (optional) previous image CSS class\r
+ * @option String captionPosition (optional) image caption position ['top'|'bottom'|null]\r
+ * @option String captionClass (optional) image caption CSS class\r
+ * @option String autoplay (optional) seconds to wait untill next images is displayed. This option will make the slideshow to autoplay.\r
+ * @option String random (optional) if slideshow autoplayes the images can be randomized\r
+ * @option Array images (optional) array of hash with keys 'src' (path to image) and 'cation' (image caption) for images\r
+ *\r
+ * @type jQuery\r
+ * @cat Plugins/Interface\r
+ * @author Stefan Petre\r
+ */\r
+jQuery.islideshow = {\r
+       slideshows: [],\r
+       gonext : function()\r
+       {\r
+               this.blur();\r
+               slideshow = this.parentNode;\r
+               id = jQuery.attr(slideshow, 'id');\r
+               if (jQuery.islideshow.slideshows[id] != null) {\r
+                       window.clearInterval(jQuery.islideshow.slideshows[id]);\r
+               }\r
+               slide = slideshow.ss.currentslide + 1;\r
+               if (slideshow.ss.images.length < slide) {\r
+                       slide = 1;\r
+               }\r
+               images = jQuery('img', slideshow.ss.holder);\r
+               slideshow.ss.currentslide = slide;\r
+               if (images.size() > 0) {\r
+                       images.fadeOut(\r
+                               slideshow.ss.fadeDuration,\r
+                               jQuery.islideshow.showImage\r
+                       );\r
+               }\r
+       },\r
+       goprev : function()\r
+       {\r
+               this.blur();\r
+               slideshow = this.parentNode;\r
+               id = jQuery.attr(slideshow, 'id');\r
+               if (jQuery.islideshow.slideshows[id] != null) {\r
+                       window.clearInterval(jQuery.islideshow.slideshows[id]);\r
+               }\r
+               slide = slideshow.ss.currentslide - 1;\r
+               images = jQuery('img', slideshow.ss.holder);\r
+               if (slide < 1) {\r
+                       slide = slideshow.ss.images.length ;\r
+               }\r
+               slideshow.ss.currentslide = slide;\r
+               if (images.size() > 0) {\r
+                       images.fadeOut(\r
+                               slideshow.ss.fadeDuration,\r
+                               jQuery.islideshow.showImage\r
+                       );\r
+               }\r
+       },\r
+       timer : function (c)\r
+       {\r
+               slideshow = document.getElementById(c);\r
+               if (slideshow.ss.random) {\r
+                       slide = slideshow.ss.currentslide;\r
+                       while(slide == slideshow.ss.currentslide) {\r
+                               slide = 1 + parseInt(Math.random() * slideshow.ss.images.length);\r
+                       }\r
+               } else {\r
+                       slide = slideshow.ss.currentslide + 1;\r
+                       if (slideshow.ss.images.length < slide) {\r
+                               slide = 1;\r
+                       }\r
+               }\r
+               images = jQuery('img', slideshow.ss.holder);\r
+               slideshow.ss.currentslide = slide;\r
+               if (images.size() > 0) {\r
+                       images.fadeOut(\r
+                               slideshow.ss.fadeDuration,\r
+                               jQuery.islideshow.showImage\r
+                       );\r
+               }\r
+       },\r
+       go : function(o)\r
+       {\r
+               var slideshow;\r
+               if (o && o.constructor == Object) {\r
+                       if (o.loader) {\r
+                               slideshow = document.getElementById(o.loader.slideshow);\r
+                               url = window.location.href.split("#");\r
+                               o.loader.onload = null;\r
+                               if (url.length == 2) {\r
+                                       slide = parseInt(url[1]);\r
+                                       show = url[1].replace(slide,'');\r
+                                       if (jQuery.attr(slideshow,'id') != show) {\r
+                                               slide = 1;\r
+                                       }\r
+                               } else {\r
+                                       slide = 1;\r
+                               }\r
+                       }\r
+                       if(o.link) {\r
+                               o.link.blur();\r
+                               slideshow = o.link.parentNode.parentNode;\r
+                               id = jQuery.attr(slideshow, 'id');\r
+                               if (jQuery.islideshow.slideshows[id] != null) {\r
+                                       window.clearInterval(jQuery.islideshow.slideshows[id]);\r
+                               }\r
+                               url = o.link.href.split("#");\r
+                               slide = parseInt(url[1]);\r
+                               show = url[1].replace(slide,'');\r
+                               if (jQuery.attr(slideshow,'id') != show) {\r
+                                       slide = 1;\r
+                               }\r
+                       }\r
+                       if (slideshow.ss.images.length < slide || slide < 1) {\r
+                               slide = 1;\r
+                       }\r
+                       slideshow.ss.currentslide = slide;\r
+                       slidePos = jQuery.iUtil.getSize(slideshow);\r
+                       slidePad = jQuery.iUtil.getPadding(slideshow);\r
+                       slideBor = jQuery.iUtil.getBorder(slideshow);\r
+                       if (slideshow.ss.prevslide) {\r
+                               slideshow.ss.prevslide.o.css('display', 'none');\r
+                       }\r
+                       if (slideshow.ss.nextslide) {\r
+                               slideshow.ss.nextslide.o.css('display', 'none');\r
+                       }\r
+                       \r
+                       //center loader\r
+                       if (slideshow.ss.loader) {\r
+                               y = parseInt(slidePad.t) + parseInt(slideBor.t);\r
+                               if (slideshow.ss.slideslinks) {\r
+                                       if (slideshow.ss.slideslinks.linksPosition == 'top') {\r
+                                               y += slideshow.ss.slideslinks.dimm.hb;\r
+                                       } else {\r
+                                               slidePos.h -= slideshow.ss.slideslinks.dimm.hb;\r
+                                       }\r
+                               }\r
+                               if (slideshow.ss.slideCaption) {\r
+                                       if (slideshow.ss.slideCaption && slideshow.ss.slideCaption.captionPosition == 'top') {\r
+                                               y += slideshow.ss.slideCaption.dimm.hb;\r
+                                       } else {\r
+                                               slidePos.h -= slideshow.ss.slideCaption.dimm.hb;\r
+                                       }\r
+                               }\r
+                               if (!slideshow.ss.loaderWidth) {\r
+                                       slideshow.ss.loaderHeight = o.loader ? o.loader.height : (parseInt(slideshow.ss.loader.css('height'))||0);\r
+                                       slideshow.ss.loaderWidth = o.loader ? o.loader.width : (parseInt(slideshow.ss.loader.css('width'))||0);\r
+                               }\r
+                               \r
+                               slideshow.ss.loader.css('top', y + (slidePos.h - slideshow.ss.loaderHeight)/2 + 'px');\r
+                               slideshow.ss.loader.css('left', (slidePos.wb - slideshow.ss.loaderWidth)/2 + 'px');\r
+                               slideshow.ss.loader.css('display', 'block');\r
+                       }\r
+                       \r
+                       //getimage\r
+                       images = jQuery('img', slideshow.ss.holder);\r
+                       if (images.size() > 0) {\r
+                               images.fadeOut(\r
+                                       slideshow.ss.fadeDuration,\r
+                                       jQuery.islideshow.showImage\r
+                               );\r
+                       } else {\r
+                               lnk = jQuery('a', slideshow.ss.slideslinks.o).get(slide-1);\r
+                               jQuery(lnk).addClass(slideshow.ss.slideslinks.activeLinkClass);\r
+                               var img = new Image();\r
+                               img.slideshow = jQuery.attr(slideshow,'id');\r
+                               img.slide = slide-1;\r
+                               img.src = slideshow.ss.images[slideshow.ss.currentslide-1].src ;\r
+                               if (img.complete) {\r
+                                       img.onload = null;\r
+                                       jQuery.islideshow.display.apply(img);\r
+                               } else {\r
+                                       img.onload = jQuery.islideshow.display;\r
+                               }\r
+                               //slideshow.ss.holder.html('<img src="' + slideshow.ss.images[slide-1].src + '" />');\r
+                               if (slideshow.ss.slideCaption) {\r
+                                       slideshow.ss.slideCaption.o.html(slideshow.ss.images[slide-1].caption);\r
+                               }\r
+                               //jQuery('img', slideshow.ss.holder).bind('load',jQuery.slideshowDisplay);\r
+                       }\r
+               }\r
+       },\r
+       showImage : function()\r
+       {\r
+               slideshow = this.parentNode.parentNode;\r
+               slideshow.ss.holder.css('display','none');\r
+               if (slideshow.ss.slideslinks.activeLinkClass) {\r
+                       lnk = jQuery('a', slideshow.ss.slideslinks.o).removeClass(slideshow.ss.slideslinks.activeLinkClass).get(slideshow.ss.currentslide - 1);\r
+                       jQuery(lnk).addClass(slideshow.ss.slideslinks.activeLinkClass);\r
+               }\r
+               //slideshow.ss.holder.html('<img src="' + slideshow.ss.images[slideshow.ss.currentslide - 1].src + '" />');\r
+               \r
+               var img = new Image();\r
+               img.slideshow = jQuery.attr(slideshow,'id');\r
+               img.slide = slideshow.ss.currentslide - 1;\r
+               img.src = slideshow.ss.images[slideshow.ss.currentslide - 1].src ;\r
+               if (img.complete) {\r
+                       img.onload = null;\r
+                       jQuery.islideshow.display.apply(img);\r
+               } else {\r
+                       img.onload = jQuery.islideshow.display;\r
+               }\r
+               if (slideshow.ss.slideCaption) {\r
+                       slideshow.ss.slideCaption.o.html(slideshow.ss.images[slideshow.ss.currentslide-1].caption);\r
+               }\r
+               //jQuery('img', slideshow.ss.holder).bind('load',jQuery.slideshowDisplay);\r
+       },\r
+       display : function ()\r
+       {\r
+               slideshow = document.getElementById(this.slideshow);\r
+               if (slideshow.ss.prevslide) {\r
+                       slideshow.ss.prevslide.o.css('display', 'none');\r
+               }\r
+               if (slideshow.ss.nextslide) {\r
+                       slideshow.ss.nextslide.o.css('display', 'none');\r
+               }\r
+               slidePos = jQuery.iUtil.getSize(slideshow);\r
+               y = 0;\r
+               if (slideshow.ss.slideslinks) {\r
+                       if (slideshow.ss.slideslinks.linksPosition == 'top') {\r
+                               y += slideshow.ss.slideslinks.dimm.hb;\r
+                       } else {\r
+                               slidePos.h -= slideshow.ss.slideslinks.dimm.hb;\r
+                       }\r
+               }\r
+               if (slideshow.ss.slideCaption) {\r
+                       if (slideshow.ss.slideCaption && slideshow.ss.slideCaption.captionPosition == 'top') {\r
+                               y += slideshow.ss.slideCaption.dimm.hb;\r
+                       } else {\r
+                               slidePos.h -= slideshow.ss.slideCaption.dimm.hb;\r
+                       }\r
+               }\r
+               par = jQuery('.slideshowHolder', slideshow);\r
+               y = y + (slidePos.h - this.height)/2 ;\r
+               x = (slidePos.wb - this.width)/2;\r
+               slideshow.ss.holder.css('top', y + 'px').css('left', x + 'px').html('<img src="' + this.src + '" />');\r
+               slideshow.ss.holder.fadeIn(slideshow.ss.fadeDuration);\r
+               nextslide = slideshow.ss.currentslide + 1;\r
+               if (nextslide > slideshow.ss.images.length) {\r
+                       nextslide = 1;\r
+               }\r
+               prevslide = slideshow.ss.currentslide - 1;\r
+               if (prevslide < 1) {\r
+                       prevslide = slideshow.ss.images.length;\r
+               }\r
+               slideshow.ss.nextslide.o\r
+                               .css('display','block')\r
+                               .css('top', y + 'px')\r
+                               .css('left', x + 2 * this.width/3 + 'px')\r
+                               .css('width', this.width/3 + 'px')\r
+                               .css('height', this.height + 'px')\r
+                               .attr('title', slideshow.ss.images[nextslide-1].caption);\r
+               slideshow.ss.nextslide.o.get(0).href = '#' + nextslide + jQuery.attr(slideshow, 'id');\r
+               slideshow.ss.prevslide.o\r
+                               .css('display','block')\r
+                               .css('top', y + 'px')\r
+                               .css('left', x + 'px')\r
+                               .css('width', this.width/3 + 'px')\r
+                               .css('height', this.height + 'px')\r
+                               .attr('title', slideshow.ss.images[prevslide-1].caption);\r
+               slideshow.ss.prevslide.o.get(0).href = '#' + prevslide + jQuery.attr(slideshow, 'id');\r
+       },\r
+       build : function(o)\r
+       {\r
+               if (!o || !o.container || jQuery.islideshow.slideshows[o.container])\r
+                       return;\r
+               var container = jQuery('#' + o.container);\r
+               var el = container.get(0);\r
+               \r
+               if (el.style.position != 'absolute' && el.style.position != 'relative') {\r
+                       el.style.position = 'relative';\r
+               }\r
+               el.style.overflow = 'hidden';\r
+               if (container.size() == 0)\r
+                       return;\r
+               el.ss = {};\r
+               \r
+               el.ss.images = o.images ? o.images : [];\r
+               el.ss.random = o.random && o.random == true || false;\r
+               imgs = el.getElementsByTagName('IMG');\r
+               for(i = 0; i< imgs.length; i++) {\r
+                       indic = el.ss.images.length;\r
+                       el.ss.images[indic] = {src:imgs[i].src, caption:imgs[i].title||imgs[i].alt||''};\r
+               }\r
+               \r
+               if (el.ss.images.length == 0) {\r
+                       return;\r
+               }\r
+               \r
+               el.ss.oP = jQuery.extend(\r
+                               jQuery.iUtil.getPosition(el),\r
+                               jQuery.iUtil.getSize(el)\r
+                       );\r
+               el.ss.oPad = jQuery.iUtil.getPadding(el);\r
+               el.ss.oBor = jQuery.iUtil.getBorder(el);\r
+               t = parseInt(el.ss.oPad.t) + parseInt(el.ss.oBor.t);\r
+               b = parseInt(el.ss.oPad.b) + parseInt(el.ss.oBor.b);\r
+               jQuery('img', el).remove();\r
+               el.ss.fadeDuration = o.fadeDuration ? o.fadeDuration : 500;\r
+               if (o.linksPosition || o.linksClass || o.activeLinkClass) {\r
+                       el.ss.slideslinks = {};\r
+                       container.append('<div class="slideshowLinks"></div>');\r
+                       el.ss.slideslinks.o = jQuery('.slideshowLinks', el);\r
+                       if (o.linksClass) {\r
+                               el.ss.slideslinks.linksClass = o.linksClass;\r
+                               el.ss.slideslinks.o.addClass(o.linksClass);\r
+                       }\r
+                       if (o.activeLinkClass) {\r
+                               el.ss.slideslinks.activeLinkClass = o.activeLinkClass;\r
+                       }\r
+                       el.ss.slideslinks.o.css('position','absolute').css('width', el.ss.oP.w + 'px');\r
+                       if (o.linksPosition && o.linksPosition == 'top') {\r
+                               el.ss.slideslinks.linksPosition = 'top';\r
+                               el.ss.slideslinks.o.css('top',t + 'px');\r
+                       } else {\r
+                               el.ss.slideslinks.linksPosition = 'bottom';\r
+                               el.ss.slideslinks.o.css('bottom',b + 'px');\r
+                       }\r
+                       el.ss.slideslinks.linksSeparator = o.linksSeparator ? o.linksSeparator : ' ';\r
+                       for (var i=0; i<el.ss.images.length; i++) {\r
+                               indic = parseInt(i) + 1;\r
+                               el.ss.slideslinks.o.append('<a href="#' + indic + o.container + '" class="slideshowLink" title="' + el.ss.images[i].caption + '">' + indic + '</a>' + (indic != el.ss.images.length ? el.ss.slideslinks.linksSeparator : ''));\r
+                       }\r
+                       jQuery('a', el.ss.slideslinks.o).bind(\r
+                               'click',\r
+                               function()\r
+                               {\r
+                                       jQuery.islideshow.go({link:this})\r
+                               }\r
+                       );\r
+                       el.ss.slideslinks.dimm = jQuery.iUtil.getSize(el.ss.slideslinks.o.get(0));\r
+               }\r
+               if (o.captionPosition || o.captionClass) {\r
+                       el.ss.slideCaption = {};\r
+                       container.append('<div class="slideshowCaption">&nbsp;</div>');\r
+                       el.ss.slideCaption.o = jQuery('.slideshowCaption', el);\r
+                       if (o.captionClass) {\r
+                               el.ss.slideCaption.captionClass = o.captionClass;\r
+                               el.ss.slideCaption.o.addClass(o.captionClass);\r
+                       }\r
+                       el.ss.slideCaption.o.css('position','absolute').css('width', el.ss.oP.w + 'px');\r
+                       if (o.captionPosition&& o.captionPosition == 'top') {\r
+                               el.ss.slideCaption.captionPosition = 'top';\r
+                               el.ss.slideCaption.o.css('top', (el.ss.slideslinks && el.ss.slideslinks.linksPosition == 'top' ? el.ss.slideslinks.dimm.hb + t : t) + 'px');\r
+                       } else {\r
+                               el.ss.slideCaption.captionPosition = 'bottom';\r
+                               el.ss.slideCaption.o.css('bottom', (el.ss.slideslinks && el.ss.slideslinks.linksPosition == 'bottom' ? el.ss.slideslinks.dimm.hb + b : b) + 'px');\r
+                       }\r
+                       el.ss.slideCaption.dimm = jQuery.iUtil.getSize(el.ss.slideCaption.o.get(0));\r
+               }\r
+               \r
+               if (o.nextslideClass) {\r
+                       el.ss.nextslide = {nextslideClass:o.nextslideClass};\r
+                       container.append('<a href="#2' + o.container + '" class="slideshowNextSlide">&nbsp;</a>');\r
+                       el.ss.nextslide.o = jQuery('.slideshowNextSlide', el);\r
+                       el.ss.nextslide.o.css('position', 'absolute').css('display', 'none').css('overflow','hidden').css('fontSize', '30px').addClass(el.ss.nextslide.nextslideClass);\r
+                       el.ss.nextslide.o.bind('click', jQuery.islideshow.gonext);\r
+               }\r
+               if (o.prevslideClass) {\r
+                       el.ss.prevslide= {prevslideClass:o.prevslideClass};\r
+                       container.append('<a href="#0' + o.container + '" class="slideshowPrevslide">&nbsp;</a>');\r
+                       el.ss.prevslide.o = jQuery('.slideshowPrevslide', el);\r
+                       el.ss.prevslide.o.css('position', 'absolute').css('display', 'none').css('overflow','hidden').css('fontSize', '30px').addClass(el.ss.prevslide.prevslideClass);\r
+                       el.ss.prevslide.o.bind('click', jQuery.islideshow.goprev);\r
+               }\r
+               \r
+               container.prepend('<div class="slideshowHolder"></div>');\r
+               el.ss.holder = jQuery('.slideshowHolder', el);\r
+               el.ss.holder.css('position','absolute').css('top','0px').css('left','0px').css('display', 'none');\r
+               if (o.loader) {\r
+                       container.prepend('<div class="slideshowLoader" style="display: none;"><img src="' + o.loader + '" /></div>');\r
+                       el.ss.loader = jQuery('.slideshowLoader', el);\r
+                       el.ss.loader.css('position', 'absolute');\r
+                       var img = new Image();\r
+                       img.slideshow = o.container;\r
+                       img.src = o.loader;\r
+                       if (img.complete) {\r
+                               img.onload = null;\r
+                               jQuery.islideshow.go({loader:img});\r
+                       } else {\r
+                               img.onload = function()\r
+                               {\r
+                                       jQuery.islideshow.go({loader:this});\r
+                               };\r
+                       }\r
+               } else {\r
+                       jQuery.islideshow.go({container:el});\r
+               }\r
+               \r
+               if(o.autoplay) {\r
+                       time = parseInt(o.autoplay) * 1000;\r
+               }\r
+               jQuery.islideshow.slideshows[o.container] = o.autoplay ? window.setInterval('jQuery.islideshow.timer(\'' + o.container + '\')', time) : null;\r
+       }\r
+};\r
+jQuery.slideshow = jQuery.islideshow.build;
\ No newline at end of file
diff --git a/scripts/interface/isortables.js b/scripts/interface/isortables.js
new file mode 100644 (file)
index 0000000..6568324
--- /dev/null
@@ -0,0 +1,392 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * Sortables\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ */\r
+\r
+/**\r
+ * Allows you to resort elements within a container by dragging and dropping. Requires\r
+ * the Draggables and Droppables plugins. The container and each item inside the container\r
+ * must have an ID. Sortables are especially useful for lists.\r
+ * \r
+ * @see Plugins/Interface/Draggable\r
+ * @see Plugins/Interface/Droppable\r
+ * @author Stefan Petre\r
+ * @name Sortable\r
+ * @cat Plugins/Interface\r
+ * @param Hash options        A hash of options\r
+ * @option String accept      The class name for items inside the container (mandatory)\r
+ * @option String activeclass The class for the container when one of its items has started to move\r
+ * @option String hoverclass  The class for the container when an acceptable item is inside it\r
+ * @option String helperclass The helper is used to point to the place where the item will be \r
+ *                            moved. This is the class for the helper.\r
+ * @option Float opacity      Opacity (between 0 and 1) of the item while being dragged\r
+ * @option Boolean ghosting   When true, the sortable is ghosted when dragged\r
+ * @option String tolerance   Either 'pointer', 'intersect', or 'fit'. See Droppable for more details\r
+ * @option Boolean fit        When true, sortable must be inside the container in order to drop\r
+ * @option Integer fx         Duration for the effect applied to the sortable\r
+ * @option Function onchange  Callback that gets called when the sortable list changed. It takes\r
+ *                            an array of serialized elements\r
+ * @option Boolean floats     True if the sorted elements are floated\r
+ * @option String containment Use 'parent' to constrain the drag to the container\r
+ * @option String axis        Use 'horizontally' or 'vertically' to constrain dragging to an axis\r
+ * @option String handle      The jQuery selector that indicates the draggable handle\r
+ * @option DOMElement handle  The node that indicates the draggable handle\r
+ * @option Function onHover   Callback that is called when an acceptable item is dragged over the\r
+ *                            container. Gets the hovering DOMElement as a parameter\r
+ * @option Function onOut     Callback that is called when an acceptable item leaves the container.\r
+ *                            Gets the leaving DOMElement as a parameter\r
+ * @option Object cursorAt    The mouse cursor will be moved to the offset on the dragged item\r
+ *                            indicated by the object, which takes "top", "bottom", "left", and\r
+ *                            "right" keys\r
+ * @option Function onStart   Callback function triggered when the dragging starts\r
+ * @option Function onStop    Callback function triggered when the dragging stops\r
+ * @example                   $('ul').Sortable(\r
+ *                             {\r
+ *                                     accept : 'sortableitem',\r
+ *                                     activeclass : 'sortableactive',\r
+ *                                             hoverclass : 'sortablehover',\r
+ *                                             helperclass : 'sorthelper',\r
+ *                                             opacity:        0.5,\r
+ *                                             fit :   false\r
+ *                                     }\r
+ *                             )\r
+ */\r
+\r
+jQuery.iSort = {\r
+       changed : [],\r
+       collected : {},\r
+       helper : false,\r
+       inFrontOf: null,\r
+       \r
+       start : function ()\r
+       {\r
+               if (jQuery.iDrag.dragged == null) {\r
+                       return;\r
+               }\r
+               var shs, margins,c, cs;\r
+               \r
+               jQuery.iSort.helper.get(0).className = jQuery.iDrag.dragged.dragCfg.hpc;\r
+               shs = jQuery.iSort.helper.get(0).style;\r
+               shs.display = 'block';\r
+               jQuery.iSort.helper.oC = jQuery.extend(\r
+                       jQuery.iUtil.getPosition(jQuery.iSort.helper.get(0)),\r
+                       jQuery.iUtil.getSize(jQuery.iSort.helper.get(0))\r
+               );\r
+               \r
+               shs.width = jQuery.iDrag.dragged.dragCfg.oC.wb + 'px';\r
+               shs.height = jQuery.iDrag.dragged.dragCfg.oC.hb + 'px';\r
+               //shs.cssFloat = jQuery.iDrag.dragged.dragCfg.oF;\r
+               margins = jQuery.iUtil.getMargins(jQuery.iDrag.dragged);\r
+               shs.marginTop = margins.t;\r
+               shs.marginRight = margins.r;\r
+               shs.marginBottom = margins.b;\r
+               shs.marginLeft = margins.l;\r
+               if (jQuery.iDrag.dragged.dragCfg.ghosting == true) {\r
+                       c = jQuery.iDrag.dragged.cloneNode(true);\r
+                       cs = c.style;\r
+                       cs.marginTop = '0px';\r
+                       cs.marginRight = '0px';\r
+                       cs.marginBottom = '0px';\r
+                       cs.marginLeft = '0px';\r
+                       cs.display = 'block';\r
+                       jQuery.iSort.helper.empty().append(c);\r
+               }\r
+               jQuery(jQuery.iDrag.dragged).after(jQuery.iSort.helper.get(0));\r
+               jQuery.iDrag.dragged.style.display = 'none';\r
+       },\r
+       \r
+       check : function (e)\r
+       {\r
+               if (!e.dragCfg.so && jQuery.iDrop.overzone.sortable) {\r
+                       if (e.dragCfg.onStop)\r
+                               e.dragCfg.onStop.apply(dragged);\r
+                       jQuery(e).css('position', e.dragCfg.initialPosition || e.dragCfg.oP);\r
+                       jQuery(e).DraggableDestroy();\r
+                       jQuery(jQuery.iDrop.overzone).SortableAddItem(e);\r
+               }\r
+               jQuery.iSort.helper.removeClass(e.dragCfg.hpc).html('&nbsp;');\r
+               jQuery.iSort.inFrontOf = null;\r
+               var shs = jQuery.iSort.helper.get(0).style;\r
+               shs.display = 'none';\r
+               jQuery.iSort.helper.after(e);\r
+               if (e.dragCfg.fx > 0) {\r
+                       jQuery(e).fadeIn(e.dragCfg.fx);\r
+               }\r
+               jQuery('body').append(jQuery.iSort.helper.get(0));\r
+               var ts = [];\r
+               var fnc = false;\r
+               for(var i=0; i<jQuery.iSort.changed.length; i++){\r
+                       var iEL = jQuery.iDrop.zones[jQuery.iSort.changed[i]].get(0);\r
+                       var id = jQuery.attr(iEL, 'id');\r
+                       var ser = jQuery.iSort.serialize(id);\r
+                       if (iEL.dropCfg.os != ser.hash) {\r
+                               iEL.dropCfg.os = ser.hash;\r
+                               if (fnc == false && iEL.dropCfg.onChange) {\r
+                                       fnc = iEL.dropCfg.onChange;\r
+                               }\r
+                               ser.id = id;\r
+                               ts[ts.length] = ser;\r
+                       }\r
+               }\r
+               jQuery.iSort.changed = [];\r
+               if (fnc != false && ts.length > 0) {\r
+                       fnc(ts);\r
+               }\r
+       },\r
+       \r
+       checkhover : function(e,o)\r
+       {\r
+               if (!jQuery.iDrag.dragged)\r
+                       return;\r
+               var cur = false;\r
+               var i = 0;\r
+               if ( e.dropCfg.el.size() > 0) {\r
+                       for (i = e.dropCfg.el.size(); i >0; i--) {\r
+                               if (e.dropCfg.el.get(i-1) != jQuery.iDrag.dragged) {\r
+                                       if (!e.sortCfg.floats) {\r
+                                               if ( \r
+                                               (e.dropCfg.el.get(i-1).pos.y + e.dropCfg.el.get(i-1).pos.hb/2) > jQuery.iDrag.dragged.dragCfg.ny  \r
+                                               ) {\r
+                                                       cur = e.dropCfg.el.get(i-1);\r
+                                               } else {\r
+                                                       break;\r
+                                               }\r
+                                       } else {\r
+                                               if (\r
+                                               (e.dropCfg.el.get(i-1).pos.x + e.dropCfg.el.get(i-1).pos.wb/2) > jQuery.iDrag.dragged.dragCfg.nx && \r
+                                               (e.dropCfg.el.get(i-1).pos.y + e.dropCfg.el.get(i-1).pos.hb/2) > jQuery.iDrag.dragged.dragCfg.ny  \r
+                                               ) {\r
+                                                       cur = e.dropCfg.el.get(i-1);\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+               //helpos = jQuery.iUtil.getPos(jQuery.iSort.helper.get(0));\r
+               if (cur && jQuery.iSort.inFrontOf != cur) {\r
+                       jQuery.iSort.inFrontOf = cur;\r
+                       jQuery(cur).before(jQuery.iSort.helper.get(0));\r
+               } else if(!cur && (jQuery.iSort.inFrontOf != null || jQuery.iSort.helper.get(0).parentNode != e) ) {\r
+                       jQuery.iSort.inFrontOf = null;\r
+                       jQuery(e).append(jQuery.iSort.helper.get(0));\r
+               }\r
+               jQuery.iSort.helper.get(0).style.display = 'block';\r
+       },\r
+       \r
+       measure : function (e)\r
+       {\r
+               if (jQuery.iDrag.dragged == null) {\r
+                       return;\r
+               }\r
+               e.dropCfg.el.each (\r
+                       function ()\r
+                       {\r
+                               this.pos = jQuery.extend(\r
+                                       jQuery.iUtil.getSizeLite(this),\r
+                                       jQuery.iUtil.getPositionLite(this)\r
+                               );\r
+                       }\r
+               );\r
+       },\r
+       \r
+       serialize : function(s)\r
+       {\r
+               var i;\r
+               var h = '';\r
+               var o = {};\r
+               if (s) {\r
+                       if (jQuery.iSort.collected[s] ) {\r
+                               o[s] = [];\r
+                               jQuery('#' + s + ' .' + jQuery.iSort.collected[s]).each(\r
+                                       function ()\r
+                                       {\r
+                                               if (h.length > 0) {\r
+                                                       h += '&';\r
+                                               }\r
+                                               h += s + '[]=' + jQuery.attr(this,'id');\r
+                                               o[s][o[s].length] = jQuery.attr(this,'id');\r
+                                       }\r
+                               );\r
+                       } else {\r
+                               for ( a in s) {\r
+                                       if (jQuery.iSort.collected[s[a]] ) {\r
+                                               o[s[a]] = [];                   \r
+                                               jQuery('#' + s[a] + ' .' + jQuery.iSort.collected[s[a]]).each(\r
+                                                       function ()\r
+                                                       {\r
+                                                               if (h.length > 0) {\r
+                                                                       h += '&';\r
+                                                               }\r
+                                                               h += s[a] + '[]=' + jQuery.attr(this,'id');\r
+                                                               o[s[a]][o[s[a]].length] = jQuery.attr(this,'id');\r
+                                                       }\r
+                                               );\r
+                                       }\r
+                               }\r
+                       }\r
+               } else {\r
+                       for ( i in jQuery.iSort.collected){\r
+                               o[i] = [];\r
+                               jQuery('#' + i + ' .' + jQuery.iSort.collected[i]).each(\r
+                                       function ()\r
+                                       {\r
+                                               if (h.length > 0) {\r
+                                                       h += '&';\r
+                                               }\r
+                                               h += i + '[]=' + jQuery.attr(this,'id');\r
+                                               o[i][o[i].length] = jQuery.attr(this,'id');\r
+                                       }\r
+                               );\r
+                       }\r
+               }\r
+               return {hash:h, o:o};\r
+       },\r
+       \r
+       addItem : function (e)\r
+       {\r
+               if ( !e.childNodes ) {\r
+                       return;\r
+               }\r
+               return this.each(\r
+                       function ()\r
+                       {\r
+                               if(!this.sortCfg || !jQuery(e).is('.' +  this.sortCfg.accept))\r
+                                       jQuery(e).addClass(this.sortCfg.accept);\r
+                               jQuery(e).Draggable(this.sortCfg.dragCfg);\r
+                       }\r
+               );\r
+       },\r
+       \r
+       destroy: function()\r
+       {\r
+               return this.each(\r
+                       function()\r
+                       {\r
+                               jQuery('.' + this.sortCfg.accept).DraggableDestroy();\r
+                               jQuery(this).DroppableDestroy();\r
+                               this.sortCfg = null;\r
+                               this.isSortable = null;\r
+                       }\r
+               );\r
+       },\r
+       \r
+       build : function (o)\r
+       {\r
+               if (o.accept && jQuery.iUtil && jQuery.iDrag && jQuery.iDrop) {\r
+                       if (!jQuery.iSort.helper) {\r
+                               jQuery('body',document).append('<div id="sortHelper">&nbsp;</div>');\r
+                               jQuery.iSort.helper = jQuery('#sortHelper');\r
+                               jQuery.iSort.helper.get(0).style.display = 'none';\r
+                       }\r
+                       this.Droppable(\r
+                               {\r
+                                       accept :  o.accept,\r
+                                       activeclass : o.activeclass ? o.activeclass : false,\r
+                                       hoverclass : o.hoverclass ? o.hoverclass : false,\r
+                                       helperclass : o.helperclass ? o.helperclass : false,\r
+                                       /*onDrop: function (drag, fx) \r
+                                                       {\r
+                                                               jQuery.iSort.helper.after(drag);\r
+                                                               if (fx > 0) {\r
+                                                                       jQuery(drag).fadeIn(fx);\r
+                                                               }\r
+                                                       },*/\r
+                                       onHover: o.onHover||o.onhover,\r
+                                       onOut: o.onOut||o.onout,\r
+                                       sortable : true,\r
+                                       onChange :      o.onChange||o.onchange,\r
+                                       fx : o.fx ? o.fx : false,\r
+                                       ghosting : o.ghosting ? true : false,\r
+                                       tolerance: o.tolerance ? o.tolerance : 'intersect'\r
+                               }\r
+                       );\r
+                       \r
+                       return this.each(\r
+                               function()\r
+                               {\r
+                                       var dragCfg = {\r
+                                               revert : o.revert? true : false,\r
+                                               zindex : 3000,\r
+                                               opacity : o.opacity ? parseFloat(o.opacity) : false,\r
+                                               hpc : o.helperclass ? o.helperclass : false,\r
+                                               fx : o.fx ? o.fx : false,\r
+                                               so : true,\r
+                                               ghosting : o.ghosting ? true : false,\r
+                                               handle: o.handle ? o.handle : null,\r
+                                               containment: o.containment ? o.containment : null,\r
+                                               onStart : o.onStart && o.onStart.constructor == Function ? o.onStart : false,\r
+                                               onDrag : o.onDrag && o.onDrag.constructor == Function ? o.onDrag : false,\r
+                                               onStop : o.onStop && o.onStop.constructor == Function ? o.onStop : false,\r
+                                               axis : /vertically|horizontally/.test(o.axis) ? o.axis : false,\r
+                                               snapDistance : o.snapDistance ? parseInt(o.snapDistance)||0 : false,\r
+                                               cursorAt: o.cursorAt ? o.cursorAt : false\r
+                                       };\r
+                                       jQuery('.' + o.accept, this).Draggable(dragCfg);\r
+                                       this.isSortable = true;\r
+                                       this.sortCfg = {\r
+                                               accept :  o.accept,\r
+                                               revert : o.revert? true : false,\r
+                                               zindex : 3000,\r
+                                               opacity : o.opacity ? parseFloat(o.opacity) : false,\r
+                                               hpc : o.helperclass ? o.helperclass : false,\r
+                                               fx : o.fx ? o.fx : false,\r
+                                               so : true,\r
+                                               ghosting : o.ghosting ? true : false,\r
+                                               handle: o.handle ? o.handle : null,\r
+                                               containment: o.containment ? o.containment : null,\r
+                                               floats: o.floats ? true : false,\r
+                                               dragCfg : dragCfg\r
+                                       }\r
+                               }\r
+                       );\r
+               }\r
+       }\r
+};\r
+\r
+jQuery.fn.extend(\r
+       {\r
+               Sortable : jQuery.iSort.build,\r
+               /**\r
+                * A new item can be added to a sortable by adding it to the DOM and then adding it via\r
+                * SortableAddItem. \r
+                *\r
+                * @name SortableAddItem\r
+                * @param DOMElement elem A DOM Element to add to the sortable list\r
+                * @example $('#sortable1').append('<li id="newitem">new item</li>')\r
+                *                         .SortableAddItem($("#new_item")[0])\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                */\r
+               SortableAddItem : jQuery.iSort.addItem,\r
+               /**\r
+                * Destroy a sortable\r
+                *\r
+                * @name SortableDestroy\r
+                * @example $('#sortable1').SortableDestroy();\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                */\r
+               SortableDestroy: jQuery.iSort.destroy\r
+       }\r
+);\r
+\r
+/**\r
+ * This function returns the hash and an object (can be used as arguments for $.post) for every \r
+ * sortable in the page or specific sortables. The hash is based on the 'id' attributes of \r
+ * container and items.\r
+ *\r
+ * @params String sortable The id of the sortable to serialize\r
+ * @name $.SortSerialize\r
+ * @type String\r
+ * @cat Plugins/Interface\r
+ */\r
+\r
+jQuery.SortSerialize = jQuery.iSort.serialize;
\ No newline at end of file
diff --git a/scripts/interface/itooltip.js b/scripts/interface/itooltip.js
new file mode 100644 (file)
index 0000000..1ef350f
--- /dev/null
@@ -0,0 +1,184 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * Tooltip\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ */\r
+\r
+/**\r
+ * Creates tooltips using title attribute\r
+ *\r
+ * \r
+ * \r
+ * @name ToolTip\r
+ * @description Creates tooltips using title attribute\r
+ * @param Hash hash A hash of parameters\r
+ * @option String position tooltip's position ['top'|'left'|'right'|'bottom'|'mouse']\r
+ * @options Function onShow (optional) A function to be executed whenever the tooltip is displayed\r
+ * @options Function onHide (optional) A function to be executed whenever the tooltip is hidden\r
+ *\r
+ * @type jQuery\r
+ * @cat Plugins/Interface\r
+ * @author Stefan Petre\r
+ */\r
+jQuery.iTooltip = {\r
+       current : null,\r
+       focused : false,\r
+       oldTitle : null,\r
+       focus : function(e)\r
+       {\r
+               jQuery.iTooltip.focused = true;\r
+               jQuery.iTooltip.show(e, this, true);\r
+       },\r
+       hidefocused : function(e)\r
+       {\r
+               if (jQuery.iTooltip.current != this)\r
+                       return ;\r
+               jQuery.iTooltip.focused = false;\r
+               jQuery.iTooltip.hide(e, this);\r
+       },\r
+       show : function(e, el, focused)\r
+       {\r
+               if (jQuery.iTooltip.current != null)\r
+                       return ;\r
+               if (!el) {\r
+                       el = this;\r
+               }\r
+               \r
+               jQuery.iTooltip.current = el;\r
+               pos = jQuery.extend(\r
+                       jQuery.iUtil.getPosition(el),\r
+                       jQuery.iUtil.getSize(el)\r
+               );\r
+               jEl = jQuery(el);\r
+               title = jEl.attr('title');\r
+               href = jEl.attr('href');\r
+               if (title) {\r
+                       jQuery.iTooltip.oldTitle = title;\r
+                       jEl.attr('title','');\r
+                       jQuery('#tooltipTitle').html(title);\r
+                       if (href)\r
+                               jQuery('#tooltipURL').html(href.replace('http://', ''));\r
+                       else \r
+                               jQuery('#tooltipURL').html('');\r
+                       helper = jQuery('#tooltipHelper');\r
+                       if(el.tooltipCFG.className){\r
+                               helper.get(0).className = el.tooltipCFG.className;\r
+                       } else {\r
+                               helper.get(0).className = '';\r
+                       }\r
+                       helperSize = jQuery.iUtil.getSize(helper.get(0));\r
+                       filteredPosition = focused && el.tooltipCFG.position == 'mouse' ? 'bottom' : el.tooltipCFG.position;\r
+                       \r
+                       switch (filteredPosition) {\r
+                               case 'top':\r
+                                       ny = pos.y - helperSize.hb;\r
+                                       nx = pos.x;\r
+                               break;\r
+                               case 'left' :\r
+                                       ny = pos.y;\r
+                                       nx = pos.x - helperSize.wb;\r
+                               break;\r
+                               case 'right' :\r
+                                       ny = pos.y;\r
+                                       nx = pos.x + pos.wb;\r
+                               break;\r
+                               case 'mouse' :\r
+                                       jQuery('body').bind('mousemove', jQuery.iTooltip.mousemove);\r
+                                       pointer = jQuery.iUtil.getPointer(e);\r
+                                       ny = pointer.y + 15;\r
+                                       nx = pointer.x + 15;\r
+                               break;\r
+                               default :\r
+                                       ny = pos.y + pos.hb;\r
+                                       nx = pos.x;\r
+                               break;\r
+                       }\r
+                       helper.css(\r
+                               {\r
+                                       top     : ny + 'px',\r
+                                       left    : nx + 'px'\r
+                               }\r
+                       );\r
+                       if (el.tooltipCFG.delay == false) {\r
+                               helper.show();\r
+                       } else {\r
+                               helper.fadeIn(el.tooltipCFG.delay);\r
+                       }\r
+                       if (el.tooltipCFG.onShow) \r
+                               el.tooltipCFG.onShow.apply(el);\r
+                       jEl.bind('mouseout',jQuery.iTooltip.hide)\r
+                          .bind('blur',jQuery.iTooltip.hidefocused);\r
+               }\r
+       },\r
+       mousemove : function(e)\r
+       {\r
+               if (jQuery.iTooltip.current == null) {\r
+                       jQuery('body').unbind('mousemove', jQuery.iTooltip.mousemove);\r
+                       return; \r
+               }\r
+               pointer = jQuery.iUtil.getPointer(e);\r
+               jQuery('#tooltipHelper').css(\r
+                       {\r
+                               top     : pointer.y + 15 + 'px',\r
+                               left    : pointer.x + 15 + 'px'\r
+                       }\r
+               );\r
+       },\r
+       hide : function(e, el)\r
+       {\r
+               if (!el) {\r
+                       el = this;\r
+               }\r
+               if (jQuery.iTooltip.focused != true && jQuery.iTooltip.current == el) {\r
+                       jQuery.iTooltip.current = null;\r
+                       jQuery('#tooltipHelper').fadeOut(1);\r
+                       jQuery(el)\r
+                               .attr('title',jQuery.iTooltip.oldTitle)\r
+                               .unbind('mouseout', jQuery.iTooltip.hide)\r
+                               .unbind('blur', jQuery.iTooltip.hidefocused);\r
+                       if (el.tooltipCFG.onHide) \r
+                               el.tooltipCFG.onHide.apply(el);\r
+                       jQuery.iTooltip.oldTitle = null;\r
+               }\r
+       },\r
+       build : function(options)\r
+       {\r
+               if (!jQuery.iTooltip.helper)\r
+               {\r
+                       jQuery('body').append('<div id="tooltipHelper"><div id="tooltipTitle"></div><div id="tooltipURL"></div></div>');\r
+                       jQuery('#tooltipHelper').css(\r
+                               {\r
+                                       position:       'absolute',\r
+                                       zIndex:         3000,\r
+                                       display:        'none'\r
+                               }\r
+                       );\r
+                       jQuery.iTooltip.helper = true;\r
+               }\r
+               return this.each(\r
+                       function(){\r
+                               if(jQuery.attr(this,'title')) {\r
+                                       this.tooltipCFG = {\r
+                                               position        : /top|bottom|left|right|mouse/.test(options.position) ? options.position : 'bottom',\r
+                                               className       : options.className ? options.className : false,\r
+                                               delay           : options.delay ? options.delay : false,\r
+                                               onShow          : options.onShow && options.onShow.constructor == Function ? options.onShow : false,\r
+                                               onHide          : options.onHide && options.onHide.constructor == Function ? options.onHide : false\r
+                                       };\r
+                                       var el = jQuery(this);\r
+                                       el.bind('mouseover',jQuery.iTooltip.show);\r
+                                       el.bind('focus',jQuery.iTooltip.focus);\r
+                               }\r
+                       }\r
+               );\r
+       }\r
+};\r
+\r
+jQuery.fn.ToolTip = jQuery.iTooltip.build;
\ No newline at end of file
diff --git a/scripts/interface/ittabs.js b/scripts/interface/ittabs.js
new file mode 100644 (file)
index 0000000..54b9330
--- /dev/null
@@ -0,0 +1,92 @@
+/**\r
+ * Interface Elements for jQuery\r
+ * TTabs\r
+ * \r
+ * http://interface.eyecon.ro\r
+ * \r
+ * Copyright (c) 2006 Stefan Petre\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *   \r
+ *\r
+ *\r
+ */\r
+\r
+jQuery.iTTabs =\r
+{\r
+       doTab : function(e)\r
+       {\r
+               pressedKey = e.charCode || e.keyCode || -1;\r
+               if (pressedKey == 9) {\r
+                       if (window.event) {\r
+                               window.event.cancelBubble = true;\r
+                               window.event.returnValue = false;\r
+                       } else {\r
+                               e.preventDefault();\r
+                               e.stopPropagation();\r
+                       }\r
+                       if (this.createTextRange) {\r
+                               document.selection.createRange().text="\t";\r
+                               this.onblur = function() { this.focus(); this.onblur = null; };\r
+                       } else if (this.setSelectionRange) {\r
+                               start = this.selectionStart;\r
+                               end = this.selectionEnd;\r
+                               this.value = this.value.substring(0, start) + "\t" + this.value.substr(end);\r
+                               this.setSelectionRange(start + 1, start + 1);\r
+                               this.focus();\r
+                       }\r
+                       return false;\r
+               }\r
+       },\r
+       destroy : function()\r
+       {\r
+               return this.each(\r
+                       function()\r
+                       {\r
+                               if (this.hasTabsEnabled && this.hasTabsEnabled == true) {\r
+                                       jQuery(this).unbind('keydown', jQuery.iTTabs.doTab);\r
+                                       this.hasTabsEnabled = false;\r
+                               }\r
+                       }\r
+               );\r
+       },\r
+       build : function()\r
+       {\r
+               return this.each(\r
+                       function()\r
+                       {\r
+                               if (this.tagName == 'TEXTAREA' && (!this.hasTabsEnabled || this.hasTabsEnabled == false)) {\r
+                                       jQuery(this).bind('keydown', jQuery.iTTabs.doTab);\r
+                                       this.hasTabsEnabled = true;\r
+                               }\r
+                       }\r
+               );                      \r
+       }\r
+};\r
+\r
+jQuery.fn.extend (\r
+       {\r
+               /**\r
+                * Enable tabs in textareas\r
+                * \r
+                * @name EnableTabs\r
+                * @description Enable tabs in textareas\r
+                *\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               EnableTabs : jQuery.iTTabs.build,\r
+               /**\r
+                * Disable tabs in textareas\r
+                * \r
+                * @name DisableTabs\r
+                * @description Disable tabs in textareas\r
+                *\r
+                * @type jQuery\r
+                * @cat Plugins/Interface\r
+                * @author Stefan Petre\r
+                */\r
+               DisableTabs : jQuery.iTTabs.destroy\r
+       }\r
+);
\ No newline at end of file
diff --git a/scripts/interface/iutil.js b/scripts/interface/iutil.js
new file mode 100644 (file)
index 0000000..2dcba9f
--- /dev/null
@@ -0,0 +1,245 @@
+/**
+ * Interface Elements for jQuery
+ * utility function
+ *
+ * http://interface.eyecon.ro
+ *
+ * Copyright (c) 2006 Stefan Petre
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ *
+ */
+
+jQuery.iUtil = {
+       getPosition : function(e)
+       {
+               var x = 0;
+               var y = 0;
+               var es = e.style;
+               var restoreStyles = false;
+               if (jQuery(e).css('display') == 'none') {
+                       var oldVisibility = es.visibility;
+                       var oldPosition = es.position;
+                       restoreStyles = true;
+                       es.visibility = 'hidden';
+                       es.display = 'block';
+                       es.position = 'absolute';
+               }
+               var el = e;
+               while (el){
+                       x += el.offsetLeft + (el.currentStyle && !jQuery.browser.opera ?parseInt(el.currentStyle.borderLeftWidth)||0:0);
+                       y += el.offsetTop + (el.currentStyle && !jQuery.browser.opera ?parseInt(el.currentStyle.borderTopWidth)||0:0);
+                       el = el.offsetParent;
+               }
+               el = e;
+               while (el && el.tagName  && el.tagName.toLowerCase() != 'body')
+               {
+                       x -= el.scrollLeft||0;
+                       y -= el.scrollTop||0;
+                       el = el.parentNode;
+               }
+               if (restoreStyles == true) {
+                       es.display = 'none';
+                       es.position = oldPosition;
+                       es.visibility = oldVisibility;
+               }
+               return {x:x, y:y};
+       },
+       getPositionLite : function(el)
+       {
+               var x = 0, y = 0;
+               while(el) {
+                       x += el.offsetLeft || 0;
+                       y += el.offsetTop || 0;
+                       el = el.offsetParent;
+               }
+               return {x:x, y:y};
+       },
+       getSize : function(e)
+       {
+               var w = jQuery.css(e,'width');
+               var h = jQuery.css(e,'height');
+               var wb = 0;
+               var hb = 0;
+               var es = e.style;
+               if (jQuery(e).css('display') != 'none') {
+                       wb = e.offsetWidth;
+                       hb = e.offsetHeight;
+               } else {
+                       var oldVisibility = es.visibility;
+                       var oldPosition = es.position;
+                       es.visibility = 'hidden';
+                       es.display = 'block';
+                       es.position = 'absolute';
+                       wb = e.offsetWidth;
+                       hb = e.offsetHeight;
+                       es.display = 'none';
+                       es.position = oldPosition;
+                       es.visibility = oldVisibility;
+               }
+               return {w:w, h:h, wb:wb, hb:hb};
+       },
+       getSizeLite : function(el)
+       {
+               return {
+                       wb:el.offsetWidth||0,
+                       hb:el.offsetHeight||0
+               };
+       },
+       getClient : function(e)
+       {
+               var h, w, de;
+               if (e) {
+                       w = e.clientWidth;
+                       h = e.clientHeight;
+               } else {
+                       de = document.documentElement;
+                       w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
+                       h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
+               }
+               return {w:w,h:h};
+       },
+       getScroll : function (e)
+       {
+               var t=0, l=0, w=0, h=0, iw=0, ih=0;
+               if (e && e.nodeName.toLowerCase() != 'body') {
+                       t = e.scrollTop;
+                       l = e.scrollLeft;
+                       w = e.scrollWidth;
+                       h = e.scrollHeight;
+                       iw = 0;
+                       ih = 0;
+               } else  {
+                       if (document.documentElement) {
+                               t = document.documentElement.scrollTop;
+                               l = document.documentElement.scrollLeft;
+                               w = document.documentElement.scrollWidth;
+                               h = document.documentElement.scrollHeight;
+                       } else if (document.body) {
+                               t = document.body.scrollTop;
+                               l = document.body.scrollLeft;
+                               w = document.body.scrollWidth;
+                               h = document.body.scrollHeight;
+                       }
+                       iw = self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;
+                       ih = self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;
+               }
+               return { t: t, l: l, w: w, h: h, iw: iw, ih: ih };
+       },
+       getMargins : function(e, toInteger)
+       {
+               var el = jQuery(e);
+               var t = el.css('marginTop') || '';
+               var r = el.css('marginRight') || '';
+               var b = el.css('marginBottom') || '';
+               var l = el.css('marginLeft') || '';
+               if (toInteger)
+                       return {
+                               t: parseInt(t)||0,
+                               r: parseInt(r)||0,
+                               b: parseInt(b)||0,
+                               l: parseInt(l)
+                       };
+               else
+                       return {t: t, r: r,     b: b, l: l};
+       },
+       getPadding : function(e, toInteger)
+       {
+               var el = jQuery(e);
+               var t = el.css('paddingTop') || '';
+               var r = el.css('paddingRight') || '';
+               var b = el.css('paddingBottom') || '';
+               var l = el.css('paddingLeft') || '';
+               if (toInteger)
+                       return {
+                               t: parseInt(t)||0,
+                               r: parseInt(r)||0,
+                               b: parseInt(b)||0,
+                               l: parseInt(l)
+                       };
+               else
+                       return {t: t, r: r,     b: b, l: l};
+       },
+       getBorder : function(e, toInteger)
+       {
+               var el = jQuery(e);
+               var t = el.css('borderTopWidth') || '';
+               var r = el.css('borderRightWidth') || '';
+               var b = el.css('borderBottomWidth') || '';
+               var l = el.css('borderLeftWidth') || '';
+               if (toInteger)
+                       return {
+                               t: parseInt(t)||0,
+                               r: parseInt(r)||0,
+                               b: parseInt(b)||0,
+                               l: parseInt(l)||0
+                       };
+               else
+                       return {t: t, r: r,     b: b, l: l};
+       },
+       getPointer : function(event)
+       {
+               var x = event.pageX || (event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)) || 0;
+               var y = event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop)) || 0;
+               return {x:x, y:y};
+       },
+       traverseDOM : function(nodeEl, func)
+       {
+               func(nodeEl);
+               nodeEl = nodeEl.firstChild;
+               while(nodeEl){
+                       jQuery.iUtil.traverseDOM(nodeEl, func);
+                       nodeEl = nodeEl.nextSibling;
+               }
+       },
+       purgeEvents : function(nodeEl)
+       {
+               jQuery.iUtil.traverseDOM(
+                       nodeEl,
+                       function(el)
+                       {
+                               for(var attr in el){
+                                       if(typeof el[attr] === 'function') {
+                                               el[attr] = null;
+                                       }
+                               }
+                       }
+               );
+       },
+       centerEl : function(el, axis)
+       {
+               var clientScroll = jQuery.iUtil.getScroll();
+               var windowSize = jQuery.iUtil.getSize(el);
+               if (!axis || axis == 'vertically')
+                       jQuery(el).css(
+                               {
+                                       top: clientScroll.t + ((Math.max(clientScroll.h,clientScroll.ih) - clientScroll.t - windowSize.hb)/2) + 'px'
+                               }
+                       );
+               if (!axis || axis == 'horizontally')
+                       jQuery(el).css(
+                               {
+                                       left:   clientScroll.l + ((Math.max(clientScroll.w,clientScroll.iw) - clientScroll.l - windowSize.wb)/2) + 'px'
+                               }
+                       );
+       },
+       fixPNG : function (el, emptyGIF) {
+               var images = jQuery('img[@src*="png"]', el||document), png;
+               images.each( function() {
+                       png = this.src;                         
+                       this.src = emptyGIF;
+                       this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + png + "')";
+               });
+       }
+};
+
+// Helper function to support older browsers!
+[].indexOf || (Array.prototype.indexOf = function(v, n){
+       n = (n == null) ? 0 : n;
+       var m = this.length;
+       for (var i=n; i<m; i++)
+               if (this[i] == v)
+                       return i;
+       return -1;
+});
diff --git a/scripts/jquery.js b/scripts/jquery.js
new file mode 100644 (file)
index 0000000..f954b6b
--- /dev/null
@@ -0,0 +1 @@
+eval(function(p,a,c,k,e,d){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--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[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}('7(1C 1w.6=="T"){1w.T=1w.T;B 6=u(a,c){7(1w==q)v 1p 6(a,c);a=a||17;7(6.1t(a))v 1p 6(17)[6.E.27?"27":"2O"](a);7(1C a=="23"){B m=/^[^<]*(<(.|\\s)+>)[^>]*$/.2Q(a);7(m)a=6.3k([m[1]]);J v 1p 6(c).2o(a)}v q.6r(a.1l==2y&&a||(a.3Y||a.I&&a!=1w&&!a.24&&a[0]!=T&&a[0].24)&&6.3M(a)||[a])};7(1C $!="T")6.2S$=$;B $=6;6.E=6.8p={3Y:"1.1.2",8q:u(){v q.I},I:0,2b:u(1T){v 1T==T?6.3M(q):q[1T]},2r:u(a){B L=6(a);L.6p=q;v L},6r:u(a){q.I=0;[].1g.14(q,a);v q},K:u(E,1E){v 6.K(q,E,1E)},2h:u(1c){B 4c=-1;q.K(u(i){7(q==1c)4c=i});v 4c},1I:u(1Y,O,C){B 1c=1Y;7(1Y.1l==3t)7(O==T)v q.I&&6[C||"1I"](q[0],1Y)||T;J{1c={};1c[1Y]=O}v q.K(u(2h){P(B H 1x 1c)6.1I(C?q.1q:q,H,6.H(q,1c[H],C,2h,H))})},1m:u(1Y,O){v q.1I(1Y,O,"30")},2L:u(e){7(1C e=="23")v q.3u().3r(17.8t(e));B t="";6.K(e||q,u(){6.K(q.2I,u(){7(q.24!=8)t+=q.24!=1?q.60:6.E.2L([q])})});v t},2K:u(){B a=6.3k(1A);v q.K(u(){B b=a[0].3l(U);q.11.2X(b,q);22(b.1b)b=b.1b;b.4C(q)})},3r:u(){v q.3j(1A,U,1,u(a){q.4C(a)})},5i:u(){v q.3j(1A,U,-1,u(a){q.2X(a,q.1b)})},5j:u(){v q.3j(1A,12,1,u(a){q.11.2X(a,q)})},5t:u(){v q.3j(1A,12,-1,u(a){q.11.2X(a,q.2e)})},4g:u(){v q.6p||6([])},2o:u(t){v q.2r(6.31(q,u(a){v 6.2o(t,a)}),t)},4Y:u(4N){v q.2r(6.31(q,u(a){B a=a.3l(4N!=T?4N:U);a.$1H=16;v a}))},1D:u(t){v q.2r(6.1t(t)&&6.2q(q,u(2z,2h){v t.14(2z,[2h])})||6.3z(t,q))},2g:u(t){v q.2r(t.1l==3t&&6.3z(t,q,U)||6.2q(q,u(a){v(t.1l==2y||t.3Y)?6.3y(a,t)<0:a!=t}))},1M:u(t){v q.2r(6.2k(q.2b(),t.1l==3t?6(t).2b():t.I!=T&&(!t.1f||t.1f=="8v")?t:[t]))},4l:u(1s){v 1s?6.1D(1s,q).r.I>0:12},1a:u(1a){v 1a==T?(q.I?q[0].O:16):q.1I("O",1a)},4U:u(1a){v 1a==T?(q.I?q[0].2t:16):q.3u().3r(1a)},3j:u(1E,1P,3Z,E){B 4Y=q.I>1;B a=6.3k(1E);7(3Z<0)a.8w();v q.K(u(){B 1c=q;7(1P&&6.1f(q,"1P")&&6.1f(a[0],"3m"))1c=q.5J("20")[0]||q.4C(17.6n("20"));6.K(a,u(){E.14(1c,[4Y?q.3l(U):q])})})}};6.1z=6.E.1z=u(){B 1O=1A[0],a=1;7(1A.I==1){1O=q;a=0}B H;22(H=1A[a++])P(B i 1x H)1O[i]=H[i];v 1O};6.1z({8x:u(){7(6.2S$)$=6.2S$;v 6},1t:u(E){v!!E&&1C E!="23"&&!E.1f&&1C E[0]=="T"&&/u/i.1n(E+"")},4B:u(D){v D.66&&D.5I&&!D.5I.64},1f:u(D,Y){v D.1f&&D.1f.3K()==Y.3K()},K:u(1c,E,1E){7(1c.I==T)P(B i 1x 1c)E.14(1c[i],1E||[i,1c[i]]);J P(B i=0,6q=1c.I;i<6q;i++)7(E.14(1c[i],1E||[i,1c[i]])===12)3O;v 1c},H:u(D,O,C,2h,H){7(6.1t(O))O=O.3n(D,[2h]);B 6s=/z-?2h|7P-?8A|1d|58|8B-?28/i;v O&&O.1l==3Q&&C=="30"&&!6s.1n(H)?O+"4S":O},19:{1M:u(D,c){6.K(c.3o(/\\s+/),u(i,Q){7(!6.19.2V(D.19,Q))D.19+=(D.19?" ":"")+Q})},2f:u(D,c){D.19=c?6.2q(D.19.3o(/\\s+/),u(Q){v!6.19.2V(c,Q)}).6t(" "):""},2V:u(t,c){t=t.19||t;c=c.1R(/([\\.\\\\\\+\\*\\?\\[\\^\\]\\$\\(\\)\\{\\}\\=\\!\\<\\>\\|\\:])/g,"\\\\$1");v t&&1p 4v("(^|\\\\s)"+c+"(\\\\s|$)").1n(t)}},4d:u(e,o,f){P(B i 1x o){e.1q["1N"+i]=e.1q[i];e.1q[i]=o[i]}f.14(e,[]);P(B i 1x o)e.1q[i]=e.1q["1N"+i]},1m:u(e,p){7(p=="28"||p=="3V"){B 1N={},46,3P,d=["7d","8C","8D","8E"];6.K(d,u(){1N["8F"+q]=0;1N["8G"+q+"8H"]=0});6.4d(e,1N,u(){7(6.1m(e,"1h")!="1Z"){46=e.8I;3P=e.8J}J{e=6(e.3l(U)).2o(":4j").5l("2Z").4g().1m({4n:"1G",45:"8K",1h:"2D",7I:"0",8M:"0"}).5z(e.11)[0];B 3d=6.1m(e.11,"45");7(3d==""||3d=="4b")e.11.1q.45="6x";46=e.6y;3P=e.6z;7(3d==""||3d=="4b")e.11.1q.45="4b";e.11.33(e)}});v p=="28"?46:3P}v 6.30(e,p)},30:u(D,H,53){B L;7(H=="1d"&&6.W.1j)v 6.1I(D.1q,"1d");7(H=="4h"||H=="2v")H=6.W.1j?"3T":"2v";7(!53&&D.1q[H])L=D.1q[H];J 7(17.44&&17.44.4W){7(H=="2v"||H=="3T")H="4h";H=H.1R(/([A-Z])/g,"-$1").4m();B Q=17.44.4W(D,16);7(Q)L=Q.55(H);J 7(H=="1h")L="1Z";J 6.4d(D,{1h:"2D"},u(){B c=17.44.4W(q,"");L=c&&c.55(H)||""})}J 7(D.51){B 56=H.1R(/\\-(\\w)/g,u(m,c){v c.3K()});L=D.51[H]||D.51[56]}v L},3k:u(a){B r=[];6.K(a,u(i,1r){7(!1r)v;7(1r.1l==3Q)1r=1r.6C();7(1C 1r=="23"){B s=6.35(1r),1V=17.6n("1V"),2i=[];B 2K=!s.18("<1u")&&[1,"<42>","</42>"]||(!s.18("<6D")||!s.18("<20")||!s.18("<6E"))&&[1,"<1P>","</1P>"]||!s.18("<3m")&&[2,"<1P><20>","</20></1P>"]||(!s.18("<6F")||!s.18("<6G"))&&[3,"<1P><20><3m>","</3m></20></1P>"]||[0,"",""];1V.2t=2K[1]+s+2K[2];22(2K[0]--)1V=1V.1b;7(6.W.1j){7(!s.18("<1P")&&s.18("<20")<0)2i=1V.1b&&1V.1b.2I;J 7(2K[1]=="<1P>"&&s.18("<20")<0)2i=1V.2I;P(B n=2i.I-1;n>=0;--n)7(6.1f(2i[n],"20")&&!2i[n].2I.I)2i[n].11.33(2i[n])}1r=[];P(B i=0,l=1V.2I.I;i<l;i++)1r.1g(1V.2I[i])}7(1r.I===0&&!6.1f(1r,"3w"))v;7(1r[0]==T||6.1f(1r,"3w"))r.1g(1r);J r=6.2k(r,1r)});v r},1I:u(D,Y,O){B 2j=6.4B(D)?{}:{"P":"6J","6L":"19","4h":6.W.1j?"3T":"2v",2v:6.W.1j?"3T":"2v",2t:"2t",19:"19",O:"O",2W:"2W",2Z:"2Z",89:"6N",2Y:"2Y"};7(Y=="1d"&&6.W.1j&&O!=T){D.58=1;v D.1D=D.1D.1R(/4i\\([^\\)]*\\)/6O,"")+(O==1?"":"4i(1d="+O*6g+")")}J 7(Y=="1d"&&6.W.1j)v D.1D?4T(D.1D.6P(/4i\\(1d=(.*)\\)/)[1])/6g:1;7(Y=="1d"&&6.W.3h&&O==1)O=0.6R;7(2j[Y]){7(O!=T)D[2j[Y]]=O;v D[2j[Y]]}J 7(O==T&&6.W.1j&&6.1f(D,"3w")&&(Y=="81"||Y=="80"))v D.6T(Y).60;J 7(D.66){7(O!=T)D.6V(Y,O);7(6.W.1j&&/5E|3e/.1n(Y)&&!6.4B(D))v D.36(Y,2);v D.36(Y)}J{Y=Y.1R(/-([a-z])/6W,u(z,b){v b.3K()});7(O!=T)D[Y]=O;v D[Y]}},35:u(t){v t.1R(/^\\s+|\\s+$/g,"")},3M:u(a){B r=[];7(a.1l!=2y)P(B i=0,2R=a.I;i<2R;i++)r.1g(a[i]);J r=a.3N(0);v r},3y:u(b,a){P(B i=0,2R=a.I;i<2R;i++)7(a[i]==b)v i;v-1},2k:u(2u,3H){B r=[].3N.3n(2u,0);P(B i=0,5b=3H.I;i<5b;i++)7(6.3y(3H[i],r)==-1)2u.1g(3H[i]);v 2u},2q:u(1U,E,4k){7(1C E=="23")E=1p 4w("a","i","v "+E);B 1i=[];P(B i=0,2z=1U.I;i<2z;i++)7(!4k&&E(1U[i],i)||4k&&!E(1U[i],i))1i.1g(1U[i]);v 1i},31:u(1U,E){7(1C E=="23")E=1p 4w("a","v "+E);B 1i=[],r=[];P(B i=0,2z=1U.I;i<2z;i++){B 1a=E(1U[i],i);7(1a!==16&&1a!=T){7(1a.1l!=2y)1a=[1a];1i=1i.6Z(1a)}}B r=1i.I?[1i[0]]:[];5f:P(B i=1,5e=1i.I;i<5e;i++){P(B j=0;j<i;j++)7(1i[i]==r[j])5F 5f;r.1g(1i[i])}v r}});1p u(){B b=7L.71.4m();6.W={2N:/5D/.1n(b),3f:/3f/.1n(b),1j:/1j/.1n(b)&&!/3f/.1n(b),3h:/3h/.1n(b)&&!/(72|5D)/.1n(b)};6.7H=!6.W.1j||17.74=="75"};6.K({5u:"a.11",4z:"6.4z(a)",76:"6.2a(a,2,\'2e\')",7D:"6.2a(a,2,\'5s\')",78:"6.2B(a.11.1b,a)",79:"6.2B(a.1b)"},u(i,n){6.E[i]=u(a){B L=6.31(q,n);7(a&&1C a=="23")L=6.3z(a,L);v q.2r(L)}});6.K({5z:"3r",7b:"5i",2X:"5j",7e:"5t"},u(i,n){6.E[i]=u(){B a=1A;v q.K(u(){P(B j=0,2R=a.I;j<2R;j++)6(a[j])[n](q)})}});6.K({5l:u(1Y){6.1I(q,1Y,"");q.7g(1Y)},7h:u(c){6.19.1M(q,c)},7i:u(c){6.19.2f(q,c)},7k:u(c){6.19[6.19.2V(q,c)?"2f":"1M"](q,c)},2f:u(a){7(!a||6.1D(a,[q]).r.I)q.11.33(q)},3u:u(){22(q.1b)q.33(q.1b)}},u(i,n){6.E[i]=u(){v q.K(n,1A)}});6.K(["5q","5n","5p","5v"],u(i,n){6.E[n]=u(1T,E){v q.1D(":"+n+"("+1T+")",E)}});6.K(["28","3V"],u(i,n){6.E[n]=u(h){v h==T?(q.I?6.1m(q[0],n):16):q.1m(n,h.1l==3t?h:h+"4S")}});6.1z({1s:{"":"m[2]==\'*\'||6.1f(a,m[2])","#":"a.36(\'2J\')==m[2]",":":{5n:"i<m[3]-0",5p:"i>m[3]-0",2a:"m[3]-0==i",5q:"m[3]-0==i",2u:"i==0",2T:"i==r.I-1",5R:"i%2==0",5S:"i%2","2a-3s":"6.2a(a.11.1b,m[3],\'2e\',a)==a","2u-3s":"6.2a(a.11.1b,1,\'2e\')==a","2T-3s":"6.2a(a.11.7n,1,\'5s\')==a","7p-3s":"6.2B(a.11.1b).I==1",5u:"a.1b",3u:"!a.1b",5v:"6.E.2L.14([a]).18(m[3])>=0",3i:\'a.C!="1G"&&6.1m(a,"1h")!="1Z"&&6.1m(a,"4n")!="1G"\',1G:\'a.C=="1G"||6.1m(a,"1h")=="1Z"||6.1m(a,"4n")=="1G"\',7v:"!a.2W",2W:"a.2W",2Z:"a.2Z",2Y:"a.2Y||6.1I(a,\'2Y\')",2L:"a.C==\'2L\'",4j:"a.C==\'4j\'",5x:"a.C==\'5x\'",4G:"a.C==\'4G\'",5y:"a.C==\'5y\'",4R:"a.C==\'4R\'",5A:"a.C==\'5A\'",5B:"a.C==\'5B\'",3x:\'a.C=="3x"||6.1f(a,"3x")\',5C:"/5C|42|7A|3x/i.1n(a.1f)"},".":"6.19.2V(a,m[2])","@":{"=":"z==m[4]","!=":"z!=m[4]","^=":"z&&!z.18(m[4])","$=":"z&&z.2U(z.I - m[4].I,m[4].I)==m[4]","*=":"z&&z.18(m[4])>=0","":"z",4u:u(m){v["",m[1],m[3],m[2],m[5]]},5P:"z=a[m[3]];7(!z||/5E|3e/.1n(m[3]))z=6.1I(a,m[3]);"},"[":"6.2o(m[2],a).I"},5M:[/^\\[ *(@)([a-2m-3C-]*) *([!*$^=]*) *(\'?"?)(.*?)\\4 *\\]/i,/^(\\[)\\s*(.*?(\\[.*?\\])?[^[]*?)\\s*\\]/,/^(:)([a-2m-3C-]*)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/i,/^([:.#]*)([a-2m-3C*-]*)/i],1Q:[/^(\\/?\\.\\.)/,"a.11",/^(>|\\/)/,"6.2B(a.1b)",/^(\\+)/,"6.2a(a,2,\'2e\')",/^(~)/,u(a){B s=6.2B(a.11.1b);v s.3N(6.3y(a,s)+1)}],3z:u(1s,1U,2g){B 1N,Q=[];22(1s&&1s!=1N){1N=1s;B f=6.1D(1s,1U,2g);1s=f.t.1R(/^\\s*,\\s*/,"");Q=2g?1U=f.r:6.2k(Q,f.r)}v Q},2o:u(t,1B){7(1C t!="23")v[t];7(1B&&!1B.24)1B=16;1B=1B||17;7(!t.18("//")){1B=1B.4H;t=t.2U(2,t.I)}J 7(!t.18("/")){1B=1B.4H;t=t.2U(1,t.I);7(t.18("/")>=1)t=t.2U(t.18("/"),t.I)}B L=[1B],2c=[],2T=16;22(t&&2T!=t){B r=[];2T=t;t=6.35(t).1R(/^\\/\\//i,"");B 3B=12;B 1J=/^[\\/>]\\s*([a-2m-9*-]+)/i;B m=1J.2Q(t);7(m){6.K(L,u(){P(B c=q.1b;c;c=c.2e)7(c.24==1&&(6.1f(c,m[1])||m[1]=="*"))r.1g(c)});L=r;t=t.1R(1J,"");7(t.18(" ")==0)5F;3B=U}J{P(B i=0;i<6.1Q.I;i+=2){B 1J=6.1Q[i];B m=1J.2Q(t);7(m){r=L=6.31(L,6.1t(6.1Q[i+1])?6.1Q[i+1]:u(a){v 40(6.1Q[i+1])});t=6.35(t.1R(1J,""));3B=U;3O}}}7(t&&!3B){7(!t.18(",")){7(L[0]==1B)L.4L();6.2k(2c,L);r=L=[1B];t=" "+t.2U(1,t.I)}J{B 34=/^([a-2m-3C-]+)(#)([a-2m-9\\\\*2S-]*)/i;B m=34.2Q(t);7(m){m=[0,m[2],m[3],m[1]]}J{34=/^([#.]?)([a-2m-9\\\\*2S-]*)/i;m=34.2Q(t)}7(m[1]=="#"&&L[L.I-1].4X){B 2l=L[L.I-1].4X(m[2]);7(6.W.1j&&2l&&2l.2J!=m[2])2l=6(\'[@2J="\'+m[2]+\'"]\',L[L.I-1])[0];L=r=2l&&(!m[3]||6.1f(2l,m[3]))?[2l]:[]}J{7(m[1]==".")B 4r=1p 4v("(^|\\\\s)"+m[2]+"(\\\\s|$)");6.K(L,u(){B 3E=m[1]!=""||m[0]==""?"*":m[2];7(6.1f(q,"7J")&&3E=="*")3E="3g";6.2k(r,m[1]!=""&&L.I!=1?6.4x(q,[],m[1],m[2],4r):q.5J(3E))});7(m[1]=="."&&L.I==1)r=6.2q(r,u(e){v 4r.1n(e.19)});7(m[1]=="#"&&L.I==1){B 5K=r;r=[];6.K(5K,u(){7(q.36("2J")==m[2]){r=[q];v 12}})}L=r}t=t.1R(34,"")}}7(t){B 1a=6.1D(t,r);L=r=1a.r;t=6.35(1a.t)}}7(L&&L[0]==1B)L.4L();6.2k(2c,L);v 2c},1D:u(t,r,2g){22(t&&/^[a-z[({<*:.#]/i.1n(t)){B p=6.5M,m;6.K(p,u(i,1J){m=1J.2Q(t);7(m){t=t.7M(m[0].I);7(6.1s[m[1]].4u)m=6.1s[m[1]].4u(m);v 12}});7(m[1]==":"&&m[2]=="2g")r=6.1D(m[3],r,U).r;J 7(m[1]=="."){B 1J=1p 4v("(^|\\\\s)"+m[2]+"(\\\\s|$)");r=6.2q(r,u(e){v 1J.1n(e.19||"")},2g)}J{B f=6.1s[m[1]];7(1C f!="23")f=6.1s[m[1]][m[2]];40("f = u(a,i){"+(6.1s[m[1]].5P||"")+"v "+f+"}");r=6.2q(r,f,2g)}}v{r:r,t:t}},4x:u(o,r,1Q,Y,1J){P(B s=o.1b;s;s=s.2e)7(s.24==1){B 1M=U;7(1Q==".")1M=s.19&&1J.1n(s.19);J 7(1Q=="#")1M=s.36("2J")==Y;7(1M)r.1g(s);7(1Q=="#"&&r.I)3O;7(s.1b)6.4x(s,r,1Q,Y,1J)}v r},4z:u(D){B 4A=[];B Q=D.11;22(Q&&Q!=17){4A.1g(Q);Q=Q.11}v 4A},2a:u(Q,1i,3Z,D){1i=1i||1;B 1T=0;P(;Q;Q=Q[3Z]){7(Q.24==1)1T++;7(1T==1i||1i=="5R"&&1T%2==0&&1T>1&&Q==D||1i=="5S"&&1T%2==1&&Q==D)v Q}},2B:u(n,D){B r=[];P(;n;n=n.2e){7(n.24==1&&(!D||n!=D))r.1g(n)}v r}});6.G={1M:u(S,C,1o,F){7(6.W.1j&&S.3L!=T)S=1w;7(F)1o.F=F;7(!1o.2A)1o.2A=q.2A++;7(!S.$1H)S.$1H={};B 38=S.$1H[C];7(!38){38=S.$1H[C]={};7(S["39"+C])38[0]=S["39"+C]}38[1o.2A]=1o;S["39"+C]=q.5Y;7(!q.1k[C])q.1k[C]=[];q.1k[C].1g(S)},2A:1,1k:{},2f:u(S,C,1o){7(S.$1H){B i,j,k;7(C&&C.C){1o=C.1o;C=C.C}7(C&&S.$1H[C])7(1o)5U S.$1H[C][1o.2A];J P(i 1x S.$1H[C])5U S.$1H[C][i];J P(j 1x S.$1H)q.2f(S,j);P(k 1x S.$1H[C])7(k){k=U;3O}7(!k)S["39"+C]=16}},1S:u(C,F,S){F=6.3M(F||[]);7(!S)6.K(q.1k[C]||[],u(){6.G.1S(C,F,q)});J{B 1o=S["39"+C],1a,E=6.1t(S[C]);7(1o){F.61(q.2j({C:C,1O:S}));7((1a=1o.14(S,F))!==12)q.4F=U}7(E&&1a!==12)S[C]();q.4F=12}},5Y:u(G){7(1C 6=="T"||6.G.4F)v;G=6.G.2j(G||1w.G||{});B 3R;B c=q.$1H[G.C];B 1E=[].3N.3n(1A,1);1E.61(G);P(B j 1x c){1E[0].1o=c[j];1E[0].F=c[j].F;7(c[j].14(q,1E)===12){G.2n();G.2H();3R=12}}7(6.W.1j)G.1O=G.2n=G.2H=G.1o=G.F=16;v 3R},2j:u(G){7(!G.1O&&G.63)G.1O=G.63;7(G.65==T&&G.67!=T){B e=17.4H,b=17.64;G.65=G.67+(e.68||b.68);G.7Y=G.7Z+(e.6c||b.6c)}7(6.W.2N&&G.1O.24==3){B 3a=G;G=6.1z({},3a);G.1O=3a.1O.11;G.2n=u(){v 3a.2n()};G.2H=u(){v 3a.2H()}}7(!G.2n)G.2n=u(){q.3R=12};7(!G.2H)G.2H=u(){q.82=U};v G}};6.E.1z({3U:u(C,F,E){v q.K(u(){6.G.1M(q,C,E||F,F)})},6u:u(C,F,E){v q.K(u(){6.G.1M(q,C,u(G){6(q).6f(G);v(E||F).14(q,1A)},F)})},6f:u(C,E){v q.K(u(){6.G.2f(q,C,E)})},1S:u(C,F){v q.K(u(){6.G.1S(C,F,q)})},3X:u(){B a=1A;v q.6j(u(e){q.4M=q.4M==0?1:0;e.2n();v a[q.4M].14(q,[e])||12})},83:u(f,g){u 4O(e){B p=(e.C=="41"?e.84:e.85)||e.86;22(p&&p!=q)2G{p=p.11}2w(e){p=q};7(p==q)v 12;v(e.C=="41"?f:g).14(q,[e])}v q.41(4O).6k(4O)},27:u(f){7(6.3W)f.14(17,[6]);J{6.3c.1g(u(){v f.14(q,[6])})}v q}});6.1z({3W:12,3c:[],27:u(){7(!6.3W){6.3W=U;7(6.3c){6.K(6.3c,u(){q.14(17)});6.3c=16}7(6.W.3h||6.W.3f)17.87("6o",6.27,12)}}});1p u(){6.K(("88,8a,2O,8b,8d,52,6j,8e,"+"8f,8g,8h,41,6k,8j,42,"+"4R,8k,8l,8m,2C").3o(","),u(i,o){6.E[o]=u(f){v f?q.3U(o,f):q.1S(o)}});7(6.W.3h||6.W.3f)17.8n("6o",6.27,12);J 7(6.W.1j){17.8o("<8r"+"8s 2J=62 8u=U "+"3e=//:><\\/2d>");B 2d=17.4X("62");7(2d)2d.37=u(){7(q.3D!="1X")v;q.11.33(q);6.27()};2d=16}J 7(6.W.2N)6.50=3L(u(){7(17.3D=="8y"||17.3D=="1X"){4p(6.50);6.50=16;6.27()}},10);6.G.1M(1w,"2O",6.27)};7(6.W.1j)6(1w).6u("52",u(){B 1k=6.G.1k;P(B C 1x 1k){B 4Z=1k[C],i=4Z.I;7(i&&C!=\'52\')6w 6.G.2f(4Z[i-1],C);22(--i)}});6.E.1z({6A:u(V,21,M){q.2O(V,21,M,1)},2O:u(V,21,M,1W){7(6.1t(V))v q.3U("2O",V);M=M||u(){};B C="5d";7(21)7(6.1t(21)){M=21;21=16}J{21=6.3g(21);C="5V"}B 4e=q;6.3v({V:V,C:C,F:21,1W:1W,1X:u(2P,15){7(15=="2M"||!1W&&15=="5L")4e.1I("2t",2P.3G).4V().K(M,[2P.3G,15,2P]);J M.14(4e,[2P.3G,15,2P])}});v q},6B:u(){v 6.3g(q)},4V:u(){v q.2o("2d").K(u(){7(q.3e)6.59(q.3e);J 6.4a(q.2L||q.6H||q.2t||"")}).4g()}});7(!1w.3p)3p=u(){v 1p 6I("6K.6M")};6.K("5m,5Q,5O,5W,5N,5H".3o(","),u(i,o){6.E[o]=u(f){v q.3U(o,f)}});6.1z({2b:u(V,F,M,C,1W){7(6.1t(F)){M=F;F=16}v 6.3v({V:V,F:F,2M:M,4t:C,1W:1W})},6Q:u(V,F,M,C){v 6.2b(V,F,M,C,1)},59:u(V,M){v 6.2b(V,16,M,"2d")},6S:u(V,F,M){v 6.2b(V,F,M,"6m")},6U:u(V,F,M,C){7(6.1t(F)){M=F;F={}}v 6.3v({C:"5V",V:V,F:F,2M:M,4t:C})},6X:u(29){6.3q.29=29},6Y:u(5c){6.1z(6.3q,5c)},3q:{1k:U,C:"5d",29:0,5r:"70/x-73-3w-77",5h:U,48:U,F:16},3S:{},3v:u(s){s=6.1z({},6.3q,s);7(s.F){7(s.5h&&1C s.F!="23")s.F=6.3g(s.F);7(s.C.4m()=="2b"){s.V+=((s.V.18("?")>-1)?"&":"?")+s.F;s.F=16}}7(s.1k&&!6.4E++)6.G.1S("5m");B 4y=12;B N=1p 3p();N.7j(s.C,s.V,s.48);7(s.F)N.3A("7l-7m",s.5r);7(s.1W)N.3A("7o-4K-7q",6.3S[s.V]||"7s, 7t 7w 7x 4o:4o:4o 7z");N.3A("X-7B-7C","3p");7(N.7E)N.3A("7F","7G");7(s.5G)s.5G(N);7(s.1k)6.G.1S("5H",[N,s]);B 37=u(4s){7(N&&(N.3D==4||4s=="29")){4y=U;7(3I){4p(3I);3I=16}B 15;2G{15=6.5Z(N)&&4s!="29"?s.1W&&6.69(N,s.V)?"5L":"2M":"2C";7(15!="2C"){B 3F;2G{3F=N.4P("6b-4K")}2w(e){}7(s.1W&&3F)6.3S[s.V]=3F;B F=6.6i(N,s.4t);7(s.2M)s.2M(F,15);7(s.1k)6.G.1S("5N",[N,s])}J 6.3J(s,N,15)}2w(e){15="2C";6.3J(s,N,15,e)}7(s.1k)6.G.1S("5O",[N,s]);7(s.1k&&!--6.4E)6.G.1S("5Q");7(s.1X)s.1X(N,15);7(s.48)N=16}};B 3I=3L(37,13);7(s.29>0)57(u(){7(N){N.7N();7(!4y)37("29")}},s.29);2G{N.7Q(s.F)}2w(e){6.3J(s,N,16,e)}7(!s.48)37();v N},3J:u(s,N,15,e){7(s.2C)s.2C(N,15,e);7(s.1k)6.G.1S("5W",[N,s,e])},4E:0,5Z:u(r){2G{v!r.15&&7V.7W=="4G:"||(r.15>=5X&&r.15<7X)||r.15==6d||6.W.2N&&r.15==T}2w(e){}v 12},69:u(N,V){2G{B 6e=N.4P("6b-4K");v N.15==6d||6e==6.3S[V]||6.W.2N&&N.15==T}2w(e){}v 12},6i:u(r,C){B 4Q=r.4P("8c-C");B F=!C&&4Q&&4Q.18("N")>=0;F=C=="N"||F?r.8i:r.3G;7(C=="2d")6.4a(F);7(C=="6m")40("F = "+F);7(C=="4U")6("<1V>").4U(F).4V();v F},3g:u(a){B s=[];7(a.1l==2y||a.3Y)6.K(a,u(){s.1g(2x(q.Y)+"="+2x(q.O))});J P(B j 1x a)7(a[j]&&a[j].1l==2y)6.K(a[j],u(){s.1g(2x(j)+"="+2x(q))});J s.1g(2x(j)+"="+2x(a[j]));v s.6t("&")},4a:u(F){7(1w.54)1w.54(F);J 7(6.W.2N)1w.57(F,0);J 40.3n(1w,F)}});6.E.1z({1L:u(R,M){B 1G=q.1D(":1G");R?1G.26({28:"1L",3V:"1L",1d:"1L"},R,M):1G.K(u(){q.1q.1h=q.2E?q.2E:"";7(6.1m(q,"1h")=="1Z")q.1q.1h="2D"});v q},1K:u(R,M){B 3i=q.1D(":3i");R?3i.26({28:"1K",3V:"1K",1d:"1K"},R,M):3i.K(u(){q.2E=q.2E||6.1m(q,"1h");7(q.2E=="1Z")q.2E="2D";q.1q.1h="1Z"});v q},5g:6.E.3X,3X:u(E,4I){B 1E=1A;v 6.1t(E)&&6.1t(4I)?q.5g(E,4I):q.K(u(){6(q)[6(q).4l(":1G")?"1L":"1K"].14(6(q),1E)})},7a:u(R,M){v q.26({28:"1L"},R,M)},7c:u(R,M){v q.26({28:"1K"},R,M)},7f:u(R,M){v q.K(u(){B 5k=6(q).4l(":1G")?"1L":"1K";6(q).26({28:5k},R,M)})},7r:u(R,M){v q.26({1d:"1L"},R,M)},7u:u(R,M){v q.26({1d:"1K"},R,M)},7y:u(R,43,M){v q.26({1d:43},R,M)},26:u(H,R,1v,M){v q.1F(u(){q.2F=6.1z({},H);B 1u=6.R(R,1v,M);P(B p 1x H){B e=1p 6.3b(q,1u,p);7(H[p].1l==3Q)e.2s(e.Q(),H[p]);J e[H[p]](H)}})},1F:u(C,E){7(!E){E=C;C="3b"}v q.K(u(){7(!q.1F)q.1F={};7(!q.1F[C])q.1F[C]=[];q.1F[C].1g(E);7(q.1F[C].I==1)E.14(q)})}});6.1z({R:u(R,1v,E){B 1u=R&&R.1l==7K?R:{1X:E||!E&&1v||6.1t(R)&&R,25:R,1v:E&&1v||1v&&1v.1l!=4w&&1v};1u.25=(1u.25&&1u.25.1l==3Q?1u.25:{7R:7S,7T:5X}[1u.25])||7U;1u.1N=1u.1X;1u.1X=u(){6.6a(q,"3b");7(6.1t(1u.1N))1u.1N.14(q)};v 1u},1v:{},1F:{},6a:u(D,C){C=C||"3b";7(D.1F&&D.1F[C]){D.1F[C].4L();B f=D.1F[C][0];7(f)f.14(D)}},3b:u(D,1e,H){B z=q;B y=D.1q;B 4D=6.1m(D,"1h");y.5T="1G";z.a=u(){7(1e.49)1e.49.14(D,[z.2p]);7(H=="1d")6.1I(y,"1d",z.2p);J 7(6l(z.2p))y[H]=6l(z.2p)+"4S";y.1h="2D"};z.6v=u(){v 4T(6.1m(D,H))};z.Q=u(){B r=4T(6.30(D,H));v r&&r>-8z?r:z.6v()};z.2s=u(4f,43){z.4J=(1p 5o()).5w();z.2p=4f;z.a();z.4q=3L(u(){z.49(4f,43)},13)};z.1L=u(){7(!D.1y)D.1y={};D.1y[H]=q.Q();1e.1L=U;z.2s(0,D.1y[H]);7(H!="1d")y[H]="5a"};z.1K=u(){7(!D.1y)D.1y={};D.1y[H]=q.Q();1e.1K=U;z.2s(D.1y[H],0)};z.3X=u(){7(!D.1y)D.1y={};D.1y[H]=q.Q();7(4D=="1Z"){1e.1L=U;7(H!="1d")y[H]="5a";z.2s(0,D.1y[H])}J{1e.1K=U;z.2s(D.1y[H],0)}};z.49=u(32,47){B t=(1p 5o()).5w();7(t>1e.25+z.4J){4p(z.4q);z.4q=16;z.2p=47;z.a();7(D.2F)D.2F[H]=U;B 2c=U;P(B i 1x D.2F)7(D.2F[i]!==U)2c=12;7(2c){y.5T="";y.1h=4D;7(6.1m(D,"1h")=="1Z")y.1h="2D";7(1e.1K)y.1h="1Z";7(1e.1K||1e.1L)P(B p 1x D.2F)7(p=="1d")6.1I(y,p,D.1y[p]);J y[p]=""}7(2c&&6.1t(1e.1X))1e.1X.14(D)}J{B n=t-q.4J;B p=n/1e.25;z.2p=1e.1v&&6.1v[1e.1v]?6.1v[1e.1v](p,n,32,(47-32),1e.25):((-6h.7O(p*6h.8L)/2)+0.5)*(47-32)+32;z.a()}}}})}',62,545,'||||||jQuery|if|||||||||||||||||||this||||function|return||||||var|type|elem|fn|data|event|prop|length|else|each|ret|callback|xml|value|for|cur|speed|element|undefined|true|url|browser||name|||parentNode|false||apply|status|null|document|indexOf|className|val|firstChild|obj|opacity|options|nodeName|push|display|result|msie|global|constructor|css|test|handler|new|style|arg|expr|isFunction|opt|easing|window|in|orig|extend|arguments|context|typeof|filter|args|queue|hidden|events|attr|re|hide|show|add|old|target|table|token|replace|trigger|num|elems|div|ifModified|complete|key|none|tbody|params|while|string|nodeType|duration|animate|ready|height|timeout|nth|get|done|script|nextSibling|remove|not|index|tb|fix|merge|oid|z0|preventDefault|find|now|grep|pushStack|custom|innerHTML|first|cssFloat|catch|encodeURIComponent|Array|el|guid|sibling|error|block|oldblock|curAnim|try|stopPropagation|childNodes|id|wrap|text|success|safari|load|res|exec|al|_|last|substr|has|disabled|insertBefore|selected|checked|curCSS|map|firstNum|removeChild|re2|trim|getAttribute|onreadystatechange|handlers|on|originalEvent|fx|readyList|parPos|src|opera|param|mozilla|visible|domManip|clean|cloneNode|tr|call|split|XMLHttpRequest|ajaxSettings|append|child|String|empty|ajax|form|button|inArray|multiFilter|setRequestHeader|foundToken|9_|readyState|tag|modRes|responseText|second|ival|handleError|toUpperCase|setInterval|makeArray|slice|break|oWidth|Number|returnValue|lastModified|styleFloat|bind|width|isReady|toggle|jquery|dir|eval|mouseover|select|to|defaultView|position|oHeight|lastNum|async|step|globalEval|static|pos|swap|self|from|end|float|alpha|radio|inv|is|toLowerCase|visibility|00|clearInterval|timer|rec|isTimeout|dataType|_resort|RegExp|Function|getAll|requestDone|parents|matched|isXMLDoc|appendChild|oldDisplay|active|triggered|file|documentElement|fn2|startTime|Modified|shift|lastToggle|deep|handleHover|getResponseHeader|ct|submit|px|parseFloat|html|evalScripts|getComputedStyle|getElementById|clone|els|safariTimer|currentStyle|unload|force|execScript|getPropertyValue|newProp|setTimeout|zoom|getScript|1px|sl|settings|GET|rl|check|_toggle|processData|prepend|before|state|removeAttr|ajaxStart|lt|Date|gt|eq|contentType|previousSibling|after|parent|contains|getTime|checkbox|password|appendTo|image|reset|input|webkit|href|continue|beforeSend|ajaxSend|ownerDocument|getElementsByTagName|tmp|notmodified|parse|ajaxSuccess|ajaxComplete|_prefix|ajaxStop|even|odd|overflow|delete|POST|ajaxError|200|handle|httpSuccess|nodeValue|unshift|__ie_init|srcElement|body|pageX|tagName|clientX|scrollLeft|httpNotModified|dequeue|Last|scrollTop|304|xmlRes|unbind|100|Math|httpData|click|mouseout|parseInt|json|createElement|DOMContentLoaded|prevObject|ol|setArray|exclude|join|one|max|do|relative|clientHeight|clientWidth|loadIfModified|serialize|toString|thead|tfoot|td|th|textContent|ActiveXObject|htmlFor|Microsoft|class|XMLHTTP|readOnly|gi|match|getIfModified|9999|getJSON|getAttributeNode|post|setAttribute|ig|ajaxTimeout|ajaxSetup|concat|application|userAgent|compatible|www|compatMode|CSS1Compat|next|urlencoded|siblings|children|slideDown|prependTo|slideUp|Top|insertAfter|slideToggle|removeAttribute|addClass|removeClass|open|toggleClass|Content|Type|lastChild|If|only|Since|fadeIn|Thu|01|fadeOut|enabled|Jan|1970|fadeTo|GMT|textarea|Requested|With|prev|overrideMimeType|Connection|close|boxModel|right|object|Object|navigator|substring|abort|cos|font|send|slow|600|fast|400|location|protocol|300|pageY|clientY|method|action|cancelBubble|hover|fromElement|toElement|relatedTarget|removeEventListener|blur|readonly|focus|resize|content|scroll|dblclick|mousedown|mouseup|mousemove|responseXML|change|keydown|keypress|keyup|addEventListener|write|prototype|size|scr|ipt|createTextNode|defer|FORM|reverse|noConflict|loaded|10000|weight|line|Bottom|Right|Left|padding|border|Width|offsetHeight|offsetWidth|absolute|PI|left'.split('|'),0,{}))
index de543828814e0bb6ee6668d07b6e2eda74262a7d..a06fc33b5747c16c53f45d833f4059013e8d9c38 100644 (file)
@@ -6,10 +6,14 @@
   <link rel="stylesheet" type="text/css" href="templates/layout.css" />
   <link rel="stylesheet" type="text/css" href="templates/style.css" />
 
-  <script src="js/prototype.js" type="text/javascript"></script>
-  <script src="js/scriptaculous.js" type="text/javascript"></script>
-  <script src="js/formatDate.js" type="text/javascript"></script>
-  <script src="js/gui.js" type="text/javascript"></script>
+  <link rel="stylesheet" type="text/css" href="styles/scripted.css" />
+  <script src="scripts/jquery.js" type="text/javascript"></script>
+
+  <script src="scripts/interface/iutil.js" type="text/javascript"></script>
+  <script src="scripts/interface/iautocompleter.js" type="text/javascript"></script>
+  <script src="scripts/interface/imagebox.js" type="text/javascript"></script>
+
+  <script src="scripts/gui.js" type="text/javascript"></script>
 
   {if $LDAPERRORS != ''}
   <script>