function firefox() { var agt=navigator.userAgent.toLowerCase(); return (agt.indexOf('firefox')!=-1); } var MIN_IMAGE = 1; var currentSelection = 1; var inventory = [[0,0] ,[122,'UNLIMITED'],[123,'UNLIMITED'],[121,'UNLIMITED'],[91,'UNLIMITED'],[90,'UNLIMITED'],[88,'UNLIMITED'],[89,'UNLIMITED'],[87,'UNLIMITED'],[86,'UNLIMITED'],[75,'UNLIMITED'],[73,'UNLIMITED'],[74,'UNLIMITED'],[72,'UNLIMITED'],[71,'UNLIMITED'],[55,'UNLIMITED'],[54,'UNLIMITED'],[53,'UNLIMITED'],[52,'UNLIMITED'],[51,'UNLIMITED'],[48,'UNLIMITED'],[46,'UNLIMITED'],[47,'UNLIMITED'],[60,'UNLIMITED'],[61,'UNLIMITED'],[15,'UNLIMITED'],[14,'UNLIMITED'],[13,'UNLIMITED'],[12,'UNLIMITED'],[9,'UNLIMITED'],[8,'UNLIMITED'],[7,'UNLIMITED'],[6,'UNLIMITED'],[5,'UNLIMITED'],[4,'UNLIMITED'],[3,'UNLIMITED'],[2,'UNLIMITED'],[1,'UNLIMITED'],[124,'UNLIMITED']]; var MAX_IMAGE = inventory.length; var l=new String(document.location); if (l.indexOf("checkout.php") == -1 && l.indexOf("complete") == -1) { if (l.indexOf("https://") != -1) { if (l.indexOf("localhost") == -1&& l.indexOf("dev.4wordsystems.com")== -1) { var red = "http://"+l.substring(l.indexOf("https://")+8,l.length); document.location=red; } } } else { if (l.indexOf("http://") != -1) { if (l.indexOf("localhost") == -1 && l.indexOf("dev.4wordsystems.com")== -1) { if (l.indexOf("www")==-1) { red="https://www."+l.substring(l.indexOf("http://")+7,l.length); } else { var red = "https://"+l.substring(l.indexOf("http://")+7,l.length); } document.location=red; } } } imageObj1='images/star_journey-88.jpg'; imageObj2='images/infinity-88.jpg'; imageObj3='images/heaven_earth-88.jpg'; imageObj4='images/human-88.jpg'; imageObj5='images/nirvana_urn-88.jpg'; imageObj6='images/aqua_sphere-88.jpg'; imageObj7='images/aqua_sphere_keepsake-88.jpg'; imageObj8='images/evolution-88.jpg'; imageObj9='images/evolution_keepsake-88.jpg'; imageObj10='images/aqua_oval-88.jpg'; imageObj11='images/aqua_oval_keepsake-88.jpg'; imageObj12='images/world-88.jpg'; imageObj13='images/crystal_egg-88.jpg'; imageObj14='images/aqua_trapezium-88.jpg'; imageObj15='images/aqua_trapezium_keepsake-88.jpg'; imageObj16='images/aqua_cylinder-88.jpg'; imageObj17='images/aqua_cylinder_keepsake-88.jpg'; imageObj18='images/red_dali_keepsake-88.jpg'; imageObj19='images/blue_dali_keepsake-88.jpg'; imageObj20='images/black_dali_keepsake-88.jpg'; imageObj21='images/white_dali_keepsake-88.jpg'; imageObj22='images/marble_dali_keepsake-88.jpg'; imageObj23='images/flying_bird-88.jpg'; imageObj24='images/black_caesar-88.jpg'; imageObj25='images/amethyst_caesar-88.jpg'; imageObj26='images/winter_frost-88.jpg'; imageObj27='images/amarate_starlet-88.jpg'; imageObj28='images/valencia_gothic-88.jpg'; imageObj29='images/crystal_bloom-88.jpg'; imageObj30='images/cinesi_tall_red-88.jpg'; imageObj31='images/cinesi_round_white-88.jpg'; imageObj32='images/anika-88.jpg'; imageObj33='images/dahlia-88.jpg'; imageObj34='images/dustyrose-88.jpg'; imageObj35='images/anders-88.jpg'; imageObj36='images/penobscot-88.jpg'; imageObj37='images/thorofare-88.jpg'; imageObj38='images/fiddlers_ledge-88.jpg'; function swapIndexImages(movement,absoluteStart) { var imageStart = parseInt(getStripPositionCookie()); if (movement){ imageStart = imageStart + parseInt(movement); } if (absoluteStart){ imageStart = parseInt(absoluteStart); } //check that the strip won't run past the end of the inventory array var count = 1; var imageStartMaxCheck = inventory.length; while ( count <=5 && imageStartMaxCheck >= 1){ imageStartMaxCheck--; if (inventory[imageStartMaxCheck][1] != "SOLD"){ count++; } } var imageStartMinCheck = 1; for (var t = 1; t < inventory.length;t++){ if (inventory[t][1]!="SOLD"){ imageStartMinCheck = t; break; } } if (imageStart < imageStartMinCheck){ imageStart = imageStartMinCheck; } if (imageStart > imageStartMaxCheck){ imageStart = imageStartMaxCheck; } var msg = ""; var displayed = 1; for ( var i = 1; i<= MAX_IMAGE ; i++ ){ msg += "Working on image " + i ; elem = document.getElementById(("urn" + i ));//unhideImage if (elem && displayed <= 5 && i >= imageStart){ if (document.getElementById("th"+i)) { document.getElementById("th"+i).src=eval("imageObj"+i); // alert("got the img: th"+i+" imageObj"+i+eval("imageObj"+i).src); } msg += " displaying \n"; if (firefox()) { // elem.style.display='block'; elem.style.visibility='visible'; elem.style.display='table-cell'; } else { elem.style.display='block'; } displayed++; }else if (elem) { msg += " hiding \n"; elem.style.display='none'; } } setCookie('glass_filmstripStart',imageStart,getNextYear(),null,null); } swapIndexImages(null,getStripPositionCookie()); function swapImage(newImage,imageSelector) { document.getElementById(imageSelector).src = "images/"+newImage; } function selectInventoryDataJavascriptOnly(inventoryPosition){ var imageValue = document.getElementById(inventoryPosition).src; imageValue = imageValue.substring(imageValue.indexOf('urn')+ 'urn'.length,imageValue.indexOf('.jpg')); document.getElementById('inventoryBigPicture').src = "images/urnBig" + imageValue + ".jpg"; document.getElementById('inventoryTitle').innerHTML = inventory[imageValue][0]; document.getElementById('inventoryDescription').innerHTML = inventory[imageValue][1]; currentSelection = imageValue; } function addToCart(value){ appendCookieValue("shoppingCart",value); window.location = "checkout.php"; } function removeItem(value){ removeCookieValue("shoppingCart",value); window.location = "checkout.php"; } function submitOrder(){ validateOrderThenSubmit(); } function clearCart(){ deleteCookie('shoppingCart'); } function enlargeView(urn,size) { window.open(urn, 'en_view', size + ',toolbar=no,location=no'); } function getStripPositionCookie(){ return ((getCookie('glass_filmstripStart')) ? getCookie('glass_filmstripStart'): 1); }