<?php

$out2 = wp_cache_get( 'wct_select_js' , 'wct');
if ($out2 == false) {
	$url = str_replace("/&","/?",get_site_url().preg_replace("/[&?]+wctdro(p|f)=[a-zA-Z]*/","",str_replace("%20","xxxoooxxx","/".basename($_SERVER[REQUEST_URI]))));
	if (strpos($url,"?") !== FALSE) { $url .= "&"; } else { $url .= "?"; }
	$url = str_replace("xxxoooxxx","%20",$url);
	$out2 = "<script type=\"text/javascript\">
		function selector(field){
			var selection = document.getElementById('wctdrop_' + field).options[document.getElementById('wctdrop_' + field).selectedIndex].value;
			location.href= '".$url."wctdrof=' + field + '&wctdrop=' + selection;
		}
		</script>";
	wp_cache_set( 'wct_select_js', $out, 'wct', $this->settings['wct_cachetime']);
}
echo $out2;

?>