jQuery.noConflict();

jQuery(document).ready(function(){
	jQuery('#parallax').jparallax({});
	jQuery('#slides-cycle').after('<ul id="nav"></ul>').cycle({
			fx:     'scrollLeft',
			speed:    300,
			timeout:  8000,
			pager:  '#nav',
			pagerAnchorBuilder: function(idx, slide) { 
				return '<li class="nav-item"><a href="#"><div class="gallery-icon"><img src="' + jQuery(slide).find('img').attr("src") + '" width="95" height="67"/></div></a></li>'; 
			},
			pagerEvent: 'mouseover' 
	});
	
	/*jQuery('#numbers-pages .number').tooltip({ 
		showURL: false,
		top:0,
		left:0
		
	});*/
	
	jQuery('#numbers-pages .number span').append(function(){
		return '<div class="tooltip">'+ jQuery(this).parent().attr('title')+'</div>'
	});
	
	jQuery('#numbers-pages .number span').hover(function () {
		jQuery('.tooltip',this).fadeIn(0);
	  },
	  function () {
		jQuery('.tooltip',this).fadeOut(0);
	  }
	);
	
	/*var lleft = jQuery('#left_featured').css('left');
	var lmargin_left = jQuery('#left_featured').css('margin-left');
	var ltop = jQuery('#left_featured').css('top');
	var lmargin_top = jQuery('#left_featured').css('margin-top');
	var rleft = jQuery('#right_featured').css('left');
	var rmargin_left = jQuery('#right_featured').css('margin-left');
	var rtop = jQuery('#right_featured').css('top');
	var rmargin_top = jQuery('#right_featured').css('margin-top');
	var mleft = jQuery('#main_featured').css('left');
	var mmargin_left = jQuery('#main_featured').css('margin-left');
	var mtop = jQuery('#main_featured').css('top');
	var mmargin_top = jQuery('#main_featured').css('margin-top');
	*/
	/*
	jQuery("#parallax").hover(
	  function () {		
	  }, 
	  function () {	
		
		
	  }
	);
	
	jQuery('a[href="#one"]').click(function() {
    var ref=jQuery(this).attr("href");
    jQuery('#parallax').trigger("link", [ref]);    
	});
	*/
	/*
	jQuery("#home-main").click(
	  function () {	
		jQuery('#left_featured').animate({left:lleft, marginLeft:lmargin_left, top:ltop, marginTop:lmargin_top});
		jQuery('#right_featured').animate({left:rleft, marginLeft:rmargin_left, top:rtop, marginTop:rmargin_top});
		jQuery('#main_featured').animate({left:mleft, marginLeft:mmargin_left, top:mtop, marginTop:mmargin_top});		
	  });*/
	
	
	jQuery('.main-aside ul  li a').hover(
	  function () {		
		jQuery(this).animate({color:'#000000', backgroundColor:'#dedddd'},300);
	  }, 
	  function () {	
		jQuery(this).animate({color:'#282828', backgroundColor:'#e8e8e8'},300);		
	  }
	);
	
	/* Contact Form Values */
	
	jQuery('#contact_form #input_1_1').focus(function(){
		if (jQuery(this).attr('value') == "Name*")
			jQuery(this).attr('value', '');
	});
	
	jQuery('#contact_form #input_1_1').blur(function(){
		if (jQuery(this).attr('value') == "")
			jQuery(this).attr('value', 'Name*');
	});
	
	jQuery('#contact_form #input_1_3').focus(function(){
		if (jQuery(this).attr('value') == "Email*")
			jQuery(this).attr('value', '');
	});
	
	jQuery('#contact_form #input_1_3').blur(function(){
		if (jQuery(this).attr('value') == "")
			jQuery(this).attr('value', 'Email*');
	});
	
	jQuery('#contact_form #input_1_4').focus(function(){
		if (jQuery(this).attr('value') == "Website")
			jQuery(this).attr('value', '');
	});
	
	jQuery('#contact_form #input_1_4').blur(function(){
		if (jQuery(this).attr('value') == "")
			jQuery(this).attr('value', 'Website');
	});
	
	jQuery('#contact_form #input_1_6').focus(function(){
		if (jQuery(this).attr('value') == "Subject")
			jQuery(this).attr('value', '');
	});
	
	jQuery('#contact_form #input_1_6').blur(function(){
		if (jQuery(this).attr('value') == "")
			jQuery(this).attr('value', 'Subject');
	});
	
	jQuery('#contact_form #input_1_5').focus(function(){
		if (jQuery(this).text() == "Your message here*")
			jQuery(this).text("");
	});
	
	/* For some reson this doesn't work in Safari and Chrome */
	/*jQuery('#contact_form #input_1_5').blur(function(){
		if (jQuery(this).text() == "")
			jQuery(this).text("Your message here*");
	});*/
	
	
	/* Set height for backgroun-continues in .hentry */
	if (navigator.appName == 'Microsoft Internet Explorer'){
		jQuery('.hentry > .background-continues').css('height', function(){
			return jQuery(this).parent().height() + 20;
		});		
	}
	
});


