<?php 


include("../formCommon.php");
include("../campaignCodes.php");
//include("../conf.inc.php");



date_default_timezone_set('Asia/Singapore'); 
$utm_campaign = stripJunk($_GET['utm_campaign'], 3);
$utm_source = stripJunk($_GET['utm_source'], 3);
$utm_medium = stripJunk($_GET['utm_medium'], 3);


if(empty($utm_campaign)){
    $formlink = $testdrive;
} else{
    $formlink = $testdrive . "?utm_campaign=".$utm_campaign;
    if(!empty($utm_source)){
       $formlink .= '&utm_source='.$utm_source;
    }
    if(!empty($utm_medium)){
       $formlink .= '&utm_medium='.$utm_medium;
    }
    if(!empty($utm_content)){
       $formlink .= '&utm_content='.$utm_content;
    }
}


$checkSubmit = stripJunk($_GET['f'], 1);

if (is_numeric($checkSubmit)) {
    if ($checkSubmit == 1){
        echo '<div class="alert alert-danger" id="alertM">Thank you for your submission.  We will get back to you as soon as we can.  Have a nice day.</div>';
    } else {
        // do-nothing
    }
} else {
    // do-nothing

}

    if ($_POST){
   
        //$emailRecipient = 'mini.info@eurokars.com.sg'; 
        //$emailRecipient = "yingjie_low@atlasdata.com";
           
        $resultMsg = "";
        $email = "";
        $fieldsOKOK = "0";
        $emailSubject = "MINI Test Drive Request";

        if (!empty($_POST['name'])) {
            $name = trim(stripJunk($_POST['name'],3));
        } else {
            $name = "";
            $nameMessage= "Please enter your first name.";
        }
         if (!empty($_POST['lname'])) {
            $lname = trim(stripJunk($_POST['lname'],3));
        } else {
            $lname = "";
            $lnameMessage= "Please enter your last name.";
        }
        
        if (!empty($_POST['phone'])) {
            if (is_numeric($_POST['phone'])){
              $phone = trim($_POST['phone']);
            } else {
              $phoneMessage = "Please ensure you only enter numbers.";  
            }
        } else {
            $phone = "";
            $phoneMessage = "Please enter your contact no.";
        }

        if (!empty($_POST['email'])) {
          $email = trim(stripJunk($_POST['email'], 4) );
            if(empty($email)){
            $emailMessage = "Please enter valid email address.";
          }
        } else {
          $email = "";
          $emailMessage = "Please enter your email address.";
        }

        if ($_POST['model'] != "") {
            $model = trim(stripJunk($_POST['model'],3));
        } else {
            $model = "";
            $modelMessage = "Please select a model.";
        }

        if (!empty($_POST['params'])){
            $params = $_POST['params'];
        } else {
            $params = "";
        }


        if ((isset($_POST['agree'])) && ($_POST['agree'] != "")) {
            $agree = trim($_POST['agree']);
           
        } else {
            $agree = "";
          
            $agreeMessage = "Please acknowledge this.";
        }

        if(!empty($_POST['campaign'])){
           $campaignName = trim(stripJunk( $_POST['campaign'], 3));
        }

        if(!empty($_POST['source'])){
           $campaignSource = trim(stripJunk( $_POST['source'], 3));
        }

        if(!empty($_POST['medium'])){
           $campaignMedium = trim(stripJunk( $_POST['medium'], 3));
        }

        if(!empty($_POST['content'])){
           $campaignContent = trim(stripJunk( $_POST['content'], 3));
        }

        if(!empty($_POST['location'])){
           $location = trim(stripJunk( $_POST['location'], 3));
        }
        if(!empty($campaignName)){
            $toLink = 'utm_campaign='.$campaignName;
            if(!empty($campaignSource)){
               $toLink .= '&utm_source='.$campaignSource;
            }
            if(!empty($campaignMedium)){
               $toLink .= '&utm_medium='.$campaignMedium;
            }
        }else{
            $toLink = '';
        }

        $ipAddress = $_SERVER['REMOTE_ADDR'];    



        $curl = curl_init();
        curl_setopt_array($curl, array(
            CURLOPT_RETURNTRANSFER => 1,
            CURLOPT_URL => 'https://www.google.com/recaptcha/api/siteverify',
            CURLOPT_POST => 1,
            CURLOPT_POSTFIELDS => array(
                'secret' => '6LfY0iEUAAAAAIjQ7wmdePmh173MZvPW_kmdmNBj',
                'response' => $_POST['g-recaptcha-response']
            )
        ));

        $resp = curl_exec($curl);
        curl_close($curl);

     
        if(strpos($resp, '"success": true') !== FALSE) {
            $checkCap = 1;
        } else {
            $checkCap = 0;
            //$checkCapMessage = "Please verifty that you are not a robot.";
        }



        if( ($name!= "") && ($lname!= "") && ($model != "") && ($email != "") && ($phone != "") && ($agree != "") && ($_POST['confirmB1'] == "") && ($_POST['confirmB2'] == "") && ($_POST['confirmB3'] == "")  && ($checkCap == 1) ){
            $fieldsOKOK = "1";
        } else {
            $fieldsOKOK = "0";
            $promptMsg = "Please note that all fields must be filled in before you can submit a request!";
        }

        $senderEmail = "MINI Singapore <noreply@mini.com.sg>";
        $dateAndTime = date('l jS \of F Y h:i:s A');
        $dateSubmit = date("Y-m-d");
        $headers  = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        $headers .= 'From: '.$senderEmail . "\r\n";

        $mailMessage = '<br />' . $dateAndTime . 
                       '<br />=========================================' .
                       '<br /><br><b>SUBMISSION DETAILS</b>' .
                       '<br />First Name : ' . $name .
                       '<br />Last Name : ' . $lname .
                        
                       '<br />Email Address : ' . $email .
                        '<br />Contact No : ' . $phone .
                        '<br />Selected Model : ' . $model .
                        '<br /><br />' . $agree . ',&nbsp;' . $formTNCEmail . '<br />'.
                        
                        '<br />Campaign Name : ' . $campaignName .
                        '<br />Campaign Source : ' . $campaignSource .
                        '<br />Campaign Medium : ' . $campaignMedium .
                        '<br />Campaign Content : ' . $campaignContent .
                        '<br />=========================================';


        if ($fieldsOKOK == "1") {
            if (validate_email($email)) {
                $now = date('Y-m-d h:i:s');
                
                $queryR = "INSERT INTO `clcarlisting_details` (`firstName`,`lastName`, `contactNo`, `email`, `model`, `date`, `typeId`, `location`, `campaign`,  `source`, `medium`, `content`, `ipAddress`) VALUES ( AES_ENCRYPT('$name','".SALT."'), AES_ENCRYPT('$lname','".SALT."'), AES_ENCRYPT('$phone','".SALT."'), AES_ENCRYPT('$email','".SALT."') , '$model', '$now' , 2, '$location', '$campaignName', '$campaignSource', '$campaignMedium', '$campaignContent', AES_ENCRYPT('$ipAddress','".SALT."') )";

                $queryRResult = funct_db_query($db_connect,$queryR) or $errorMessage = funct_db_error(); 
                $rowR = funct_db_fetch_array($queryRResult);
                if ($queryRResult) {
                    mail($emailRecipient,$emailSubject,$mailMessage,$headers);

                    //Send HTTP GET to Emarsys for Email auto-responder
                    require_once '../vendor/curl/curl.php';
                    $curl = new Curl;
                    $curl->options['CURLOPT_SSL_VERIFYPEER'] = false;
                    $curl->options['CURLOPT_SSL_VERIFYHOST'] = false;
                    $response = $curl->get('https://link.eurokars.com.sg/u/register.php', array(
                        'CID' => '525396524',
                        'f' => '2868',
                        'p' => '2',
                        'a' => 'r',
                        'SID' => '',
                        'el' => '',
                        'llid' => '',
                        'counted' => '',
                        'c' => '',
                        'optin' => 'y',
                        'inp_1' => $name, // First Name
                        'inp_2' => $lname, // Last Name
                        'inp_37' => $phone, // Mobile
                        'inp_3' => $email, // Email address
                        'inp_17450' => $model, // Select a model
                    ));
                    if ($response === false) {
                        error_log($curl->error());
                    }
                  
                    $name = "";
                    $lname = "";
                    $email = "";
                    $phone = "";
                    $model = "";
                    $promptMsg = 'Thank you for your submission.  We will get back to you as soon as we can.  Have a nice day.<br /><br />';

                    /* ==============================================================
                    /* 01/07/2017 - Hardcode URL
					/* ============================================================== */
                    $testdrive_thankyou = "https://secure.mini.com.sg/test-drive/";

                   
                    if(empty($toLink)){
                         header("Location: ".$testdrive_thankyou."?f=1");
                    }else{
                        header("Location: ".$testdrive_thankyou . '?'.$toLink. "&f=1");
                    }
                   

                } else {
                    $promptMsg = "Sorry, there was an error submitting the form.  Please try again.";
                  
                }

            }else{
                    $promptMsg = 'Invalid Email Address<br>You have entered ' . $email . ' and it is not a valid email address. <br />Please enter a valid email address. <br /><br />';
            }
        }

    }else{
        $promptMsg = "";
    }





?>



<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="MINI, Take a test drive, test drive" />
    <meta name="description" content="MINI Take A Test Drive">
    <meta name="author" content="BMW AG">

    <title>MINI.com.sg - <?php print $campaignTitle; ?></title>

    <link href="../css/bootstrap.css" rel="stylesheet">
    <link href="../css/extralayers.css" rel="stylesheet">
    <link href="../css/animate.css" rel="stylesheet">
    <link href="../css/carousel.css" rel="stylesheet">
    <link href="../css/et-line.css" rel="stylesheet">
    <link href="../style.css" rel="stylesheet">
    <link href="../css/custom.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="../css/extralayers.css" media="screen" /> 

    <link rel="apple-touch-icon" sizes="180x180" href="https://www.mini.com.bn/etc/designs/minidigital-white/images/favicon/apple-touch-icon.png">
    <link rel="icon" type="image/png" href="https://www.mini.com.bn/etc/designs/minidigital-white/images/favicon/favicon-32x32.png" sizes="32x32">
    <link rel="icon" type="image/png" href="https://www.mini.com.bn/etc/designs/minidigital-white/images/favicon/favicon-16x16.png" sizes="16x16">
    <link rel="manifest" href="https://www.mini.com.bn/etc/designs/minidigital-white/images/favicon/manifest.json">
    <link rel="mask-icon" href="https://www.mini.com.bn/etc/designs/minidigital-white/images/favicon/safari-pinned-tab.svg" color="#5bbad5">
    <link rel="shortcut icon" href="https://www.mini.com.bn/etc/designs/minidigital-white/images/favicon/favicon.ico">
    
    <script type="text/javascript" src="../js/jquery-1.10.2.js"></script>
    <script src='https://www.google.com/recaptcha/api.js'></script>
      <script>
       function onSubmit(token) {
         document.getElementById("form").submit();
       }
     </script>
    <!--[if lt IE 9]>
        <script src="js/html5shiv.js"></script>
        <script src="js/respond.min.js"></script>
    <![endif]-->



    <!-- Main CSS -->
    <link rel="icon" href="../favicon.ico" />

    <style type="text/css">
         @font-face {
            font-family: MINISanSeriff;
            src: url(../fonts/MINISanSerif-Regular.otf);
        }

        .center {
            margin-left: auto;
            margin-right: auto;
            width: 55%;
            padding-top:20px;
        }
        p {
            margin-bottom: 30px;
        }
        a {
            font-weight: bold;
            color: #0b0b0b;
        }        
        input[type=submit]{
            font-family: MINISanSeriff;
        }
        .subTitle {
            font-size: 1.375em;
            /*font-family:MINISanSeriff-Bold;*/
        }
        .fieldpadding {
            padding-bottom: 10px;
        }
        @media(max-width: 768px){
            .xspaddingnone {
                padding: 0;
            }
            .fieldpadding {
            padding-bottom: 0;
            }
        }   
        .formtitle{
            font-family:MINISanSeriff-Bold;
            font-weight: bold;
            color:#FFF;
            opacity:1 !important;
            font-size: 20px;
            
        }
       .textbox {
            color:#000;
            height:40px !important;
            padding:5px;
            width:100%;
            font-size: 15px;
            border: 2px solid #000;
        }
        a input {
            font-family:'MINISanSeriff';
            font-weight: bold;
            padding:3px;
        }
        .padding-left {
                padding-left: 0;
            }
            .padding-right {
                padding-right: 0;
            }
        @media (min-width: 768px){
            .padding-left {
                padding-left: 0;
            }
            .padding-right {
                padding-right: 0;
            }
            .padding-left-2 {
                padding-left: 20px ;
            }

        }
        
        th {
            font-size: 15px;
            font-weight: 800;
            padding-bottom: 5px;
        }
        td {
            padding-top: 5px;
            padding-bottom: 5px;
        }
    </style>

  <?php include('../googleAnalytics.php');?>

</head>
<body id="body" >

<?php //print $utm_campaign; 
	if ($utm_campaign == "MINI17F60Launch") {
		
		?>

		<!--
		Start of DoubleClick Floodlight Tag: Please do not remove
		Activity name of this tag: (Secure) MINI Form Page
		URL of the webpage where the tag is expected to be placed: http://secure.mini.com.sg/test-drive/?utm_campaign=MINI17F60Launch
		This tag must be placed between the <body> and </body> tags, as close as possible to the opening tag.
		Creation Date: 06/29/2017
		-->
		<script type="text/javascript">
		var axel = Math.random() + "";
		var a = axel * 10000000000000;
		document.write('<iframe src="https://6479288.fls.doubleclick.net/activityi;src=6479288;type=secur0;cat=secur0;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord=' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
		</script>
		<noscript>
		<iframe src="https://6479288.fls.doubleclick.net/activityi;src=6479288;type=secur0;cat=secur0;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord=1?" width="1" height="1" frameborder="0" style="display:none"></iframe>
		</noscript>
		<!-- End of DoubleClick Floodlight Tag: Please do not remove -->

		<?php 

	}

?>

    <!--
    Start of DoubleClick Floodlight Tag: Please do not remove
    Activity name of this tag: MINI Test Drive
    URL of the webpage where the tag is expected to be placed: http://mini.com.sg/contact/test-drive/
    This tag must be placed between the <body> and </body> tags, as close as possible to the opening tag.
    Creation Date: 06/01/2016
    -->
    <script type="text/javascript">
        var axel = Math.random() + "";
        var a = axel * 10000000000000;
        document.write('<iframe src="https://5689141.fls.doubleclick.net/activityi;src=5689141;type=minis0;cat=minit0;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord=' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
    </script>
    <noscript>
        <iframe src="https://5689141.fls.doubleclick.net/activityi;src=5689141;type=minis0;cat=minit0;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord=1?" width="1" height="1" frameborder="0" style="display:none"></iframe>
    </noscript>
    <!-- End of DoubleClick Floodlight Tag: Please do not remove -->

    <!--
    Start of DoubleClick Floodlight Tag: Please do not remove
    Activity name of this tag: MINI_All Sites
    URL of the webpage where the tag is expected to be placed: http://www.mini.com.sg/
    This tag must be placed between the <body> and </body> tags, as close as possible to the opening tag.
    Creation Date: 02/01/2017
    -->
    <script type="text/javascript">
        var axel = Math.random() + "";
        var a = axel * 10000000000000;
        document.write('<iframe src="https://6479288.fls.doubleclick.net/activityi;src=6479288;type=minia0;cat=mini_0;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord=' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
    </script>
    <noscript>
        <iframe src="https://6479288.fls.doubleclick.net/activityi;src=6479288;type=minia0;cat=mini_0;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord=1?" width="1" height="1" frameborder="0" style="display:none"></iframe>
    </noscript>
    <!-- End of DoubleClick Floodlight Tag: Please do not remove -->

    <!--
    Start of DoubleClick Floodlight Tag: Please do not remove
    Activity name of this tag: MINI_JCW_Form
    URL of the webpage where the tag is expected to be placed: http://www.mini.com.sg/contact/test-drive/?type=testdrive
    This tag must be placed between the <body> and </body> tags, as close as possible to the opening tag.
    Creation Date: 02/01/2017
    -->
    <script type="text/javascript">
        var axel = Math.random() + "";
        var a = axel * 10000000000000;
        document.write('<iframe src="https://6479288.fls.doubleclick.net/activityi;src=6479288;type=minif0;cat=mini_0;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord=' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
    </script>
    <noscript>
        <iframe src="https://6479288.fls.doubleclick.net/activityi;src=6479288;type=minif0;cat=mini_0;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord=1?" width="1" height="1" frameborder="0" style="display:none"></iframe>
    </noscript>
    <!-- End of DoubleClick Floodlight Tag: Please do not remove -->


    <div class="wrapper">
       <?php include('../header.php');?>
       <section id="about" class="clearfix" >
        <div class="container">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 padding-left padding-right">
                <h1 class="title">
                    <?php echo $testDriveTitle;?>
                </h1>
                <h3 class="subTitle"><?php echo $testDriveSubTitle;?></h3>
                <p><?php echo $testDriveCopy;?></p>
                <?php //echo $additionalInfo;?>
            </div>
        </div>
    </section>
        <section id="about" class="clearfix" style="margin:0 auto;">
            <div class="container">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 padding-left padding-right">
                    <h6 class="textUpper formtitle line-height padding-bottom-1" style="color:#000;<!-- border-bottom: 1px solid #000; -->">personal details</h6>
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 paddingleft paddingright">
                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 paddingleft paddingright" id="btmform">
                          
                            <form action="<?php print $formlink; ?>" method="post" enctype="application/x-www-form-urlencoded" name="form" id="form" >
                                <div class="row row1 fieldpadding" style="padding-top:10px;">
                                     <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 paddingleft xspaddingnone">
                                        <input name="name" type="text" class="textbox" id="name" maxlength="40" placeholder="First Name*" value="<?php echo $name;?>" />
                                        <br/>
                                         <span class="errorInput"><?php echo $nameMessage;?></span>
                                    </div>
                                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 paddingright xspaddingnone">
                                        <input name="lname" type="text" class="textbox" id="lname" maxlength="40" placeholder="Last Name*" value="<?php echo $lname;?>"/>
                                        <br/>
                                        <span class="errorInput"><?php echo $lnameMessage;?></span>
                                    </div>
                                </div>
                                
                                <div class="row row1 fieldpadding">
                                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 paddingleft xspaddingnone">
                                        <input name="phone" type="text" class="textbox" id="phone" maxlength="40" placeholder="Contact*" value="<?php echo $phone;?>"/>
                                        <br/>
                                        <span class="errorInput"><?php echo $phoneMessage;?></span>
                                    </div>
                                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 paddingright xspaddingnone">
                                        <input name="email" type="text" class="textbox" id="email" maxlength="40" placeholder="Email* eg. Nick@example.com" value="<?php echo $email;?>"/>                            
                                        <br/>
                                        <span class="errorInput"><?php echo $emailMessage;?></span>
                                    </div>
                                </div>

                                 <div class="row row1 fieldpadding" style="display:none;">
                                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 paddingleft xspaddingnone">
                                        <input type="text" class="confirmB" id="confirmB3" name="confirmB3">
                                    </div>
                                </div>

                            

                                <div class="row row1 fieldpadding">
                                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 paddingleft xspaddingnone">
                                       <?php require_once("../selectModels.php"); ?>
                                        <br/>
                                        <span class="errorInput"><?php echo $modelMessage;?></span>
                                    </div>
                                </div>

                                <div class="row row1 fieldpadding" style="display:none;">
                                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 paddingleft xspaddingnone">
                                        <input type="text" class="confirmB" id="confirmB1" name="confirmB1">
                                    </div>
                                </div>
                                <div class="row row1 fieldpadding" style="display:none;">
                                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 paddingleft xspaddingnone">
                                        <input type="text" class="confirmB" id="confirmB2" name="confirmB2">
                                    </div>
                                </div>

                                <div class="row row1" style="padding-bottom:10px;">
                                    <p style="font-size:0.875em;">
                                        <p><?php print $formTNC; ?></p>
                                    </p>
                                        <input name="agree" type="checkbox" class="copyText11-form2" id="agree" value="Yes" style="height:15px; padding:4px;" />&nbsp;&nbsp;<span style="top: -3px;position: relative;font-size:0.875em;"><?php print $formConsent; ?> <span style="color:red;">*</span></span>
                                    <?php 
                                    if (!empty($agreeMessage)){
                                          echo '<span class="errorInput">'.$agreeMessage.'</span>';
                                    }?>
                                </div>
                                 <div class="row row1" style="padding-top:10px;">

                                    <div class="col-lg-10 col-md-10 col-sm-10 col-xs-12 paddingleft paddingright">
                                        <p style="font-size:0.875em;"><span style="color:#FF0000;">* </span>Mandatory Fields</p>
                                         <?php  if (!empty($promptMsg)){echo '<span class="errorInput">'.$promptMsg.'</span><br/>';}?>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 col-xs-12 paddingleft paddingright">
                                         <button class="g-recaptcha" data-sitekey="6LfY0iEUAAAAALWP1lO_fFFeWufA-DAyDHrToNd5" data-callback='onSubmit' style="font-family:MINISanSeriff; color:<?php echo $btnTextCode;?>;float:right;text-transform: uppercase;background:<?php echo $colourCode; ?>;height:40px; border: 2px solid <?php echo $colourCode; ?>;padding:0 25px;line-height:2.8em">Submit</button>

                                       <!-- <input type="submit" value="SUBMIT" name="submit" style="color:<?php echo $btnTextCode;?>;float:right;text-transform: uppercase;background:<?php echo $colourCode; ?>;height:40px; border: 2px solid <?php echo $colourCode; ?>;padding:0 25px;line-height:2.8em">
                                     -->
                                    </div>
                                </div>
                                <br/><br/>
                            
                                <input name="campaign" value="<?php print $utm_campaign; ?>" type="hidden" />
                                <input name="source" value="<?php print $utm_source; ?>" type="hidden" />
                                <input name="medium" value="<?php print $utm_medium; ?>" type="hidden" />
                                <input name="content" value="testdrive" type="hidden" />
                                <input type="hidden" name="params" value="<?php print $params; ?>" />
                            </form>
                            <script type="text/javascript">
                                 (function ($) {
                                     var loaded = false;
                                     var $form = $('#test_drive_form');
                                     $form.find('input[type="submit"]').on('click', function (e) {
                                         if (loaded === false) {
                                             e.preventDefault();
                                             var axel = Math.random() + "";
                                             var a = axel * 10000000000000;
                                             var floodlightTag = $('<iframe src="https://5689141.fls.doubleclick.net/activityi;src=5689141;type=minis0;cat=minit00;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord=' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
                                             floodlightTag.on('load', function () {
                                                 loaded = true;
                                                 $form.submit();
                                             });
                                             $('body').append(floodlightTag);
                                             return false;
                                         }
                                         return true;
                                     });
                                 }(jQuery));
                             </script>
                        </div>
                    </div>
                </div>
            </div>
        </section>


        

        
        <div class="dmtop">Scroll to Top</div>
    </div>

<!--    <script src="js/jquery.js"></script>-->
   
    <script type="text/javascript">
        document.getElementById('confirmB1').className = "confirmB";
        document.getElementById('confirmB1').style.display = 'none';
        document.getElementById('confirmB2').className = "confirmB";
        document.getElementById('confirmB2').style.display = 'none';
        document.getElementById('confirmB3').className = "confirmB";
        document.getElementById('confirmB3').style.display = 'none';
    </script>


</body>
</html>