
var contct={};

contct.replyForm=function(warrantyId){
	editAccountPanel.show();
	var heading=getElementId("heading");
	heading.innerHTML='Reply';
	var URL=APPLICATION_URL+"contactus/getReplyForm/"+warrantyId+"?ajaxcall=true";
	handleSuccess=function(o){
		getElementId("editaccountDiv").innerHTML=o.responseText;
	}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.asyncRequest("GET",URL,callback);}

contct.saveReply=function(cId){
	var URL=APPLICATION_URL+"contactus/saveReply/"+cId+"?ajaxcall=true";
	var formObject=getElementId("editaccount");
	handleSuccess=function(o){
		if(parseInt(o.responseText)==1){
			alert("Reply has been sent successfully");
			editAccountPanel.hide();
			location.href=APPLICATION_URL+'contactus/allReplies/'+cId;
		}else{
			getElementId("editaccountDiv").innerHTML=o.responseText;
		}
	}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.setForm(formObject);YAHOO.util.Connect.asyncRequest("POST",URL,callback);}

contct.deleteReply=function(tid,contctId){
		if(confirm("Are you sure you want to delete?")){
			lookupURL=APPLICATION_URL+"contactus/deleteReply/"+tid+"?ajaxcall=true";
			handleSuccess=function(o){
				alert(o.responseText);
				location.href=APPLICATION_URL+'contactus/allReplies/'+contctId;
			}
			callback={success:handleSuccess,failure:this.handleFailure}
			YAHOO.util.Connect.asyncRequest("GET",lookupURL,callback)
		}
	}
contct.dlt=function(contctId){
		if(confirm("Are you sure you want to delete?")){
			lookupURL=APPLICATION_URL+"contactus/deleteContct/"+contctId+"?ajaxcall=true";
			handleSuccess=function(o){
				alert(o.responseText);
				location.href=APPLICATION_URL+'myaccount/allContacts';
			}
			callback={success:handleSuccess,failure:this.handleFailure}
			YAHOO.util.Connect.asyncRequest("GET",lookupURL,callback)
		}
	}	
