﻿var rValue;
function holdDown(elem, period, funcRef)
{
 rValue=true;  
 elem.onmouseup=function(){clearTimeout(this.execDelay);}  
 elem.onclick=function(){return rValue++;}
 elem.onmousedown=function() {rValue=true; this.execDelay = setTimeout( (function(e,f){ return function(){ rValue=false; f(); }})(this,funcRef), period); } 
}

//Ajax default parameters
$.ajaxSetup({
  type: "POST",
  data: "{}",
  contentType: "application/json; charset=utf-8",
  dataType: "json"
});