Error: $(".ui-dialog-content").dialog is not a function

Error: $(".ui-dialog-content").dialog is not a function


I created a jquery pop up and when i try to close it it give a error as above. Please help me to solve this error. My source code is attached here with.

$(document).ready( function() { $( ".pop-close" ).click(function() { $(".ui-dialog-content").dialog("close"); }); $(".preview").click(function() { $( ".ui-dialog-content #add" ).hide("slow"); $( ".ui-dialog-content #preview" ).show("slow"); }); $(".back-preview").click(function() { $( ".ui-dialog-content #preview" ).hide("slow"); $( ".ui-dialog-content #add" ).show("slow"); }); }); 



regards,
charith