/**
 * @author rgriffith
 * JQUERY Common library
 */
$(document).ready(function(){
	<!--//---------------------------------+
	//  Developed by Roshan Bhattarai 
	//  Visit http://roshanbh.com.np for this script and more.
	//  This notice MUST stay intact for legal use
	// --------------------------------->
	$("p.menu_child.open").parent().prev().addClass("open");
	$("p.menu_child.open a").addClass("active");
	$("#menu-tree p.menu_head.open").next("div.menu-child").slideToggle(300).siblings("div.menu-child").slideUp("slow");
	<!--//---------------------------------+
	//  End of code Developed by Roshan Bhattarai 
	// --------------------------------->
	
	if ($('.date-pick').length > 0) {
		Date.format = 'yyyy-mm-dd';
		$('.date-pick').datePicker({startDate:'2008-01-01'}).val(new Date().asString()).trigger('change');
	}
	if ($('#SuccesschartEntrydate').length > 0) {
		$('#SuccesschartEntrydate').dpSetPosition($.dpConst.POS_TOP, $.dpConst.POS_RIGHT);
	}
});
/**
 * @author rgriffith
 * CONVERT FUNCTION: http://ntu.csie.org/~piaip/unihtml/
 */
function convert(obj)
{
  str = obj.value;
  result = "";

  for(i = 0 ; i < str.length ; i++) {
    c = str.charAt(i);
    if((' ' <= c && c <= '~') || (c == '\r') || (c == '\n')) {
      if(c == '&') {
        cstr = "&amp;";
      } else if(c == '<') {
        cstr = "&lt;";
      } else if(c == '>') {
        cstr = "&gt;";
      } else {
        cstr = c.toString();
      }
    } else {
      cstr = "&#" + c.charCodeAt().toString() + ";";
    }
    result = result + cstr;
  }
  obj.value = result;
}

