<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta name='description' content='' />
<meta name='keywords' content="chevy phils manila auto atutomobile safety car specs gas diesel suv" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Contact Us | Chevrolet Philippines</title>
</head>
<body style="margin:0px; padding:0px" bgcolor="#000000">

<div id='bg' style="position:absolute; top:0; right:0; bottom:0; left:0; opacity:.7; filter: alpha(opacity=70); width:100%; background-color:#000000; z-index:9999; height:auto; display:none"></div>
<style>
	.b1, .b2, .b3, .b4{font-size:1px; overflow:hidden; display:block;}
	.b1 {height:1px; background:#888; margin:0 5px;}
	.b2 {height:1px; background:#dbdbdb; border-right:2px solid #888; border-left:2px solid #888; margin:0 3px;}
	.b3 {height:1px; background:#dbdbdb; border-right:1px solid #888; border-left:1px solid #888; margin:0 2px;}
	.b4 {height:2px; background:#dbdbdb; border-right:1px solid #888; border-left:1px solid #888; margin:0 1px;}
	.contentb {background: #dbdbdb; border-right:1px solid #888; border-left:1px solid #888;}
	.contentb div {margin-left: 5px;}
	body table tr td
	{
		font-family:Tahoma, Geneva, sans-serif;
		font-size:11px;
		color:#333
	}
</style>

<div id = 'inqDiv' name='inqDiv' style="position:absolute; filter:Alpha(opacity=100); width:700px; z-index:10000; height:335px; top:28%; left:22%; display:none">
    <b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b>
        <div class="contentb" id="message">

        </div>
    <b class="b4"></b><b class="b3"></b><b class="b2"></b><b class="b1"></b>
</div>

<script>
	var form = '<div style="position:relative; height:300px; margin:0px; padding:100px 0px 0px 40px;"><div style="position:absolute; left:20px; top:5px;"><span style="color: #666; font-family:Tahoma, Geneva, sans-serif; font-size:18px;"><br /><b>Inquiry Form</b></span><br /><br /><span style="color:#666; font-family:Tahoma, Geneva, sans-serif; font-size:12px;">Please complete all the fields below.</span><br /></div><table width="300px;"><tr><td>First name:</td><td><input type="text" name="fname" id="fname" size="24" /></td></tr><tr><td>Middle name:</td><td><input type="text" name="mname" id="mname" size="24" /></td></tr><tr><td>Last name:</td><td><input type="text" name="lname" id="lname" size="24"/></td></tr><tr><td>E-mail address:</td><td><input type="text" name="email" id="email" size="24"/></td></tr><tr><td>Landline #:</td><td><input type="text" name="landline" id="landline" size="24"/></td></tr><tr><td>Cellphone #:</td><td><input type="text" name="cel" id="cel" size="24"/></td></tr><tr><td>Vehicle model:</td><td><select name="vmodel" id="vmodel"><option value="">Please select one</option><option value="Aveo">Aveo</option><option value="Camaro">Camaro</option><option value="Captiva">Captiva</option><option value="Cruze">Cruze</option><option value="Orlando">Orlando</option><option value="Suburban">Suburban</option><option value="Spark">Spark</option></select></td></tr></table><div style="position:absolute; left:340px; top:100px; width:320px; height:220px;"><table><tr><td>Message</td><tr><tr><td><textarea name="msg" id="msg" style=" height: 170px; width: 294px;  font-size: 8pt; font-family: Tahoma, Geneva, sans-serif; color: #333; margin: 2px 0px 0px 2px; overflow: hidden; " ></textarea></td></tr></table></div><div style="position:absolute; left:530px; top:350px;"><input type="button" value="Submit" style="height:40px; width:70px;" onClick="trySubmitting();"/></div><div style="position:absolute; left:610px; top:350px;"><input type="button" value="Cancel" style="height:40px; width:70px;" onClick="closeMe();"/></div></div>';
	var preloader = '<div style="position:relative; height:300px; margin:0px; padding:100px 0px 0px 73px;"><div style="position:absolute; left:326px; top:170px;"><img src="images/loading.gif"></div><div style="position:absolute; left:280px; top:240px;"><span style="font-family:Tahoma, Geneva, sans-serif; font-size:10pt;">Sending inquiry form...</span></div></div>';
	var success = '<div style="position:relative; height:300px; margin:0px; padding:100px 0px 0px 73px;"><div style="position:absolute; left:135px; top:190px; text-align:center; width:400px;"><span style="font-family:Tahoma, Geneva, sans-serif; color:#555555; font-size:13pt;">Your inquiry form was successfully submitted!</span></div></div>';
	var error = '<div style="position:relative; height:300px; margin:0px; padding:100px 0px 0px 73px;"><div style="position:absolute; left:140px; top:180px; text-align:center; width:400px;"><span style="font-family:Tahoma, Geneva, sans-serif; color:#555555; font-size:13pt;">An error has occured. Please try again later.</span><br><br><br><span onclick="manageForm(\'HIDE\');" style="font-size:11pt; font-family:Tahoma; cursor:pointer"><b>[close]</b></span></div></div>';
	var message	= document.getElementById('message');
	var submitting = false;
	var closing = false;
	var my_seq;
	var my_seqListener;
	var form_mc = document.getElementById('inqDiv');
	var bg_mc = document.getElementById('bg');
    var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	var sequence;
	message.innerHTML = form;
	function trySubmitting()
	{
		if(submitting) return;
		if(dataNotValid())
		{
			alert('Please check all the fields for invalid entry.');
			return;
		}
		else
		{	
			//alert('valid.');
		}
		submitting = true;
		var xmlHttp;
		try
		{    // Firefox, Opera 8.0+, Safari    
			xmlHttp=new XMLHttpRequest();  
		}
		catch (e)
		{    // Internet Explorer    
			try
			{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e)
			{   
				try
				{
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
				}
				catch (e)
				{        
					alert("Your browser does not support AJAX!");        
					return false;
				}      
			}    
		}
		xmlHttp.onreadystatechange = function()
		{
			if(xmlHttp.readyState == 4)
			{
				result = xmlHttp.responseText;
				if(result == 'success')
				{
					document.getElementById('message').innerHTML = success;
					var closeForm = setTimeout("manageForm('HIDE')", 1500);
				}
				else
				{
					document.getElementById('message').innerHTML = error;
				}
				//document.getElementById('message').innerHTML = result;
			}
		}
		var params = 
			'fname=' + trim(document.getElementById('fname').value, ' ') + 
			'&mname=' + trim(document.getElementById('mname').value, ' ') + 
			'&lname=' + trim(document.getElementById('lname').value, ' ') + 
			'&email=' + trim(document.getElementById('email').value, ' ') + 
			'&landline=' + trim(document.getElementById('landline').value, ' ') + 
			'&cel=' + trim(document.getElementById('cel').value, ' ') + 
			'&vmodel=' + trim(document.getElementById('vmodel').value, ' ') + 
			'&msg=' + trim(document.getElementById('msg').value, ' ');
		message.innerHTML = preloader;
		xmlHttp.open('POST', 'submit_inquiry.php', true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader('Content-length', params.length);
		xmlHttp.setRequestHeader('Connection', 'close');
		xmlHttp.send(params);
	}
	function dataNotValid()
	{
		
		var notValid = false;
		if((trim(document.getElementById('fname').value, ' ')) == '') notValid = true;
		if((trim(document.getElementById('mname').value, ' ')) == '') notValid = true;
		if((trim(document.getElementById('lname').value, ' ')) == '') notValid = true;
		if((trim(document.getElementById('email').value, ' ')) == '') notValid = true;
		if((trim(document.getElementById('landline').value, ' ')) == '') notValid = true;
		if((trim(document.getElementById('cel').value, ' ')) == '') notValid = true;
		if((trim(document.getElementById('vmodel').value, ' ')) == '') notValid = true;
		if((trim(document.getElementById('msg').value, ' ')) == '') notValid = true;
		if(!(reg.test(trim(document.getElementById('email').value, ' ')))) notValid = true;
		
		return notValid;
		
	}
	
	//JAVASCRIPT TRIM
	function trim(str, chars) { return ltrim(rtrim(str, chars), chars);}
	function ltrim(str, chars) {chars = chars || "\\s";return str.replace(new RegExp("^[" + chars + "]+", "g"), "");}
	function rtrim(str, chars) {chars = chars || "\\s";return str.replace(new RegExp("[" + chars + "]+$", "g"), "");}
	
	function closeMe()
	{	
		
		if(closing) return;
		closing = true;
		manageForm('HIDE');
		
	}
	
	
	function manageForm(what, vmodel)
	{
		
		if(my_seq != null) 
		{
			my_seq.stop();
			my_seq = null;
		}
		
		my_seq = new Sequence();
		my_seqListener = new Object();
		
		if(what == 'HIDE')
		{
			my_seq.addChild(new OpacityTween(form_mc, Tween.strongEaseInOut, 100, 0, .4));
			my_seq.addChild(new OpacityTween(bg_mc, Tween.strongEaseInOut, 70, 0, .4));
			my_seqListener.onMotionFinished = function ()
			{
				form_mc.style.display = 'none';
				bg_mc.style.display = 'none';
				closing = false;
				message.innerHTML = form;
			}
			my_seq.addListener(my_seqListener);
		}
		else
		{
			scroll(0, 0);
			message.innerHTML = form;
			document.getElementById('vmodel').selectedIndex = vmodel;
			form_mc.style.display = 'block';
			bg_mc.style.display = 'block';
			my_seq.addChild(new OpacityTween(bg_mc, Tween.strongEaseInOut, 0,70, .3));
			my_seq.addChild(new OpacityTween(form_mc, Tween.strongEaseInOut, 0, 100, .4));
			document.getElementById('fname').focus();
		}
		my_seq.start();
		
	}
</script>
<center>
<div style="width:1024px; height:600px; position:relative;">
<style type="text/css">
	table tr td
	{
		font-family:Verdana, Arial, Helvetica, sans-serif;
		font-size:12px;
		color:#FFFFFF
	}
	body div p
	{
		font-size:10pt;
	}
</style>

<div style="position:absolute; top:50px; left:0px; height:303px; width:1024px; background-image:url('images/contact_usBG.jpg')"></div>
<?php include("common_header.php"); ?>

<div style="position:absolute; left:0px; width:1024px; top:334px; height:400px; background-color:#111111">
	<div style="position:relative; left:0px; width:1024px; top:0px; height:400px;">
		<div style="position:absolute; top:51px; left:82px;"><img src="images/contact_us_images_05.gif" width="349"height="54"/></div>
		<div style="position:absolute; top:144px; left:82px;"><img src="images/contact_us_images_11.gif" width="79"height="7"/></div>
		
		<div style="position:absolute; top:140px; left:220px;">
			<p style="margin-left:0px; text-align:left">M.C. Briones St., Highway Ibabao<br>
Mandaue City, Cebu, Philipppines

			</p>
		</div>
		<div style="position:absolute; top:264px; left:82px;"><img src="images/contact_us_images_14.gif" width="104"height="7"/></div>
		<div style="position:absolute; top:262px; left:220px;">
			<p>
				(+6332)-520-2288
			</p>
		</div>
		<div style="position:absolute; top:216px; left:82px;"><img src="images/contact_us_images_17.gif" width="40"height="8"/></div>
		<div style="position:absolute; top:214px; left:218px;">
			<p>
				(+6332)-520-5392
			</p>
		</div>
		<div style="position:absolute; top:330px; left:82px;">
			<img src="images/inqnow.gif" width="110" height="15" border="0" onclick="manageForm('SHOW', 0);" style="cursor:pointer"/>
	</div>	
</div>

</div>
</center>
<script>
	var scnHei;
	if (self.innerHeight) // all except Explorer
		scnHei = document.body.scrollHeight;
	else if (document.documentElement && document.documentElement.clientHeight)		// Explorer 6 Strict Mode
		scnHei = document.documentElement.scrollHeight;
	else if (document.body) // other Explorers
		scnHei = document.body.scrollHeight;
	document.getElementById('bg').style.height = scnHei + 'px';
	
</script>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-18592923-1']);
  _gaq.push(['_setDomainName', 'none']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : '../www/index.htm') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
</body>
</html>
