jQuery(window).load(function () { var content_open = true; var lower_toggle = false; var slideShowPlaying = true; var header_width = jQuery("#header").width() + 65; var open_space = jQuery(window).width() - header_width; var floating_slideshow_nav_pos = header_width + ((open_space / 2) - ((jQuery("#floating_slideshow_nav").width()) / 2)); var window_height = jQuery(this).height(); var cfInterval = null; var emailValResult = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; jQuery("#contact_form #message").text(""); jQuery("#contact_form").submit(function () { jQuery("#result_box").html("Processing"); jQuery("#name,#email,#message ").css("border-color", "#333333"); if (jQuery("#contact_form #name").val() != cf_name && jQuery("#contact_form #email").val() != cf_email && emailValResult.test(jQuery("#contact_form #email").val()) && jQuery("#contact_form #message").val() != "") { jQuery("#contact_form input[type=submit]").fadeOut(0); if (cfInterval != null) clearInterval(cfInterval); jQuery("#result_box").fadeIn(200); var fieldsVal = jQuery(this).serialize(); $.ajax({ type: "POST", url: ajaxurl, data: fieldsVal, success: function( result ){ jQuery("#result_box").html(result); cfInterval = setInterval('jQuery("#result_box").fadeOut(200);', 3000); jQuery("#contact_form input[type=submit]").fadeIn(0); } }); } else { if (jQuery("#contact_form #name").val() == cf_name) { jQuery("#name").css("border-color", "#912e35"); } if (jQuery("#contact_form #email").val() == cf_email || !emailValResult.test(jQuery("#contact_form #email").val())) { jQuery("#email").css("border-color", "#912e35"); } if (jQuery("#contact_form #message").val() == "") { jQuery("#message").css("border-color", "#912e35"); } } return false; }); // SLIDESHOW CONTENT AUTO HIDE if (jQuery("#thumbs").size() > 0) { jQuery("#thumbs ul li.play_stop_button").css("background-position", "-53px -30px"); jQuery("#thumbs ul li.play_stop_button").click(function () { if (slideShowPlaying == true) { jQuery("#thumbs").stopSlideShow(); jQuery("#thumbs ul li.play_stop_button").css("background-position", "-53px 0px"); slideShowPlaying = false; } else { jQuery("#thumbs").startSlideShow(); jQuery("#thumbs ul li.play_stop_button").css("background-position", "-53px -30px"); slideShowPlaying = true; } }); jQuery("#thumbs ul li.forward_button").click(function () { jQuery("#thumbs").nextSlide(); }); jQuery("#thumbs ul li.backward_button").click(function () { jQuery("#thumbs").prevSlide(); }); if (!jQuery("#slideshow_nav_portrait").length) { var thumb_ypos = 0; jQuery("#thumb_vert_mousemove a").each(function (i) { $(this).css("top", thumb_ypos); thumb_ypos += 62; }); jQuery("#thumb_vert_mousemove").css("overflow", "hidden"); jQuery("#thumb_vert_mousemove").mousemove(function(e){ var thumb_container_height = (62 * jQuery("#thumb_vert_mousemove a").size()); var top = (e.pageY - jQuery(this).offset().top) * (thumb_container_height - (window_height - 140)) / (window_height - 140); jQuery(this).scrollTop(top); }); } else { var thumb_ypos = 0; jQuery("#thumb_vert_mousemove a").each(function (i) { $(this).css("top", thumb_ypos); thumb_ypos += 104; }); jQuery("#thumb_vert_mousemove").css("overflow", "hidden"); jQuery("#thumb_vert_mousemove").mousemove(function(e){ var thumb_container_height = (104 * jQuery("#thumb_vert_mousemove a").size()); var top = (e.pageY - jQuery(this).offset().top) * (thumb_container_height - (window_height - 140)) / (window_height - 140); jQuery(this).scrollTop(top); }); } } if (jQuery("#floating_slideshow_nav").length) { lower_toggle = true; jQuery("#floating_slideshow_nav ul li.play_stop_button").css("background-position", "-53px -30px"); jQuery("#floating_slideshow_nav ul li.play_stop_button").click(function () { if (slideShowPlaying == true) { jQuery("#floating_slideshow_nav").stopSlideShow(); jQuery("#floating_slideshow_nav ul li.play_stop_button").css("background-position", "-53px 0px"); slideShowPlaying = false; } else { jQuery("#floating_slideshow_nav").startSlideShow(); jQuery("#floating_slideshow_nav ul li.play_stop_button").css("background-position", "-53px -30px"); slideShowPlaying = true; } }); jQuery("#floating_slideshow_nav ul li.forward_button").click(function () { jQuery("#floating_slideshow_nav").nextSlide(); }); jQuery("#floating_slideshow_nav ul li.backward_button").click(function () { jQuery("#floating_slideshow_nav").prevSlide(); }); if (!jQuery("#floating_slideshow_nav_portrait").length) { var thumb_xpos = 0; jQuery("#thumb_mousemove a").each(function (i) { $(this).css("left", thumb_xpos); thumb_xpos += 102; }); jQuery("#thumb_mousemove").css("overflow", "hidden"); jQuery("#thumb_mousemove").mousemove(function(e){ var thumb_container_width = 102 * jQuery("#thumb_mousemove a").size(); var left = (e.pageX - jQuery(this).offset().left) * (thumb_container_width - 508) / 508; jQuery(this).scrollLeft(left); }); } else { var thumb_xpos = 0; jQuery("#thumb_mousemove a").each(function (i) { $(this).css("left", thumb_xpos); thumb_xpos += 82; }); jQuery("#thumb_mousemove").css("overflow", "hidden"); jQuery("#thumb_mousemove").mousemove(function(e){ var thumb_container_width = 82 * jQuery("#thumb_mousemove a").size(); var left = (e.pageX - jQuery(this).offset().left) * (thumb_container_width - 508) / 508; jQuery(this).scrollLeft(left); }); } } // HEADER FUNCTIONS if (jQuery("#wall").length || jQuery("#floating_slideshow_nav").length) { content_open = false; if (!jQuery("#wall_menu").length) { var header_width = (-(jQuery("#header").width()) - 150).toString(); jQuery("#header").animate({"left": header_width + "px"}, "slow"); } } // SHOW/HIDE PAGE background jQuery("#cross").hover(function () { jQuery(this).find("img").stop().fadeTo("slow", 1); }, function () { jQuery(this).find("img").stop().fadeTo("slow", 0.3); }).find("img").fadeTo(0, 0.3).click(function () { jQuery("#content, #header").animate({"left": "-740px"}, 800, "easeInOutExpo"); jQuery("body").css("overflow", "hidden").resize(); jQuery.fn.superbgResize(); content_open = false; }); // POSITION TOGGLE + TOGGLE FUNCTIONS + FLOATING SLIDESHOW FUNCTIONS jQuery(window).resize(function () { window_height = jQuery(this).height(); header_width = jQuery("#header").width() + 65; open_space = jQuery(window).width() - header_width; floating_slideshow_nav_pos = header_width + ((open_space / 2) - ((jQuery("#floating_slideshow_nav").width() + 20) / 2)); if (lower_toggle == false) { jQuery("#show_hide").css("top", ((jQuery(window).height() / 2) - (jQuery("#show_hide").height() / 2) - 35) + "px"); } else { jQuery("#show_hide").css("top", jQuery(window).height() - jQuery("#show_hide").height() - 90); } if (content_open == true) { jQuery("#floating_slideshow_nav").css("left", floating_slideshow_nav_pos); } else { jQuery("#floating_slideshow_nav").css("left", (((open_space + header_width) / 2) - ((jQuery("#floating_slideshow_nav").width() + 20) / 2))); } jQuery("#thumb_vert_mousemove").css("height", jQuery(window).height() - 60); }).resize(); jQuery("#show_hide").click(function () { if (content_open == false) { jQuery("#header").animate({"left": "0px"}, 800, "easeInOutExpo"); jQuery("#content").animate({"left": "255px"}, 800, "easeInOutExpo"); jQuery("body").css("overflow", "auto").resize(); jQuery("#floating_slideshow_nav").animate({"left": floating_slideshow_nav_pos}, 800, "easeInOutExpo"); content_open = true; } else { content_open = false; } }).hover(function () { jQuery(this).find("img").stop().fadeTo("slow", 1); }, function () { jQuery(this).find("img").stop().fadeTo("slow", 0.5); }).find("img").fadeTo(0, 0.3); // GALLERY THUMB FUNCTIONS jQuery(".gallery_one_post, .gallery_two_post, .gallery_three_post, .gallery_four_post").hover(function () { jQuery(this).find(".gallery_item_info").fadeOut(200); jQuery(this).find("img").fadeTo("medium", 0.7); }, function () { jQuery(this).find(".gallery_item_info").fadeIn(200); jQuery(this).find("img").fadeTo("medium", 1); }); // MENU CONFIG jQuery("#menu ul li").hover(function () { if (jQuery(this).find("ul")) { jQuery(this).find("ul").css("display", "block").fadeOut(0).slideDown(200); jQuery(this).find("ul li ul").hide(); } }, function () { if (jQuery(this).find("ul")) jQuery(this).find("ul").slideUp(200); }); });