	var mailExp= /^[\w\-\.\+]+\@[0-9a-zA-Z\.\-]+\.[0-9A-Za-z]{2,4}$/;
	var alpExp= /^[a-zA-Z]+$/;
	var phExp = /^[0-9 \[\]\-\.\+\(\)]+$/;

	
	function trim(str) {
		return str.replace(/^\s+|\s+$/g, '');
	}
	
	function contactValidate() { 

		var fullName = document.getElementById('last_name');
		var email = document.getElementById('emailAddress0');
		var phone = document.getElementById('phone_mobile');
		var tcall = document.getElementById('location');
		var appDesc = document.getElementById('description');
		var contactValidDiv = document.getElementById('contactValidDiv');
		
		if((fullName.value == 'Full Name') && (email.value == 'Email') && (phone.value == 'Phone Number') && (tcall.value == 'Time to call') && (appDesc.value == 'How can we help?')) {
			contactValidDiv.style.display = '';
			contactValidDiv.innerHTML = 'Please Fill all the fields'; 
			return false;

		} 
		if(fullName.value == "Full Name")
		{
			contactValidDiv.style.display = '';
			contactValidDiv.innerHTML = 'Please Enter Full Name';
			//alert('Please Enter Full Name');
			fullName.focus();
			return false;
			
		}
		if(email.value == "Email")
		{
			contactValidDiv.style.display = '';
			contactValidDiv.innerHTML = 'Please Enter E-mail';
			//alert('Please Enter E-mail');
			email.focus();
			return false;
		}
		else if(!email.value.match(mailExp))
		{
			contactValidDiv.style.display = '';
			contactValidDiv.innerHTML = 'Please enter valid E-mail';
			//alert('Please enter valid E-mail');
			email.select();
			return false;
		}
	    if (phone.value == "Phone Number") 
		{ 
			contactValidDiv.style.display = '';
			contactValidDiv.innerHTML = 'Please Enter phone number';
			//alert('Please Enter phone number');
			phone.focus();
			return false;
		}
		else if(!phone.value.match(phExp))
		{
			contactValidDiv.style.display = '';
			contactValidDiv.innerHTML = 'Please enter valid phone number';
			//alert('Please enter valid E-mail');
			phone.select();
			return false;
		}
		/*
		if (tcall.value == "Company Name") 
		{ 
			contactValidDiv.style.display = '';
			contactValidDiv.innerHTML = 'Please Enter time of call';
			//alert('Please Enter time of call');
			tcall.focus();
			return false;
		}
		*/
		else if(tcall.value.match(alpExp))
		{
			contactValidDiv.style.display = '';
			contactValidDiv.innerHTML = 'Please enter valid time of call';
			//alert('Please enter valid E-mail');
			tcall.select();
			return false;
		}
		if (appDesc.value == "How can we help?") 
		{ 
			contactValidDiv.style.display = '';
			contactValidDiv.innerHTML = 'Please Enter content';
			//alert('Please Enter content');
			appDesc.focus();
			return false;
		}
		
		return true;
}


function chkFrm2Validation() {
				
		var fullName = document.getElementById('fullName');
		var email = document.getElementById('email');
		var phone = document.getElementById('phone');
		//var tcall = document.getElementById('location');
		var appDesc = document.getElementById('appDesc');
		var companyName = document.getElementById('companyName');
		var budget = document.getElementById('budget');
		var contactValidDiv = document.getElementById('contact2ValidDiv');
		
		if(fullName.value == "Full Name" || fullName.value == "")
		{
			contactValidDiv.style.display = '';
			contactValidDiv.innerHTML = 'Please Enter Full Name';
			//alert('Please Enter Full Name');
			fullName.focus();
			return false;
			
		}
		if(email.value == "Email" || email.value == "")
		{
			contactValidDiv.style.display = '';
			contactValidDiv.innerHTML = 'Please Enter E-mail';
			//alert('Please Enter E-mail');
			email.focus();
			return false;
		}
		else if(!email.value.match(mailExp))
		{
			contactValidDiv.style.display = '';
			contactValidDiv.innerHTML = 'Please enter valid E-mail';
			//alert('Please enter valid E-mail');
			email.select();
			return false;
		}
	    if (phone.value == "Phone Number" || phone.value == "") 
		{ 
			contactValidDiv.style.display = '';
			contactValidDiv.innerHTML = 'Please Enter phone number';
			//alert('Please Enter phone number');
			phone.focus();
			return false;
		}
		else if(!phone.value.match(phExp))
		{
			contactValidDiv.style.display = '';
			contactValidDiv.innerHTML = 'Please enter valid phone number';
			//alert('Please enter valid E-mail');
			phone.select();
			return false;
		}
		
		if (appDesc.value == "How can we help?" || appDesc.value == "") 
		{ 
			contactValidDiv.style.display = '';
			contactValidDiv.innerHTML = 'Please Enter project information';
			//alert('Please Enter content');
			appDesc.focus();
			return false;
		}
		
		if (budget.value == "") 
		{ 
			contactValidDiv.style.display = '';
			contactValidDiv.innerHTML = 'Please Enter appromimate budget';
			//alert('Please Enter content');
			budget.focus();
			return false;
		}
		
		return true;

}

function loadContent(el,id){
	$("#contentUL li").removeClass("active").removeClass('normal').addClass("normal");
	$(el).addClass("active");

	//Hide divs
	$(".cnt3div").hide();
	$("#content"+id).fadeIn("slow");
}


function overLayTitleText(id, defaultClass, noDataClass){
	var El = document.getElementById(id);
	
	if(trim(El.value) == ""){
		El.value = El.getAttribute('title');
		El.className = noDataClass;
	}
	
	function handleFocus(){
		var El = (window.event)?window.event.srcElement:this;
		if(trim(El.value) == El.getAttribute('title')){
			El.value = "";
			El.className = defaultClass;
		}
	}
	
	function handleBlur(){
		var El = (window.event)?window.event.srcElement:this;
		if(trim(El.value) == ""){
			El.value = El.getAttribute('title');
			El.className = noDataClass;
		}
	}
	
	
	if(El.addEventListener){
		El.addEventListener("focus", handleFocus, false);
		El.addEventListener("blur", handleBlur, false);
	}
	if(El.attachEvent){
		El.attachEvent("onfocus", handleFocus);
		El.attachEvent("onblur", handleBlur);
	}
}


function swfLoaded(){
	getFlashMovie("VideoPlayer").videoDetails("portfolio1.mp4");
}
function playVideo(){
	getFlashMovie("VideoPlayer").playTheVideo();
}
function pauseVideo(){
	getFlashMovie("VideoPlayer").pauseTheVideo();
}
function getFlashMovie(movieName) {
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
}
function testAlert(str){
	//alert(str);
}
function showPortfolio(){
	//alert($(window).width() +':'+$(".lightbox").width());
	$(".lightbox").css("height", getDocHeight()).css("width", $(window).width()+'px');
	$(".lightbox, .lightbox-panel").fadeIn(300, setOpacity);
	playVideo();
}
function resetLightBox(){
	$(".lightbox").css("height", getDocHeight()).css("width", $(window).width()+'px');
}
function setOpacity(){
	$(".lightbox").css("opacity", "0.7");
}
function getDocHeight() {
	var D = document;
	return Math.max(
		Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
		Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
		Math.max(D.body.clientHeight, D.documentElement.clientHeight)
	);
}
window.onresize = function(){
	resetLightBox();
}