Index: /trunk/admin.php
===================================================================
--- /trunk/admin.php	(revision 5097)
+++ /trunk/admin.php	(revision 5098)
@@ -60,4 +60,34 @@
 }
 
+// theme changer
+if (isset($_GET['change_theme']))
+{
+  $admin_themes = array('goto/roma', 'goto/clear');
+
+  $new_admin_theme = array_pop(
+    array_diff(
+      $admin_themes,
+      array($conf['admin_layout'])
+      )
+    );
+
+  $query = '
+DELETE
+  FROM '.CONFIG_TABLE.'
+  WHERE param = "admin_layout"
+;';
+  pwg_query($query);
+
+  $query = '
+INSERT
+  INTO '.CONFIG_TABLE.'
+  SET param = "admin_layout"
+    , value = "'.$new_admin_theme.'"
+;';
+  pwg_query($query);
+
+  redirect('admin.php');
+}
+
 // +-----------------------------------------------------------------------+
 // |                    synchronize user informations                      |
@@ -95,4 +125,5 @@
 $template->assign(
   array(
+    'USERNAME' => $user['username'],
     'U_SITE_MANAGER'=> $link_start.'site_manager',
     'U_HISTORY_STAT'=> $link_start.'stats',
@@ -124,4 +155,5 @@
     'U_PLUGINS'=> $link_start.'plugins_list',
     'U_ADD_PHOTOS' => $link_start.'photos_add',
+    'U_CHANGE_THEME' => PHPWG_ROOT_PATH.'admin.php?change_theme=1',
     )
   );
Index: /trunk/admin/template/goto/admin.tpl
===================================================================
--- /trunk/admin/template/goto/admin.tpl	(revision 5097)
+++ /trunk/admin/template/goto/admin.tpl	(revision 5098)
@@ -1,4 +1,5 @@
 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/packed/ui.core.packed.js" }
 {known_script id="jquery.ui.accordion" src=$ROOT_URL|@cat:"template-common/lib/ui/packed/ui.accordion.packed.js" }
+{known_script id="jquery.tipTip" src=$ROOT_URL|@cat:"template-common/lib/plugins/jquery.tipTip.minified.js" }
 
 <script type="text/javascript">
@@ -13,23 +14,6 @@
 
 <div id="menubar">
+  <div id="adminHome"><a href="{$U_ADMIN}">Administration Home</a></div>
   <dl class="first">
-    <dt class="rdion"><span>{'Links'|@translate}&nbsp;</span></dt>
-    <dd>
-      <ul>
-        <li><a href="{$U_RETURN}">{'Home'|@translate}</a></li>
-        <li><a href="{$U_FAQ}">{'Instructions'|@translate}</a></li>
-        <li><a href="{$U_ADMIN}" title="{'Administration'|@translate}">{'Administration'|@translate}</a></li>
-        <li><a href="{$U_LOGOUT}">{'Logout'|@translate}</a></li>
-{if isset($pwgmenu)}
-        <li class="external"><a class="external" href="{$pwgmenu.WIKI}" onclick="window.open(this.href, ''); 
-          return false;">{'Documentation'|@translate}</a></li>
-        <li class="external"><a class="external" href="{$pwgmenu.FORUM}" onclick="window.open(this.href, '');
-          return false;">{'Support'|@translate}</a></li>
-{/if}
-        
-      </ul>
-    </dd>
-  </dl>
-  <dl>
     <dt class="rdion"><span>{'Configuration'|@translate}&nbsp;</span></dt>
     <dd>
Index: /trunk/admin/template/goto/content.css
===================================================================
--- /trunk/admin/template/goto/content.css	(revision 5097)
+++ /trunk/admin/template/goto/content.css	(revision 5098)
@@ -1,5 +1,5 @@
 /* .Content  is on every pages so it is common and it will no longer be a specific css */
 .content { margin-right: 1em; margin-bottom: 1em; }
-.content h2 { margin-bottom: 3px;}
+.content h2 {margin: 0; padding: 5px 0.5em 5px 0.5em; text-align: right; font-size: 120%;}
 .content .navigationBar { margin: 10px 0; text-align: center; }
 .content form { text-align: left; }
Index: /trunk/admin/template/goto/default-layout.css
===================================================================
--- /trunk/admin/template/goto/default-layout.css	(revision 5097)
+++ /trunk/admin/template/goto/default-layout.css	(revision 5098)
@@ -211,22 +211,26 @@
 	padding: 0;
 	font-size: 0.8em;
-	font-family: Univers, Helvetica, Optima, "Bitstream Vera Sans", sans-serif;
+	font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
 	text-align: center; /* be nice to IE5 */
 }
 
 H1 {
-	text-align: center;
-	font-size: 150%;
-	font-weight: bold;
-	padding: 0;
-	margin: 0.5em 0 1em 0;
-}
-
-H2 {
-	margin: 0;
-	padding: 5px 0.5em 5px 0.5em;
-	text-align: left;
-	font-size: 120%;
-}
+color:#eee;
+letter-spacing:1px;
+text-align: left;
+font-size: 150%;
+font-weight: normal;
+font-style:italic;
+padding: 8px 0 0 10px;
+margin: 0;
+float:left;
+}
+
+#pwgHead {color:#aaa;}
+#pwgHead A {color:#ccc;}
+#pwgHead A:hover {color:#fff;border-bottom:1px solid #fff}
+#pwgHead A#instructions:hover {border:none;}
+
+#headActions {float:right; height:46px; line-height:46px; margin-right:10px;}
 
 A {
@@ -247,11 +251,4 @@
 	visibility: hidden;
 	clear: both;
-}
-
-#copyright {
-	clear: both;
-	font-size: 83%;
-	text-align: center;
-	margin: 0 0 10px 0;
 }
 
@@ -549,2 +546,153 @@
   width:50%;
 }
+
+#pwgHead {
+  background-color:#464646;
+  height:46px;
+}
+
+html, body {height:100%; margin:0; padding:0;}
+#the_page {min-height:100%; position:relative; padding:0;margin:0;}
+#pwgMain {padding:10px;padding-bottom:60px;}
+
+#footer {
+  position:absolute;
+  bottom:0;
+  width:100%;
+  height:46px;
+  background-color:#464646;
+  color:#aaa;
+  line-height:46px;
+}
+
+#footer A {color:#ccc;}
+#footer A:hover {color:#fff;border-bottom:1px solid #fff;}
+
+#adminHome {
+  text-align:center;
+  margin-bottom:15px;
+  line-height:30px;
+  width:200px;
+  margin-left:5px;
+  -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px;
+}
+
+#adminHome A {display:block; font-size:1.1em; font-weight:bold;}
+#adminHome A {border:none;}
+
+#piwigoInfos {float:left; margin-left:10px;}
+#pageInfos {float:right; margin-right:10px;}
+
+/* TipTip CSS - Version 1.2 */
+
+#tiptip_holder {
+	display: none;
+	position: absolute;
+	top: 0;
+	left: 0;
+	z-index: 99999;
+}
+
+#tiptip_holder.tip_top {
+	padding-bottom: 5px;
+}
+
+#tiptip_holder.tip_bottom {
+	padding-top: 5px;
+}
+
+#tiptip_holder.tip_right {
+	padding-left: 5px;
+}
+
+#tiptip_holder.tip_left {
+	padding-right: 5px;
+}
+
+#tiptip_content {
+	font-size: 11px;
+	color: #fff;
+	text-shadow: 0 0 2px #000;
+	padding: 4px 8px;
+	border: 1px solid rgba(255,255,255,0.25);
+	background-color: rgb(25,25,25);
+	background-color: rgba(25,25,25,0.92);
+	background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(#000));
+	border-radius: 3px;
+	-webkit-border-radius: 3px;
+	-moz-border-radius: 3px;
+	box-shadow: 0 0 3px #555;
+	-webkit-box-shadow: 0 0 3px #555;
+	-moz-box-shadow: 0 0 3px #555;
+}
+
+#tiptip_arrow, #tiptip_arrow_inner {
+	position: absolute;
+	border-color: transparent;
+	border-style: solid;
+	border-width: 6px;
+	height: 0;
+	width: 0;
+}
+
+#tiptip_holder.tip_top #tiptip_arrow {
+	border-top-color: #fff;
+	border-top-color: rgba(255,255,255,0.35);
+}
+
+#tiptip_holder.tip_bottom #tiptip_arrow {
+	border-bottom-color: #fff;
+	border-bottom-color: rgba(255,255,255,0.35);
+}
+
+#tiptip_holder.tip_right #tiptip_arrow {
+	border-right-color: #fff;
+	border-right-color: rgba(255,255,255,0.35);
+}
+
+#tiptip_holder.tip_left #tiptip_arrow {
+	border-left-color: #fff;
+	border-left-color: rgba(255,255,255,0.35);
+}
+
+#tiptip_holder.tip_top #tiptip_arrow_inner {
+	margin-top: -7px;
+	margin-left: -6px;
+	border-top-color: rgb(25,25,25);
+	border-top-color: rgba(25,25,25,0.92);
+}
+
+#tiptip_holder.tip_bottom #tiptip_arrow_inner {
+	margin-top: -5px;
+	margin-left: -6px;
+	border-bottom-color: rgb(25,25,25);
+	border-bottom-color: rgba(25,25,25,0.92);
+}
+
+#tiptip_holder.tip_right #tiptip_arrow_inner {
+	margin-top: -6px;
+	margin-left: -5px;
+	border-right-color: rgb(25,25,25);
+	border-right-color: rgba(25,25,25,0.92);
+}
+
+#tiptip_holder.tip_left #tiptip_arrow_inner {
+	margin-top: -6px;
+	margin-left: -7px;
+	border-left-color: rgb(25,25,25);
+	border-left-color: rgba(25,25,25,0.92);
+}
+
+/* Webkit Hacks  */
+@media screen and (-webkit-min-device-pixel-ratio:0) {	
+	#tiptip_content {
+		padding: 4px 8px 5px 8px;
+		background-color: rgba(45,45,45,0.88);
+	}
+	#tiptip_holder.tip_bottom #tiptip_arrow_inner { 
+		border-bottom-color: rgba(45,45,45,0.88);
+	}
+	#tiptip_holder.tip_top #tiptip_arrow_inner { 
+		border-top-color: rgba(20,20,20,0.92);
+	}
+}
Index: /trunk/admin/template/goto/footer.tpl
===================================================================
--- /trunk/admin/template/goto/footer.tpl	(revision 5097)
+++ /trunk/admin/template/goto/footer.tpl	(revision 5098)
@@ -3,25 +3,5 @@
           don't be confusing with the public page footer
 *}
-<div id="copyright">
- <a name="EoP"></a> <!-- End of ADMIN Page -->
- {if isset($debug.TIME) }
- {'SQL queries in'|@translate} {$debug.TIME} ({$debug.NB_QUERIES} {'SQL queries in'|@translate} {$debug.SQL_TIME}) -
- {/if}
-
- {* Please, do not remove this copyright. If you really want to,
-      contact us on http://piwigo.org to find a solution on how
-      to show the origin of the script...
-  *}
-
-  {'Powered by'|@translate}
-  <a href="{$PHPWG_URL}" class="Piwigo">
-  <span class="Piwigo">Piwigo</span></a>
-  {$VERSION}
-  {if isset($CONTACT_MAIL)}
-  - {'Contact'|@translate}
-  <a href="mailto:{$CONTACT_MAIL}?subject={'title_send_mail'|@translate|@escape:url}">{'Webmaster'|@translate}</a>
-  {/if}
-
-</div> <!-- copyright -->
+</div> <!-- pwgMain -->
 {if isset($footer_elements)}
 {foreach from=$footer_elements item=v}
@@ -34,5 +14,44 @@
 </div>
 {/if}
+
+<div id="footer">
+  <div id="piwigoInfos">
+ {* Please, do not remove this copyright. If you really want to,
+      contact us on http://piwigo.org to find a solution on how
+      to show the origin of the script...
+  *}
+
+  {'Powered by'|@translate}
+  <a href="{$PHPWG_URL}" title="Visit Piwigo project website">
+  <span class="Piwigo">Piwigo</span></a>
+  {$VERSION}
+  | <a class="external" href="{$pwgmenu.WIKI}" title="Read Piwigo Documentation" onclick="window.open(this.href, ''); return false;">{'Documentation'|@translate}</a>
+  | <a class="external" href="{$pwgmenu.FORUM}" title="Get Support on Piwigo Forum" onclick="window.open(this.href, ''); return false;">{'Support'|@translate}</a>
+  </div> <!-- piwigoInfos -->
+
+  <div id="pageInfos">
+ {if isset($debug.TIME) }
+ {'SQL queries in'|@translate} {$debug.TIME} ({$debug.NB_QUERIES} {'SQL queries in'|@translate} {$debug.SQL_TIME}) -
+ {/if}
+
+
+  {'Contact'|@translate}
+  <a href="mailto:{$CONTACT_MAIL}?subject={'title_send_mail'|@translate|@escape:url}">{'Webmaster'|@translate}</a>
+  </div> <!-- pageInfos -->
+
+</div> <!-- footer -->
 </div> <!-- the_page -->
+
+{literal}
+<script type='text/javascript'>
+  $(function() {
+    $('#pwgHead A, #footer A').tipTip({
+        'delay' : 0,
+        'fadeIn' : 200,
+        'fadeOut' : 200,
+    });
+  });
+</script>
+{/literal}
 
 </body>
Index: /trunk/admin/template/goto/header.tpl
===================================================================
--- /trunk/admin/template/goto/header.tpl	(revision 5097)
+++ /trunk/admin/template/goto/header.tpl	(revision 5098)
@@ -44,6 +44,25 @@
 
 <body id="{$BODY_ID}">
-<div id="headbranch"></div> {* Dummy block for double background management *}
+
 <div id="the_page">
+
+<div id="pwgHead">
+  <h1>
+    <a href="{$U_RETURN}" title="Visit Gallery">
+      <img src="admin/template/goto/icon/home.png" alt="{'Home'|@translate}">
+      {$GALLERY_TITLE}
+    </a>
+  </h1>
+
+  <div id="headActions">
+    Hello {$USERNAME} :
+    <a href="{$U_RETURN}" title="Visit Gallery">Visit Gallery</a> |
+    <a href="{$U_CHANGE_THEME}" title="Switch to clear theme for administration">Change Theme</a> |
+    <a href="{$U_LOGOUT}">{'Logout'|@translate}</a>
+    <a href="{$U_FAQ}" title="{'Instructions'|@translate}" id="instructions"><img style="padding-left:10px;" src="{$ROOT_URL}admin/template/goto/icon/help.png" class="button" alt="(?)"></a>
+  </div>
+</div>
+
+<div style="clear:both;"></div>
 
 {if not empty($header_msgs)}
@@ -56,4 +75,5 @@
 
 <div id="theHeader">{*$PAGE_BANNER*}</div>
+
 {if not empty($header_notes)}
 <div class="header_notes">
@@ -63,2 +83,4 @@
 </div>
 {/if}
+
+<div id="pwgMain">
Index: /trunk/admin/template/goto/photos_add_direct.tpl
===================================================================
--- /trunk/admin/template/goto/photos_add_direct.tpl	(revision 5097)
+++ /trunk/admin/template/goto/photos_add_direct.tpl	(revision 5098)
@@ -72,5 +72,5 @@
 {/if}
 
-<div class="titrePage" style="height:25px">
+<div class="titrePage">
   <h2>{'Upload photos'|@translate}</h2>
 </div>
Index: /trunk/admin/template/goto/theme/clear/theme.css
===================================================================
--- /trunk/admin/template/goto/theme/clear/theme.css	(revision 5097)
+++ /trunk/admin/template/goto/theme/clear/theme.css	(revision 5098)
@@ -23,6 +23,6 @@
 html, body { min-height: 100%; }
 body { margin: 0; padding: 0; background:#eeeeee }
-#the_page { margin: 0; padding: 0; z-index: 1; top:0px;
-padding-top: 0; min-height: 100%; width:100%; position:absolute; left:0px; }
+/* #the_page { margin: 0; padding: 0; z-index: 1; top:0px; */
+/* padding-top: 0; min-height: 100%; width:100%; position:absolute; left:0px; } */
 #headbranch { width: 233px; height: 240px; margin: 0; padding: 0;
 position:absolute; left:0px; top:0px; z-index: 0; 
@@ -41,5 +41,5 @@
 /*.content h2:before, .content h2:after, */ 
 .content h2 { 
-letter-spacing:2px; margin-right:30px; text-align:right; color: #999; 
+letter-spacing:2px; margin-right:30px; text-align:left; color: #999; 
 text-transform:none; font-weight:bold; padding-left:20px; width:54%; }
 .content h2:lang(en) { text-transform:capitalize; }
@@ -97,7 +97,5 @@
 .content .navigationBar {color:#999;}
 ul.actions, .content form#waiting  {text-align:center;}
-h2 { display:block; font-size:28px; letter-spacing:-1px; 
-margin:0 20px; height:40px; overflow:hidden; padding:0; position:absolute; 
-right:0; text-align:right; top:0; width:770px; }
+h2 { font-size:28px; letter-spacing:-1px;padding:0; text-align:left;}
 .header_msgs { background:transparent url(images/header_msgs-bg.gif) repeat scroll right top;
 border:0; color:#ccc; font-size:24px; height:30px; left:0; margin:0; padding:10px 0 0; position:absolute;
Index: /trunk/admin/template/goto/theme/roma/theme.css
===================================================================
--- /trunk/admin/template/goto/theme/roma/theme.css	(revision 5097)
+++ /trunk/admin/template/goto/theme/roma/theme.css	(revision 5098)
@@ -9,5 +9,5 @@
 INPUT[type="submit"], INPUT[type="reset"]  { color:#999; border: 1px solid #666; background-color: #444; padding: 1px 15px; }
 input.rateButton, legend, h3 { color: #666; }
-#theAdminPage h2 { color: #333; }
+#theAdminPage h2 { color: #ccc; letter-spacing:2px; font-weight:bold;}
 .content .infos { color: #f70; border:0; background-color: transparent;
 padding:5px 60px 0pt 10pt; min-height: 48px; text-align:left; background-position:left top;}
@@ -16,6 +16,4 @@
 .content .errors { color: #f33; border:0; background-color: transparent;
 padding:5px 60px 0pt 10pt; min-height: 48px; text-align:left; font-weight:bold; background-position:left top;  }
-#copyright { color:#666; margin:60px auto 0px 240px; text-align:center;
-padding-bottom: 15px; }
 .header_notes { background: transparent url(../../icon/note.png) no-repeat right top;
 border:0; font-weight:bold; min-height: 48px;
@@ -24,29 +22,28 @@
 html, body { min-height: 100%; }
 body { margin: 0; padding: 0;
-background:#111111 url(images/bottom-left-bg.jpg) no-repeat fixed left bottom; }
-#the_page { margin: 0; padding: 0; z-index: 1; top:0px;
-padding-top: 0; min-height: 100%; width:100%; position:absolute; left:0px; }
+background-color:#111111; }
+/* #the_page { margin: 0; padding: 0; z-index: 1; top:0px; */
+/* padding-top: 0; min-height: 100%; width:100%; position:absolute; left:0px; } */
 #headbranch { width: 233px; height: 240px; margin: 0; padding: 0;
 position:absolute; left:0px; top:0px; z-index: 0;
-background:transparent url(images/top-left-bg.jpg) no-repeat scroll left top; }
-#theHeader { min-height:105px; margin: 0; padding: 0;
+}
+#theHeader { display:none;min-height:105px; margin: 0; padding: 0;
 background:transparent url(images/piwigo_logo_sombre_214x100.png) no-repeat scroll 245px top; }
 h3, #imageToolBar a:hover, .row2, .content { background-color: #222; }
 .throw, .row1 { background-color:#111; }
 .throw em { font-style: normal; color: #ff3363; }
-#content { min-height: 466px; margin-top: 9px; }
+
+#content { min-height: 466px; margin-top: 15px; }
 .content { padding:0 5px 5px; margin: 0 10px 0 248px; z-index:99; }
-.content h3 { font-size:20px; letter-spacing:-0.4px; margin:0 20px 12px 0;
- text-align:center; background:none; border: 0; }
+
+.content h3 { font-size:20px; letter-spacing:-0.4px; margin:0 20px 12px 0; text-align:center; background:none; border: 0; }
 .content h3 ~ h3{ margin-top: 40px; }
 .content h4 { font-size:14px; text-align:left; padding:3px; margin: 2px;}
-/*.content h2:before, .content h2:after, */
-.content h2 {
-letter-spacing:2px; margin-right:30px; text-align:right; color: #666;
-text-transform:none; font-weight:bold; padding-left:20px; width:54%; }
-.content h2:lang(en) { text-transform:capitalize; }
+
+/*.content h2:before, .content h2:after, */ 
+h2:lang(en) { text-transform:capitalize; }
 
 .content dl, dd { margin:5px; }
-.content div.titrePage { height:55px; }
+.content div.titrePage {}
 .instructions { height:450px; overflow:scroll; padding:0 20px 0; text-align:left; margin-bottom: 20px;
 font-size:14px; line-height:21px; }
@@ -108,7 +105,5 @@
 .content .navigationBar {color:#666;}
 ul.actions, .content form#waiting  {text-align:center;}
-h2 { display:block; font-size:28px; letter-spacing:-1px;
-margin:0 20px; height:104px; overflow:hidden; padding:0; position:absolute;
-right:0; text-align:right; top:0; width:770px; }
+
 .header_msgs { background:transparent url(images/header_msgs-bg.gif) repeat scroll right top;
 border:0; color:#333; font-size:24px; height:30px; left:0; margin:0; padding:10px 0 0; position:absolute;
@@ -125,5 +120,5 @@
 top:-2px; white-space:nowrap; margin: 0 0 0 -5px; padding-left:10px;
 width:100%; }
-.tabsheet li { background:#222222; float:left; margin:0 6px 0 0; overflow:hidden; text-align:right; border:1px solid #ff3363; border-bottom:none; position:relative; top:11px; }
+.tabsheet li { background:#222222; float:left; margin:0 6px 0 0; overflow:hidden; text-align:right; border:1px solid #ff3363; border-bottom:none; position:relative; top:11px; -moz-border-radius-topleft:5px; -moz-border-radius-topright:5px;}
 .tabsheet a {
 color:#666; display:block; font-size:11px; border:0;
@@ -143,6 +138,6 @@
 #menubar {
 background:transparent url(images/menuBoxBottom_new.png) no-repeat scroll left bottom;
-border:0; display:inline; float:left; left:0; margin: 0 0 0 35px; min-height:475px; height:475px; /* should be 477 */
-padding:0; width:207px; z-index:99; text-align: left; }
+border:0; display:inline; float:left; left:0; margin: 10px 0 0 10px; min-height:475px; height:475px; /* should be 477 */
+padding:0; width:230px; z-index:99; text-align: left; }
 #menubar ul.scroll { height:163px; margin-right:10px; overflow-y:auto;
  /* Only IE family supports colored scrollbar */
@@ -218,3 +213,7 @@
 *+html  .bigtext { left: 70px; }
 *+html  .bigbutton input, * html  .bigbutton input  { left:0px; position:relative; top:-40px; }
+
 * html .bigtext { margin-right: 300px; }
+
+#adminHome       {background-color:#222;}
+#adminHome:hover {background-color:#333;}
Index: /trunk/template-common/lib/plugins/jquery.tipTip.minified.js
===================================================================
--- /trunk/template-common/lib/plugins/jquery.tipTip.minified.js	(revision 5098)
+++ /trunk/template-common/lib/plugins/jquery.tipTip.minified.js	(revision 5098)
@@ -0,0 +1,27 @@
+ /*
+ * TipTip
+ * Copyright 2010 Drew Wilson
+ * www.drewwilson.com
+ * code.drewwilson.com/entry/tiptip-jquery-plugin
+ *
+ * Version 1.2   -   Updated: Jan. 13, 2010
+ *
+ * This Plug-In will create a custom tooltip to replace the default
+ * browser tooltip. It is extremely lightweight and very smart in
+ * that it detects the edges of the browser window and will make sure
+ * the tooltip stays within the current window size. As a result the
+ * tooltip will adjust itself to be displayed above, below, to the left 
+ * or to the right depending on what is necessary to stay within the
+ * browser window. It is completely customizable as well via CSS.
+ *
+ * This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
+ *   http://www.opensource.org/licenses/mit-license.php
+ *   http://www.gnu.org/licenses/gpl.html
+ */
+(function($){$.fn.tipTip=function(options){var defaults={maxWidth:"200px",edgeOffset:3,delay:400,fadeIn:200,fadeOut:200,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')));}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow");}
+return this.each(function(){var org_elem=$(this);var org_title=org_elem.attr("title");if(org_title!=""){org_elem.removeAttr("title");var timeout=false;org_elem.hover(function(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(w_compare<0){if((w_compare+left)<parseInt($(window).scrollLeft())){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare);}else if((tip_w+left)>parseInt($(window).width())){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare);}}
+if((top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop())){t_class=t_class+"_top";arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset));}else if(((top+org_height)-(opts.edgeOffset+tip_h))<0||t_class==""){t_class=t_class+"_bottom";arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset);}
+if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5;}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5;}
+if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5;}
+tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout);}
+timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn);},opts.delay);},function(){opts.exit.call(this);if(timeout){clearTimeout(timeout);}tiptip_holder.fadeOut(opts.fadeOut);});}});}})(jQuery);
