<!--
shapes = new Array("RD","PS","OV","MQ","EC","PR","RA","HS","AS","CU");
shapeLinks = new Array("rounds/RD_Band.htm", "pears/PS_Band.htm", "ovals/OV_Band.htm", "marquises/MQ_Band.htm", "emeralds/EC_Band.htm", "princess/PR_Band.htm", "radiants/RA_Band.htm", "hearts/HS_Band.htm", "asscher/AS_Band.htm", "cushion/CU_Band.htm");

defaultDest = "../designring/solitaire.htm" + location.search;
newDest = defaultDest;

function parseSingle(strQuery,field)
{
        var searchStr = field+"=";
        var len = searchStr.length;
        var i = strQuery.indexOf(searchStr);
        var j;
        var tail;
        if (i > -1)
        {
                tail = strQuery.substr(i+len,strQuery.length-len-i);
                j = tail.indexOf("&");
                if (j > -1)
                {
                        return tail.substr(0,j);
                }
                else
                {
			var k = tail.indexOf("#");
			if(k == -1)
	                        return tail.substr(0,tail.length);
			else
				return tail.substr(0,k);
                }
        }
        else                    { return ""; }
}
function parseQuery()
{
        var strQuery = location.search;
        var oForm = document.forms[1];
        oForm.StockNo.value = parseSingle(strQuery,"ID");
	oForm.RngStockNo1.value = parseSingle(strQuery,"SETTING");
        var origShape = parseSingle(strQuery,"SHAPE");
        for(var i=0;i<shapes.length;i++)
        {
                if (origShape == shapes[i])
		{
			oForm.Shape1.options[i+1].selected=true;
			newDest = "../designring/" + shapeLinks[i] + location.search;
		}
        }
        oForm.Ct1.value = parseSingle(strQuery,"SIZE");
        oForm.Ct2.value = parseSingle(strQuery,"SIZE");
        for(i=1;i<oForm.Color1.options.length;i++)
        {
                if (oForm.Color1.options[i].value==parseSingle(strQuery,"COLOR"))        {
                        oForm.Color1.selectedIndex = i;
                        oForm.Color2.selectedIndex = i;
                }
        }
        //oForm.Color1.value = parseSingle(strQuery,"COLOR");
        //oForm.Color2.value = parseSingle(strQuery,"COLOR");
        for(i=1;i<oForm.Clarity1.options.length;i++)
        {
                if (oForm.Clarity1.options[i].value==parseSingle(strQuery,"CLAR")) {
                        oForm.Clarity1.selectedIndex = i;
                        oForm.Clarity2.selectedIndex = i;
                }
        }
        //oForm.Clarity1.value = parseSingle(strQuery,"CLAR");
        //oForm.Clarity2.value = parseSingle(strQuery,"CLAR");
        oForm.Price.value = "$"+parseSingle(strQuery,"PRICE");
        oForm.Price1.value = "$"+parseSingle(strQuery,"PRICE");
}
function setVals()
{
        if (location.search != "")
        {
                parseQuery();
        }
}

function design()
{
	window.location.href = newDest;
}

onload=setVals
// -->

