/*Services Tabs*/
$j(document).ready(function(){
	$j('ul.tabNav a').click(function() {
		var curChildIndex = $j(this).parent().prevAll().length + 1;
		$j('#services').children('.active').removeClass('active');
		$j('#technology').children('.active').removeClass('active');
		$j('#mobileapp').children('.active').removeClass('active');
		$j(this).addClass('active');
		$j(this).parent().parent().next('.tabContainer').children('.current').slideUp('fast',function() {
			$j(this).removeClass('current');
			$j(this).parent().children('div:nth-child('+curChildIndex+')').slideDown('normal',function() {
				$j(this).addClass('current');
			});
		});
		return false;								
	});
	$j('#sendbutton4').click(function() {
   if($j('#cf_uploadfile4-8').val())
   {
		var fileName = $j('#cf_uploadfile4-8').val();
		if(fileName != "")
		{
			var fileType = fileName.split('.').pop();
			if($j.inArray(fileType, ['zip','doc','rtf','xls','docx','pdf']) == -1) {
				$j("#li-4-8 label").before('<ul class="cf_li_text_err"><li>File not accepted, file type not allowed.</li></ul>');
             return false;
			}
		}
   }
		var validation = $j('#li-4-1').find('.cf_li_text_err').html();
		if(validation)
			$j('#cf4_field_1').focus();

   var captcha = $j('.cf_li_text_err').html();
      if(captcha)
         reset_captcha('4');
	});
	$j('#sendbutton2').click(function() {
		var validation = $j('#li-2-1').find('.cf_li_text_err').html();
		if(validation)
			$j('#cf2_field_1').focus();
	});
});


/*Sliders*/
window.addEvent('load', function(){
			new ImageSlider({
				container: 'MozaicSlider', // overall container, element containing all slides
				slides: '.slide', // single slide container css class
				images:'.image', // inside single slide, css class for image container
				infos: '.info', // inside single slide, css class for info container
				infosFx:{
					duration: 500, // info container fx duration
					fx: Fx.Transitions.Sine.easeOut // info container fx
				},
				infosFxCss:{ // here you can change the info containers fx. You need to set all 3 instances: show, hide and hidden to make sure this works
					showFx:{ // set this to how you want the info container to appear
						'bottom':0,
						'opacity':1
					},
					hideFx:{ // set this to how you want it to dissapear
						'bottom':-160,
						'opacity':0
					},
					hiddenFx:{ // if not the current slide, infos need to be hidden. Set the hidden instance here
						'bottom':-160,
						'opacity':0
					}
				}, // remember, for all 3 you need to play with the same properties
				gridW:10, // grid pieces width
				gridH:5, // grid pieces height
				navigators: '#MozaicNavigation li a', // complete path to navigation, can be anything as long as the number of elements is equal to the number of slides
				currentNavClass: 'selected', // css class to highlight navigator currently running
				autoSlide:5000 // set to 0/null/false to stop autoslide				
			});			
	});

function show()
{
	for ( x=0; x<show.arguments.length; x++ )
	{
		var e = show.arguments[x];
		document.getElementById(e).style.display = '';
	}
}
function hide()
{
	for ( x=0; x<hide.arguments.length; x++ )
	{
		var e = hide.arguments[x];
		document.getElementById(e).style.display = 'none';
	}
}

/*Lightbox code*/

( function($) {
$(document).ready(function(){
			$(".lightbox").lightbox({
			    fitToScreen: true,
			    imageClickClose: false
		    });
		    $(".lightbox1").lightbox({
			    fitToScreen: true,
			    imageClickClose: false
		    });
		});
		} ) ( jQuery );

/*$j(document).ready(function(){
	$j(".tabNav > li").click(function(e){
		switch(e.target.id){
			case "services":
				//change status & style menu
				$j("#services").addClass("active");
				$j("#technology").removeClass("active");
				$j("#mobileapp").removeClass("active");
				//display selected division, hide others
				$j("div.services").fadeIn();
				$j("div.technology").css("display", "none");
				$j("div.mobileapp").css("display", "none");
			break;
			case "technology":
				//change status & style menu
				$j("#services").removeClass("active");
				$j("#technology").addClass("active");
				$j("#mobileapp").removeClass("active");
				//display selected division, hide others
				$j("div.services").fadeIn();
				$j("div.technology").css("display", "none");
				$j("div.mobileapp").css("display", "none");
			break;
			case "mobileapp":
				//change status & style menu
				$j("#services").removeClass("active");
				$j("#technology").removeClass("active");
				$j("#mobileapp").addClass("active");
				//display selected division, hide others
				$j("div.services").fadeIn();
				$j("div.technology").css("display", "none");
				$j("div.mobileapp").css("display", "none");
			break;
		}
		//alert(e.target.id);
		return false;
	});
});*/

