jQuery(document).ready(function() {

//text replacement
Cufon.replace('.archer', {fontFamily: 'Archer Bold', hover: true});
Cufon.replace('.archer-italic', {fontFamily: 'Archer Medium', hover: true});
Cufon.replace('.shadow', {textShadow: '#fff 0px 1px', fontFamily: 'Archer Bold'});
Cufon.replace('.post-body h3', {fontFamily: 'Archer Bold'});

//carousels
$('.themascotimages').cycle({ 
fx: 'fade', 
timeout: 6000, 
cleartype: !$.support.opacity,cleartypeNoBg: true,delay: -2000 
});

$('#mycarousel').cycle({ 
fx: 'scrollRight', 
timeout: 6000, 
cleartype: !$.support.opacity,cleartypeNoBg: true,delay: -2000
});

$('#ourwork').cycle({ 
cleartype: !$.support.opacity,cleartypeNoBg: true,delay: -2000,
fx:     'scrollRight', 
speed:  'slow', 
timeout: 0, 
next:   '#next2', 
prev:   '#prev2' 
});

//worksheet show-hide
$(".brand").hide(); 
$(".scope").hide(); 
$(".designinfo").hide(); 
$(".additional").hide(); 

$("#view1").hide(); 
$("#view2").hide(); 
$("#view3").hide(); 
$("#view4").hide(); 

$('.details-toggle').click(function() {$('.details').slideToggle('slow');$(this).toggleClass("notactive"); return false;});
$('.brand-toggle').click(function() {
$('.brand').slideToggle('slow');
$(this).toggleClass("active"); return false;
});
$('.scope-toggle').click(function() {
$('.scope').slideToggle('slow');
$(this).toggleClass("active"); return false;});
$('.design-toggle').click(function() {
$('.designinfo').slideToggle('slow');$(this).toggleClass("active"); return false;});
$('.additional-toggle').click(function() {
$('.additional').slideToggle('slow');$(this).toggleClass("active"); return false;});

//archive list show-hide
$(".archive-list").hide(); $(".category-list").hide(); 
$('.archives .archive-heading span').click(function() {
$('.archive-list').slideToggle('slow');
$(this).toggleClass("arrow-open"); return false;
});
$('.archives .category-heading span').click(function() {$('.category-list').slideToggle('slow');$(this).toggleClass("arrow-open"); return false;});

//fadein-fadeout 
$("#fineprint p").fadeTo("slow", 0.4); 
$("#fineprint p").hover(function(){$(this).fadeTo("slow", 1.0); 
},function(){
$(this).fadeTo("slow", 0.4); 
});
$("#social-icons li a").fadeTo("slow", 0.4); 
$("#social-icons li a").hover(function(){$(this).fadeTo("slow", 1.0); },function(){$(this).fadeTo("slow", 0.4); });
$(".getupdates  li a").fadeTo("slow", 0.4); $(".getupdates  li a").hover(function(){$(this).fadeTo("slow", 1.0); },function(){$(this).fadeTo("slow", 0.4); });

//show and hide views
$.viewMap = {
'0' : $([]),
'view1' : $('#view1'),
'view2' : $('#view2'),
'view3' : $('#view3'),
'view4' : $('#view4')
};
$('#viewSelector').change(function() {
// hide all
$.each($.viewMap, function() { this.hide(); });
// show current
$.viewMap[$(this).val()].show();
});

//dropdown nav
$("ul.nav").superfish({ 
animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
speed:       'fast',                          // faster animation speed 
autoArrows:  false,                           // disable generation of arrow mark-up 
dropShadows: false     
}); 

//column stacking
$('.instagram').masonry({
itemSelector: '.grid_4'
});

$(function(){
var $container = $('.pinner');
$container.imagesLoaded( function(){
$container.masonry({
itemSelector : '.grid_3'
});
});
});
 
 //custom file button
 $("#file").filestyle({ 
image: "http://www.emtwowebstudios.com/themes/site_themes/emtwo-11/contact/select-file.png",
imageheight : 37,
imagewidth : 103,
width : 350
});

//custom select

$("#viewSelector").selectBox();


//portfolio toggle

$('.sidebar-toggle').click(function() {
$('.portfolio-sidebar').slideToggle('fast');
$(this).toggleClass("notactive"); return false;
});

$("#prev2, #next2").click(function() {
$(".portfolio-sidebar").hide();
return false;
});
	
	
//remove default input text

$('#mce-EMAIL, #message').each(function() {
    var default_value = this.value;
    $(this).focus(function() {
        if(this.value == default_value) {
            this.value = '';
        }
    });
    $(this).blur(function() {
        if(this.value == '') {
            this.value = default_value;
        }
    });
});
	
});
