/* 
 * MISC jQuery args
 */

// ### Scroll-To-Top ###
jQuery(document).ready(function() { 
	jQuery("#toTop").scrollToTop({
		speed: 1000,
		//ease:  "easeInOutCirc",
		start: 500
	});
});




/* 
 * Custom jQuery args by Gustavo Olmedo of UnikWebDesign.com
 * 	Copyright (c) 2010 Gustavo Olmedo http://gustavoolmedo.com
 * 	Portions Copyright (c) 2010 UnikWebDesign.com http://www.unikwebdesign.com
 * 	Portions Copyright (c) 2010 Unik Media Inc.
 * 
 */

jQuery(document).ready(function() { 


	// Tell jQuery what link to convert into the "control" of the top hood,
	// then the link will activate the top hood to open and close, instead of taking users to the actual page
	// Contact page = 41 (must match the number below to the page id in order to work!), 
	// so, if another page is assigned to be the last one, then change the number below.
	jQuery(".page-item-41").addClass("top-hood-control");


	// Remove the separator image ("nav_link_separator_1.png") from the last link
	// Contact page = 41 (must match the number below to the page id in order to work!), 
	// so, if another page is assigned to be the last one, then change the number below.
	jQuery(".page-item-41").css("background", "transparent");
	jQuery(".page-item-41").css("border-right", "0");


	// "Top Hood" Controls
	if(jQuery.browser.msie){
		jQuery(".jqueryslidemenu .top-hood-control").html("<li class='page_item' id='top-hood-control'><a href='#'><img src='/wp-content/themes/uwdif/lib/scripts/top-hood/images/main_navigation_li_link_Contact_ffffff.png' style='padding-top:5px' alt='Contact' /></a></li><!--Open-OnLoad-->").click(function() {
			if (jQuery("#top-hood").is(":visible")) {
				jQuery("#top-hood").slideUp(1000);
				jQuery(".jqueryslidemenu .top-hood-control").html("<li class='page_item' id='top-hood-control'><a href='#'><img src='/wp-content/themes/uwdif/lib/scripts/top-hood/images/main_navigation_li_link_Contact_ffffff.png' style='padding-top:5px' alt='Contact' /></a></li><!--Open-->");
			} else {
				jQuery("#top-hood").slideDown(1000);
				jQuery(".jqueryslidemenu .top-hood-control").html("<li class='page_item' id='top-hood-control'><a href='#'><img src='/wp-content/themes/uwdif/lib/scripts/top-hood/images/main_navigation_li_link_^Close_dddddd.png' style='padding-top:5px' alt='Contact' /></a></li><!--Close-->");
			}
		});
	}else{
		jQuery(".jqueryslidemenu .top-hood-control").html("<li class='page_item' id='top-hood-control'><a href='#'><img src='/wp-content/themes/uwdif/lib/scripts/top-hood/images/main_navigation_li_link_Contact_ffffff.png' style='padding-top:2px' alt='Contact' /></a></li><!--Open-OnLoad-->").click(function() {
			if (jQuery("#top-hood").is(":visible")) {
				jQuery("#top-hood").slideUp(1000);
				jQuery(".jqueryslidemenu .top-hood-control").html("<li class='page_item' id='top-hood-control'><a href='#'><img src='/wp-content/themes/uwdif/lib/scripts/top-hood/images/main_navigation_li_link_Contact_ffffff.png' style='padding-top:2px' alt='Contact' /></a></li><!--Open-->");
			} else {
				jQuery("#top-hood").slideDown(1000);
				jQuery(".jqueryslidemenu .top-hood-control").html("<li class='page_item' id='top-hood-control'><a href='#'><img src='/wp-content/themes/uwdif/lib/scripts/top-hood/images/main_navigation_li_link_^Close_dddddd.png' style='padding-top:2px' alt='Contact' /></a></li><!--Close-->");
			}
		});
	}


	// on page load
	jQuery("a.slider_featured_image").fadeTo("fast", 1.0); // Covers .slider_content until mouseover event
 
	jQuery("a.slider_featured_image").hover(function(){
		// on hover event
		jQuery(this).stop().fadeTo("slow", 0.15); // Allows slider content to show up
		},function(){
		// on mouseout event
		jQuery(this).stop().fadeTo("slow", 1.0); // Covers slider content again
	});


	// If it is not an IE browser (any version)
	if(!jQuery.browser.msie){
		jQuery(".home-featured-content,#top-hood .top-hood-col2 input.wpcf7_submit_button_dark,.content .wpcf7-form input.wpcf7_submit_button").corner("10px");
		jQuery("#toTop").corner("20px");
		jQuery(".toggle_content,.fancy_box,.download_box,.warning_box,.info_box,.note_box").corner("6px");
		jQuery("textarea,input[type=text],input[type=password],input[type=file]").corner("6px");
	}


	jQuery(".i_em_adr").html("<a href='mailto:info@unikwebdesign.com'>info@unikwebdesign.com</a>");


	jQuery("a.target_blank").attr("target", "_blank");
	jQuery("a[rel='contact']").attr("target", "_blank");
	jQuery("a[rel='acquaintance']").attr("target", "_blank");


	// ### FADE ###
	// .slider_content


	// ### FADE ### -Sets the opacity of specified classes
	// on page load
	jQuery(".slider_img").fadeTo("fast", 1.0); // Covers .slider_content until mouseover event
 
	jQuery(".slider_img").hover(function(){
			// on hover event
			jQuery(this).fadeTo("slow", 0.1); // Lets slider content show up
		},function(){
			// on mouseout event
			jQuery(this).fadeTo("slow", 1.0); // Covers slider content again
	});


	jQuery('#coda-slider-1').codaSlider({
		//Optional controls:
		autoHeight: false,
		autoSlide: true,
		autoSlideInterval: 4000,
		dynamicTabsPosition: "bottom",
		dynamicArrows: false
	});


});
