function foop(){}//this function is passed to setTimeout function toggle_overlay(turnOff) { if(turnOff == 1) { $("#coveroverlay").css("display", "none"); return true; } else if(turnOff == 0) { $("#coveroverlay").css("display", "none"); return true; } if( $("#coveroverlay").css("display") == "block" ) $("#coveroverlay").css("display", "none"); else if( $("#coveroverlay").css("display") == "none" ) $("#coveroverlay").css("display", "block"); } function close_all() { $("#imageLargeContainer").css("display", "none"); } function toggle_sharelist(elem, turnOn) { if( turnOn ) { $(elem).siblings(".imageShareList").css("display", "block"); return true; } else if( turnOn == 0 ) { $(elem).siblings(".imageShareList").css("display", "none"); return true; } if( $(elem).siblings(".imageShareList").css("display") == "none" ) $(elem).siblings(".imageShareList").css("display", "block"); else $(elem).siblings(".imageShareList").css("display", "none"); } $(document).ready(function() { //jQuery functions for every page $("#editPage").click(function(event) { //inject form elements into page }); $("#coveroverlay").click(function(event) { toggle_overlay(); close_all(); }); //jQuery functions for product pages $("div.images .mainImg img").click(function(event) { var imageSrc = event.target.src; imageSrc = imageSrc.split("?i="); imageSrc = imageSrc[1].split("&h="); imageSrc = "/media/images/?i=" + imageSrc[0] + "&h=800"; $("#imageLargeImage").attr("src", imageSrc); $("#imageLargeContainer").css("display", "block"); toggle_overlay(); }); var timeoutTmp; $("div.images .mainImg").mouseover(function(event) { toggle_sharelist(event.target, 1); if(typeof timeoutTmp !== "undefined") clearTimeout(timeoutTmp); }); $("div.images .mainImg img").mouseout(function(event) { timeoutTmp = setTimeout(function(){toggle_sharelist(event.target, 0)}, 3000); }); //Thumbnail list mouseover $("div.images ul li img").mouseover(function(event) { var imageSrc = event.target.src; var imageId = event.target.id.substring(9); var imageDescription = $(event.target).attr("rel"); imageSrc = imageSrc.split("?i="); imageSrc = imageSrc[1].split("&h="); imageSrc = "/media/images/?i=" + imageSrc[0]; $(event.target).parent().parent().siblings(".mainImg").children("img").attr("src", imageSrc + "&h=380"); var shareList = $(event.target).parent().parent().siblings(".mainImg").children(".imageShareList"); var googleShareId = $(shareList).children(".googleShare").attr("id"); gapi.plusone.render( googleShareId, {"href": "http://www.ZAGGLEPUSS/gallery/view/" + imageId, "size": "medium", "annotation": "none"} ); shareList.children(".pinterestShare").children().attr( "href", encodeURI("http://pinterest.com/pin/create/button/?url=http://www.ZAGGLEPUSS" +imageSrc + "&media=http://www.ZAGGLEPUSS" +imageSrc +"&description=" +imageDescription) + "%0A%0A%23Jewelry" ); shareList.children(".facebookShare").children().attr("href", "http://www.facebook.com/sharer.php?u=http://www.ZAGGLEPUSS/gallery/view/" + imageId); gapi.plusone.render( googleShareId + "BIG", {"href": "http://www.ZAGGLEPUSS/gallery/view/" + imageId, "size": "standard", "annotation": "none"} ); $("#imageLargeContainer .pinterestShare").children().attr( "href", encodeURI("http://pinterest.com/pin/create/button/?url=http://www.ZAGGLEPUSS" +imageSrc + "&media=http://www.ZAGGLEPUSS" +imageSrc +"&description=" +imageDescription) + "%0A%0A%23Jewelry" ); $("#imageLargeContainer .facebookShare").children().attr("href", "http://www.facebook.com/sharer.php?u=http://www.ZAGGLEPUSS/gallery/view/" + imageId); /*shareList.children(".googleShare").children().attr("href", "http://www.ZAGGLEPUSS/gallery/view/" + imageId);*/ }); //Thumbnail list click $("div.images ul li img").click(function(event) { var imageSrc = event.target.src; imageSrc = imageSrc.split("?i="); imageSrc = imageSrc[1].split("&h="); imageSrc = "/media/images/?i=" + imageSrc[0] + "&h=800"; $("#imageLargeImage").attr("src", imageSrc); $("#imageLargeContainer").css("display", "block"); toggle_overlay(); }); }); /* $(".addImage img").mouseover(function() { var imageSrc = $(this).attr("src"); imageSrc = imageSrc.split("&h"); $("#imageInfoImage").attr("src", imageSrc[0] + "&w=200"); }); $(".addImage img").click(function() { $(".addImage").css("display", "none"); var imageSrc = $("#imageInfoImage").attr("src").split("&"); imageSrc = imageSrc[1].substring(2); $("#imageSrc").val(imageSrc); }); */