function nsChangeImage() { var color=""; var holes=""; var trim=""; var cup=""; for (var x=0; x < document.cart_quantity.elements.length;x++) { if ((document.cart_quantity.elements[x].name == 'id[1]' ) || (document.cart_quantity.elements[x].name == 'id[2]')){ //if(document.cart_quantity.elements[x].id=="Black"){ // alert(x); //Black is when x==0 //} if (document.cart_quantity.elements[x].checked) { color=document.cart_quantity.elements[x].id; } }else{ if (document.cart_quantity.elements[x].name == 'id[7]') { if (document.cart_quantity.elements[x].checked) { if (document.cart_quantity.elements[x].value == '44') { holes = 'No Holes'; }else{ if (document.cart_quantity.elements[x].value == '58') { holes = 'Triangle'; }else{ holes = 'With Holes'; } } } } if (document.cart_quantity.elements[x].name == 'id[10]') { if (document.cart_quantity.elements[x].checked) { if (document.cart_quantity.elements[x].value == '51') { cup = ' Water Cup'; }else{ cup = ''; } } } } } var imgurl; if (color != "") { if (holes != "") { imgurl = '/images/tables/plastic/' + color + ' ' + holes + trim + cup + '.gif'; }else{ imgurl = '/images/tables/plastic/' + color + '.gif'; } } else { imgurl = '/images/tables/plastic/Stain.gif'; } document.images['mainproductimage'].src = imgurl; } function nsChangeImageForce(cid,cval) { var color=""; var holes=""; var trim=""; var cup=""; for (var x=0; x < document.cart_quantity.elements.length;x++) { if ((document.cart_quantity.elements[x].name == 'id[1]' ) || (document.cart_quantity.elements[x].name == 'id[2]')){ if (document.cart_quantity.elements[x].checked) { if (cid == document.cart_quantity.elements[x].name) { color=cval; }else{ color=document.cart_quantity.elements[x].id; } } }else{ if (document.cart_quantity.elements[x].name == 'id[7]') { if (document.cart_quantity.elements[x].checked) { if (cid == document.cart_quantity.elements[x].name) { if (cval == '44') { holes = 'No Holes'; }else{ if (cval == '58') { holes = 'Triangle'; }else{ holes = 'With Holes'; } } }else{ if (document.cart_quantity.elements[x].value == '44') { holes = 'No Holes'; }else{ if (document.cart_quantity.elements[x].value == '58') { holes = 'Triangle'; }else{ holes = 'With Holes'; } } } } } if (document.cart_quantity.elements[x].name == 'id[10]') { if (document.cart_quantity.elements[x].checked) { if (cid == document.cart_quantity.elements[x].name) { if (cval == '51') { cup = ' Water Cup'; }else{ cup = ''; } }else{ if (document.cart_quantity.elements[x].value == '51') { cup = ' Water Cup'; }else{ cup = ''; } } } } } } var imgurl; if (color != "") { if (holes != "") { imgurl = '/images/tables/plastic/' + color + ' ' + holes + trim + cup + '.gif'; }else{ imgurl = '/images/tables/plastic/' + color + '.gif'; } } else { imgurl = '/images/tables/plastic/Stain.gif'; } document.images['mainproductimage'].src = imgurl; } function nsChangeImageForcev3(cid,cval,pname,cval_us,ext) { //pass ext because some are gif and some are jpg var color=""; var holes=""; var trim=""; var cup=""; var graphic=""; var imgurl; var imgurl2; imgurl = '/catalog/images/tables/' + pname + '/' + cval + '/No Triangles/' + cval_us + '_Black.gif'; imgurl2 = '/catalog/images/tables/' + pname + '/' + cval + '/Large No Triangles/' + cval_us + '_Black.' + ext; document.images['mainproductimage'].src = imgurl; document.getElementById('mainproductpopup_link').href = imgurl2; } function nsChangeImageMouseOverColorv4(cid,pname,tablecolor,ext) { //pass ext because some are gif and some are jpg //example params //pnam=Aluminum //cval=Liquid Courage (remove _ and add space) //opval=No Triangles //cval_us=Liquid_Courage //ext=gif var graphic=""; var cval_us = document.cart_quantity.elements['graphicchosen'].value; //with underscores var cval = cval_us.replace(/_/gi,' '); //new var option = document.cart_quantity.elements['Leg_Option'].value; if(option != ""){ option += '/'; } option += document.cart_quantity.elements['Holes_Triangles'].value; switch(cval_us){ case "New_York": case "Boston": case "Philadelphia": case "Paradise": case "Vegas": ext='jpg'; break; default: ext='gif'; break; } var imgurl5; //gonna have to add color too imgurl5 = '/catalog/images/tables/' + pname + '/' + cval + '/' + option + '/' + cval_us + '_' + tablecolor + '.' + ext; document.images['mainproductimage'].src = imgurl5; } function nsChangeImageMouseOverv4(cid3,pname3,opval3,ext3) { //pass ext because some are gif and some are jpg //example params //pnam=Aluminum //cval=Liquid Courage (remove _ and add space) //opval=No Triangles //cval_us=Liquid_Courage //ext=gif var graphic=""; var cval_us3 = document.cart_quantity.elements['graphicchosen'].value; //with underscores var cval3 = cval_us3.replace(/_/gi,' '); var tablecolor3 = document.cart_quantity.elements['tablecolor'].value; //new to keep track of colors...still need to filter out color from being in the array. var legoption3 = document.cart_quantity.elements['legoption'].value; var imgurl3; //gonna have to add color too //imgurl3 = '/catalog/images/tables/' + pname3 + '/' + cval3 + '/' + opval3 + '/' + cval_us3; imgurl3 = '/catalog/images/tables/' + pname3 + '/' + cval3 + '/'; if(legoption3 != "" ) {///for wood tables imgurl3 += legoption3 + '/' + opval3; //so that if we are different tables, this all stays the same }else{ imgurl3 += opval3; } imgurl3 += '/' + cval_us3; if(tablecolor3 != "" ) { //some, like wood, do not have color options imgurl3 += '_' + tablecolor3; } imgurl3 += '.' + ext3; document.images['mainproductimage'].src = imgurl3; } function nsChangeImageMouseOverWithArrv4(cid3,pname3,opval3,ext3,optionname) { //pass ext because some are gif and some are jpg //example params //pnam=Aluminum //cval=Liquid Courage (remove _ and add space) //opval=No Triangles //cval_us=Liquid_Courage //ext=gif var graphic=""; var cval_us3 = document.cart_quantity.elements['graphicchosen'].value; //with underscores var cval3 = cval_us3.replace(/_/gi,' '); var tablecolor3 = document.cart_quantity.elements['tablecolor'].value; //new to keep track of colors...still need to filter out color from being in the array. var legoption3 = document.cart_quantity.elements['legoption'].value; //var speakeroption3 = document.cart_quantity.elements['speakeroption'].value; //NEW FOR SPEAKER OPTION ROBD 2010-03-26 //document.cart_quantity.elements['Holes_Triangles'].value += speakeroption3; var imgurl3; //gonna have to add color too //imgurl3 = '/catalog/images/tables/' + pname3 + '/' + cval3 + '/' + opval3 + '/' + cval_us3; imgurl3 = '/catalog/images/tables/' + pname3 + '/' + cval3 + '/'; //opval3 += ' ' + document.cart_quantity.elements['speakeroption'].value; switch(optionname){ case 'Leg_Option': var holesoption = document.cart_quantity.elements['Holes_Triangles'].value; //here we need to attach the speaker option to the holes option imgurl3 += opval3 + '/' + holesoption + '/'; break; case 'Holes_Triangles': //var speakeroption = document.cart_quantity.elements['speakeroption'].value; //good //opval3 += ' ' + speakeroption; var legoption = document.cart_quantity.elements['Leg_Option'].value; //option values - in the future this could be reduced to two functions is one were to make this line work variably imgurl3 += legoption + '/' + opval3 + '/'; break; case 'Speakers': // imgurl3 += speakeroption3 + '/'; break; default: //alert(optionname); break; } imgurl3 += cval_us3; if(tablecolor3 != "" ) { //some, like wood, do not have color options imgurl3 += '_' + tablecolor3; } switch(cval_us3){///i know this is junky programming case "New_York": case "Boston": case "Philadelphia": case "Paradise": case "Vegas": ext3='jpg'; break; default: ext3='gif'; break; } imgurl3 += '.' + ext3; //alert(imgurl3); //alert(imgurl3); document.images['mainproductimage'].src = imgurl3; } function nsChangeImageColor(color) { //pass ext because some are gif and some are jpg //set color for tables document.cart_quantity.elements['tablecolor'].value = color; //option values } function nsChangeImageForcev4(cid,pname,option,ext) { //pass ext because some are gif and some are jpg //example params //pnam=Aluminum //cval=Liquid Courage (remove _ and add space) //opval=No Triangles //cval_us=Liquid_Courage //ext=gif var color=""; var holes=""; var trim=""; var cup=""; var graphic=""; var cval_us = document.cart_quantity.elements['graphicchosen'].value; //with underscores var cval = cval_us.replace(/_/gi,' '); var tablecolor = document.cart_quantity.elements['tablecolor'].value; //option values - in the future this could be reduced to two functions is one were to make this line work variably var legoption = document.cart_quantity.elements['legoption'].value; //option values - in the future this could be reduced to two functions is one were to make this line work variably var imgurl; //gonna have to add color too var bigimgurl; imgurl = '/catalog/images/tables/' + pname + '/' + cval + '/'; bigimgurl = '/catalog/images/tables/' + pname + '/' + cval + '/Large '; if(legoption != "" ) {///for wood tables" //if((option != "fancy") || (option != "standard")){ imgurl += legoption + '/' + option; //so that if we are different tables, this all stays the same bigimgurl += legoption + '/' + option; }else{ imgurl += option; bigimgurl += option; } imgurl += '/' + cval_us; bigimgurl += '/' + cval_us; if(tablecolor != "" ) { //some, like wood, do not have color options imgurl += '_' + tablecolor; bigimgurl += '_' + tablecolor; } imgurl += '.' + ext; bigimgurl += '.' + ext; document.images['mainproductimage'].src = imgurl; document.getElementById('mainproductpopup_link').href = bigimgurl; //greybox href...update with href to large image of table document.cart_quantity.elements['tablecolor'].value = tablecolor; //hidden product name //document.cart_quantity.elements['optionschosen'].value = option; document.cart_quantity.elements['legoption'].value = legoption; //for wood document.cart_quantity.elements['extention'].value = ext; } function nsChangeImageForceWithArrv4(cid,pname,option,ext,optionname) { //pass ext because some are gif and some are jpg //example params //pnam=Aluminum //cval=Liquid Courage (remove _ and add space) //opval=No Triangles //cval_us=Liquid_Courage //ext=gif var color=""; var holes=""; var trim=""; var cup=""; var graphic=""; var cval_us = document.cart_quantity.elements['graphicchosen'].value; //with underscores var cval = cval_us.replace(/_/gi,' '); var tablecolor = document.cart_quantity.elements['tablecolor'].value; //option values - in the future this could be reduced to two functions is one were to make this line work variably //var speakeroption3 = document.cart_quantity.elements['speakeroption'].value; //NEW FOR SPEAKER OPTION ROBD 2010-03-26 //document.cart_quantity.elements['Holes_Triangles'].value += speakeroption3; var imgurl; //gonna have to add color too var bigimgurl; imgurl = '/catalog/images/tables/' + pname + '/' + cval + '/'; bigimgurl = '/catalog/images/tables/' + pname + '/' + cval + '/'; switch(optionname){ case 'Leg_Option': var holesoption = document.cart_quantity.elements['Holes_Triangles'].value; imgurl += option + '/' + holesoption + '/'; bigimgurl += option + '/Large ' + holesoption + '/'; break; case 'Holes_Triangles': var legoption = document.cart_quantity.elements['Leg_Option'].value; //option values - in the future this could be reduced to two functions is one were to make this line work variably imgurl += legoption + '/' + option + '/'; bigimgurl += option + '/Large ' + holesoption + '/'; break; default: break; } imgurl += cval_us; bigimgurl += cval_us; if(tablecolor != "" ) { //some, like wood, do not have color options imgurl += '_' + tablecolor; bigimgurl += '_' + tablecolor; } switch(cval_us){ case "New_York": case "Boston": case "Philadelphia": case "Paradise": case "Vegas": ext='jpg'; break; default: ext='gif'; break; } imgurl += '.' + ext; bigimgurl += '.' + ext; //alert(imgurl); //alert(bigimgurl); document.images['mainproductimage'].src = imgurl; document.getElementById('mainproductpopup_link').href = bigimgurl; //greybox href...update with href to large image of table document.cart_quantity.elements['tablecolor'].value = tablecolor; //hidden product name document.cart_quantity.elements[optionname].value = option; //document.cart_quantity.elements['legoption'].value = legoption; //for wood document.cart_quantity.elements['extention'].value = ext; } function nsChangeImageForceColorv4(cid,pname,tablecolor,ext) { //pass ext because some are gif and some are jpg //example params //pnam=Aluminum //cval=Liquid Courage (remove _ and add space) //opval=No Triangles //cval_us=Liquid_Courage //ext=gif var color=""; var holes=""; var trim=""; var cup=""; var graphic=""; var cval_us = document.cart_quantity.elements['graphicchosen'].value; //with underscores var cval = cval_us.replace(/_/gi,' '); var option = document.cart_quantity.elements['Leg_Option'].value; if(option != ""){ option += '/'; } option += document.cart_quantity.elements['Holes_Triangles'].value; var imgurl; //gonna have to add color too var bigimgurl; switch(cval_us){ case "New_York": case "Boston": case "Philadelphia": case "Paradise": case "Vegas": ext='jpg'; break; default: ext='gif'; break; } imgurl = '/catalog/images/tables/' + pname + '/' + cval + '/' + option + '/' + cval_us + '_' + tablecolor + '.' + ext; bigimgurl = '/catalog/images/tables/' + pname + '/' + cval + '/Large ' + option + '/' + cval_us + '_' + tablecolor + '.' + ext; document.images['mainproductimage'].src = imgurl; document.getElementById('mainproductpopup_link').href = bigimgurl; //greybox href...update with href to large image of table document.cart_quantity.elements['tablecolor'].value = tablecolor; //hidden product name } function nsChangeImagev4() { //pass ext because some are gif and some are jpg //example params //pnam=Aluminum //cval=Liquid Courage (remove _ and add space) //opval=No Triangles //cval_us=Liquid_Courage //ext=gif //////GET DOCUMENT SETTINGS SO EVERYTHING IS SAVED WHEN OTHER CHANGES ARE MADE//////////// var cval_us2 = document.cart_quantity.elements['graphicchosen'].value; //with underscores var cval2 = cval_us2.replace(/_/gi,' '); var pname2 = document.cart_quantity.elements['prodname'].value; //hidden product name var opval2 = document.cart_quantity.elements['Leg_Option'].value; var bigopval2 = document.cart_quantity.elements['Leg_Option'].value; if(opval2 != ""){ opval2 += '/'; bigopval2 += '/'; } opval2 += document.cart_quantity.elements['Holes_Triangles'].value; bigopval2 += 'Large ' + document.cart_quantity.elements['Holes_Triangles'].value; var ext2 = document.cart_quantity.elements['extention'].value; switch(cval_us2){ case "New_York": case "Boston": case "Philadelphia": case "Paradise": case "Vegas": ext2='jpg'; break; default: ext2='gif'; break; } var tablecolor2 = document.cart_quantity.elements['tablecolor'].value; //new to keep track of colors...still need to filter out color from being in the array. var legoption2 = document.cart_quantity.elements['legoption'].value; ///for wood tables //for (var x=0; x < document.cart_quantity.elements.length;x++) { var imgurl2; //gonna have to add color too var bigimgurl2; //gonna have to add color too if (opval2 == "") { imgurl2 = '/catalog/images/tables/' + pname2 + '/' + cval2 + '/Small/' + cval_us2; bigimgurl2 = '/catalog/images/tables/' + pname2 + '/' + cval2 + '/Large/' + cval_us2; } else { imgurl2 = '/catalog/images/tables/' + pname2 + '/' + cval2 + '/' + opval2 + '/' + cval_us2; bigimgurl2 = '/catalog/images/tables/' + pname2 + '/' + cval2 + '/' + bigopval2 + '/' + cval_us2; } if(tablecolor2 != "" ) { imgurl2 += '_' + tablecolor2; bigimgurl2 += '_' + tablecolor2; } imgurl2 += '.' + ext2; bigimgurl2 += '.' + ext2; document.images['mainproductimage'].src = imgurl2; document.getElementById('mainproductpopup_link').href = bigimgurl2; //greybox href...update with href to large image of table }