function MM_swapImgRestore() {  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}function MM_preloadImages() {  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}function MM_findObj(n, d) {  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);  if(!x && d.getElementById) x=d.getElementById(n); return x;}function MM_swapImage() {  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}function switchSelectionPage(category) {    switch(category) {        case (category = 'magazine'):            document.myform.action = "mag.htm" + location.search;            break        case (category = 'software'):            document.myform.action = "software.htm" + location.search;            break        case (category = 'merchandise'):            document.myform.action = "merch.htm" + location.search;            break        case (category = 'dvd'):            document.myform.action = "dvd.htm" + location.search;            break        default:            document.myform.action = "mag.htm" + location.search;            break  }  document.myform.submit();}function createOfferPK(his,msc,ssc,gsc,dsc) {  var pipeCount = 0;  var offerPK = '';  while (20 > pipeCount){	var PipePosition = his.indexOf('|');	keepTitleName = his.substr(0,PipePosition);	if ( keepTitleName.length > 0 ) {	  titleIndex = keepTitleName.substring(4,6);	  if ( titleIndex.substring(1) == ']') {	    titleIndex = titleIndex.substring(0,1);	  }	  if ( keepTitleName.substring(0,1) == 'm' ){        offerPK = offerPK + mPd[titleIndex][2] + "," + mPd[titleIndex][3] + "," + msc + ",1|";	  } else if ( keepTitleName.substring(0,1) == 's' ){        offerPK = offerPK + sPd[titleIndex][2] + "," + sPd[titleIndex][3] + "," + ssc + ",1|";	  } else if ( keepTitleName.substring(0,1) == 'g' ){        offerPK = offerPK + gPd[titleIndex][2] + "," + gPd[titleIndex][3] + "," + gsc + ",1|";	  } else if ( keepTitleName.substring(0,1) == 'd' ){        offerPK = offerPK + dPd[titleIndex][2] + "," + dPd[titleIndex][3] + "," + dsc + ",1|";	  }	}	his = his.substr(PipePosition+1);	if ( his == '' ) {	  pipeCount = 20;	} else {	  pipeCount++;	}  }  return offerPK;}function populateValues() {  var re = /\+/gi;  if ( location.search != '' ){    document.myform.his.value = unescape(getParam("his", location.search));    document.myform.his.value = document.myform.his.value.replace(re, " ");  } else {    document.myform.his.value = '';  }  //get the remaining Value for cart...  var originalRemainingSpreeValue = 100;  var pipeCount = 0;  currentProd = document.myform.his.value;  while (20 > pipeCount){	var PipePosition = currentProd.indexOf('|');	keepTitleName = currentProd.substr(0,PipePosition);	if ( keepTitleName.length > 0 ) {	  titleIndex = keepTitleName.substring(4,6);	  if ( titleIndex.substring(1) == ']') {	    titleIndex = titleIndex.substring(0,1);	  }	  if ( keepTitleName.substring(0,1) == 'm' ){        originalRemainingSpreeValue = originalRemainingSpreeValue - mPd[titleIndex][1];	  } else if ( keepTitleName.substring(0,1) == 's' ){        originalRemainingSpreeValue = originalRemainingSpreeValue - sPd[titleIndex][1];	  } else if ( keepTitleName.substring(0,1) == 'g' ){        originalRemainingSpreeValue = originalRemainingSpreeValue - gPd[titleIndex][1];	  } else if ( keepTitleName.substring(0,1) == 'd' ){        originalRemainingSpreeValue = originalRemainingSpreeValue - dPd[titleIndex][1];	  }	}	currentProd = currentProd.substr(PipePosition+1);	if ( currentProd == '' ) {	  pipeCount = 20;	} else {	  pipeCount++;	}  }  spreeValue.innerHTML = "$" + originalRemainingSpreeValue + ".00";}