// JavaScript Document
function eraseCookie(name)
{
	createCookie(name,"",-1);
	return;
}
function createCookie(name,value,days)
{

	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
function resetSearch(action, formName)
{
  var sector=getCookie('sector');
  var state=getCookie('state');
  var StartDate=getCookie('startdate');
  var EndDate=getCookie('enddate');
  var Keywords=getCookie('keywords');
  var PriceMin=getCookie('pricemin');
  var PriceMax=getCookie('pricemax');

 if (sector!=null)
  {
	eraseCookie('sector');
   }//endfor
   if (state!=null)
  {
	eraseCookie('state');
   }//endfor
   if (StartDate!=null)
  {
	eraseCookie('startdate');
   }//endfor
   if (EndDate!=null)
  {
	eraseCookie('enddate');
   }//endfor

   if (Keywords!=null)
  {
	eraseCookie('keywords');
   }//endfor
   if (PriceMin!=null)
  {
	eraseCookie('pricemin');
   }//endfor
   if (PriceMax!=null)
  {
	eraseCookie('pricemax');
   }//endfor
   
  if(action=='anotherSearch')
  {
	window.location="/databases/VC/ASPSearch/vcDatabase_Query.asp?DBName=VC";
  
  }  
  if(action=='reset')
  {
	window.location="/databases/VC/ASPSearch/vcDatabase_Query.asp?DBName=VC";
  
  }   
  if(formName!=null && action!=null)
  {
  document[formName][action]();
  }

}
function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1 
    c_end=document.cookie.indexOf(";",c_start)
    if (c_end==-1) c_end=document.cookie.length
    return unescape(document.cookie.substring(c_start,c_end))
    } 
  }
return null
}



