var ckTemp = document.cookie;

function setCookie(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 = ""; }

 if (value != null && value != "")
  document.cookie = name+"="+escape(value)+expires+"; path=/techref/";
  ckTemp = document.cookie;
}

function getCookie(name) {
 var index = ckTemp.indexOf(name + "=");

 if(index == -1) return null;
 index = ckTemp.indexOf("=", index) + 1;
 var endstr = ckTemp.indexOf(";", index);

 if (endstr == -1) endstr = ckTemp.length;
 return unescape(ckTemp.substring(index, endstr));
}

function checkCookie() {
 var temp = getCookie("disclaimer");
 if(!temp == 1) {
  var disclaimer = confirm('LEGAL NOTICE\n\nTechnology Configuration Recommendation Guides\n\nThe following information is provided for public benefit for anyone\nrequiring various configuration guidelines.\n\nDo not attempt to implement any of these settings in these guides without\nfirst testing in a non-operational environment.\n\nThese documents are only a guide containing recommended settings.\nThey are only meant as a supplement to assist in the understanding of best\npractices and specific configuration issues and not meant to replace\nwell-structured policy or sound judgement. Furthermore, these guides\ndo not address site-specific configuration issues. Care must be taken\nwhen implementing these guides to address local operational and policy\nconcerns.\n\nThe changes described in this document only apply to the specific devices listed and\nshould not be applied to any other equipment.\n\nSOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\nINCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY\nDISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n\(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES\; LOSS OF USE, DATA, OR PROFITS\; OR BUSINESS INTERRUPTION\)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT \(INCLUDING NEGLIGENCE OR\nOTHERWISE\)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\nOF THE POSSIBILITY OF SUCH DAMAGE.');
  if(!disclaimer) { 
   window.location = "http://www.thewaystation.com/techref/disclaimer.shtml";
  } else { setCookie("disclaimer",1,1); }
 }
}
