function readCookies(){
	  if (readCookie("pt1")!="") {
			document.p2phone.num_part1.value = readCookie("pt1")
	  }
	  if (readCookie("pt2")!="") {
			document.p2phone.num_part2.value = readCookie("pt2")
	  }
	  if (readCookie("pt3")!="") {
			document.p2phone.num_part3.value = readCookie("pt3")
	  }
	  if (readCookie("ex")!="") {
			document.p2phone.extn.value = readCookie("ex")
	  }
	  if (readCookie("intl")!="") {
			document.p2phone.intl_num.value = readCookie("intl")
	  }
	  if (readCookie("nm")!="") {
			document.p2phone.txtName.value = readCookie("nm")
	  }
	  if (readCookie("em")!="") {
			document.p2phone.txtEmail.value = readCookie("em")
	  }
}

function makeCookies(){
	  makeCookie("pt1", document.p2phone.num_part1.value, 7)
	  makeCookie("pt2", document.p2phone.num_part2.value, 7)
	  makeCookie("pt3", document.p2phone.num_part3.value, 7)
	  makeCookie("ex", document.p2phone.extn.value, 7)
	  makeCookie("intl", document.p2phone.intl_num.value, 7)
	  makeCookie("nm", document.p2phone.txtName.value, 7)
	  makeCookie("em", document.p2phone.txtEmail.value, 7)
}

function readCookie(cookieName){
   var searchName = cookieName + "="
   var cookies = document.cookie
   var start = cookies.indexOf(searchName)
   if (start == -1){ // cookie not found 
     return ""
     }
   start += searchName.length //start of the cookie data
   var end = cookies.indexOf(";", start)
   if (end == -1){
     end = cookies.length
     }
   return cookies.substring(start, end)
   }

function getCookieExpireDate(noDays){
  var today = new Date()
  var expr = new Date(today.getTime()+noDays*24*60*60*1000)
  return  expr.toGMTString()
  }
function makeCookie(name, data, noDays){
  var cookieStr = name + "="+ data
  if (makeCookie.arguments.length > 2){
    cookieStr += "; expires=" + getCookieExpireDate(noDays) + "; secure"
    }
  document.cookie = cookieStr
  }

