function submitForm (formObj) {
    if (!formObj) {
        return false;
    }

    var deepLinkParamsArr = [],
        flightTypeValue = '',
        flightType = formObj["param[type]"];
    deepLinkParamsArr["action"] = "encodes_load";
    for (var i=0; i<flightType.length; i++) {
        if (flightType[i].checked == true)
            flightTypeValue = flightType[i].value;
    }

    deepLinkParamsArr["param[type]"] = flightTypeValue;
    deepLinkParamsArr["param[acc_dep]"] = formObj["param[acc_dep]"].value;
    deepLinkParamsArr["param[acc_arr]"] = formObj["param[acc_arr]"].value;
    deepLinkParamsArr["param[city_dep]"] = formObj["param[city_dep]"].value;
    deepLinkParamsArr["param[city_arr]"] = formObj["param[city_arr]"].value;

    flightNonStop = formObj["param[nonstop]"];
    deepLinkParamsArr["param[outbound_date_str]"] = formObj["param[outbound_date_day]"][formObj["param[outbound_date_day]"].selectedIndex].value + "." + formObj["param[outbound_date_month]"][formObj["param[outbound_date_month]"].selectedIndex].value + "." + formObj["param[outbound_date_year]"][formObj["param[outbound_date_year]"].selectedIndex].value;

/*        deepLinkParamsArr["param[outbound_dep_datetime]"] = formObj["param[outbound_dep_datetime]"].value; */
    deepLinkParamsArr["param[inbound_date_str]"] = formObj["param[inbound_date_day]"][formObj["param[inbound_date_day]"].selectedIndex].value + "." + formObj["param[inbound_date_month]"][formObj["param[inbound_date_month]"].selectedIndex].value + "." + formObj["param[inbound_date_year]"][formObj["param[inbound_date_year]"].selectedIndex].value;
/*        deepLinkParamsArr["param[inbound_dep_datetime]"] = formObj["param[inbound_dep_datetime]"].value; */

    var flightNonStopValue = "FALSE";
    deepLinkParamsArr["param[nonstop]"] = flightNonStopValue;
    deepLinkParamsArr["param[cabinclass]"] = formObj["param[cabinclass]"][formObj["param[cabinclass]"].selectedIndex].value;

    deepLinkParamsArr["param[dep_arl]"] = formObj["param[dep_arl]"][formObj["param[dep_arl]"].selectedIndex].value;
    deepLinkParamsArr["param[pax_adt]"] = formObj["param[pax_adt]"][formObj["param[pax_adt]"].selectedIndex].value;
    deepLinkParamsArr["param[pax_chd]"] = formObj["param[pax_chd]"][formObj["param[pax_chd]"].selectedIndex].value;
    deepLinkParamsArr["param[pax_inf]"] = formObj["param[pax_inf]"][formObj["param[pax_inf]"].selectedIndex].value;

    var deepLinkParamsStr = "";
    for (var key in deepLinkParamsArr) {
        if ( typeof deepLinkParamsArr[key] == 'string')
            deepLinkParamsStr += key + "=" + escape(deepLinkParamsArr[key]) + "&amp;";
    }

    var ibeUrl = HOME_URL + "flight/ibe?deeplink=" + escape(deepLinkParamsStr);
    return false;
}

function showLoadingScreen() {
    jQuery('#overlaytext').hide();
    jQuery('#overlaybox,#overlay').show();
}

function showNormalScreen() {
    jQuery('#overlaybox').hide();
    jQuery('#overlay').hide();
}

function checkForm() {
    jQuery('#errorMessageRow').hide();
    var message = '';
    if (jQuery('#depCity').val() == '') {
        message = "einen Abflughafen";
    }

    if (jQuery('#arrCity').val() == '') {
        if (message != '') {
            message += " und einen Zielflughafen";
        }
        else {
            message = "einen Zielflughafen";
        }
    }

    if (message != '') {
        message = "Sie müssen " + message + " eingeben um Ergebnisse zu erhalten!<br />";
    }
 
    if (typeof flightDepCal == 'object' && typeof flightArrCal == 'object') {
        if (flightDepCal.date.getTime() > flightArrCal.date.getTime()) {
            message += "Das Rückflugdatum liegt vor dem Hinflugdatum!";
        }
    }

    if (message != '') {
        jQuery('#errorMessage').html(message);
            showNormalScreen();
        }
    else {
        var departure = jQuery('#accDep, #sFlightInput\\[accDep\\]').val();
        var arrival = jQuery('#accArr, #sFlightInput\\[accArr\\]').val();
        var departureRegion = jQuery('#accDepRegion').val();
        var arrivalRegion = jQuery('#accArrRegion').val();
        departure = (departure != '' && departure != undefined ) ? departure : jQuery('#depCity').val();
        arrival = (arrival != '' && arrival != undefined) ? arrival : jQuery('#arrCity').val();
        departureRegion = (departureRegion != '' && departureRegion != undefined ) ? departureRegion : '';
        arrivalRegion = (arrivalRegion != '' && arrivalRegion != undefined ) ? arrivalRegion : '';

        jQuery.getJSON(HOME_URL + 'flight/checkairport/', {
            departure: departure,
            arrival: arrival,
            departureRegion: departureRegion,
            arrivalRegion: arrivalRegion
        },
        function(data){
            if(data.status != 'success'){
                jQuery('#depCity, #arrCity').css('color', '#000');
                if(data.message == 'departure'){
                    message = "Abflughafen";
                    jQuery('#depCity').css('color', 'red');
                }
                else if(data.message == 'arrival'){
                    message = "Zielflughafen";
                    jQuery('#arrCity').css('color', 'red');
                }
                else if(data.message == 'both'){
                    message += "Abflughafen und beim Zielflughafen";
                    jQuery('#depCity, #arrCity').css('color', 'red');
                }
                
                if (message != '') {
                    message = "Möglicherweise haben Sie sich beim " + message + " vertippt. Bitte korrigieren Sie Ihre Eingabe.<br />";
                    jQuery('#errorMessage').html(message);
                }
            }
            else{
                    showNormalScreen();
                document.forms.sflight.submit();
            }
        });
    }
}

function checkAirports() {
    var cookie = jQuery.cookies.get(GetCookieName());
    if(cookie != null) {
        var cookieData = GetCookieData(cookie, "ACW");

        if(cookieData == "1"){
                showLoadingScreen();
        }
    }

    setTimeout("checkForm()", (RUN_MODE != 'online') ? 2000 : 0);
}

function setNumPax() {
    var maxPax = 9,
        elChd = jQuery('#childSelector'),
        elInf = jQuery('#infantSelector'),
        adtNum = parseInt(1 * jQuery('#adultSelector').val()),
        infNum = parseInt(1 * elInf.val()),
        chdNum = parseInt(1 * elChd.val()),
        chdMax = maxPax - adtNum,
        x;
    
    if(infNum > adtNum) {
        infNum = adtNum;
    }

    if((maxPax-adtNum) < chdNum) {
        chdNum = maxPax-adtNum;
    }
    
    elChd.html('');
    elInf.html('');
    
    for(x=0;x<=adtNum;x++) {
        if(x==1) { val=" Baby";    }else {    val=" Babys"; }
        jQuery("<option/>").val(x).text(x+val).appendTo(jQuery(elInf));
    }
    jQuery('#infantSelector option[value="' + infNum + '"]').attr('selected',true);
    
    for(x=0;x<=chdMax;x++) {
        if(x==1) { val=" Kind";    }else {    val=" Kinder"; }
        jQuery("<option/>").val(x).text(x+val).appendTo(jQuery(elChd));
    }
    jQuery('#childSelector option[value="' + chdNum + '"]').attr('selected',true);

}

function switchDate( flightType ) {
    if (flightType == 'OW') {
        jQuery('#returnDate, #flightRetVal, #dateto').datepicker('disable');
        jQuery('#flightRetTime, #sFlightInput\\[inbound_time\\], #returnTimeRange, #sFlightInput\\[returnTimeRange\\], #flightRetVal, #sFlightInput\\[inbound_date_month\\], #sFlightInput\\[inbound_date_day\\], #returnDate').attr("disabled", true);
        jQuery("[name='sFlightInput\[returnTimeRange\]']").attr("disabled", true);
        jQuery('#arrCal, #flightArrCal').hide();
    }
    else {
        jQuery('#returnDate, #flightRetVal, #dateto').datepicker('enable');
        jQuery('#flightRetTime, #sFlightInput\\[inbound_time\\], #returnTimeRange, #sFlightInput\\[returnTimeRange\\], #flightRetVal, #sFlightInput\\[inbound_date_month\\], #sFlightInput\\[inbound_date_day\\], #returnDate').removeAttr("disabled");
        jQuery("[name='sFlightInput\[returnTimeRange\]']").removeAttr("disabled");
        jQuery('#arrCal, #flightArrCal').show();
    }
}

function switchRoute( mode ) {
    flightType = jQuery('#sFlightInput\\[flightType\\], #flightType, #ow').is(':checked');
    if (flightType == true) {
        jQuery('#returnDate, #flightRetVal').datepicker('disable');
        jQuery('#sFlightInput\\[inbound_time\\], #returnTimeRange, #sFlightInput\\[returnTimeRange\\], #flightRetVal, #sFlightInput\\[inbound_date_month\\], #sFlightInput\\[inbound_date_day\\], #returnDate').attr("disabled", true);
        jQuery('#arrCal, #flightArrCal').hide();
    }
    else {
        jQuery('#returnDate, #flightRetVal').datepicker('enable');
        jQuery('#sFlightInput\\[inbound_time\\], #returnTimeRange, #sFlightInput\\[returnTimeRange\\], #flightRetVal, #sFlightInput\\[inbound_date_month\\], #sFlightInput\\[inbound_date_day\\], #returnDate').removeAttr("disabled"); 
        jQuery('#arrCal, #flightArrCal').show();
    }
}

String.prototype.leftPad = function (l, c) { return new Array(l - this.length + 1).join(c || '0') + this; };

function changeReturnDate(hin, rueck, ustf, range) {
    hin   = !!hin ? jQuery(hin) : jQuery('#departureDate');
    rueck = !!rueck ? jQuery(rueck) : jQuery('#returnDate');
    ustf  = !!ustf ? ustf = true : ustf = false;
    range = !!range ? range : 604800000;

    if (hin.length) {
        if(ustf == false){
            var sStr = hin.val().split(".");
            var oDate = new Date(sStr[2],(parseInt(sStr[1],10) - 1),sStr[0]);
            var sDate = oDate.getTime() + range;
            oDate.setTime(sDate);
            rueck.val((oDate.getDate()).toString().leftPad(2, '0') + '.' + (parseInt(oDate.getMonth(),10) + 1).toString().leftPad(2, '0')  + '.' + oDate.getFullYear());
        } else {
            var sStr = hin.val().split("-");
            var oDate = new Date(sStr[0],(parseInt(sStr[1],10) - 1),sStr[2]);
            var sDate = oDate.getTime() + range;
            oDate.setTime(sDate);
            rueck.val( oDate.getFullYear()+ '-' + (parseInt(oDate.getMonth(),10) + 1).toString().leftPad(2, '0')  + '-' +  (oDate.getDate()).toString().leftPad(2, '0'));
        }
    }
}

jQuery(document).ready(function() {
    var flex = jQuery('#flexible');
    flex.click(function(){
        jQuery('#returnFlexible').val(flex.is(':checked') ? "2" : "0");
    });
});

/*global constants*/
jQuery.constants = (function($) {
    var oJq = arguments.callee;
    if (!oJq.isIE) {
        oJq.ua = $.browser;
        oJq.isIE = oJq.ua.msie;
        oJq.isIE6 = oJq.ua.msie && oJq.ua.version == '6.0';
        oJq.ltIE8 = oJq.isIE6 ||(oJq.isIE && parseInt(oJq.ua.version, 10) < 8);
        oJq.isIE9 = oJq.ua.msie && !!window.performance;
        oJq.isFF4 = oJq.ua.mozilla && oJq.ua.version >= '2.0';
        oJq.isOpera = oJq.ua.opera;
        oJq.isIpad = (navigator.platform.indexOf('iPad') != -1);
        oJq.body = $('body');
        oJq.doc = $(document);
        oJq.wrapper = $('#wrapper');
    }
    return oJq;
})(jQuery);

/* jquery plugin to typeahead */
(function($) {
    /* use jQuery as container for more convenience */
    $.fn.typeahead = function(target) {
        var target = $(target),
            $this = this;
        target.on('focus', function() {
            $this.off('keyup');
        });
        $this.on('keyup', function() {
            target.val($this.val());
        });

        return this;
    };
})(jQuery);


/* jquery plugin for popunder */
(function($) {
    /* use jQuery as container for more convenience */
    $.popunder = function(sUrl) {
        var _parent = self;
        var bPopunder = ($.browser.msie && parseInt($.browser.version, 10) < 9);

        if (top != self) {
            try {
                if (top.document.location.toString()) {
                    _parent = top;
                }
            }
            catch(err) { }
        }

        /* popunder options */
        var sOptions = 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,width=' + (screen.availWidth - 10).toString();
        sOptions += ',height=' + (screen.availHeight - 122).toString() + ',screenX=0,screenY=0,left=0,top=0';

        /* create pop-up from parent context */
        var popunder = _parent.window.open(sUrl, 'pu_' + Math.floor(89999999*Math.random()+10000000), sOptions);
        if (popunder) {
            popunder.blur();
            if (bPopunder) {
                /* classic popunder, used for old ie*/
                window.focus();
                try { opener.window.focus(); }
                catch (err) { }
            }
            else {
                /* popunder for e.g. ff4+, chrome, ie9 */
                popunder.init = function(e) {
                    with (e) {
                        (function() {
                            if (typeof window.mozPaintCount != 'undefined') {
                                var x = window.open('about:blank');
                                x.close();
                            }

                            try { opener.window.focus(); }
                            catch (err) { }
                        })();
                    }
                };
                popunder.params = {
                    url: sUrl
                };
                popunder.init(popunder);
            }
        }

        return this;
    };
})(jQuery);

/* jquery plugin for splitted booking-page */
(function($) {
    $.splitFunc = {
        showPage: function(page) {
            page = (page || '').replace(/#/, '');
            if ($('#page-' + page).length) {
                if (page !== 'booking' && $('#page-booking').validationEngine({returnIsValid:true}) === false) {
                    splitFunc.showPage('booking');
                    $('#page-booking').validationEngine({
                        inlineValidation: true,
                        scroll: false
                    });
                }
                else {
                    _gaq = _gaq || [];
                    _gaq.push(['_trackPageview', '/booking/' + page]);
                    $('div.pages, div.booking-nav').hide();
                    $('div.formError').remove();
                    $('#page-' + page + ', #nav-' + page).show();
                    $(document).scrollTop(0);
                }
            }
        }
    };
})(jQuery);

/**
 * This function maps the payment types for the Unister Payment Secure system.
 * @return boolean Returns always TRUE.
 */
function mapPaymentTypes(
    fligthPaymentTypeFieldName, flightPaymentTypeUPv2FieldName, insurancePaymentTypeFieldName, insurancePaymentTypeUPv2FieldName)
{
    /* The UPv2 specific mapping strings */
    var MAPPED_STRING_UNKNWON = '',
        MAPPED_STRING_CC      = 'cc',
        MAPPED_STRING_DEBIT   = 'elv',
        MAPPED_STRING_INVOICE = 'invoice';

    /* Map payment type for FLIGHT */
    var elPaymentType = jQuery('input[name$="' + fligthPaymentTypeFieldName + '"]:checked');
    var sPaymentType = '';
    if (elPaymentType.length === 0) {
        /* Special solution for the mobile page - here we have a select instead of an input element */
    	elPaymentType = jQuery('select[name$="' + fligthPaymentTypeFieldName + '"]');
    if (elPaymentType.length) {
    		sPaymentType = 'paymenttype' + String( elPaymentType.val() ).toLowerCase();
    	}
    }
    else {
    	sPaymentType = String( elPaymentType.attr('id') ).toLowerCase();
    }

    if (elPaymentType.length > 0) {
        /* Get or create the hidden field that holds the mapped value */
        var elPaymentTypeUPv2 = jQuery('input[name$="' + flightPaymentTypeUPv2FieldName + '"]');
        if (!elPaymentTypeUPv2.length) {
            elPaymentTypeUPv2 = jQuery('<input type="hidden" />')
                .attr('name', flightPaymentTypeUPv2FieldName)
                .appendTo( elPaymentType.parent() );
        }
        elPaymentTypeUPv2.attr('disabled', false);
        /* Map the value... */
        switch (sPaymentType) {
            case 'paymenttypecc':
                elPaymentTypeUPv2.val(MAPPED_STRING_CC);
                break;
            case 'paymenttypedebit':
                elPaymentTypeUPv2.val(MAPPED_STRING_DEBIT);
                break;
            case 'paymenttypeinvoice':
                elPaymentTypeUPv2.val(MAPPED_STRING_INVOICE);
                break;
            default:
                elPaymentTypeUPv2.val(MAPPED_STRING_UNKNWON);
        }
    }

    /* Map payment type for INSURANCE */
    if (typeof insurancePaymentTypeFieldName !== 'undefined') {
    var elPaymentTypeErv = jQuery('input[name$="' + insurancePaymentTypeFieldName + '"]');
    if (elPaymentTypeErv.length) {
        /* Create a new hidden field that holds the mapped value */
        var elPaymentTypeErvUPv2 = jQuery('input[name$="' + insurancePaymentTypeUPv2FieldName + '"]');
        if (!elPaymentTypeErvUPv2.length) {
            elPaymentTypeErvUPv2 = jQuery('<input type="hidden" />')
                .attr('name', insurancePaymentTypeUPv2FieldName)
                .appendTo( elPaymentTypeErv.parent() );
            };
            elPaymentTypeErvUPv2.attr('disabled', false);
        /* Map the value... */
        switch ( String(elPaymentTypeErv.val()).toLowerCase() ) {
            case 'cc':
                elPaymentTypeErvUPv2.val(MAPPED_STRING_CC);
                break;
            case 'debit':
                elPaymentTypeErvUPv2.val(MAPPED_STRING_DEBIT);
                break;
            case 'invoice':
                elPaymentTypeErvUPv2.val(MAPPED_STRING_INVOICE);
                break;
            default:
                elPaymentTypeErvUPv2.val(MAPPED_STRING_UNKNWON);
        }
    }
    }

    return true;
}


/*http://jacwright.com/projects/javascript/date_format*/
Date.prototype.format=function(a){var b='';var c=Date.replaceChars;for(var i=0;i<a.length;i++){var d=a.charAt(i);if ('#' == d){b+=a.charAt(1+i);i++;}else {if(c[d]){b+=c[d].call(this)}else{b+=d}}}return b};Date.replaceChars={shortMonths:['Jan','Feb','Mar','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'],longMonths:['Januar','Februar','M&auml;rz','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'],shortDays:['So','Mo','Di','Mi','Do','Fr','Sa'],longDays:['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],d:function(){return(this.getDate()<10?'0':'')+this.getDate()},D:function(){return Date.replaceChars.shortDays[this.getDay()]},j:function(){return this.getDate()},l:function(){return Date.replaceChars.longDays[this.getDay()]},N:function(){return this.getDay()+1},S:function(){return(this.getDate()%10==1&&this.getDate()!=11?'st':(this.getDate()%10==2&&this.getDate()!=12?'nd':(this.getDate()%10==3&&this.getDate()!=13?'rd':'th')))},w:function(){return this.getDay()},z:function(){return"Not Yet Supported"},W:function(){return"Not Yet Supported"},F:function(){return Date.replaceChars.longMonths[this.getMonth()]},m:function(){return(this.getMonth()<11?'0':'')+(this.getMonth()+1)},M:function(){return Date.replaceChars.shortMonths[this.getMonth()]},n:function(){return this.getMonth()+1},t:function(){return"Not Yet Supported"},L:function(){return"Not Yet Supported"},o:function(){return"Not Supported"},Y:function(){return this.getFullYear()},y:function(){return(''+this.getFullYear()).substr(2)},a:function(){return this.getHours()<12?'am':'pm'},A:function(){return this.getHours()<12?'AM':'PM'},B:function(){return"Not Yet Supported"},g:function(){return this.getHours()%12||12},G:function(){return this.getHours()},h:function(){return((this.getHours()%12||12)<10?'0':'')+(this.getHours()%12||12)},H:function(){return(this.getHours()<10?'0':'')+this.getHours()},i:function(){return(this.getMinutes()<10?'0':'')+this.getMinutes()},s:function(){return(this.getSeconds()<10?'0':'')+this.getSeconds()},e:function(){return"Not Yet Supported"},I:function(){return"Not Supported"},O:function(){return(this.getTimezoneOffset()<0?'-':'+')+(this.getTimezoneOffset()/60<10?'0':'')+(this.getTimezoneOffset()/60)+'00'},T:function(){return"Not Yet Supported"},Z:function(){return this.getTimezoneOffset()*60},c:function(){return"Not Yet Supported"},r:function(){return this.toString()},U:function(){return this.getTime()/1000}};
var JSON=JSON||{};(function(){function f(n){return n<10?'0'+n:n}if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(a){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+f(this.getUTCMonth()+1)+'-'+f(this.getUTCDate())+'T'+f(this.getUTCHours())+':'+f(this.getUTCMinutes())+':'+f(this.getUTCSeconds())+'Z':null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(a){return this.valueOf()}}var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(b){escapable.lastIndex=0;return escapable.test(b)?'"'+b.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+b+'"'}function str(a,b){var i,k,v,length,mind=gap,partial,value=b[a];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(a)}if(typeof rep==='function'){value=rep.call(b,a,value)}switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null'}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null'}v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v}if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v)}}}}v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v}}if(typeof JSON.stringify!=='function'){JSON.stringify=function(a,b,c){var i;gap='';indent='';if(typeof c==='number'){for(i=0;i<c;i+=1){indent+=' '}}else if(typeof c==='string'){indent=c}rep=b;if(b&&typeof b!=='function'&&(typeof b!=='object'||typeof b.length!=='number')){throw new Error('JSON.stringify');}return str('',{'':a})}}if(typeof JSON.parse!=='function'){JSON.parse=function(c,d){var j;function walk(a,b){var k,v,value=a[b];if(value&&typeof value==='object'){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return d.call(a,b,value)}e.lastIndex=0;if(e.test(c)){c=c.replace(e,function(a){return'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(c.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+c+')');return typeof d==='function'?walk({'':j},''):j}throw new SyntaxError('JSON.parse');}}}());
