$(document).ready(function(){
		
	$('img').each(function(){
		if($(this).attr('src') == ''){
			$(this).css('display','none');
		}
	});
	$('.search input[type=text]').focus(function(){
		$(this).val('');
	});
	/****************************************
	ROUND CORNER VARS
	****************************************/
	var set10 = {
      		tl: { radius: 10 },
      		tr: { radius: 10 },
      		bl: { radius: 10 },
      		br: { radius: 10 },
      		antiAlias: true
    	}
	
	var set5 = {
		tl: { radius: 5 },
      		tr: { radius: 5 },
      		bl: { radius: 5 },
      		br: { radius: 5 },
      		antiAlias: true
	}
	var top5 = {
		tl: { radius: 5 },
      		tr: { radius: 5 },
      		antiAlias: true
	}
	var topLeft15 = {
		tl: { radius: 15 },
		antiAlias: true
	}

	/************************************
	ROUNDED CORNER FOR SITE SEARCH BOX
	*************************************/	
if($('#searchInputBox').size() >0){
	//curvyCorners(set5,".#searchInputBox");
	$('#searchInputBox >div').css({borderRightColor:'#cacaca'});
}
	/*******************************
	OUR WORK PAGE Style
	*******************************/
	if($('.typeClient').size() >0){
		//$('.typeClient').dropShadow({left: 3, top: 3, blur: 2,color:'#000',opacity:'0.3'});	
	}
	
	if($('.clientBoxes').size() >0 ){
		//$('.clientBoxes').dropShadow({left: 5, top: 5, blur: 1});
	}

	/***********************************
	HEADER BACK BUTTON on OUR WORK 
	***********************************/
	$('.backBtn a').mouseover(function(){
		$('.backBtn a .backLnk').show('medium');
	});
	$('.backBtn a').mouseleave(function(){
		$('.backBtn a .backLnk').hide();
	});
	
	if($('#ourWorkItemImage .scrollable').size() > 0 && $('#ourWorkItemImage .scrollable .items .item').size() > 1){
		$('#ourWorkItemImage .scrollable').scrollable({size:1,clickable:false}).circular().navigator().autoscroll({
 			steps: 1,
			clonedClass:'cloned',
			interval: 5000
		}); 
	}else{
		if($('#ourWorkItemImage .scrollable').size() > 0 && $('#ourWorkItemImage .scrollable .items .item').size() == 1){
			$('.navi').hide();
		}
	}

	if($('#homeFeaturedClients .scrollable').size() > 0){
		$('#homeFeaturedClients .scrollable').scrollable({size:1,clickable:false}).circular().navigator().autoscroll({
 			steps: 1,
			interval: 5000
		}); 
	}
		

	/*****************************************
	HEADER OUR WORK DROPDOWN MENU
	*****************************************/
	$('#headerMenu ul li a').click(function(){
		$('#headerMenu ul li a').removeClass('active').parent().removeClass('active');
		$(this).addClass('active').parent().addClass('active').children('ul').show();
		
	});

	/*****************************************
	EMPLOYMENT Selector 
	*****************************************/
	$('.employBoxHeader').toggle(function(){
		$('.employBoxHeaderActive').removeClass('employBoxHeaderActive').addClass('employBoxHeader');
		$(this).removeClass('employBoxHeader').addClass('employBoxHeaderActive');
		$('.employBox .employBoxHeader').siblings('div').addClass('hide');
		$(this).siblings('div').removeClass('hide');
	},function(){
		$(this).removeClass('employBoxHeaderActive').addClass('employBoxHeader');
		$(this).siblings('div').addClass('hide');
	});
	

	/***********************************
	Pretty Photo
	***********************************/
	if($('a[rel^=prettyPhoto]').size() > 0){
		if($('a').parent('.cloned')){
			$('a').parent('.cloned').children('a').attr("rel","prettyPhoto");
		}
		$('a[rel^=prettyPhoto]').prettyPhoto({
			animationSpeed: 'normal', /* fast/slow/normal */
			opacity: 0.80, /* Value between 0 and 1 */
			showTitle: true, /* true/false */
			allowresize: true, /* true/false */
			default_width: 720,
			default_height: 626,
			counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
			theme: 'light_rounded', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
			hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
			wmode: 'opaque', /* Set the flash wmode attribute */
			autoplay: true, /* Automatically start videos: True/False */
			modal: false /* If set to true, only the close button will close the window */
		});
	}

	/************************************
	If a survey has not been selected, let's hide it
	************************************/
	if($('.pollquestion').size() > 0 && $('.pollquestion').text().length < 25){
		$('#survey').hide();
	}




//Randomly fades in and out the Services
setInterval(randomItem,10000);

//Randomly displays the Featured Clients text on the 'View by Clients' page.
//setInterval(randomFeaturedTxt,8000);

//$('.typeClient').fadeOut(1);
//fadeInAllClients();

	//jQuery animate for the services menu on services pages.
	$('.expand').hover(function(){
		$(this).find('ul').animate({opacity: '+=0'}, 50).slideDown("medium");
	},function() {
		$(this).find('ul').animate({opacity: '+=0'}, 50).slideUp("medium");
	});



});
/*
function fadeInAllClients(){
	$('.typeClient').each(function(){
		$(this).fadeIn('slow');	
	});
}

function randomFeaturedTxt(){
	var item = $('.featured:random').removeClass('featured').addClass('running');
	var txt = $(item).find('span').html();
	$(item).find('span').fadeOut('slow',function(){
		$(this).html('Featured Client').fadeIn(2000,function(){
			$(this).fadeOut(2000,function(){
				$(this).html(txt).fadeIn(2000);
				$(this).parents('a.running').removeClass('running').addClass('featured');
			});
		});
	});
}
*/
function randomItem(){

	$('.typeClient:random').fadeOut(1000,function(){
		
	}).fadeIn(1000,function(){
		
	});


}



