function goUrl(url){
	if(url.indexOf("#")> -1){
	        if(url=="#"){return false;}
			document.location.href= url;
			return false;
	}else{
		var txt = url.split("?");
		if (txt.length < 2) { 
			document.location.href=(url +"?rand=" + (new Date).getTime()); 
		}else{
				var txt1 = txt[1].split("&");
				var nurl = txt[0]+"?";
				for(var i =0 ; i < txt1.length; i++){
					var txt2 = txt1[i].split("=");
					if (txt2[0]!="rand") {
						nurl += txt2[0] + "=" + txt2[1]+"&";
					} 
				}
//				document.location.replace( url + "&rand="+ (new Date).getTime() );
				document.location.href = (nurl + "rand="+ (new Date).getTime()) ;
		}
	}
	return false;
}

function getUrl(url){
	if(url.indexOf("#")> -1){
			return url;
	}else{
		var txt = url.split("?");
		if (txt.length < 2) { return url +"?rand=" + (new Date).getTime(); }
		else{
				var txt1 = txt[1].split("&");
				for(var i =0 ; i < txt1.length; i++){ if (txt1[i]=="rand") { document.location.href=url +"?rand=" + (new Date).getTime(); return false; } }
				return url + "&rand="+ (new Date).getTime();
		}
	}
}

function goRefreshWithParam(param){

	return goUrl(getRefreshUrlWithParam(param));
}

function getRefreshUrlWithParam(param){
	var url = document.location.href;
	var txt = param.split("=");
	var txt0 = url.split("?");
	if(txt0.length>1){
		url = txt0[0]+"?";
		txt1 = txt0[1].split("&");
		var count = 0;
		for(var i =0; i < txt1.length;i++){
			var txt2 = txt1[i].split("=");
			if(txt2[0]!="rand"){
				if(txt2[0]!=txt[0]){ 
					url += ((count==0)?"":"&")+txt1[i]; count ++;
				}
			}
		}
		url +=((count>1)?"&":"") + param;
	}else{
		url = url + "?"+param;
	}
	return url;
}

function printPage(){ window.print(); return false; }
