function loadUrl(destination,inner,call){var xmlhttp=null;try{xmlhttp=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP');}catch(e){alert('Your browser doesn\'t support ajax: '.e.toString());}
var url=destination.split('?');xmlhttp.open('POST',url[0],true);xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');xmlhttp.setRequestHeader('Content-length',url[1].length);xmlhttp.setRequestHeader('Connection','close');xmlhttp.onreadystatechange=triggeredPost;xmlhttp.send(url[1]);function triggeredPost(){if((xmlhttp.readyState==4)&&(xmlhttp.status==200)){if(inner=='RELOAD_PAGE')location.reload();if(inner!=null)
document.getElementById(inner).innerHTML=xmlhttp.responseText;if(call!=null)
callFunction(call);}}}
function callFunction(f){var fn=window[f];if(typeof fn==='function'){fn();}}
function postToUrl(path,params,method){method=method||'post';var form=document.createElement('form');form.setAttribute('method',method);form.setAttribute('action',path);for(var key in params){var hiddenField=document.createElement('input');hiddenField.setAttribute('type','hidden');hiddenField.setAttribute('name',key);hiddenField.setAttribute('value',params[key]);form.appendChild(hiddenField);}
document.body.appendChild(form);form.submit();}
function openWindowWithPost(url,name,keys,values)
{var newWindow=window.open(url,name);if(!newWindow)return false;var html="";html+="<html><head></head><body><form id='openWindowWithPost' method='post' action='"+url+"'>";if(keys&&values&&(keys.length==values.length))
for(var i=0;i<keys.length;i++)
html+="<input type='hidden' name='"+keys[i]+"' value='"+values[i]+"'/>";html+="</form><script type='text/javascript'>document.getElementById(\"openWindowWithPost\").submit()</script></body></html>";newWindow.document.write(html);return newWindow;}
