function OpenCataloguePopup () { $.getScript("/javascript/catalogue.js.php"); OpenPopup("/sections/prophoto/ajax/order_catalogue.php"); } function OpenDigitalCopiesPopup () { $.getScript("/javascript/catalogue.js.php"); OpenPopup("/sections/prophoto/ajax/order_digital_copies.php"); } function OnSubjectChange(elm, ref) { subjectuuid = elm.options[elm.selectedIndex].value; document.location.href = '/sections/prophoto/packages.php?subjectUuid=' + subjectuuid + '&ref=' + ref } function OnInputFocus(elm) { orgtext = elm.getAttribute("realname"); value = elm.value; realtype = elm.getAttribute("realtype"); faketype = elm.getAttribute("faketype"); name = elm.getAttribute('name'); if (value == orgtext) { oldElm = jQuery(elm); // Duplicate stuff: newElm = jQuery(""); newElm.attr('id', oldElm.attr('id')); newElm.attr('realname', orgtext); newElm.attr('value', ''); newElm.attr('realtype', realtype); newElm.attr('faketype', faketype); newElm.attr('class', 'ftextbox'); newElm.attr('name', name); newElm.css('width', oldElm.css('width')); if (oldElm.attr('onkeypress') != undefined) { newElm.keypress( oldElm.attr('onkeypress')); } else { $.event.copy(oldElm, newElm); } oldElm.replaceWith(newElm); // we need a short sleep here: newElm.trigger('focus'); setTimeout("addElementTrigger()", 100); } return true; } function addElementTrigger() { newElm.trigger('focus'); } function OnInputBlur(elm) { orgtext = elm.getAttribute("realname"); value = elm.value; realtype = elm.getAttribute("realtype"); faketype = elm.getAttribute("faketype"); name = elm.getAttribute('name'); if (faketype == null || faketype == "null") faketype = realtype; if (value == '') { oldElm = jQuery(elm); newElm = jQuery(""); newElm.attr('id', oldElm.attr('id')); newElm.attr('realname', orgtext); newElm.attr('value', orgtext); newElm.attr('realtype', realtype); newElm.attr('faketype', faketype); newElm.attr('class', 'ftextboxhelp'); newElm.attr('name', name); newElm.css('width', oldElm.css('width')); if (oldElm.attr('onkeypress') != undefined) { newElm.keypress( oldElm.attr('onkeypress')); } else { $.event.copy(oldElm, newElm); } oldElm.replaceWith(newElm); } return true; } tooltip_timer = null; this.imagetooltip = function(){ /* CONFIG */ /* END CONFIG */ jQuery("body").click ( function () { $('div.image-tooltip').remove(); }); jQuery("a.image-tooltip").click(function(e) { return false; } ); jQuery("a.image-tooltip").hover( function(e) { if (tooltip_timer != null) { jQuery("div.image-tooltip").remove(); clearTimeout(tooltip_timer); tooltip_timer = null; } image_height = $(this).attr('large_height') html = "
"; html += " "; subjects = parseInt($(this).attr('subjects')) if (subjects == 1) { } html += " "; html += "
"; jQuery("body").append(html); image_uuid = $(this).attr('uuid'); jQuery("#facebook_image_share").click ( function () { top.location.href = '/sections/prophoto/sharepic.php?ref=' + escape(document.URL) + '&uuid=' + image_uuid; }); jQuery("img.image-tooltip").click(function(e) { changeImage(currentImage, image_uuid); jQuery("div.image-tooltip").remove(); }); jQuery("div.image-tooltip").mouseenter(function(e) { if (tooltip_timer != null) { clearTimeout(tooltip_timer); } tooltip_timer = null; }); jQuery("div.image-tooltip").mouseleave(function(e) { tooltip_timer = setTimeout("tooltipCloseCheck()", 1000); } ); // ctable = $(this).parent('table'); // o// ctable = $('#image_inbox').find('table').first(); container_height = ctable.height(); container_pos = ctable.offset().top; start_y = container_pos + (container_height/2) - (image_height/2); center = $(this).offset().top + ( $(this).height() / 2 ); arrow_start = center - start_y - 50; $('img.tooltip-arrow').css('top', arrow_start); pos = $(this).parent().offset(); width = $(this).parent().width(); height = $(this).parent().height(); jQuery("div.image-tooltip") .css("top",(start_y) + "px") .css("left",(pos.left + width + 40) + "px") .fadeIn("fast"); }, // On mouse out: function () { tooltip_timer = setTimeout("tooltipCloseCheck()", 1000); } ); }; function tooltipCloseCheck() { jQuery("div.image-tooltip").fadeOut("slow").remove(); tooltip_timer = null; } function promoteProductsCheckout() { p = new Array(); q = new Array(); $('input.orderproduct').each ( function () { p.push($(this).attr('product')); q.push($(this).val()); }); products = $.toJSON(p) quantity = $.toJSON(q) $.post('/sections/prophoto/ajax/do_order_promote.php', {products: products, quantity: quantity}, function (data) { document.location.href = '/sections/printsorderv2/shoppingcart.php'; }); } function updateProductPrice (id, rebate) { if (rebate == undefined) { rebate = false; } total_sum = 0; total_quantity = 0; info = new Array(); i = 0; get_param = ""; $(".product").each ( function() { product = $(this); if (product.is(':checked')) { quantity = 1; } else { quantity = 0; } line_sum = quantity * product.attr("price"); total_sum += line_sum; total_quantity += quantity; num = product.attr("num"); $('#product_line_sum_' + num).html("..."); info[i] = line_sum; get_param += line_sum + "|"; i++; }); $('#totalPrice').html("..."); $('#totalQuantity').html(total_quantity + ' ' + 'stk.'); get_param += total_sum + "|"; $.getJSON('/sections/prophoto/ajax/product_price.php', {prices: get_param, rebate: rebate},function (data) { for (i = 0; i