Index: /trunk/include/functions_url.inc.php
===================================================================
--- /trunk/include/functions_url.inc.php	(revision 14179)
+++ /trunk/include/functions_url.inc.php	(revision 14180)
@@ -136,5 +136,5 @@
   if ($url == $url_before_params)
   {
-    $url = get_absolute_root_url();
+    $url = get_absolute_root_url( url_is_remote($url) );
   }
   
Index: /trunk/themes/default/template/index.tpl
===================================================================
--- /trunk/themes/default/template/index.tpl	(revision 14179)
+++ /trunk/themes/default/template/index.tpl	(revision 14180)
@@ -31,5 +31,4 @@
 		{/strip}</li>
 {/if}
-
 {if !empty($image_derivatives)}
 		<li>{strip}<a id="derivativeSwitchLink" title="{'Photo sizes'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
@@ -42,5 +41,5 @@
 			<span>&#x2714; </span>{$image_derivative.DISPLAY}
 			{else}
-			<span style="visibility:hidden">&#x2714; </span><a href="{$image_derivative.URL}" class="switchUnselected" rel="nofollow">{$image_derivative.DISPLAY}</a>
+			<span style="visibility:hidden">&#x2714; </span><a href="{$image_derivative.URL}" rel="nofollow">{$image_derivative.DISPLAY}</a>
 			{/if}
 			{/foreach}
Index: /trunk/themes/default/template/picture.tpl
===================================================================
--- /trunk/themes/default/template/picture.tpl	(revision 14179)
+++ /trunk/themes/default/template/picture.tpl	(revision 14180)
@@ -19,5 +19,4 @@
 {include file='picture_nav_buttons.tpl'|@get_extent:'picture_nav_buttons'}
 <div class="actionButtons">
-
 {if count($current.unique_derivatives)>1}
 {footer_script require='jquery'}{literal}
@@ -35,5 +34,4 @@
 	document.cookie = 'picture_deriv='+typeSave+';path={/literal}{$COOKIE_PATH}{literal}';
 }
-
 jQuery("#derivativeSwitchLink").click(function() {
 	var elt = jQuery("#derivativeSwitchBox");
@@ -63,5 +61,4 @@
 {/strip}
 {/if}
-
 {strip}{if isset($U_SLIDESHOW_START)}
 	<a href="{$U_SLIDESHOW_START}" title="{'slideshow'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
@@ -125,5 +122,4 @@
 <p class="imageComment">{$COMMENT_IMG}</p>
 {/if}
-
 {if isset($U_SLIDESHOW_STOP)}
 <p>
@@ -338,32 +334,32 @@
 	<div id="pictureComments">
 		{if isset($comment_add)}
-			<div id="commentAdd">
-				<h4>{'Add a comment'|@translate}</h4>
-				<form method="post" action="{$comment_add.F_ACTION}" id="addComment" >
-					{if $comment_add.SHOW_AUTHOR}
-						<p><label>{'Author'|@translate} :</label></p>
-						<p><input type="text" name="author" /></p>
-						<p><label>{'Comment'|@translate} :</label></p>
+		<div id="commentAdd">
+			<h4>{'Add a comment'|@translate}</h4>
+			<form method="post" action="{$comment_add.F_ACTION}" id="addComment">
+				{if $comment_add.SHOW_AUTHOR}
+					<p><label>{'Author'|@translate} :</label></p>
+					<p><input type="text" name="author"></p>
+					<p><label>{'Comment'|@translate} :</label></p>
+				{/if}
+				<p><textarea name="content" id="contentid" rows="5" cols="50">{$comment_add.CONTENT}</textarea></p>
+				<p><input type="hidden" name="key" value="{$comment_add.KEY}">
+					<input type="submit" value="{'Submit'|@translate}"></p>
+			</form>
+		</div>
+		{/if}
+		{if isset($comments)}
+		<div id="pictureCommentList">
+			{if (($COMMENT_COUNT > 2) || !empty($navbar))}
+				<div id="pictureCommentNavBar">
+					{if $COMMENT_COUNT > 2}
+						<a href="{$COMMENTS_ORDER_URL}#comments" rel="nofollow" class="commentsOrder">{$COMMENTS_ORDER_TITLE}</a>
 					{/if}
-					<p><textarea name="content" id="contentid" rows="5" cols="50">{$comment_add.CONTENT}</textarea></p>
-					<p><input type="hidden" name="key" value="{$comment_add.KEY}" />
-						<input type="submit" value="{'Submit'|@translate}"></p>
-				</form>
-			</div>
-		{/if}
-		{if isset($comments)}
-			<div id="pictureCommentList">
-				{if (($COMMENT_COUNT > 2) || !empty($navbar))}
-					<div id="pictureCommentNavBar">
-						{if $COMMENT_COUNT > 2}
-							<a href="{$COMMENTS_ORDER_URL}#comments" rel="nofollow" class="commentsOrder">{$COMMENTS_ORDER_TITLE}</a>
-						{/if}
-						{if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
-					</div>
-				{/if}
-				{include file='comment_list.tpl'}
-			</div>
-		{/if}
-		<div style="clear: both;"></div>
+					{if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
+				</div>
+			{/if}
+			{include file='comment_list.tpl'}
+		</div>
+		{/if}
+		<div style="clear:both"></div>
 	</div>
 
Index: /trunk/themes/default/template/picture_content.tpl
===================================================================
--- /trunk/themes/default/template/picture_content.tpl	(revision 14179)
+++ /trunk/themes/default/template/picture_content.tpl	(revision 14180)
@@ -1,9 +1,6 @@
-<img src="{$current.selected_derivative->get_url()}" {$current.selected_derivative->get_size_htm()} alt="{$ALT_IMG}" id="theMainImage" usemap="#map{$current.selected_derivative->get_type()}"
-{if isset($COMMENT_IMG)}
-	title="{$COMMENT_IMG|@strip_tags:false|@replace:'"':' '}" {else} title="{$current.TITLE|@replace:'"':' '} - {$ALT_IMG}"
-{/if}>
+<img src="{$current.selected_derivative->get_url()}" {$current.selected_derivative->get_size_htm()} alt="{$ALT_IMG}" id="theMainImage" usemap="#map{$current.selected_derivative->get_type()}" title="{if isset($COMMENT_IMG)}{$COMMENT_IMG|@strip_tags:false|@replace:'"':' '}{else}{$current.TITLE|@replace:'"':' '} - {$ALT_IMG}{/if}">
 
 {foreach from=$current.unique_derivatives item=derivative key=derivative_type}{strip}
-<map name="map{$derivative->get_type()}" id="map{$derivative->get_type()}">
+<map name="map{$derivative->get_type()}">
 {assign var='size' value=$derivative->get_size()}
 {if isset($previous)}
