function highlightMenuItem() { var a = getUrlVars()["ID"]; document.getElementById("link" + a).className += "leftNavSelected"; document.getElementById("link" + a).style.color = "#990000" } function ShowMasonryGallery(prodID) { $.ajax({ type: "POST", url: getRootURL() + "Services/NewHollandSvc.asmx/GetMasonryProductGallery", data: "{'productID' : " + prodID + "}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { db = eval("(" + msg.d + ")"); InitializeGallery("L", 6) } }) } function ShowMasonryOverview(prodID) { $.ajax({ type: "POST", url: getRootURL() + "Services/NewHollandSvc.asmx/GetMasonryProductOverview", data: "{'productID' : " + prodID + "}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { db = eval("(" + msg.d + ")"); ShowMasonryColors() } }) } function ShowHardscapeOverview(prodID) { $.ajax({ type: "POST", url: getRootURL() + "Services/NewHollandSvc.asmx/GetHardscapeProductOverview", data: "{'productID' : " + prodID + "}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { db = eval("(" + msg.d + ")"); ShowHardscapeColors(); InitializeGallery("M", 4) } }) } function ShowDesignGallery() { $.ajax({ type: "POST", url: getRootURL() + "Services/NewHollandSvc.asmx/GetDesignGallery", data: "{'galleryID' : " + getUrlVars()["ID"] + "}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { db = eval("(" + msg.d + ")"); InitializeGallery("L", 6) } }) } function ShowMasonryColors() { $("tr").remove(".colorHeader"); $("tr").remove(".colorLabel"); for (var a = 0; a < db.ColorGroups.length; a++) { $(masonryColorGroupSpacingRow).appendTo(".dynamicColorTable"); $(masonryColorGroupTitleRow).find(".dynamicColorHeader").text(db.ColorGroups[a].Name).end().appendTo(".dynamicColorTable"); for (var b = 0; b < db.ColorGroups[a].ColorImages.length; b++) { if (b % 4 == 0) { $("<tr class='colorLabel'>" + "<td width='104'><div align='center'><a id='DynColorLink" + (a + 1) + "_" + (b + 1) + "' class='dynamicColorLink' href='#' onclick=''><img style='visibility:hidden' border='0' id='DynColorImg" + (a + 1) + "_" + (b + 1) + "' src='' width='60' height='60' /></div></td>" + "<td width='104'><div align='center'><a id='DynColorLink" + (a + 1) + "_" + (b + 2) + "' class='dynamicColorLink' href='#' onclick=''><img style='visibility:hidden' border='0' id='DynColorImg" + (a + 1) + "_" + (b + 2) + "' src='' width='60' height='60' /></div></td>" + "<td width='104'><div align='center'><a id='DynColorLink" + (a + 1) + "_" + (b + 3) + "' class='dynamicColorLink' href='#' onclick=''><img style='visibility:hidden' border='0' id='DynColorImg" + (a + 1) + "_" + (b + 3) + "' src='' width='60' height='60' /></div></td>" + "<td width='104'><div align='center'><a id='DynColorLink" + (a + 1) + "_" + (b + 4) + "' class='dynamicColorLink' href='#' onclick=''><img style='visibility:hidden' border='0' id='DynColorImg" + (a + 1) + "_" + (b + 4) + "' src='' width='60' height='60' /></div></td>" + "</tr>").appendTo(".dynamicColorTable") } document.getElementById("DynColorImg" + (a + 1) + "_" + (b + 1)).src = getColorsSmallImgDir() + db.ColorGroups[a].ColorImages[b].Image + get_SExt(); document.getElementById("DynColorImg" + (a + 1) + "_" + (b + 1)).style.visibility = "visible"; $("#DynColorLink" + (a + 1) + "_" + (b + 1)).attr("onclick", "showLargeColorDiv('" + getColorsLargeImgDir() + db.ColorGroups[a].ColorImages[b].Image + get_LExt() + "');"); if (b % 4 == 0) { $("<tr class='colorLabel'>" + "<td><div id='DynColorImgName" + (a + 1) + "_" + (b + 1) + "' align='center'></div></td>" + "<td><div id='DynColorImgName" + (a + 1) + "_" + (b + 2) + "' align='center'></div></td>" + "<td><div id='DynColorImgName" + (a + 1) + "_" + (b + 3) + "' align='center'></div></td>" + "<td><div id='DynColorImgName" + (a + 1) + "_" + (b + 4) + "' align='center'></div></td>" + "</tr>").appendTo(".dynamicColorTable") } document.getElementById("DynColorImgName" + (a + 1) + "_" + (b + 1)).innerHTML = db.ColorGroups[a].ColorImages[b].TextBlobs[0].Lines[0] } if (a == db.ColorGroups.length - 1) { $(masonryColorGroupSpacingRow).appendTo(".dynamicColorTable") } } } function ShowHardscapeColors() { $("tr").remove(".dynamicColorRow"); for (var a = 0; a < db.ColorGroups[0].ColorImages.length; a += 2) { if (a + 1 < db.ColorGroups[0].ColorImages.length) { $(hardscapeColorsFullRow).find(".dynamicColorLink:eq(0)").attr("onclick", "showLargeColorDiv('" + getColorsLargeImgDir() + db.ColorGroups[0].ColorImages[a].Image + get_LExt() + "');").end().find(".dynamicColorImg:eq(0)").attr("src", getColorsSmallImgDir() + db.ColorGroups[0].ColorImages[a].Image + get_SExt()).end().find(".dynamicColorName:eq(0)").text(db.ColorGroups[0].ColorImages[a].TextBlobs[0].Lines[0]).end().find(".dynamicColorLink:eq(1)").attr("onclick", "showLargeColorDiv('" + getColorsLargeImgDir() + db.ColorGroups[0].ColorImages[a + 1].Image + get_LExt() + "');").end().find(".dynamicColorImg:eq(1)").attr("src", getColorsSmallImgDir() + db.ColorGroups[0].ColorImages[a + 1].Image + get_SExt()).end().find(".dynamicColorName:eq(1)").text(db.ColorGroups[0].ColorImages[a + 1].TextBlobs[0].Lines[0]).end().appendTo(".dynamicColorTable") } else { $(hardscapeColorsHalfRow).find(".dynamicColorLink:eq(0)").attr("onclick", "showLargeColorDiv('" + getColorsLargeImgDir() + db.ColorGroups[0].ColorImages[a].Image + get_LExt() + "');").end().find(".dynamicColorImg:eq(0)").attr("src", getColorsSmallImgDir() + db.ColorGroups[0].ColorImages[a].Image + get_SExt()).end().find(".dynamicColorName:eq(0)").text(db.ColorGroups[0].ColorImages[a].TextBlobs[0].Lines[0]).end().appendTo(".dynamicColorTable") } } } function showLargeColorDiv(a) { document.getElementById("largeColorImage").src = a; popup("popUpDiv") } function ShowListItem6() { imgIndex = listIndex + 5; DisplayGallery() } function ShowListItem5() { imgIndex = listIndex + 4; DisplayGallery() } function ShowListItem4() { imgIndex = listIndex + 3; DisplayGallery() } function ShowListItem3() { imgIndex = listIndex + 2; DisplayGallery() } function ShowListItem2() { imgIndex = listIndex + 1; DisplayGallery() } function ShowListItem1() { imgIndex = listIndex; DisplayGallery() } function InitializeGallery(a, b) { numSmallSelections = b; ShowHideIndexButtons(); if (a == "M") { lgImgDir = getMediumImgDir(); lgImgExt = get_MExt() } else { lgImgDir = getLargeImgDir(); lgImgExt = get_LExt() } if (db.GalleryImages.length > 0) { imgIndex = 0; listIndex = 0; DisplayGallery() } else { $(".galleryLargeImg").attr("src", lgImgDir + "Yellow" + lgImgExt); $(".gallerySmallImg").onclick = "" } } function ChangeGallerySelection(a) { if (a == "+") { if (listIndex < db.GalleryImages.length) { listIndex++; if (imgIndex < listIndex) { imgIndex = listIndex } } } else { if (listIndex > 0) { listIndex--; if (imgIndex >= listIndex + numSmallSelections) { imgIndex = listIndex + numSmallSelections - 1 } } } if (db.GalleryImages.length > 0) { ShowHideIndexButtons(); DisplayGallery() } } function DisplayGallery() { var a = $(".gallerySmallImg"); for (var b = 0; b < a.length; b++) { if (listIndex + b < db.GalleryImages.length) { a[b].src = getSmallImgDir() + db.GalleryImages[listIndex + b].Image + get_SExt(); a[b].style.visibility = "visible"; if (listIndex + b == imgIndex) { a[b].border = "2px" } else { a[b].border = "" } } else { a[b].style.visibility = "hidden"; a[b].src = "" } } $(".galleryLargeImg").attr("src", lgImgDir + db.GalleryImages[imgIndex].Image + lgImgExt); $(".galleryProjectName").text(db.GalleryImages[imgIndex].TextBlobs[0].Lines[0]); $("tr").remove(".dynamicRow"); for (var b = 1; b < db.GalleryImages[imgIndex].TextBlobs[0].Lines.length; b++) { var c; switch ((b - 1) % 3) { case 0: c = "Product:"; break; case 1: c = "Color:"; break; case 2: c = "Finish:"; break } $(galleryProjectInfoRow).find(".dynamicRowTitle").text(c).end().find(".dynamicRowData").text(db.GalleryImages[imgIndex].TextBlobs[0].Lines[b]).end().appendTo(".dynamicTable"); if ((b - 1) % 3 == 2 && b + 1 < db.GalleryImages[imgIndex].TextBlobs[0].Lines.length) { $(galleryProjectInfoSpaceRow).appendTo(".dynamicTable") } if (b == db.GalleryImages[imgIndex].TextBlobs[0].Lines.length - 1) { $(galleryProjectInfoLastRow).appendTo(".dynamicTable") } } } function ShowHideIndexButtons() { if (db.GalleryImages.length <= numSmallSelections || listIndex == db.GalleryImages.length - numSmallSelections) { document.getElementById("rightIndex").style.visibility = "hidden" } else { document.getElementById("rightIndex").style.visibility = "visible" } if (db.GalleryImages.length <= numSmallSelections || listIndex == 0) { document.getElementById("leftIndex").style.visibility = "hidden" } else { document.getElementById("leftIndex").style.visibility = "visible" } } function getUrlVars() { var a = [], b; var c = window.location.href.slice(window.location.href.indexOf("?") + 1).split("&"); for (var d = 0; d < c.length; d++) { b = c[d].split("="); a.push(b[0]); a[b[0]] = b[1] } return a } function getColorsLargeImgDir() { return getRootURL() + "images/Colors/Large/" } function getColorsSmallImgDir() { return getRootURL() + "images/Colors/Small/" } function get_LExt() { return "_L.jpg" } function get_MExt() { return "_M.jpg" } function get_SExt() { return "_S.jpg" } function getLargeImgDir() { return getRootURL() + "images/Gallery/Large/" } function getMediumImgDir() { return getRootURL() + "images/Gallery/Medium/" } function getSmallImgDir() { return getRootURL() + "images/Gallery/Small/" } function getRootURL() { var a = location.href; return a.substring(0, a.indexOf("/", 7)) + "/" } var db; var imgIndex = 0; var listIndex = 0; var numSmallSelections = 0; var lgImgDir = ""; var lgImgExt = ""; var galleryProjectInfoRow = "<tr class='dynamicRow'>" + "<td width='123'> </td>" + "<td width='51' class='content'>" + "<div class='dynamicRowTitle' align='left'>Title Here</div>" + "</td>" + "<td width='200' class='content'>" + "<div class='dynamicRowData' align='left'>Data Here</div>" + "</td>" + "</tr>"; var galleryProjectInfoSpaceRow = "<tr class='dynamicRow'><td colspan='3'><hr /></td></tr>"; var galleryProjectInfoLastRow = "<tr class='dynamicRow' height='15'><td colspan='3'></td></tr>"; var hardscapeColorsFullRow = "<tr class='dynamicColorRow'>" + "<td class='colorLabel'>" + "<a class='dynamicColorLink' href='#' onclick=''>" + "<img border='0' class='dynamicColorImg' src='' width='64' height='44' /></a>" + "<br />" + "<p class='dynamicColorName'>Color Name Here</p>" + "</td>" + "<td class='colorLabel'>" + "<a class='dynamicColorLink' href='#' onclick=''>" + "<img border='0' class='dynamicColorImg' src='' width='64' height='44' /></a>" + "<br />" + "<p class='dynamicColorName'>Color Name Here</p>" + "</td>" + "<td class='colorLabel'>" + "</td>" + "</tr>"; var hardscapeColorsHalfRow = "<tr class='dynamicColorRow'>" + "<td class='colorLabel'>" + "<a class='dynamicColorLink' href='#' onclick=''>" + "<img border='0' class='dynamicColorImg' src='' width='64' height='44' /></a>" + "<br />" + "<p class='dynamicColorName'>Color Name Here</p>" + "</td>" + "<td class='colorLabel'>" + "</td>" + "</tr>"; var masonryColorGroupSpacingRow = "<tr class='colorHeader'><td height='15' colspan='4'></td></tr>"; var masonryColorGroupTitleRow = "<tr class='colorHeader'><td colspan='4'><div class='dynamicColorHeader' align='left'></div></td></tr>"
