function getParameter(name,cancelBubble){
var r = new RegExp("(\\?|#|&)"+name+"=([^&#]*)(&|#|$)");
var m = location.href.match(r);
if ((!m || m=="") && !cancelBubble) m = top.location.href.match(r);
return (!m?"":m[2]);
}
function setParameter(url,name,value){
if(getParameter(name)!="") {
var r = new RegExp("(\\?|#|&)"+name+"=([^&#]*)(&|#|$)");
var m = url.match(r); url=url.replace(m[0],"");
}
return (url.indexOf('?')>0?url+"&"+name+"="+value:url+"?"+name+"="+value);
}