document.createElement("article");
document.createElement("aside");
document.createElement("footer");
document.createElement("header");
document.createElement("hgroup");
document.createElement("section");
document.createElement("nav");
function hoverPortfolio(){
jQuery('.portfolio-items li ').hover(function(){
jQuery(this).find('.p-link').stop().animate({'margin-left':'0', 'margin-bottom':'0'},300);
jQuery(this).find('.p-enlarge').stop().animate({'margin-right':'0', 'margin-top':'0'},300, function(){
jQuery(this).parent().find('.post-info').fadeIn('900');
jQuery(this).parent().find('img').stop().fadeTo('700',0.2);
});
},function(){
jQuery(this).find('.post-info').fadeOut('fast');
jQuery(this).find('img').stop().fadeTo('fast',1);
jQuery(this).find('.p-link').stop().animate({'margin-left':'-45', 'margin-bottom':'-45'},300);
jQuery(this).find('.p-enlarge').stop().animate({'margin-right':'-45', 'margin-top':'-45'},300);
});
}
function hidecontent(){
jQuery('#wrapper:visible').fadeOut('fast');
jQuery('#hidecontent').hide();
jQuery('#showcontent').show();
}
function showcontent(){
jQuery('#wrapper:hidden').fadeIn('fast');
jQuery('#showcontent').hide();
jQuery('#hidecontent').show();
}
jQuery(document).ready(function($){
$('a#goback').click(function(){
history.back();
return false;
});
/*
$('.module:nth-child(1n)').addClass('module-dark');
$('.module:nth-child(2n)').addClass('module-light');
$('.module:nth-child(3n)').addClass('module-grey');
*/
$('.infobtn').click(function(){
$(this).parent().parent().find('.post-meta-popup').slideDown();
return false;
});
$('.close-info-popup').click(function(){
$(this).parent().slideUp();
return false;
});
$('#hidecontent').click(function(){
hidecontent();
return false;
});
$('#showcontent').click(function(){
showcontent();
return false;
});
$("a[data-rel^='prettyPhoto']").prettyPhoto({theme: 'pp_default'});
$('.open_modal').click(function(){
$('#modal_signup').fadeIn();
return false;
});
$('a#closemodal').click(function(){
$('#modal_signup').fadeOut();
return false;
});
$('#signupform_nav > a').click(function(){
var connected = jQuery(this).attr('data-rel');
$('#signup, #signin, #reset').hide();
$('#' + connected).fadeIn();
});
$('.epicgallery').each(function () {
$(this).epicGallery();
});
$('.fullscreen_gallery_container').epicGalleryFullscreen();
jQuery.fn.equalizeHeights = function(){
return this.height( Math.max.apply(this, jQuery(this).map(function(i,e){ return jQuery(e).height() }).get() ) )
}
//$('.module-featured .page ').equalizeHeights();
//$('.portfolio-grid .portfolio ').equalizeHeights();
jQuery('.portfoliofilter li:first').addClass('current-menu-item');
// get the action filter option item on page load
var $filterType = jQuery('.portfoliofilter li.current-menu-item a').attr('class');
var $holder = jQuery('ul.portfolio-items');
var $data = $holder.clone();
// attempt to call Quicksand when a filter option
// item is clicked
jQuery('.portfoliofilter li a').click(function(e) {
// reset the active class on all the buttons
jQuery('.portfoliofilter li').removeClass('current-menu-item');
var $filterType = jQuery(this).attr('class');
jQuery(this).parent().addClass('current-menu-item');
if ($filterType == 'showall') {
var $filteredData = $data.find('li');
}
else {
var $filteredData = $data.find('li[data-type~=' + $filterType + ']');
}
// call quicksand and assign transition parameters
$holder.quicksand($filteredData, {
duration: 800,
easing: 'easeInOutQuad'
},function(){
hoverPortfolio();
$("a[rel^='prettyPhoto']").prettyPhoto();
}
);
return false;
});
hoverPortfolio();
// Add tooltip to social media icons
jQuery('.epic_socialmedia > li > a').simpletooltip();
jQuery.fn.setAllToMaxHeight = function(){
return this.height( Math.max.apply(this, jQuery.map( this , function(e){ return jQuery(e).height() + 30}) ) );
}
jQuery('span.caption').setAllToMaxHeight();
//jQuery('#content, #sidebar').setAllToMaxHeight();
jQuery('.breakline a').click(function(){
jQuery('html, body').animate({scrollTop: jQuery("#wrapper").offset().top}, 1000);
return false;
});
/* Cycle slideshow
==================================================================*/
var cycle_transition = jQuery('#slideshow').attr('data-transition');
var cycle_interval = jQuery('#slideshow').attr('data-interval');
jQuery('#cycle-slideshow').cycle({
fx: cycle_transition,
speed:300,
easing: 'easeInOutQuad',
cleartype: 1,
pause:1,
timeout: cycle_interval,
next: '#next-slide',
prev: '#prev-slide',
before: startPreloader,
after: onAfter,
pager: '#thumbnav',
pagerAnchorBuilder: function(idx, slide) {
return '#thumbnav li:eq(' + idx + ') a';
}
});
jQuery('#controls a').not('#cycle_pauseButton, #cycle_playButton, #showthumbnails').click(function(){
//alert('stop');
jQuery('.preload_slide').stop();
jQuery('.preload_slide').css({'width':'0px'});
startPreloader();
return false;
});
jQuery('#showthumbnails').click(function(){
jQuery(this).hide();
jQuery('#hidethumbnails').show();
jQuery('#thumbnav-wrap').slideDown('fast');
return false;
});
jQuery('#hidethumbnails').click(function(){
jQuery(this).hide();
jQuery('#showthumbnails').show();
jQuery('#thumbnav-wrap').slideUp('fast');
return false;
});
jQuery('#cycle_pauseButton').click(function(){
jQuery(this).hide();
jQuery('#cycle_playButton').show();
jQuery('#cycle-slideshow').cycle('pause');
resetPreloader();
return false;
});
jQuery('#cycle_playButton').click(function(){
jQuery(this).hide();
jQuery('#cycle_pauseButton').show();
jQuery('#cycle-slideshow').cycle('resume');
startPreloader();
return false;
});
function startPreloader(){
if(jQuery('#cycle_pauseButton').is(':visible')){
var preloader = jQuery('.preload_slide');
jQuery(preloader).stop().animate({'width':'0px'},0);
jQuery(preloader).stop().animate({'width':'100%'}, (cycle_interval - 10), 'linear');
}else{
jQuery(preloader).stop().animate({'width':'0px'},0);
}
}
function resetPreloader(){
var preloader = jQuery('.preload_slide');
jQuery(preloader).stop().animate({'width':'0px'},0);
}
function onAfter(cure,next,opts) {
var caption = (opts.currSlide + 1) + ' / ' + opts.slideCount;
jQuery('#counter').html(caption);
if((opts.currSlide + 5) < opts.slideCount){
var currpos = - (opts.currSlide * 160);
jQuery('#thumbnav').animate({'marginLeft': currpos + 'px'},700,'easeInOutSine');
}
}
$('#cycle-slideshow').hover(function(){
$('.preload_slide').pause();}
, function() {
$('.preload_slide').resume();
});
/* End cycle scripts */
jQuery('span.caption').setAllToMaxHeight();
/*
jQuery('#epic_gallery_wrap').hover(function(){
jQuery('#epic_gallery_nav').fadeIn();
},function(){
jQuery('#epic_gallery_nav').fadeOut();
});
*/
jQuery('#epic_gallery_nav li a').css({'opacity':'0.4'});
jQuery('#epic_gallery_nav li.activeSlide a').css({'opacity':'1'});
jQuery('#epic_gallery_nav li a').click(function(){
jQuery('#epic_gallery_nav li a').css({'opacity':'0.4'});
jQuery('#epic_gallery_nav li.activeSlide a').css({'opacity':'1'});
});
accordionMenu();
toggleMenu();
primaryHover();
tabPanel();
sidebarheight = jQuery('#sidebar').height();
contentheight = jQuery('#content').height();
if(contentheight > sidebarheight){
jQuery('#sidebar').not('.home #sidebar').css({'height': contentheight +'px'});
}
else if(contentheight < sidebarheight){
jQuery('#content').not('.home #content').css({'height': sidebarheight +'px'});
}
}); /* End document.ready */
/*
// Fix z-indexing issues in internet explorer 8.0
if(jQuery.browser.msie && jQuery.browser.version=="8.0"){
jQuery(function() {
var zIndexNumber = 1000;
jQuery('div').not('#slideshow-fixed div').each(function() {
jQuery(this).css('zIndex', zIndexNumber);
zIndexNumber -= 10;
});
});
}
*/
function primaryHover(){
jQuery("#menu-primary .sub-menu, #epic_user_menu ul ul").hover(function(){
jQuery(this).parent().find("a").addClass("primary-active");
},function(){
jQuery(this).parent().find("a").removeClass("primary-active");
});
}
// TAB PANEL
function tabPanel(){
//Default Action
jQuery(".tabs .tabcontent").hide(); //Hide all content
jQuery('.tabs').each(function(){
jQuery(this).find(".epic_tabnav > li:first").addClass("current-menu-item").show(); //Activate first tab
jQuery(this).find(".tabcontent:first").show(); //Show first tab content
});
//On Click Event
jQuery(".epic_tabnav > li").click(function() {
jQuery(this).parent().find("li").removeClass("current-menu-item"); //Remove any "active" class
jQuery(this).addClass("current-menu-item"); //Add "active" class to selected tab
var activeTab = jQuery(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
jQuery(this).parent().parent().find(".tabcontent").hide();
jQuery(this).parent().parent().find('div:[data-id='+activeTab+']').fadeIn('fast');
return false;
});
}
// TOGGLE
function toggleMenu(){
//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
jQuery(".togglehandle").click(function(){
jQuery(this).toggleClass("active").next().slideToggle("fast");
return false; //Prevent the browser jump to the link anchor
});
}
function accordionMenu(){
//Set default open/close settings
jQuery('.acc_container').hide(); //Hide/close all containers
//jQuery('.acc_handle:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container
//On Click
jQuery('.acc_handle').click(function(){
if( jQuery(this).next().is(':hidden') ) { //If immediate next container is closed...
jQuery('.acc_handle').removeClass('active').next().slideUp('fast'); //Remove all "active" state and slide up the immediate next container
jQuery(this).toggleClass('active').next().slideDown('fast'); //Add "active" state to clicked trigger and slide down the immediate next container
}
return false; //Prevent the browser jump to the link anchor
});
}
/*********************
//* jQuery Multi Level CSS Menu #2- By Dynamic Drive: http://www.dynamicdrive.com/
//* Last update: Nov 7th, 08': Limit # of queued animations to minmize animation stuttering
//* Menu avaiable at DD CSS Library: http://www.dynamicdrive.com/style/
*********************/
//Update: April 12th, 10: Fixed compat issue with jquery 1.4x
//Specify full URL to down and right arrow images (23 is padding-right to add to top level LIs with drop downs):
// Run the script...
var siteurl = jQuery("meta[name=siteurl]").attr('content');
var arrowimages={down:['downarrowclass', siteurl + '/library/images/arrow_down.png', 18], right:['rightarrowclass', siteurl +'/library/images/arrow_right.png']}
var jqueryslidemenu={
animateduration: {over: 200, out: 100}, //duration of slide in/ out animation, in milliseconds
buildmenu:function(menuid, arrowsvar){
jQuery(document).ready(function($){
var $mainmenu=$("#"+menuid+">ul")
var $headers=$mainmenu.find("ul").parent()
$headers.each(function(i){
var $curobj=$(this)
var $subul=$(this).find('ul:eq(0)')
this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()}
this.istopheader=$curobj.parents("ul").length==1? true : false
$subul.css({top:this.istopheader? this._dimensions.h+"px" : 0})
$curobj.children("a:eq(0)").css(this.istopheader? {paddingRight: arrowsvar.down[2]} : {}).append(
''
)
$curobj.hover(
function(e){
var $targetul=$(this).children("ul:eq(0)")
this._offsets={left:$(this).offset().left, top:$(this).offset().top}
var menuleft=this.istopheader? 0 : this._dimensions.w
menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft
if ($targetul.queue().length<=1) //if 1 or less queued animations
$targetul.css({left:menuleft+"px", width:this._dimensions.subulw+'px'}).slideDown(jqueryslidemenu.animateduration.over)
},
function(e){
var $targetul=$(this).children("ul:eq(0)")
$targetul.slideUp(jqueryslidemenu.animateduration.out)
}
) //end hover
$curobj.click(function(){
$(this).children("ul:eq(0)").hide()
})
}) //end $headers.each()
$mainmenu.find("ul").css({display:'none', visibility:'visible'})
}) //end document.ready
}
}
//build menu with ID="primary" on page:
jqueryslidemenu.buildmenu("primary", arrowimages),
jqueryslidemenu.buildmenu("epic_user_menu", arrowimages),
jqueryslidemenu.buildmenu("filter", arrowimages);
// ACCORDION SLIDER EVENT HANDLERS
jQuery(function () {
jQuery('.slideimage').hide();
jQuery('.slide-minicaption').hide();
jQuery('.slidecaption').hide();
});
jQuery(window).bind("load", function() {
//jQuery(".slidecaption").hide();
jQuery(".slidecaption").css({'opacity':'0'});
jQuery('.slide-minicaption').show();
//jQuery('.slidecaption').show();
jQuery('.slideimage:hidden').fadeIn(500);
jQuery(".slide-minicaption").fadeTo(1, 0.8);
maxwidth = jQuery('#kwicks').width() - 80;
//alert (divwidth);
jQuery('.kwicks').kwicks({
max : maxwidth,
spacing:0
});
});
jQuery(function(){
jQuery(".accslide").hover(function() {
jQuery(".slide-minicaption",this).stop().animate({opacity: 0},200, 'easeInSine').parent().find(".slidecaption").show().stop().delay(400).animate({opacity: 0.8, bottom: '20'},400, 'easeOutSine');
},function(){
jQuery(".slide-minicaption",this).stop().animate({opacity: 0.8},200, 'easeOutSine');
jQuery(".slidecaption",this).stop().animate({opacity: 0, bottom: '-20'}, 200, 'easeInSine').hide();
});
});
/*
* Cross-browser event handling, by Scott Andrew
*/
function addEvent(element, eventType, lamdaFunction, useCapture) {
if (element.addEventListener) {
element.addEventListener(eventType, lamdaFunction, useCapture);
return true;
} else if (element.attachEvent) {
var r = element.attachEvent('on' + eventType, lamdaFunction);
return r;
} else {
return false;
}
}
/*
* Clear Default Text: functions for clearing and replacing default text in
* elements.
*
* by Ross Shannon, http://www.yourhtmlsource.com/
*/
addEvent(window, 'load', init, false);
function init() {
var formInputs = document.getElementsByTagName('input');
for (var i = 0; i < formInputs.length; i++) {
var theInput = formInputs[i];
if (theInput.type == 'text' && theInput.className.match(/\bcleardefault\b/)) {
/* Add event handlers */
addEvent(theInput, 'focus', clearDefaultText, false);
addEvent(theInput, 'blur', replaceDefaultText, false);
/* Save the current value */
if (theInput.value != '') {
theInput.defaultText = theInput.value;
}
}
}
}
function clearDefaultText(e) {
var target = window.event ? window.event.srcElement : e ? e.target : null;
if (!target) return;
if (target.value == target.defaultText) {
target.value = '';
}
}
function replaceDefaultText(e) {
var target = window.event ? window.event.srcElement : e ? e.target : null;
if (!target) return;
if (target.value == '' && target.defaultText) {
target.value = target.defaultText;
}
}
// OPEN LINKS IN NEW WINDOW
jQuery(function() {
jQuery('a[rel*=external]').click( function() {
window.open(this.href);
return false;
});
});
/**
*
* simpleTooltip jQuery plugin, by Marius ILIE
* visit http://dev.mariusilie.net for details
*
**/
(function($){ $.fn.simpletooltip = function(){
return this.each(function() {
var text = $(this).attr("title");
$(this).attr("title", "");
if(text != undefined) {
$(this).hover(function(e){
var tipX = e.pageX + 12;
var tipY = e.pageY + 12;
$(this).attr("title", "");
$("body").append("
' + imagecaption + '' + imagedescription + '
' ); //galleryCaptionIn(); $('#' + targetId).find('.button_next').click(function (e) { $imageNum++; if ($imageNum == $maxslides) { $imageNum = 0; } slide(); return false; }); $('#' + targetId).find('.button_prev').click(function (e) { $imageNum--; if ($imageNum < 0) { $imageNum = $maxslides - 1; } slide(); return false; }); $('#nav li a').click(function(e) { //$(this).addClass('active'); $imageNum = $(this).attr('data-rel'); slide(); return false; }); // This is where the actual slide is done function slide() { $('#nav li a').removeClass('active'); var previmageheight = $('.' + targetId + '-link_' + $imageNum - 1 + ' a').html(); imageheight = $('.' + targetId + '-link_' + $imageNum + ' a').attr('data-rel'); imageurl = $('.' + targetId + '-link_' + $imageNum + ' a').attr('href'); //$(targetObj).find('.button_prev').fadeOut('fast'); //$(targetObj).find('.button_down').fadeOut('fast'); $(targetObj).find('.loader').animate({ 'opacity': '0' }, 300, function () { $(targetObj).animate({'height': imageheight + 'px'}, 300, function(){ document.getElementById(loaderObj).innerHTML = ''; // Clear image $(targetObj).find('.loader').image(imageurl, function () { $(targetObj).find('.loader').animate({ 'opacity': '1' }, 500, function(){ $('.gallery_backdrop').find('img').remove(); $('.loader').find('img').clone().appendTo('.gallery_backdrop'); }); //$(targetObj).find('.button_prev').fadeIn('fast'); //$(targetObj).find('.button_down').fadeIn('fast'); $('#nav .' + targetId + '-link_' + $imageNum + ' a').addClass('active'); }); }); }); } }; })(jQuery); /* Fullscreen gallery */ (function ($) { // Fetch the image $.fn.image = function (src, f) { return this.each(function () { var i = new Image(); i.onload = f; i.src = src; this.appendChild(i); }); } $.fn.epicGalleryFullscreen = function (targetId) { var target = $(this), targetId = $(this).attr('id'), targetObj = "#" + targetId, loaderObj = "#" + targetId + "-loader", loader = '.loader'; // Load First image var $imageNum = 0; var $maxslides = $(this).find('.inlinegallery li').size(); // Get number of images var imageurl = $(this).find('.' + targetId + '-link_0 a').attr('href'); var imagecaption = $(this).find('.' + targetId + '-link_0 a').attr('data-title'); var imagedescription = $(this).find('.' + targetId + '-link_0 a').attr('data-description'); var previousBtn = '.fg_prev'; // Previous slide button var nextBtn = '.fg_next'; // Previous slide button $('.inlinegallery li a:first').addClass('active'); // Inline gallery initial setup $(targetObj + ' .postgallery').append(''); $(targetObj).find('.loader').image(imageurl, function () { $('.loader > img').clone().appendTo('.gallery_backdrop'); $(".gallery_backdrop img").fullBg(); $(".loader img").fullBg(); }); $(".gallery_caption").html('' + imagedescription + '
' ); //galleryCaptionIn(); $('#' + targetId).find('.fg_next').click(function (e) { $('.inlinegallery li a').removeClass('active'); $imageNum++; if ($imageNum == $maxslides) { $imageNum = 0; } $('.inlinegallery li:nth-child('+ ($imageNum + 1) +') a').addClass('active'); hidecontent(); $('#showcontent').fadeIn(); slide(); return false; }); $('#' + targetId).find('.fg_prev').click(function (e) { $('.inlinegallery li a').removeClass('active'); $imageNum--; if ($imageNum < 0) { $imageNum = $maxslides - 1; } $('.inlinegallery li:nth-child('+ ($imageNum + 1) + ') a').addClass('active'); hidecontent(); $('#showcontent').fadeIn(); slide(); return false; }); $('.inlinegallery li a').click(function(e) { $('.inlinegallery li a').removeClass('active'); $(this).addClass('active'); $imageNum = $(this).attr('data-count'); hidecontent(); $('#hidecontent, #showcontent').fadeIn(); slide(); return false; }); // This is where the actual slide is done function slide() { $(".gallery_caption").html(''); var imagecaption = $('.' + targetId + '-link_' + $imageNum + ' a').attr('data-title'); var imagedescription = $('.' + targetId + '-link_' + $imageNum + ' a').attr('data-description'); $(".gallery_caption").html('' + imagedescription + '
' ); $('#preloader').fadeIn(); $(".gallery_backdrop img").fullBg(); //$('#nav li a').removeClass('active'); imageurl = $('.' + targetId + '-link_' + $imageNum + ' a').attr('href'); $(targetObj).find('.loader').animate({ 'opacity': '0' }, 200, function () { $('.loader > img').remove(); $(targetObj).find('.loader').image(imageurl, function () { $('#preloader').fadeOut('fast'); $(".loader img").fullBg(); $(targetObj).find('.loader').animate({ 'opacity': '1' }, 1000, function(){ $('.gallery_backdrop').find('img').remove(); $('.loader > img').clone().appendTo('.gallery_backdrop'); $(".gallery_backdrop img").fullBg(); }); }); }); } }; })(jQuery); /** * jQuery.fullBg * Version 1.0 * Copyright (c) 2010 c.bavota - http://bavotasan.com * Dual licensed under MIT and GPL. * Date: 02/23/2010 **/ (function($) { $.fn.fullBg = function(){ var bgImg = $(this); function resizeImg() { var imgwidth = bgImg.width(); var imgheight = bgImg.height(); var winwidth = $(window).width(); var winheight = $(window).height(); var widthratio = winwidth / imgwidth; var heightratio = winheight / imgheight; var widthdiff = heightratio * imgwidth; var heightdiff = widthratio * imgheight; if(heightdiff>winheight) { bgImg.css({ width: winwidth+'px', height: heightdiff+'px' }); } else { bgImg.css({ width: widthdiff+'px', height: winheight+'px' }); } } resizeImg(); $(window).resize(function() { resizeImg(); }); }; })(jQuery) jQuery(function(){ //Get our elements for faster access and set overlay width var div = jQuery('#thumbs'), ul = jQuery('ul.inlinegallery'), // unordered list's left margin ulPadding = 10; //Get menu width var divWidth = div.width(); //Remove scrollbars div.css({overflow: 'hidden'}); //Find last image container var lastLi = ul.find('li:last-child'); //When user move mouse over menu div.mousemove(function(e){ //As images are loaded ul width increases, //so we recalculate it each time var ulWidth = lastLi[0].offsetLeft + lastLi.outerWidth() + ulPadding; var left = (e.pageX - div.offset().left) * (ulWidth-divWidth) / divWidth; div.scrollLeft(left); }); });