function getCookie(name){
  var cname = name + "=";               
  var dc = document.cookie;             
  if (dc.length > 0) {              
    begin = dc.indexOf(cname);       
    if (begin != -1) {           
      begin += cname.length;       
      end = dc.indexOf(";", begin);
      if (end == -1) end = dc.length;
        return unescape(dc.substring(begin, end));
    } 
  }
  return null;
}

function setCookie(name, value, expires, path, domain, secure) {
  document.cookie = name + "=" + escape(value) + 
  ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
  ((path == null) ? "" : "; path=" + path) +
  ((domain == null) ? "" : "; domain=" + domain) +
  ((secure == null) ? "" : "; secure");
}

function delCookie (name,path,domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path == null) ? "" : "; path=" + path) +
    ((domain == null) ? "" : "; domain=" + domain) +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function asignarcookie(){
	var expiration = new Date();
	var h1, h2, h3, h4, h5, h6, h7
	expiration.setTime(1609455599203);
	auxKey = document.form_search.sw.value;
	
	h1 = getCookie('key1');
	h2 = getCookie('key2');
	h3 = getCookie('key3');
	h4 = getCookie('key4');
	h5 = getCookie('key5');
	h6 = getCookie('key6');
	h7 = getCookie('key7');	
	
	if (h6 != null) {
		setCookie('key7', h6, expiration, '/', 'medicosporlaseguridadvial.com');
	};
	
	if (h5 != null) {
		setCookie('key6', h5, expiration, '/', 'medicosporlaseguridadvial.com');
	};
	
	if (h4 != null) {
		setCookie('key5', h4, expiration, '/', 'medicosporlaseguridadvial.com');
	};
	
	if (h3 != null) {
		setCookie('key4', h3, expiration, '/', 'medicosporlaseguridadvial.com');
	};
	
	if (h2 != null) {
		setCookie('key3', h2, expiration, '/', 'medicosporlaseguridadvial.com');
	};
	
	if (h1 != null) {
		setCookie('key2', h1, expiration, '/', 'medicosporlaseguridadvial.com');
	};
	
	if (auxKey != null) {
		setCookie('key1', auxKey, expiration, '/', 'medicosporlaseguridadvial.com');
	};
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
//-->
