$(document).ready(function(){

$("form.ajax").submit(function(){ 
alldata="";url=$(this).attr("action");var alldata = $(this).serialize();
$.ajax({ type: "POST", url: url, data: alldata,success: function(){	 }	}); return false;

});

});
/************************ start plugins ************************/
(function($){  

$.fn.autorefresh=function (options) { 
   var defaults = {duration: 10};  
   var options = $.extend(defaults, options);  
   return this.each(function() {  
		var obj = $(this); var theid=obj.parents(".module").attr("id");
		var autorefreshrate=setInterval(function(){			
		obj.load("modules/"+theid+"_content.asp");},options.duration*1000);		});
};


$.fn.delay = function(time, callback){
    jQuery.fx.step.delay = function(){};
    return this.animate({delay:1}, time, callback);
};

})(jQuery);

function Left(str, n){ if (n <= 0) return "";else if (n > String(str).length) return str; else return String(str).substring(0,n);}
function Right(str, n){ if (n <= 0)    return "";else if (n > String(str).length) return str; else { var iLen = String(str).length; return String(str).substring(iLen, iLen - n);}}

/********* post form with ajax ************/

var months = new Array(13);
months[0]  = "January";
months[1]  = "February";
months[2]  = "March";
months[3]  = "April";
months[4]  = "May";
months[5]  = "June";
months[6]  = "July";
months[7]  = "August";
months[8]  = "September";
months[9]  = "October";
months[10] = "November";
months[11] = "December";

function createtime()
{
var time = new Date()
var hours = time.getHours()
var minutes = time.getMinutes()
var seconds = time.getSeconds()
var abbrev = "AM"
if (hours>=12)
abbrev="PM"
if (hours>12)
{
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
var ctime=(months[time.getMonth()])+" "+time.getDate()+", "+time.getFullYear()+"&nbsp;&nbsp;"+""+hours+":"+minutes+":"+seconds+" "+abbrev+""
if (document.all) 
document.all.clock.innerHTML=ctime
else if (document.getElementById) 
document.getElementById("clock").innerHTML=ctime
else
document.write(ctime) }
if (!document.all&&!document.getElementById)
createtime()
function loadtime()
{
if (document.all||document.getElementById)
setInterval("createtime()",1000)
}
