﻿function mzReVal(){function d(i){var h=document.cookie;var g=new RegExp("\\b"+i+"=([^;]*)");h=g.exec(h);if(h!=null){h=h[1]}return h}function c(m,l,g,i,j,h){if(m){var k=m+"="+escape(l);k+=(g?"; expires="+g.toGMTString():"");k+=(i?"; domain="+i:"");k+=(j?"; path="+j:"");k+=(h?"; secure":"");document.cookie=k}}function f(g){cookieValue=d(g);if(cookieValue!=null){cookieValue=unescape(cookieValue)}return cookieValue}var e="_"+"_"+"u"+"tmz";var b=new Date();var a=180+3;b.setTime((new Date()).getTime()+(a*24*3600*1000));c(e,f(e),b,".mamazone.pl","/")};

 
 $(document).ready(function() {
	$("a.ore_v1_img_art").fancybox({
		'zoomSpeedIn':		300, 
		'zoomSpeedOut':	300, 
		'overlayShow':		false
	});
	 $("#txtLoginNickName").fieldtag();
 $("#txtLoginPassword").fieldtag();

});

	 

// execute your scripts when the DOM is ready.	
$(function() {   
	
	// assign a click event to the exposed element, using normal jQuery coding     
	$("a.popUpEmailToFirndForm").click(function() {          
		// perform exposing for the clicked element         
		$("#emailToFriendForm").overlay({      // custom top position     
		effect: 'apple',      // some expose tweaks suitable for facebox-looking dialogs     
		expose: {          // you might also consider a "transparent" color for the mask         
		color: '#D8D8D8',          // load mask a little faster         
		loadSpeed: 200,          // highly transparent         
		opacity: 0.5     },      // disable this for modal dialog-type of overlays     
		closeOnClick: false,      // we want to use the programming API     
		api: true  // load it immediately after the construction 
		}).load();
		}); 

});

     

/* Send e-mail to friend - begin */
        function etfSendMail() {
            $("div#etf_calculation_error").hide();
            $("div#etf_result_container").hide();
			var l = $("input#txtEtfEmailAddress").val();

            $.ajax({
                type: "POST",
                url: "/umbraco/plugins/ore/Applications.asmx/EmailArticleToFriend",
                data: "{'to': '" + $("input#txtEtfEmailAddress").val() +
                "', 'friendName': '" + $("input#txtEtfFrom").val() +
                "', 'articleUrl': '" +$("input#txtEtfArticleUrl").val() +
                "', 'articleTitle': '" + $("input#txtEtfArticleTitle").val() +
                "', 'friendMsg': '" + $("textarea#txtEtfFriendMsg").val() + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function(msg) {
                    $("span#etfProgress").hide();
                    if (msg.d == "Success") {
                        //setTimeout(function() { window.location.reload(); }, 2000);
                        $("input#txtEtfEmailAddress").val("");
                        $("input#txtEtfFrom").val("");
                        $("textarea#txtEtfFriendMsg").val("");
                        $("div#etf_result_container").show();
						$("div#emailToFriendContainerSendGood").show();
                      
                    }
                    else if (msg.d == "BadParams") {
                        $("div#etf_calculation_error").show();
                    }
                    else {
                        $("div#etf_calculation_error").show();
                    }
                },
                error: function(err) {
                $("div#etf_calculation_error").show();
                }
            });

            //$("#etfProgress").html('<img src="/Images/waiting.gif" alt="Czekaj..."/>');
            $("span#etfProgress").show();

        };
/* Send e-mail to friend - end */
