<script>
  function openSEOForm(event, command) {
    var evt = event || window.event;
    var mouse_cordinate = evt.clientY + "," + evt.clientX; 
    command = command.replace('str', mouse_cordinate);
    command = command.replace(/~/g,"'");
    eval(command);
  }
</script>
<div class="UISEOToolbarPorlet">
<%	
	def fullStatus = uicomponent.getFullStatus();	
	def seo_icon = fullStatus + ".png";
	def seo_title = (String)_ctx.appRes(uicomponent.getId() + ".title.seo");
	def style = "Enable";
	if(fullStatus.equals("Disabled")) style = "Disable";
	
%>
<% uiform.begin() %>
	<div class="SEOToolbar">	
	  <%if(fullStatus.equals("Disabled")) {%>
		  <a class="<%=style%>" title="<%=seo_title%>"><img src="/seo/skin/webui/seo/DefaultSkin/icons/${seo_icon}"></a>
	  <%} else {
	  	def onclickURL = "openSEOForm(event, '" + uicomponent.event("AddSEO","str").replace("'","~") + "')";
	  	%>	
	    <a class="<%=style%>" title="<%=seo_title%>" onclick="<%=onclickURL%>"><img src="/seo/skin/webui/seo/DefaultSkin/icons/${seo_icon}"></a>
	  <%}%>  
	</div>
<% uiform.end() %>
</div>