function setselect(prod_id, value_id, option_id, vert, hori){
// alert(prod_id + ' ' + value_id + ' ' + option_id);
  // CHANGE THE OPTION IN THE DROPDOWN
  for( var i=0, limit=$("attrib-"+option_id).options.length; i < limit; ++i )	{
		if( $("attrib-"+option_id).options[i].value==value_id ){
			$("attrib-"+option_id).options[i].selected=true;
		}
	}
	// SET THE RIBBONS
// 	setvert(vert, option_id);
// 	sethori(hori, option_id);
//   displayribbons();
  if( $(option_id)==3 ){
    $("topRibbonVert").value = 'images/' + vert;
    $("topRibbonHori").value = 'images/' + hori;
  } else if( $(option_id)==2 ){
    $("bottomRibbonVert").value = 'images/' + vert;
    $("bottomRibbonHori").value = 'images/' + hori;
  }
  //alert($("bottomRibbonHori").value);
  //changeImage();
  //imageVars = 'showRibbons.php?image=' + $("mainImage").value + '&topRibbonVert=' + $("topRibbonVert").value + '&topRibbonHori=' + $("topRibbonHori").value + '&bottomRibbonVert=' + $("bottomRibbonVert").value + '&bottomRibbonHori=' + $("bottomRibbonHori").value + '&product_id=' + prod_id;
  imageVars = 'showRibbons.php?topRibbonVert=' + $("topRibbonVert").value + '&topRibbonHori=' + $("topRibbonHori").value + '&bottomRibbonVert=' + $("bottomRibbonVert").value + '&bottomRibbonHori=' + $("bottomRibbonHori").value + '&product_id=' + prod_id;
  imageVarsPreview1015 = 'tenfifteen.php?topRibbonVert=' + $("topRibbonVert").value + '&topRibbonHori=' + $("topRibbonHori").value + '&bottomRibbonVert=' + $("bottomRibbonVert").value + '&bottomRibbonHori=' + $("bottomRibbonHori").value + '&product_id=' + prod_id;
  imageVarsPreview2030 = 'twentythirty.php?topRibbonVert=' + $("topRibbonVert").value + '&topRibbonHori=' + $("topRibbonHori").value + '&bottomRibbonVert=' + $("bottomRibbonVert").value + '&bottomRibbonHori=' + $("bottomRibbonHori").value + '&product_id=' + prod_id;
  $("productMainImage").innerHTML = '<img src="' + imageVars + '" border="0" width="280" />';
  $("selectedAttrs").value = imageVars;
  $('hrefImages1015').href=imageVarsPreview1015;
  $('hrefImages1015').title= '';
  $('hrefImages2030').href=imageVars;
  $('hrefImages2030').title= '';
  $('hrefImages1015img').href=imageVarsPreview1015;
  $('hrefImages1015img').title= '';
  $('hrefImages2030img').href=imageVars;
  $('hrefImages2030img').title= '';
}

// The following function is not used, but it's a good set up.
function displayribbons(){
  $("showRibbons").style.display='block';
}

function changeImage() {
    new Ajax.Request('showRibbons.php',
    {
      method: 'get',
      //parameters: $("topRibbonVert").value, $("topRibbonHori").value, $("bottomRibbonVert").value, $("bottomRibbonHori").value,
      parameters:{'topRibbonVert': $("topRibbonVert").value, 'topRibbonHori': $("topRibbonHori").value, 'bottomRibbonVert': $("bottomRibbonVert").value, 'bottomRibbonHori': $("bottomRibbonHori").value, 'image': $("mainImage").value},
      onSuccess: function(transport) {
        var notice = $('notice');
        var response = transport.responseText;
        $("productMainImage").innerHTML = response;
      }
    });
}

function showPreview(){
  alert('hi there');
  location.href="images/PreviewLarger.png";
}

function whatsThis(){
  //window.open( "personalizedtext.html", "myWindow", "location=1,status=1,scrollbars=1,width=400,height=400,resizable=Disallow" );
  //document.body.style.opacity='.9';
  //$('popupDiv').style.backgroundColor='#C0F9B2';
  $('popupDivOverlay').style.display='block';
  $('bodyTextDiv').style.display='block';
}

function whatsThisClose(){
  //document.body.style.opacity='.9';
  //$('popupDiv').style.backgroundColor='#C0F9B2';
  $('popupDivOverlay').style.display='none';
  $('bodyTextDiv').style.display='none';
}