﻿
    function setOmniModalViewOffer() {

        var s = s_gi(s_account); s = setOmniGlobal(s);

        s.pageName = 'qln: tire tool: specials';
        s.eVar11 = 'qln: tire tool: specials';
        s.eVar48 = 'incentive'; s.eVar49 = 'view';
        s.prop11 = 'qln: tire tool: specials';
        s.prop48 = 'incentive'; s.prop49 = 'view';
        s.events = 'event9,event43';

        s.prop5 = '';
        s.eVar12 = ''; s.prop12 = '';
        s.eVar16 = ''; s.prop16 = '';
        s.eVar35 = ''; s.prop21 = ''; s.prop19 = ''; s.prop35 = '';
        
        var s_code = s.t(); if (s_code) document.write(s_code);

    }


    function getQLMultiMap(dlrpa) {

        var windowUrl = 'http://www.multimap.com/map/browse.cgi?client=ql&count=1&ovtype=2&rt=1dealer.htm&f_dlrpa=' + dlrpa;
        var dtDate = new Date();
        var sSeconds = dtDate.getMilliseconds();
        var mapWindow = window.open(windowUrl, 'map', 'left=0,top=0,width=600,height=450,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0');
        mapWindow.focus();
        return false;
    }


    function showModPopup(modpopid) {

        var modPopup = $find(modpopid);
        modPopup.initialize();
        modPopup.show();

    }

    function hideModPopup(modpopid) {

        var modPopup = $find(modpopid);
        modPopup.hide();

    }

    function showDynaModPopup(modpopid, contentPanelId) {

        var pnlResult = document.getElementById(contentPanelId);
        var pnlModPop = document.getElementById('ctl00_cphMain_pnlCoupon');

        pnlModPop.innerHTML = pnlResult.innerHTML;
        
        var modPopup = $find(modpopid);
        modPopup.initialize();
        modPopup.show();

    }


    function showDynaModEmail(modpopid, contentPanelId) {

        var pnlResult = document.getElementById(contentPanelId);
        var pnlModPop = document.getElementById('ctl00_cphMain_pnlEmail');

        pnlModPop.innerHTML = pnlResult.innerHTML;
        
        var modPopup = $find(modpopid);
        modPopup.initialize();
        modPopup.show();

    }


    function printCoupon() {
	
	var offer = document.getElementById('CouponBody');
    var logo = document.getElementById('qllogo');
	offer = offer.parentNode;
	logo = logo.parentNode;

	var offers = getElementsByClassName("bodydiv","div");
	if (offers.length > 1) {
		for (i=0; i<offers.length; i++) {
		    var a = offers[i];
			cssClass("add", a, "noprint");
		}
	}

	cssClass("add",logo,"noprint");
	cssClass("remove",offer,"noprint");
    
	cancelClick(event);
	window.print();
	return false;

    }

    function printCoupon2() {

	var offer = document.getElementById('CouponBody');
    var logo = document.getElementById('qllogo');
	offer = offer.parentNode;
	logo = logo.parentNode;

	var offers = getElementsByClassName("bodydiv","div");
	if (offers.length > 1) {
		for (i=0; i<offers.length; i++) {
		    var a = offers[i];
			cssClass("add", a, "noprint");
		}
	}

	cssClass("add",logo,"noprint");
	
	cssClass("remove",offer,"noprint");

	cancelClick(event);
	window.print();
	return false;
	

    }

    function printTireCoupon(hlnk) {

        var re = /_hlnkPrintCoupon/g;
        var hlnkid = (hlnk.id);
        hlnkid = hlnkid.replace(re, "_pnlCoupon");

    
        var printContent = document.getElementById(hlnkid);
        var windowUrl = 'about:blank';
        var uniqueName = new Date();
        var windowName = 'PrintCoupon';
        var printWindow = window.open(windowUrl, windowName, 'toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,location=no,left=200,top=200,width=600,height=360');       

        printWindow.document.write("<html><head><title>Vehicle Tire Search Tool | Quick Lane Tire and Auto Centers</title><link href='App_Themes/quicklane_ami.css' rel='stylesheet' type='text/css' /></head><body>");
        printWindow.document.write(printContent.innerHTML);
        printWindow.document.write("</body></html>");
        printWindow.document.close();
        printWindow.print();
        printWindow.close();

                
        return false;
    }


    function printProfile() {


	var offer = document.getElementById('TireDtls');
	offer = offer.parentNode;
    var logo = document.getElementById('qllogo');
	logo = logo.parentNode;

	var offers = getElementsByClassName("bodydiv","div");
	if (offers.length > 1) {
		for (i=0; i<offers.length; i++) {
		    var a = offers[i];
			cssClass("remove", a, "noprint");
		}
	}
	
	cssClass("remove",offer,"noprint");
	cssClass("remove",logo,"noprint");

	cancelClick(event);
	window.print();
	return false;


    }

    function printTireProfile(sPrintSec) {

        var printContent = document.getElementById(sPrintSec);
        var windowUrl = 'about:blank';
        var uniqueName = new Date();
        var windowName = 'PrintTire';
        var dcString = '';
        
        var printWindow = window.open(windowUrl, windowName, 'toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,location=no,left=200,top=200,width=600,height=360');

        printWindow.document.write("<html><title>Vehicle Tire Search Tool | Quick Lane Tire and Auto Centers</title><head><link href='App_Themes/quicklane_ami.css' rel='stylesheet' type='text/css' /></head><body>");

        printWindow.document.write(dcString);
        printWindow.document.write(printContent.innerHTML);

        printWindow.document.write("</body></html>");
        printWindow.document.close();
        printWindow.print();
        printWindow.close();
        return false;

    }

      var yearsList=[[4557,2010],[4432,2009],[4285,2008],[4093,2007],[3829,2006],[3044,2005],[3043,2004],[3042,2003],[3041,2002],[3040,2001],[3039,2000],[3038,1999],[3037,1998],[3036,1997],[3035,1996]];

      var makesList =[[186,'Mercury'],[185,'Lincoln'],[184,'Ford']];

      var modelsList =[[104,'Zephyr'],[354,'ZX2'],[97,'Windstar'],[96,'Villager'],[90,'Tracer'],[89,'Town Car'],[87,'Thunderbird'],[4352,'Taurus X'],[85,'Taurus'],[4413,'Shelby GT 500'],[83,'Sable'],[74,'Ranger'],[71,'Probe'],[4343,'Navigator L'],[69,'Navigator'],[67,'Mystique'],[63,'Mustang'],[61,'Mountaineer'],[3049,'Monterey'],[3551,'Montego'],[4605,'Milan Hybrid'],[3962,'Milan'],[57,'Mark VIII'],[3854,'Mark LT'],[4033,'Mariner Hybrid'],[3554,'Mariner'],[54,'Marauder'],[4150,'MKZ'],[4240,'MKX'],[4619,'MKT'],[4497,'MKS'],[51,'LS'],[48,'Grand Marquis'],[2337,'GT'],[4558,'Fusion Hybrid'],[3954,'Fusion'],[3555,'Freestyle'],[465,'Freestar'],[46,'Focus'],[4473,'Flex'],[3550,'Five Hundred'],[153,'F-Super Duty'],[36,'F-550'],[35,'F-450'],[34,'F-350'],[33,'F-250'],[32,'F-150'],[152,'Explorer Sport Trac'],[31,'Explorer'],[30,'Expedition'],[28,'Excursion'],[27,'Escort'],[3556,'Escape Hybrid'],[26,'Escape'],[4253,'Edge'],[290,'E-Super Duty'],[296,'E-550'],[295,'E-450'],[294,'E-350'],[293,'E-250'],[292,'E-150'],[25,'Crown Victoria'],[20,'Cougar'],[19,'Contour'],[18,'Continental'],[14,'Bronco'],[13,'Blackwood'],[11,'Aviator'],[10,'Aspire'],[9,'Aerostar']];

      var ymmList =[[3035,184,9],[3036,184,9],[3035,184,10],[3036,184,10],[3042,185,11],[3043,185,11],[3044,185,11],[3041,185,13],[3042,185,13],[3035,184,14],[3035,185,18],[3036,185,18],[3037,185,18],[3038,185,18],[3039,185,18],[3040,185,18],[3041,185,18],[3035,184,19],[3036,184,19],[3037,184,19],[3038,184,19],[3039,184,19],[3035,186,20],[3036,186,20],[3038,186,20],[3039,186,20],[3040,186,20],[3041,186,20],[4557,184,25],[4432,184,25],[3035,184,25],[3036,184,25],[3037,184,25],[3038,184,25],[3039,184,25],[3040,184,25],[3041,184,25],[3042,184,25],[3043,184,25],[3044,184,25],[3829,184,25],[4093,184,25],[4285,184,25],[4432,184,292],[3035,184,292],[3036,184,292],[3037,184,292],[3038,184,292],[3039,184,292],[3040,184,292],[3041,184,292],[3042,184,292],[3043,184,292],[3044,184,292],[3829,184,292],[4093,184,292],[4285,184,292],[4432,184,293],[3035,184,293],[3036,184,293],[3037,184,293],[3038,184,293],[3039,184,293],[3040,184,293],[3041,184,293],[3042,184,293],[3043,184,293],[3044,184,293],[3829,184,293],[4093,184,293],[4285,184,293],[4432,184,294],[3035,184,294],[3036,184,294],[3037,184,294],[3038,184,294],[3039,184,294],[3040,184,294],[3041,184,294],[3042,184,294],[3043,184,294],[3044,184,294],[3829,184,294],[4093,184,294],[4285,184,294],[4432,184,295],[3038,184,295],[3039,184,295],[3040,184,295],[3041,184,295],[3042,184,295],[3043,184,295],[3044,184,295],[3829,184,295],[4093,184,295],[4285,184,295],[3041,184,296],[3042,184,296],[3035,184,290],[3036,184,290],[3037,184,290],[4557,184,4253],[4432,184,4253],[4093,184,4253],[4285,184,4253],[4557,184,26],[4432,184,26],[3040,184,26],[3041,184,26],[3042,184,26],[3043,184,26],[3044,184,26],[3829,184,26],[4093,184,26],[4285,184,26],[4557,184,3556],[4432,184,3556],[3044,184,3556],[3829,184,3556],[4093,184,3556],[4285,184,3556],[3035,184,27],[3036,184,27],[3037,184,27],[3038,184,27],[3039,184,27],[3040,184,27],[3041,184,27],[3039,184,28],[3040,184,28],[3041,184,28],[3042,184,28],[3043,184,28],[3044,184,28],[4557,184,30],[4432,184,30],[3036,184,30],[3037,184,30],[3038,184,30],[3039,184,30],[3040,184,30],[3041,184,30],[3042,184,30],[3043,184,30],[3044,184,30],[3829,184,30],[4093,184,30],[4285,184,30],[4557,184,31],[4432,184,31],[3035,184,31],[3036,184,31],[3037,184,31],[3038,184,31],[3039,184,31],[3040,184,31],[3041,184,31],[3042,184,31],[3043,184,31],[3044,184,31],[3829,184,31],[4093,184,31],[4285,184,31],[4557,184,152],[4432,184,152],[3040,184,152],[3041,184,152],[3042,184,152],[3043,184,152],[3044,184,152],[4093,184,152],[4285,184,152],[4557,184,32],[4432,184,32],[3035,184,32],[3036,184,32],[3037,184,32],[3038,184,32],[3039,184,32],[3040,184,32],[3041,184,32],[3042,184,32],[3043,184,32],[3044,184,32],[3829,184,32],[4093,184,32],[4285,184,32],[4557,184,33],[4432,184,33],[3035,184,33],[3036,184,33],[3037,184,33],[3038,184,33],[3039,184,33],[3040,184,33],[3041,184,33],[3042,184,33],[3043,184,33],[3044,184,33],[3829,184,33],[4093,184,33],[4285,184,33],[4557,184,34],[4432,184,34],[3035,184,34],[3036,184,34],[3037,184,34],[3038,184,34],[3039,184,34],[3040,184,34],[3041,184,34],[3042,184,34],[3043,184,34],[3044,184,34],[3829,184,34],[4093,184,34],[4285,184,34],[4557,184,35],[4432,184,35],[3038,184,35],[3039,184,35],[3040,184,35],[3041,184,35],[3042,184,35],[3043,184,35],[3044,184,35],[3829,184,35],[4093,184,35],[4285,184,35],[4557,184,36],[4432,184,36],[3038,184,36],[3039,184,36],[3040,184,36],[3041,184,36],[3042,184,36],[3043,184,36],[3044,184,36],[3829,184,36],[4093,184,36],[4285,184,36],[3035,184,153],[3036,184,153],[3037,184,153],[3044,184,3550],[3829,184,3550],[4093,184,3550],[4557,184,4473],[4432,184,4473],[4432,184,46],[3039,184,46],[3040,184,46],[3041,184,46],[3042,184,46],[3043,184,46],[3044,184,46],[3829,184,46],[4093,184,46],[4285,184,46],[3043,184,465],[3044,184,465],[3829,184,465],[4093,184,465],[3044,184,3555],[3829,184,3555],[4093,184,3555],[4557,184,3954],[4432,184,3954],[3829,184,3954],[4093,184,3954],[4285,184,3954],[4557,184,4558],[3044,184,2337],[3829,184,2337],[4557,186,48],[4432,186,48],[3035,186,48],[3036,186,48],[3037,186,48],[3038,186,48],[3039,186,48],[3040,186,48],[3041,186,48],[3042,186,48],[3043,186,48],[3044,186,48],[3829,186,48],[4093,186,48],[4285,186,48],[3039,185,51],[3040,185,51],[3041,185,51],[3042,185,51],[3043,185,51],[3044,185,51],[3829,185,51],[4557,185,4497],[4432,185,4497],[4557,185,4619],[4557,185,4240],[4432,185,4240],[4093,185,4240],[4285,185,4240],[4557,185,4150],[4432,185,4150],[4093,185,4150],[4285,185,4150],[3042,186,54],[3043,186,54],[3044,186,54],[4557,186,3554],[4432,186,3554],[3044,186,3554],[3829,186,3554],[4093,186,3554],[4285,186,3554],[4557,186,4033],[4432,186,4033],[3829,186,4033],[4093,186,4033],[4285,186,4033],[3829,185,3854],[4093,185,3854],[4285,185,3854],[3035,185,57],[3036,185,57],[3037,185,57],[4557,186,3962],[4432,186,3962],[3829,186,3962],[4093,186,3962],[4285,186,3962],[4557,186,4605],[3044,186,3551],[3829,186,3551],[4093,186,3551],[3043,186,3049],[3044,186,3049],[3829,186,3049],[4093,186,3049],[4557,186,61],[4432,186,61],[3036,186,61],[3037,186,61],[3038,186,61],[3039,186,61],[3040,186,61],[3041,186,61],[3042,186,61],[3043,186,61],[3044,186,61],[3829,186,61],[4093,186,61],[4285,186,61],[4557,184,63],[4432,184,63],[3035,184,63],[3036,184,63],[3037,184,63],[3038,184,63],[3039,184,63],[3040,184,63],[3041,184,63],[3042,184,63],[3043,184,63],[3044,184,63],[3829,184,63],[4093,184,63],[4285,184,63],[3035,186,67],[3036,186,67],[3037,186,67],[3038,186,67],[3039,186,67],[4557,185,69],[4432,185,69],[3037,185,69],[3038,185,69],[3039,185,69],[3040,185,69],[3041,185,69],[3042,185,69],[3043,185,69],[3044,185,69],[3829,185,69],[4093,185,69],[4285,185,69],[4557,185,4343],[4432,185,4343],[4285,185,4343],[3035,184,71],[3036,184,71],[4432,184,74],[3035,184,74],[3036,184,74],[3037,184,74],[3038,184,74],[3039,184,74],[3040,184,74],[3041,184,74],[3042,184,74],[3043,184,74],[3044,184,74],[3829,184,74],[4093,184,74],[4285,184,74],[4432,186,83],[3035,186,83],[3036,186,83],[3037,186,83],[3038,186,83],[3039,186,83],[3040,186,83],[3041,186,83],[3042,186,83],[3043,186,83],[3044,186,83],[4285,186,83],[4557,184,4413],[4432,184,4413],[4285,184,4413],[4557,184,85],[4432,184,85],[3035,184,85],[3036,184,85],[3037,184,85],[3038,184,85],[3039,184,85],[3040,184,85],[3041,184,85],[3042,184,85],[3043,184,85],[3044,184,85],[3829,184,85],[4093,184,85],[4285,184,85],[4432,184,4352],[4285,184,4352],[3035,184,87],[3036,184,87],[3041,184,87],[3042,184,87],[3043,184,87],[3044,184,87],[4432,185,89],[3035,185,89],[3036,185,89],[3037,185,89],[3038,185,89],[3039,185,89],[3040,185,89],[3041,185,89],[3042,185,89],[3043,185,89],[3044,185,89],[3829,185,89],[4093,185,89],[4285,185,89],[3035,186,90],[3036,186,90],[3037,186,90],[3038,186,90],[3039,186,90],[3035,186,96],[3036,186,96],[3037,186,96],[3038,186,96],[3039,186,96],[3040,186,96],[3041,186,96],[3035,184,97],[3036,184,97],[3037,184,97],[3038,184,97],[3039,184,97],[3040,184,97],[3041,184,97],[3042,184,97],[3040,184,354],[3041,184,354],[3042,184,354],[3829,185,104],[4093,185,104]];

 

      function loadYM(form){

            

            //Set the year values 

            var isSelected = false;

            var year = document.scheduleForm.year; //document.scheduleForm.year;

            year.options[0] = new Option('Select year','-1',true,false);

            for(i=0;i<yearsList.length; i++){

             year.options[i+1] = new Option(yearsList[i][1], yearsList[i][0], false, isSelected);

            }

            //Set the make values

            isSelected = false;

            var make = document.scheduleForm.make; //document.scheduleForm.make;

 

            make.options[0] = new Option('Select make','-1',true,false);

            for(i=0;i<makesList.length; i++){

                  make.options[i+1] = new Option(makesList[i][1], makesList[i][0], false, isSelected);

            }

            make.options[i+1] = new Option("Other Makes", 999, false, isSelected);

            //Set model values

            loadModel(form);

            

      }

 

      function loadModel(form){

            var year = document.scheduleForm.year; //document.scheduleForm.year;

            var make = document.scheduleForm.make; //document.scheduleForm.make;

            var model = document.scheduleForm.model; //document.scheduleForm.model;

            var modelName = "";

            var isSelected = false;

            if((year.value != '-1')&&(make.value != '-1')){

                  model.disabled = false;

                  model.options.length = 0;

                  model.options[0] = new Option('Select model','-1',true,false);

                  for(i=0;i<ymmList.length;i++){

                              if(ymmList[i][0] == year.value && ymmList[i][1] == make.value){

                                    var modelId = ymmList[i][2];

                                          for(j=0;j<modelsList.length;j++){

                                                if(modelId == modelsList[j][0])

                                                            { 

                                                              modelName =modelsList[j][1];

                                                              model.options[model.options.length] = new Option(modelName, modelId, false, isSelected)

                                                              break; 

                                                            }

                                                }

                                          

                                    }

 

                        }

            }

            else return;

 

}

      function submitScheduleForm(form){

                  var s=s_gi(s_account);

                  s.pageName='qln: schedule: driving conditions';

                  s.linkTrackVars='eVar4,eVar14,eVar15,prop14,prop15,channel,hier1';

                  s.eVar4='eng'; s.eVar14='fcsd'; s.eVar15='quicklane.com';

                  s.prop14='fcsd'; s.prop15='quicklane.com';

                  s.channel='schedule';

                  s.hier1='qln: schedule';

                  s.tl(this,'o', 'Maintenance Schedule');

      }

 

      window.onload=function(){

            loadYM(document.scheduleForm);

      }

function cssClass(fn, el, class1, class2) {
  switch (fn) {
    case "swap":
      el.className = !cssClass("check", el, class1) ? el.className.replace(class2, class1) : el.className.replace(class1, class2);
    break;
    case "add":
      if (!cssClass("check", el, class1)) {
        el.className += el.className ? " " + class1 : class1;
      }
    break;
    case "remove":
      var rep = el.className.match(" " + class1) ? " " + class1 : class1;
      el.className = el.className.replace(rep, "");
    break;
    case "check":
      return new RegExp("\\b" + class1 + "\\b").test(el.className);
    break;
  }
}
 
