var now = new Date();
var expdate = new Date(now.getTime() + 14 * 24 * 60 * 60 * 1000);

function makeCookie(fn,ln,user,pswd){
   document.cookie = "fn = "+fn+";expires="+expdate.toGMTString();
   document.cookie= "ln = "+ln+";expires="+expdate.toGMTString();
   document.cookie = "user = "+user+";expires="+expdate.toGMTString();
   document.cookie= "pswd = "+pswd+";expires="+expdate.toGMTString();
   loadpage('detailsLayer', null, 'home.php');
  <!--window.location = "homePage.aspx";-->
}

function findCookie(val) {
   var cookie = null;
   var findVal = val + "=";
   var dc = document.cookie;
   if (dc.length > 0) {
      var start = dc.indexOf(findVal);
      if (start >= 0) {
         start += findVal.length;
         lastVal = dc.indexOf(";", start);
         if (lastVal == -1) {
            lastVal = dc.length;
	 }
         cookie = (dc.substring(start, lastVal));
      } else {
         return cookie;
      }
   }
   return cookie;
}

fn = findCookie("fn");
ln = findCookie("ln");
user = findCookie("user");
pswd = findCookie("pswd");

function makeOrderCookie(n,id,prod,pr,q){
  document.cookie = "myitem"+n+" = "+id+","+prod+","+pr+","+q+";expires = "
  	+expdate.toGMTString();
  alert("You have added "+q+" of the "+prod+" to your shopping cart.");
}

function checkForm(){
   var fn = document.login2.fn.value;
   var ln = document.login2.ln.value;
   var user = document.login2.user.value;
   var pswd = document.login2.pswd.value;
   var pswd2 = document.login2.pswd2.value;
   if((fn == "")||(ln == "")||(user == "")||(pswd == "")||(pswd2 == "")) {
      alert("Please fill out all input fields on this form.");
      return false;
   } else if(pswd != pswd2) {
      alert("Your passwords did not match. Please try again.");
      return false;
   } else {
      makeCookie(fn,ln,user,pswd);
   }
}
if(fn == null) {fn = "";}
if(ln == null) {ln = "";}
if(user == null) {user = "";}

<!-- Begin-->
var nn4 = (document.layers);
var nn6 = (document.getElementById && !document.all);
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);

function loadpage(id,nestref,url) {
	var prefix = id.substring(0, id.indexOf('Layer')) + 'Frame';
	if (nn4) {
		var lyr = (nestref)? eval('document.'+nestref+'.document.'+id) : document.layers[id]
		lyr.load(url,lyr.clip.width)
	}
	else if(ie4) { var doc = eval('parent.'+prefix); doc.location = url;}
	else if(ie5 || nn6) {document.getElementById(prefix).src = url;}
}
<!--showing the content of other pages into details layer while compiling -->
function showpage(id) {
	var prefix = id.substring(0, id.indexOf('Layer')) + 'Frame';
if (ie4) {
document.all[id].innerHTML = parent.contentFRM.document.body.innerHTML;
}
else if(nn6 || ie5) { 
document.getElementById(id).innerHTML = window.frames[prefix].document.getElementById('body').innerHTML;
   }
}
