$(function(){LayoutSetup();$(".expand_row").on("mouseenter",function(){$(this).addClass("hover")}).on("mouseleave",function(){$(this).removeClass("hover")});gplinks.layout_id=function(a,e){function b(){f.hide();$("body").off(".layout_id")}e.preventDefault();var g=$(this).offset();$("#current_color").css("background-color",a);var f=$("#layout_ident").show().css({left:g.left+20,top:g.top}).appendTo("#gp_admin_html"),d=f.find("form").get(0);d&&$(this).find("input").each(function(a,c){d[c.name]&&(d[c.name].value=
c.value)});f.find("a.color").off("click").on("click",function(){$("#current_color").css("background-color",this.rel);d.color.value=this.rel});f.find("input.cancel").off("click").on("click",function(){b()});$("body").on("click.layout_id",function(){b()}).on("keydown.layout_id",function(a){27===a.keyCode&&(a.preventDefault(),b())});f.on("click.layout_id",function(a){a.stopPropagation()})};$(".draggable_element").live("mouseenter",function(){$this=$(this);if(!$this.hasClass("target")){$this.addClass("hover");
$this.find("div").stop(!0,!0).fadeIn();$this.stop(!0).fadeTo("200",1);var a=$this.height();$this.data("ph",a);$this.height("auto").height()<a&&$this.height(a)}}).live("mouseleave",function(){$this.removeClass("hover");$this=$(this);$this.stop(!0).fadeTo("slow",0.5);$this.find("div").stop(!0,!0).fadeOut();var a=$this.data("ph");0<parseInt(a)&&$this.height(a)});$(".theme_select select").change(function(){""!=this.value&&(window.location="layout"==this.name?this.form.action+"/"+this.value:this.form.action+
"?cmd=preview&theme="+this.value)})});
function LayoutSetup(){if("undefined"!=typeof gpLayouts){$("a.ExtraEditLink").detach();$(".editable_area").removeClass("editable_area");var a=$(".filetype-text");a.offset();a.width();$("body").addClass("edit_layout");var e=$('<div class="draggable_droparea" id="theme_content_drop"></div>').appendTo("#gp_admin_html");$(".output_area").each(function(a,b){var d,h,c;c=$(b);d=GetCoords(c);h=c.find(".gplinks");if(0<h.length)$('<div class="draggable_element" style="position:absolute;height:5px;width:5px;"></div>').appendTo(e).append(h).fadeTo("fast",0.5).height(d.h-
3).width(d.w-3).on("gp_position",function(){var a=GetCoords(c);20>a.h&&(c.height(20),a.h=20);20>a.w&&(c.width(20),a.w=20);$(this).css({top:a.top,left:a.left})})});var b=$(".draggable_element");b.trigger("gp_position");window.setInterval(function(){b.trigger("gp_position")},2E3)}}function EditCSS(){var a=$("#gp_layout_css"),e=$("#gp_layout_style"),b=$("#gp_layout_style").html(),g=window.setInterval(function(){a.is(":visible")?e.html(a.val()):(e.html(b),window.clearInterval(g))},1E3)};