// JavaScript Document

<!-- [ job reviews ] start -->
function slideSwitch() {
	var $active = $('.job-review div.active');

	if ( $active.length == 0 ) $active = $('.job-review div:last');
	
	// use this to pull the divs in the order they appear in the markup
	var $next =  $active.next().length ? $active.next()
		: $('.job-review div:first');

	$active.addClass('last-active');

	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
			$active.removeClass('active last-active');
		});
}

$(function() {
	setInterval( "slideSwitch()", 10000 );
});
<!-- [ job reviews ] end -->

<!-- [ contact icons ] start -- >
$(document).ready(function(){
	
	$(".contact-itam div p").eq(0).show();

	$(".contact-itam div a").mouseover(function(){
	  $(this).next("p").show("slow").siblings("p:visible").hide("slow");
	});
	
	<!-- [ list portfoiio thumbnail ] start -->
	//$('.list3 img').hide();
	/*$('.list3 img').bind('load',function() {
		$(this).fadeIn(1000);
	});*/
	//$('.list3 img').hide();
	$('.content img').each(function(){
		
		var imgTag = $(this);
		var img1 = $(this).attr('src');
		var img = "<img src="+img1+" />";
		$(img).load(function() {
			imgTag.fadeIn(1000);
		});
		
	});
	$('.logo img').each(function(){
		
		var imgTag = $(this);
		var img1 = $(this).attr('src');
		var img = "<img src="+img1+" />";
		$(img).load(function() {
			imgTag.fadeIn(1000);
		});
		
	});
	<!-- [ list portfoiio thumbnail ] end -->
	
	<!-- [ portfolio ] start -->
	$('.list3 li').hover(function(){
		$(this).find('div').slideDown(200);
		$(this).find('span').slideUp(200);
	},function(){
		$(this).find('div').slideUp(200);
		$(this).find('span').slideDown(200);
	});
	<!-- [ portfolio ] end -->
	
});
<!-- [ contact icons ] end -->

<!-- [ page scrolling script ] start -->
$(document).ready(function() {
	$(".anchorLink").anchorAnimate()
});

jQuery.fn.anchorAnimate = function(settings) {

 	settings = jQuery.extend({
		speed : 700
	}, settings);	
	
	return this.each(function(){
		var caller = this
		$(caller).click(function (event) {
			event.preventDefault()
			var locationHref = window.location.href
			//alert($(caller).attr("name"));
			$('#block1').attr('style',$(caller).attr("rel"));
			
			$('#block1').append('<div class="jquery_loader"></div>');
			
			var img1 = $('#block1').css('background-image').replace('url("','');
			var img2 = img1.replace('")','');
			var img = "<img src="+img2+" />";
			$(img).load(function() {
				$(".jquery_loader").fadeOut(500,function(){
					$(this).remove();
				});
			});

			var elementClick = $(caller).attr('name');
			$(elementClick).fadeIn(1000);
			var destination = $(elementClick).offset().top;
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
				//window.location.hash = elementClick
			});
			
		  	return false;
		})
	})
}
<!-- [ page scrolling script ] end -->

<!-- [ form send ] start -->
function sendForm(form)
{
	var errors = '';
	var regexpEmail = /\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/;
		
	if (!form.cname.value) errors += "please fill the required field (name).<br />";
	if (!regexpEmail.test(form.cemail.value)) errors += "please enter a valid email address.<br />";
	if (!form.cphone.value) errors += "please fill the required field (Telephone).<br />";
	if (form.cmessage.value=='Message : ') errors += "please fill the required field (Message).<br />";

	if (errors != '') {
		$('.message').html('<p>Error:<br />'+errors+'</p>');
		return false;
	}
	else
	{
		$('.message').html('<div>Sending....</div>');
		
		var url = 'mail.php?cname='+form.cname.value+'&cmail='+form.cemail.value+'&cphone='+form.cphone.value+'&cmessage='+form.cmessage.value;
		var xmlhttp;
		if (window.XMLHttpRequest)
		  xmlhttp=new XMLHttpRequest();
		else
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		
		xmlhttp.onreadystatechange=function()
		{
			if (xmlhttp.readyState==4 && xmlhttp.status==200)
			{
				$('.message').html(xmlhttp.responseText);
				form.reset();
			}
		}
		
		xmlhttp.open("GET",url,true);
		xmlhttp.send();
		
		return true;
	}
}
<!-- [ form send ] end -->
