$(function() {
		   
	$("#port-home .box").hover(
	  function () {
		$(this).children('h3,p').animate({
			top: '-=115'
		}, 500, function() {
			// Animation complete.
		});

	  }, 
	  function () {
		$(this).children('h3,p').animate({
			top: '+=115'
		}, 500, function() {
			// Animation complete.
		});
		
	 });
	
	$("#slider").easySlider({
		auto: false,
		continuous: true,
		pause: 6000
	});
	
	// toggles the contents on faq page
	$(".faq h4").click(function () {
      $(this).parent().find(".faq_info", this).slideToggle("fast");
	  return false;
    });
	
	// toggles the client list on home page
	$(".box1").hover(
      function () {
        $("#client_list").fadeIn();
      }, 
      function () {
        $("#client_list").fadeOut();
      }
    );
	
	// toggles the background for services
	// have to do for child element because ie8 is wacked
	$("div.shadowbox_fullwidth").hover(
      function () {
		$(this).parent().addClass('on');
      }, 
      function () {
		$(this).parent().removeClass('on');
      }
    );
	
	$("div.shadowbox_fullwidth").click(function () {
      window.location = "/contact/";
    });
	
	$("div.shadowbox_fullwidth a").click(function () {
      window.location = $(this).attr('href');
    });
	
	// blog ticker
	$('#blog_ticker').vTicker({
	   speed: 600,
	   pause: 4000,
	   showItems: 1,
	   animation: 'fade',
	   mousePause: true
	});
	
	// defuscate emails
	$('.defuscate').defuscate();
	
	// colorbox modals
	$("a[class='modal']").colorbox({transition:"elastic"}); // for images
	$(".iframe_modal, a[title='iframe_modal']").colorbox({width:"90%", height:"90%", iframe:true}); // for iframe modals
	$(".iframe_modal_narrow").colorbox({width:"700px", height:"90%", iframe:true}); // for iframe modals
	$(".youtube").colorbox({iframe:true, innerWidth:500, innerHeight:405});
	
	$(".inline_modal").click(function() { // for inline modals, content in hidden div on page
									  
		var modalvars = $(this).attr('rel').split('|');
		var id = modalvars[0];
		var mwidth = modalvars[1];
		var mheight = modalvars[2];
		
		if(mheight != ''){
			$(this).colorbox({width:mwidth, height:mheight, inline:true, href:id});
		} else {
			$(this).colorbox({width:mwidth, inline:true, href:id});
		}
									  
	});
	
	// selectboxes
	$('#jelectbox1,#jelectbox2,#jelectbox3,#jelectbox4,#jelectbox5,#jelectbox6').sSelect({ddMaxHeight: '240px'});
	
	// contact input hover
	$("#contact input[type]=textbox, #contact textarea").hover(
  		function () {
    		$(this).addClass("hover");
  		}, 
  		function () {
    		$(this).removeClass("hover");
  		}
	);

	// makes stripes for elements like li or table rows
	$("table.zebra tr:odd, ul.zebra li:even").css("background-color", "#0B1723");
	$("table.zebra tr:odd, ul.zebra li:odd").css("background-color", "#050C11");
	
	
	// opens all external links in a new window
	$('a[rel="external"]').live('click',function(){ this.target='_blank'; });
	
	
	// disable iframe scrollbars
	$('.blogentry iframe').attr('scrolling','no');
	

		   
});