
(function($){var apiMethods=["scheduleRecording","scheduleReminder","deleteRecording","deleteReminder","getRecordings","getBoxes"];function getSessionCookie(){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=$.trim(cookies[i]);if(cookie.substring(0,11)==('_rpvr_sess=')){return decodeURIComponent(cookie.substring(11));}}
return'0';}
function setSessionCookie(value){document.cookie='_rpvr_sess='+encodeURIComponent(value)+';path=/';}
window.WebPVR={_callJSONP:function(functionName,options,callback){var optionsUrl=$.param(options);var sessionKey=getSessionCookie();$.getJSON("http://remotepvr.telenet.be/api/"+sessionKey+"/"+functionName+"?"+optionsUrl+"&callback=?",function(p){setSessionCookie(p[0]);callback(p[1]);});}}
$.each(apiMethods,function(i,name){window.WebPVR[name]=function(options,callback){WebPVR._callJSONP(name,options,callback);}});})(jQuery);
