<?
function setpagestyle($params){
		extract($params);
		$pagestyle = isset($pagestyle) ? $pagestyle : "html";
		$url =  "http://".$_SERVER ['HTTP_HOST'].$_SERVER['REQUEST_URI'];
		$urlarray = parse_url($url);
		$newurl = "http://".$urlarray["host"].$urlarray["path"]."?".url_set_value($urlarray["query"],"pagestyle",$pagestyle);
		return $newurl;
}
?>