function go_pct_page(page){
var pct = readCookie("pct")
var pct_page = pct+page
//alert(pct_page)
location = pct_page
}

function go_pct_pdf(page){
var pct = readCookie("pct")
var pct_page = pct+page
//alert(pct_page)
popUpWindow(pct_page)
}

var popUpWin=0;
function popUpWindow(URLStr, width, height)
{
if((!height)&&(!width)){
	width = 590
	height = 570
	
}
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=yes,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left=20, top=20,screenX=20,screenY=20');
}

function pct_choice(sel_pct){
var pct
var pct_url
if(sel_pct){pct=sel_pct}
else{pct =  form_menu.prac_menu.value}
pct_url = 'manual/'+pct+'_choice.htm'
popUpWindow(pct_url)
}

function multimap(postcode){
var map_url
map_url = 'http://www.multimap.com/map/browse.cgi?pc='+postcode
popUpWindow(map_url, 750, 550)
}

function pct_cookie(sel_pct){
	//alert(sel_pct)
	var pct
	if(sel_pct){pct=sel_pct}
	else{pct =  form_main.prac_main.value}
	writeCookie("pct", pct)
	location = 'manual/what_is_choice.htm'
}


function writeCookie(name, value)
{
  document.cookie = name + "=" + escape(value);
}

function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}


