function login()

{

	$("#login_msg").show("slow");

	setTimeout( function() {

		$("#login_msg").hide("slow");

	}, 2000 );

}



function forgot_password()

{

	$("#forgot_msg").show("slow");

	setTimeout( function() {

		$("#forgot_msg").hide("slow");

	}, 2000 );

}



function isValidEmailAddress(emailAddress) {

var pattern = new RegExp(/^(("[\w-+\s]+")|([\w-+]+(?:\.[\w-+]+)*)|("[\w-+\s]+")([\w-+]+(?:\.[\w-+]+)*))(@((?:[\w-+]+\.)*\w[\w-+]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);

return pattern.test(emailAddress);

};

function chatnow()

{

	var chatname = $("#chatname").val();

	var chatemail = $("#chatemail").val();

	if(chatname=="")

	{

		$("#chat_errmsg").show("slow").html('Please enter name');

		setTimeout( function() {

		$("#chat_errmsg").html('').hide("");

		}, 5000 );

		return false;

	}

	else if(chatemail=="")

	{

		$("#chat_errmsg").show("slow").html('Please enter email address');

		setTimeout( function() {

		$("#chat_errmsg").html('').hide("");

		}, 5000 );

		return false;

	}

	else

	{

		

		if( !isValidEmailAddress( chatemail ) ) { 

			$("#chat_errmsg").show("slow").html('Please enter valid email address');

			setTimeout( function() {

			$("#chat_errmsg").html('').hide("");

			}, 5000 );

			return false;

		}else

		{

			setTimeout( function() {

			$("#chat_errmsg").html('').hide("");

			}, 5000 );

			$("#panel").slideToggle('slow');

		 function popitup(url) {	newwindow=window.open(url, current_time() ,'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=500,left = 310,top = 150'); 	if (window.focus) {newwindow.focus()} 	return false; }

		 function current_time() {var d = new Date(); return d.getTime();}

		var chattrackpage = "/livechat_button?page="+GetCurrentPageName();

		_gaq.push(['_trackPageview', chattrackpage]);

		popitup('http://simplewebchat.livechatengine.com/chat.php?i=77&submit=1&testjava=true&dept=Sales&inqname='+chatname+'&email='+chatemail); 

		

		}

		

	}

	

}





function start_chat()

{

	var chatname = $("#chat_contact_name").val();

	var chatemail = $("#chat_contact_email").val();

	if(chatname=="")

	{

		$("#chat_msg").show("slow").html('Please enter name');

		setTimeout( function() {

		$("#chat_msg").html('').hide("");

		}, 5000 );

		return false;

	}

	else if(chatemail=="")

	{

		$("#chat_msg").show("slow").html('Please enter email address');

		setTimeout( function() {

		$("#chat_msg").html('').hide("");

		}, 5000 );

		return false;

	}

	else

	{

		

		if( !isValidEmailAddress( chatemail ) ) { 

			$("#chat_msg").show("slow").html('Please enter valid email address');

			setTimeout( function() {

			$("#chat_msg").html('').hide("");

			}, 5000 );

			return false;

		}else

		{

			//$("#panel").slideToggle('slow');

			setTimeout( function() {

			$("#chat_msg").html('').hide("");

			}, 5000 );

		$("#chat_contact_name").val('');

		$("#chat_contact_email").val('');	

		 function popitup(url) {	newwindow=window.open(url, current_time() ,'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=500,left = 310,top = 150'); 	if (window.focus) {newwindow.focus()} 	return false; }

		 function current_time() {var d = new Date(); return d.getTime();}

		_gaq.push(['_trackPageview', '/livechat_about']);

		popitup('http://simplewebchat.livechatengine.com/chat.php?i=77&submit=1&testjava=true&dept=Sales&inqname='+chatname+'&email='+chatemail); 

		

		}

		

	}

	

}











function gomodal(modal_id)

{

	window.location.href='model_detail.php?model_id='+modal_id;

}



function submit_inquery()

{

	var inqname = $("#inqname").val();

	var inqemail = $("#inqemail").val();

	var inqphone = $("#inqphone").val();

	var inqmsg = $("#inqmsg").val();

	

	

	

	$.ajax({ 

	type: "POST", 

	url: "ajax_common.php", 

	data: "action=inquiry&inqname="+inqname+"&inqemail="+inqemail+"&inqphone="+inqphone+"&inqmsg="+inqmsg, 

	success: function(msg){ 

	$("#inq_msg").show('slow');

		$("#inq_msg").html(msg);

		setTimeout( function() {

		$("#inq_msg").html('');

		$("#inq_msg").hide('slow');

	}, 3000 );

		

	} 

	});

}





function showforgot(showId,hideId)

{

	

	$("#"+hideId).hide();	

	$("#"+showId).show();	

	

	if(showId=='forgot_password')

	{

		$("#h3_forgot").show();

		$("#h3_login").hide();

	}else

	{

		$("#h3_forgot").hide();

		$("#h3_login").show();

	}

}



function GetCurrentPageName()

{

	//method to get Current page name from url.



	var sPath = window.location.pathname;

	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);

	return sPage

}

/*
$(document).ready(function() {
	$("#album3").css("overflow", "hidden");
	
	$("ul#slides").cycle({
		fx: 'fade',
		pause: 1,
		speed:2000,
		timeout: 10000,
		prev: '#prev',
		next: '#next'
	});
	
	$("#album3").hover(function() {
    	$("ul#nav").fadeIn();
  	},
  		function() {
    	$("ul#nav").fadeOut();
  	});
	
});*/

/*$(document).ready(function() {
	$('#coin-slider').coinslider({ hoverPause: true,width:733,height:364,effect:'straight',delay:6000,navigaation:false });
});*/

$(function(){
		   
			$('#slides').slides({
				preload: true,
				preloadImage: '/images/ajax-loader-blocks.gif',
				play: 5000,
				pause: 2500,
				hoverPause: false,
				/*slideEasing: "easeOutCubic",*/
				effect: 'fade',
				fadeSpeed: 1050,
				crossfade: true,
				slideSpeed: 1400
			});
		});










