$(document).ready(function(){ 	
	
	$(".nava > li").hoverIntent( function(){
		$('div.shareit-box', this).stop().fadeIn('fast');
	}, function(){
		$('div.shareit-box', this).fadeOut('fast');
	});
	
	$(".uitg > li").hoverIntent( function(){
		$('div.cover', this).animate({"top": "-=40px"}, "fast");
	}, function(){
		$('div.cover', this).animate({"top": "+=40px"}, "fast");
	});

	/***** PARALLAX *****/

	jQuery('#parallax').jparallax({});
	
	
	
	/*
	*
	* SLIDE
	*
	* 	
	* Tutorials: http://www.webdesignerwall.com/tutorials/jquery-tutorials-for-designers/
	* 	
	* 	Slidefunction i.e. login, sitemap, etc.
	*  
	*	<div id="panel">
	*		<!-- you can put content here -->
	*		</div>
	*		
	*		<p class="slide"><a href="#" class="btn-slide">Slide Panel</a></p>
	*  #panel {
	*	display: none;
	*  }
	*
	*/
	$(".btn-slide").click(function(){
		$("#sitemap_open").slideToggle("slow");
		$(this).toggleClass("active"); return false;
	});
	
	
	/*
	*
	* PANELIST
	*
	* 	
	* Tutorials: http://www.webdesignerwall.com/tutorials/jquery-tutorials-for-designers/
	* 	
	*  Make an entire block element clickable 
	* 
	* 
	* 
	*/

	$(".project").click(function(){
		window.location=$(this).find("a").attr("href"); return false;
	});

	/*
	*
	* SLIDESHOWS
	*
	* 	
	* Tutorials: http://malsup.com/jquery/cycle/
	* 	
	*  Choose from any of the following named effects (fx:):  
	* 
	*  blindX, blindY, blindZ, cover,  curtainX, curtainY, fade, fadeZoom, growX, growY, 
	*  scrollUp, scrollDown,  scrollLeft, scrollRight, scrollHorz, scrollVert ,shuffle, 
	*  slideX, slideY, toss, turnUp, turnDown, turnLeft, turnRight, uncover, wipe, zoom
	* 
	*  
	*/
	
	for (var i = 1; i <= 50; i++) {

		$('.s4'+i).before('<div class="navi'+(i)+' navv">').cycle({
			fx:     'fade',
			speed:  'fast',
			timeout: 0,
			pagerEvent:	  'mouseover', // name of event which drives the pager navigation
			pager:  '.navi'+i
		});
	
	}
	
	/*
	*
	*
	* PNG FIX
	*
	*
	*  apply to all png images
	*  $('img[@src$=.png]').ifixpng(); 		 
	* 
	*  apply to all png images and to div#logo 
	*  $('img[@src$=.png], div#logo').ifixpng(); 		 	 
	* 
	*  apply to div#logo, undo fix, then apply the fix again 
	*  $('img[@src$=.png], div#logo').ifixpng().iunfixpng().ifixpng(); 
	* 
	*  apply to div#logo2, modify css property and add click event 
	*  $('div#logo2').ifixpng().css({cursor:'pointer'}).click(function(){ alert('ifixpng is cool!'); });; 
	* 
	*
	*
	
	$.ifixpng('js/images/pixel.gif');
  	$('img[@src$=.png]').ifixpng();
	
	
	
	/*
	*
	*
	* TABS
	*
	*
	*  Tutorial: http://jqueryfordesigners.com/jquery-tabs/
	*  
	*
	*/
	
	
	var tabContainers = $('div.tabs > div');
	tabContainers.hide().filter(':first').show();
	
	$('div.tabs ul.tabNavigation a').click(function () {
		tabContainers.hide();
		tabContainers.filter(this.hash).show();
		$('div.tabs ul.tabNavigation a').removeClass('selected');
		$(this).addClass('selected');
		return false;
	}).filter(':first').click();
	
	
	
	/*
	*
	*
	* ACCORDION
	*
	*
	*  Tutorial: http://www.webdesignerwall.com/demo/jquery/accordion2.html
	*  
	*
	*/
	
	$(".accordion2 h3").eq(2).addClass("active");
	$(".accordion2 p").eq(2).show();

	$(".accordion2 h3").click(function(){
		$(this).next("p").slideToggle("fast")
		.siblings("p:visible").slideUp("fast");
		$(this).toggleClass("active");
		$(this).siblings("h3").removeClass("active");
	});
	
	
	
	
	/*
	 * SimpleModal Basic Modal Dialog
	 * http://www.ericmmartin.com/projects/simplemodal/
	 * http://code.google.com/p/simplemodal/
	 *
	 * Copyright (c) 2008 Eric Martin - http://ericmmartin.com
	 *
	 * Licensed under the MIT license:
	 *   http://www.opensource.org/licenses/mit-license.php
	 *
	 * Revision: $Id: basic.js 132 2008-05-23 16:05:17Z emartin24 $
	 *
	 */
	
	
	$('#basicModal input:eq(0)').click(function (e) {
		e.preventDefault();
		$('#basicModalContent').modal();
	});
	
	/*
	 *
	 *	DROP DOWN
	 *
	 *
	 * Tutorial: http://users.tpg.com.au/j_birch/plugins/superfish/#getting-started
	 * 
	 *
	 *
	 *
	 * $.fn.superfish.defaults = { 
	 *     hoverClass:    'sfHover',          // the class applied to hovered list items 
	 *     pathClass:     'overideThisToUse', // the class you have applied to list items that lead to the current page 
	 *     pathLevels:    1,                  // the number of levels of submenus that remain open or are restored using pathClass 
	 *     delay:         800,                // the delay in milliseconds that the mouse can remain outside a submenu without it closing 
	 *     animation:     {opacity:'show'},   // an object equivalent to first parameter of jQuery’s .animate() method 
	 *     speed:         'normal',           // speed of the animation. Equivalent to second parameter of jQuery’s .animate() method 
	 *     autoArrows:    true,               // if true, arrow mark-up generated automatically = cleaner source code at expense of initialisation performance 
	 *     dropShadows:   true,               // completely disable drop shadows by setting this to false 
	 *     disableHI:     false,              // set to true to disable hoverIntent detection 
	 *     onInit:        function(){},       // callback function fires once Superfish is initialised – 'this' is the containing ul 
	 *     onBeforeShow:  function(){},       // callback function fires just before reveal animation begins – 'this' is the ul about to open 
	 *     onShow:        function(){},       // callback function fires once reveal animation completed – 'this' is the opened ul 
	 *     onHide:        function(){}        // callback function fires after a sub-menu has closed – 'this' is the ul that just closed 
	 * };
	 * 
	 *
	 *
	 *	IMPORTANT: When a selectbox is right beneath the menu, you'll have to include the bgiframe into the head-section: http://brandonaaron.net/jquery/plugins/bgiframe/docs/
	 *
	 *		 
	 *		 
	 *		$(document).ready(function(){ 
	 *	        $("ul.sf-menu").superfish().find('ul').bgIframe({opacity:false}); 
	 *	    }); 
	 *		 
	 *		$(document).ready(function(){ 
	 *	        $("ul.sf-menu").superfish({ 
	 *	            animation: {height:'show'},   // slide-down effect without fade-in 
	 *	            delay:     1200               // 1.2 second delay on mouseout 
	 *	        }); 
 	 *	   }); 
	 *		   
	 *		$(document).ready(function(){ 
 	 *	       $("ul.sf-menu").superfish({ 
 	 *	           pathClass:  'current' 
 	 *	       }); 
	 *	    }); 
	 *	   
	 *	   $("ul.sf-menu").supersubs({ 
 	 *           minWidth:    12,   // minimum width of sub-menus in em units 
 	 *           maxWidth:    27,   // maximum width of sub-menus in em units 
 	 *           extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
 	 *                              // due to slight rounding differences and font-family 
	 *       }).superfish();  // call supersubs first, then superfish, so that subs are 
	 *                         // not display:none when measuring. Call before initialising 
 	 *                        // containing tabs for same reason. 
	 *
	 *	 $('ul.sf-menu').superfish({ 
	 *		delay:       1000,                            // one second delay on mouseout 
	 *		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                            // disable drop shadows 
	 *	}); 
	 */
	
	
	
	
	
	$('.sponsorFlip').bind("click",function(){
 
		// $(this) point to the clicked .sponsorFlip element (caching it in elem for speed):
 			
		var elem = $(this);
		
		// data('flipped') is a flag we set when we flip the element:
 
		if(elem.data('flipped'))
		{
			// If the element has already been flipped, use the revertFlip method
			// defined by the plug-in to revert to the default state automatically:
 
 			
			elem.revertFlip();
 
			// Unsetting the flag:
			elem.data('flipped',false)
		}
		else
		{
			// Using the flip method defined by the plugin:
 
			elem.flip({
				direction:'lr',
				speed: 350,
				onBefore: function(){
					// Insert the contents of the .sponsorData div (hidden
					// from view with display:none) into the clicked
					// .sponsorFlip div before the flipping animation starts:
 
					elem.html(elem.siblings('.sponsorData').html());
				}
			});
 
			// Setting the flag:
			elem.data('flipped',true);

			
			}
	});
	
	$("ul.sf-menu").supersubs({ 
	 		delay:       0,    // one second delay on mouseout 
            minWidth:    5,   // minimum width of sub-menus in em units 
            maxWidth:    27,   // maximum width of sub-menus in em units 
            extraWidth:  -2     // extra width can ensure lines don't sometimes turn over 
                               // due to slight rounding differences and font-family 
        }).superfish();  // call supersubs first, then superfish, so that subs are 
                         // not display:none when measuring. Call before initialising 
                         // containing tabs for same reason./**/
						 
	
		
						 
});


