function Medium()
{
  var med = document.forms.PersonalInfo.medium.value;
    var medOutput='';
    if (med == 'down')
    {
        medOutput ="download to your computer";
    }
    if (med == 'www')
    {
        medOutput ="take this course online";
    }
    if (med == 'disk')
    {
        medOutput ="ship a disk to you";
    }
  return medOutput;
}

function getOrderType() {
    var x = 0;
    mySearch = parent.location.search.substr(1).split("&");
    if ((mySearch == "OrdType.value='PO'") || (mySearch == "OrdType.value='CC'"))
    {
        for (x=0;x<=mySearch.length-1;x++) {
        eval("document.forms.PersonalInfo."+mySearch[x])
        }
    }
    else
    {
        window.location='index.html';
    }

}
function getFromSearch() {
    var x = 0
    mySearch = location.search.substr(1).split("&")
    for (x=0;x<=mySearch.length-1;x++) {
    eval("document.forms.PersonalInfo."+mySearch[x])
    }
   var CPEcode = document.forms.PersonalInfo.code.value;
    document.forms.PersonalInfo.CourseTitle.value = getCourseTitle(CPEcode);

}


function GetCookie(name) 
{
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
    if (start == -1) return null;
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len,end));
}

function SetCookie(name,value,expires,path,domain,secure) 
{
    document.cookie = name + "=" +escape(value) +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (path) ? ";path=" + path : "") + 
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}

function params(code,med,nl,itemnum,form,cost)
{
var ns = navigator.appName == "Netscape";
var CourseTitle
var host
if (code.length>4)
{
	CourseTitle = "Unlimited Usage"
}
else
{
if (ns)
	eval("CourseTitle = document.anchors." + code + ".text")
else
	eval("CourseTitle = " + code + ".innerText")
}
host = document.location.host
host = host.toLowerCase();
if (host=='micromash.net')
{
	host='www.micromash.net';
}
company = GetCookie("company")
var Urltext
if (company!=null)
	Urltext ="https://" + host + "/Cgiwin/CPEorder.dll?code="+code+"&medium="+med+"&nextlook="+nl+"&itemnum="+itemnum+"&formname="+form+"&cost="+cost +"&CTitle=" + escape(CourseTitle)+"&Company=" + company;
else
     	Urltext ="https://" + host + "/Cgiwin/CPEorder.dll?code="+code+"&medium="+med+"&nextlook="+nl+"&itemnum="+itemnum+"&formname="+form+"&cost="+cost +"&CTitle=" + escape(CourseTitle);
top.document.location.href=Urltext

//return Urltext;

}

function CD(page,cost)
{
	
	document.forms["PersonalInfo"].action = "/description/" + page + "?cost=" + cost
	document.forms["PersonalInfo"].cost.value=cost
	document.forms["PersonalInfo"].submit()
	return false
}
