// JavaScript Document

jQuery(document).ready(function(){

		jQuery('.portfolio:eq(2)').after('<br class="break"/>');
		jQuery('.portfolio:eq(2),.portfolio:eq(5)').addClass('last');
		   
			   
		Cufon.replace('h1,h2,.intro p');	
		
		jQuery("#countdown").countdown2(new Date(2011, 11, 30, 17, 00, 00), {prefix:'Before conference start: ', finish: 'Go Go Go!!!'});
		
		jQuery("a[rel^='prettyPhoto']").prettyPhoto();
		jQuery("#video-promo a").prettyPhoto({opacity:0.9});
	
		
		
		jQuery('.centerdiv').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		easing: 'linear',
		cleartype:  1,		
		timeout: 5000,
		prev:    '.prev',
   		next:    '.next',
		pause:   1			
		});
		
		// Image fade - portfolio thumbnail
		jQuery(".portfolio-image").hover(function(){
		jQuery(this).stop().fadeTo("medium", 0.3);
		},function(){
		jQuery(this).stop().fadeTo("slow", 1.0); 
		});
		
		// Image fade - blog image
		jQuery(".blog-image").hover(function(){
		jQuery(this).stop().fadeTo("medium", 0.3);
		},function(){
		jQuery(this).stop().fadeTo("slow", 1.0); 
		});
		
		
		// Image fade - Social media buttons 
		jQuery(".socialmedia img").fadeTo("fast", 0.3); 
		jQuery(".socialmedia img").hover(function(){
		jQuery(this).stop().fadeTo("medium", 1.0); 
		},function(){
		jQuery(this).stop().fadeTo("medium", 0.3); 
		});
		
		
		// Image fade - prev/next buttons in slideshow
		jQuery(".prev").fadeTo("fast", 0.5); 
		jQuery(".prev").hover(function(){
		jQuery(this).stop().fadeTo("medium", 1.0); 
		},function(){
		jQuery(this).stop().fadeTo("medium", 0.5); 
		});
		
		jQuery(".next").fadeTo("fast", 0.5); 
		jQuery(".next").hover(function(){
		jQuery(this).stop().fadeTo("medium", 1.0);
		},function(){
		jQuery(this).stop().fadeTo("medium", 0.5); 
		});
		
		
		jQuery("#logo").hover(function(){
		jQuery(this).stop().fadeTo("medium", 0.5);
		},function(){
		jQuery(this).stop().fadeTo("medium", 1.0); 
		});
		
	 	jQuery.each(jQuery.browser, function(i, val) {
 		
	 		if(jQuery.browser.msie)
	 		{
  
				}
				else
				{
					jQuery("#menu ul li a.current_page_item, a.lightbtn,a.darkbtn ").fadeTo("fast", 0.8); 
				jQuery("#menu ul li a.current_page_item, a.lightbtn,a.darkbtn").hover(function(){
				jQuery(this).stop().fadeTo("fast", 1.0);
				},function(){
				jQuery(this).stop().fadeTo("medium", 0.8); 
				});
		
			}
		});

});



jQuery(function () {
	jQuery('img').hide();//hide all the images on the page
});

var i = 0;//initialize
var int=0;//Internet Explorer Fix
jQuery(window).bind("load", function() {//The load event will only fire if the entire page or document is fully loaded
	var int = setInterval("doThis(i)",300);//500 is the fade in speed in milliseconds
});

function doThis() {
	var images = jQuery('img').length;//count the number of images on the page
	if (i >= images) {// Loop the images
	clearInterval(int);//When it reaches the last image the loop ends
	}
	jQuery('img:hidden').eq(0).fadeIn(300);//fades in the hidden images one by one
	i++;//add 1 to the count
}


// Used for hiding popup div in contact form
function hidediv() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideShow').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideShow.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideShow.style.visibility = 'hidden'; 
} 
} 
}


