﻿    function reportAbuse(commentId){
       $("#abuseForm").html('<iframe id="abuseFormIframeId" width="100%" height="610" marginWidth="0" marginHeight="0" frameBorder="0" scrolling="no" />').dialog("open");
       var uri = "http://www.kentonline.co.uk/comments/RegisteredAbuseForm.aspx?commentId="+commentId;
       $("#abuseFormIframeId").attr("src",uri);
       return false;
    }
    function leaveComment(pageId){
       $("#commentForm").html('<iframe id="commentFormIframeId" width="100%" height="610" marginWidth="0" marginHeight="0" frameBorder="0" scrolling="no" />').dialog("open");
       var uri = "http://www.kentonline.co.uk/comments/RegisteredCommentForm.aspx?pageId="+pageId;
       $("#commentFormIframeId").attr("src",uri);
       return false;
    }
    function loginRegisterComment(id) {
       $("#loginRegisterForm").html('<iframe id="loginRegisterFormframeId" width="100%" height="800" marginWidth="0" marginHeight="0" frameBorder="0" scrolling="no" />').dialog("open");
       var uri = "http://www.kentonline.co.uk/authenticate/authenticate.aspx?pageId=" + id;
       $("#loginRegisterFormframeId").attr("src", uri);
       return false;
    }
    function loginRegisterAbuse(id) {
       $("#loginRegisterForm").html('<iframe id="loginRegisterFormframeId" width="100%" height="800" marginWidth="0" marginHeight="0" frameBorder="0" scrolling="no" />').dialog("open");
       var uri = "http://www.kentonline.co.uk/authenticate/authenticate.aspx?commentId=" + id;
       $("#loginRegisterFormframeId").attr("src", uri);
       return false;
    }
    function closeAbuseDialog(){
       $("#abuseForm").dialog('close');
    }
    function closeCommentDialog(){
       $("#commentForm").dialog('close');
    }
    function closeAuthDialog() {
       $("#loginRegisterForm").dialog('close');
    }
    $(document).ready(function() {
       $("#abuseForm").dialog({
               autoOpen: false,
               modal: true,
               height: 660,
               width: 480,
               closeOnEscape: true,
		       resizable: false,
		       bgiframe: true
           });
       $("#commentForm").dialog({
               autoOpen: false,
               modal: true,
               height: 660,
               width: 480,
               closeOnEscape: true,
		       resizable: false,
		       bgiframe: true
		   });
	   $("#loginRegisterForm").dialog({
		       autoOpen: false,
		       modal: true,
		       height: 800,
		       width: 920,
		       closeOnEscape: true,
		       resizable: true,
		       bgiframe: true
		   });
       $(".nobullets a[href!='']").attr('href','#');
       $(".leaveComment").attr('href', '#');
       $(".leaveComment").removeAttr('target');
       $(".blog a").removeAttr('target');
    });
