﻿$(document).ready(function () {
    var a = 'easeOutElastic';
    var b = $('#nav li.current_page_item, #nav .current_page_ancestor, #nav .current_page_parent').position();
    var c = $('#nav li.current_page_item, #nav .current_page_ancestor, #nav .current_page_parent').width();
    var d = 0;
    if(b){
	b = b.left + (($('#nav li.current_page_item, #nav .current_page_ancestor, #nav .current_page_parent').width() / 2) - 35);    
    }
    else
    {
     
        $('.page-item-13').addClass('current_page_item');
        b = $('#nav li.current_page_item, #nav .current_page_ancestor, #nav .current_page_parent').position().left + (($('#nav li.current_page_item, #nav .current_page_ancestor, #nav .current_page_parent').width() / 2) - 35)
    }
    $('#glow').css({
        left: b
    });
    $('#nav li').hover(function () {
        d = $(this).position();
        d = d.left + (($(this).width() / 2) - 35);
        $('#glow').stop(false, true).animate({
            left: d
        }, {
            duration: 1000,
            easing: a
        })
    }).click(function () {
        $('#nav li').removeClass('current_page_item');
        $(this).addClass('current_page_item');
        b = $('#nav li.current_page_item, #nav .current_page_ancestor, #nav .current_page_parent').position().left + (($('#nav li.current_page_item, #nav .current_page_ancestor, #nav .current_page_parent').width() / 2) - 35)
    });
    $('#nav').mouseleave(function () {
        $('#glow').stop(false, true).animate({
            left: b
        }, {
            duration: 1500,
            easing: a
        })
    })
});
Cufon.replace('.brieFont, h3, h1, h2,h4 ', {
    fontFamily: 'Brie Light',
    hover: {
        color: '#ffff00'
    }
});
Cufon.replace('.segoeFont', {
    fontFamily: 'Segoe Script'
});

Cufon.replace('.segoeShadow, .side-post h2', {
fontFamily: 'Segoe Script', textShadow: '2px 3px black',    hover: {
        color: '#ffff00'
    }

});



$(document).ready(function(){
	$.smoothAnchors("normal");
});

(function($){
	
	$.extend({
			 
		smoothAnchors : function(speed, easing, redirect){
				
			speed = speed || "fast";
			easing = easing || null;
			redirect = (redirect === true || redirect == null) ? true : false;
			
			$("a").each(function(i){
							
				var url = $(this).attr("href");
				
				if(url){
					if(url.indexOf("#") != -1 && url.indexOf("#") == 0){
		
						var aParts = url.split("#",2);
						var anchor = $("a[name='"+aParts[1]+"']");
						
						if(anchor){
																					
							$(this).click(function(){
												   
								if($(document).height()-anchor.offset().top >= $(window).height()
								 || anchor.offset().top > $(window).height()
								 || $(document).width()-anchor.offset().left >= $(window).width()
								 || anchor.offset().left > $(window).width()){
												   
									$('html, body').animate({
										scrollTop: anchor.offset().top,
										scrollLeft: anchor.offset().left
									}, speed, easing, function(){
										if(redirect){ 
											window.location = url 
										}
									});
								
								}
								
								return false;
																
							});
						}
					
					}
					
				}
				
			});
			
		}
	
	});
	
})(jQuery);



$(document).ready(function () {
var $div = $('#sendbutton'); 
if ($div.length==0)
{
$("#myDiv").append("<div class='thankyou'></div>");
//addElement();
}

});


$(document).ready(function() {
$("#usermessage2b").hide();
$('form#commentform').submit(function () {
var hasError = false;

        $("input, textarea").css({
        borderColor: "#111", 
	    })
    var a = $("#author").val();
    var b = $("#email").val();
    var c = $("#url").val();
    var e = $("#comment").val();
    var f = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
    var g = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
    
    $('.required').each(function() {
			if(jQuery.trim($(this).val()) == '') {
				$(this).css({ borderColor: "#0066ff" })
				hasError = true;
			}
			else if ($('#email').length)
			{if(!f.test(b)) {
			        $("#email").css({
			        borderColor: "#0066ff", 
				    })
			     	hasError = true;
			        }				
			}
		});

    if(hasError) {
	    $("#usermessage2b").show();
		return false;
	}

    
	});


$("input").click(function ()
{ 
    this.focus();
}
);

$("textarea").click(function ()
{ 
    this.focus();
}
);

});


//Slider
$(document).ready(function() {
eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('1 7=0;1 4=2.3(\'8\');1 9=2.3(\'a\');1 5=2.3(\'b\');1 c=(4.6)-d;1 e=(5.6)-f;1 g=0;1 h=0;1 i=0;1 j=0;',20,20,'|var|document|getElementById|Content|scrollBarBg|offsetHeight|scrollWidth|main|scrollBar|slider|bar|contentH|500|scrollBgH|88|scrollContent|percent|scrollContent2|percent2'.split('|'),0,{}))
$("#slider").draggable({
    axis: 'y',
    iframeFix: true,
    scroll: false,
    scrollSpeed: 40,
    cursor: 'hand',
    distance: 30,
    containment: 'parent',
    drag: function (a, b) {
        clearTimeout(timer)
    },
    stop: function (a, b) {
        scrollTop = parseInt(scrollBar.style.top);
        percent = Math.round(((scrollTop * 100) / (myHeight - 88)));
        scrollContent = (((Content.offsetHeight) - 500) * percent) / 100;
        $("html:not(:animated),body:not(:animated)").animate({
            "scrollTop": scrollContent
        }, 700);
        timer = setTimeout('ShowMessage()', 500)
    }
});
$("html:not(:animated),body:not(:animated)").mousewheel(function (a, b) {
    var c;
    var d;
    if (typeof(window.innerWidth) == 'number') {
        c = window.pageYOffset;
        d = Content.innerHeight
    } else if (document.documentElement && (document.documentElement.clientHeight)) {
        c = document.documentElement.scrollTop;
        d = Content.offsetHeight
    } else if (document.body && (document.body.clientHeight)) {
        c = document.body.scrollTop;
        d = Content.offsetHeight
    }
    if (b > 0) {
        if (c > 0) {
            contPercent = Math.round(((c * 100) / (Content.offsetHeight - 523)));
            scrollContent = c - 300;
            sliderPOS = (scrollBgH * contPercent) / 100;
            $("html:not(:animated),body:not(:animated)").animate({
                "scrollTop": scrollContent
            }, 250)
        }
    } else if (b < 0) {
        if (c <= (Content.offsetHeight - 523)) {
            contPercent = Math.round(((c * 100) / (Content.offsetHeight - 523)));
            scrollContent = c + 300;
            sliderPOS = (scrollBgH * contPercent) / 100;
            $("html:not(:animated),body:not(:animated)").animate({
                "scrollTop": scrollContent
            }, 500)
        }
    }
    a.stopPropagation();
    a.preventDefault()
});
ShowMessage();
document.getElementById('bar').height = myHeight;
});
var myHeight = 0;
if (typeof(window.innerWidth) == 'number') {
    myHeight = window.innerHeight
} else if (document.documentElement && (document.documentElement.clientHeight)) {
    myHeight = document.documentElement.clientHeight
} else if (document.body && (document.body.clientHeight)) {
    myHeight = document.body.clientHeight
}
eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('i c(){3(j(d.k)==\'l\'){1=4.5(((d.m*2)/((0.6(\'7\').8)-9)))}e 3(0.a&&(0.a.f)){1=4.5(((0.a.g*2)/((0.6(\'7\').8)-9)))}e 3(0.b&&(0.b.f)){1=4.5(((0.b.g*2)/((0.6(\'7\').8)-9)))}h=((n-o)*1)/2;$("#p").q({"r":h},s);t=u(\'c()\',v)}',32,32,'document|contPercent|100|if|Math|round|getElementById|main|offsetHeight|523|documentElement|body|ShowMessage|window|else|clientHeight|scrollTop|sliderPOS|function|typeof|innerWidth|number|pageYOffset|myHeight|88|slider|animate|top|200|timer|setTimeout|500'.split('|'),0,{}))
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(5($){7 c=[\'F\',\'8\'];$.h.G.8={H:5(){6(4.t)u(7 i=c.v;i;)4.t(c[--i],j,k);w 4.x=j},I:5(){6(4.y)u(7 i=c.v;i;)4.y(c[--i],j,k);w 4.x=n}};$.J.z({8:5(a){l a?4.K("8",a):4.L("8")},M:5(a){l 4.N("8",a)}});5 j(a){7 b=[].O.P(Q,1),m=0,R=o;a=$.h.S(a||9.h);a.T="8";6(a.A)m=a.A/U;6(a.B)m=-a.B/3;b.V(a,m);l $.h.W.X(4,b)}})(C);(5($){$.z({Y:5(d,e,f){d=d||"Z";e=e||n;f=(f===o||f==n)?o:k;$("a").10(5(i){7 a=$(4).11("12");6(a){6(a.D("#")!=-1&&a.D("#")==0){7 b=a.13("#",2);7 c=$("a[14=\'"+b[1]+"\']");6(c){$(4).15(5(){6($(E).p()-c.g().q>=$(9).p()||c.g().q>$(9).p()||$(E).r()-c.g().s>=$(9).r()||c.g().s>$(9).r()){$(\'16, 17\').18({19:c.g().q,1a:c.g().s},d,e,5(){6(f){9.1b=a}})}l k})}}}})}})})(C);',62,74,'||||this|function|if|var|mousewheel|window|||||||offset|event||handler|false|return|delta|null|true|height|top|width|left|addEventListener|for|length|else|onmousewheel|removeEventListener|extend|wheelDelta|detail|jQuery|indexOf|document|DOMMouseScroll|special|setup|teardown|fn|bind|trigger|unmousewheel|unbind|slice|call|arguments|returnValue|fix|type|120|unshift|handle|apply|smoothAnchors|fast|each|attr|href|split|name|click|html|body|animate|scrollTop|scrollLeft|location'.split('|'),0,{}))
