﻿// Partners Short Form

var ERROR_DISPLAY = 'ERROR';
var ERROR = 'The fields marked in red are missing or invalid';
var REDIRECT_URL = 'http://www.relocation.com/results.aspx';
var SCRIPTS_URL = 'http://www.relocation.com/Scripts/Zips/';
var PARTNER = '';
var SUB_PARTNER = '';
var SERVICE_TYPE = 'Moving';

var Type = '';
var Service = '';
var FromCity = '';
var FromState = '';
var FromPostal = '';
var FromCountry = '';
var FromCountryName = '';
var ToState = '';
var ToCountry = '';
var ToCountryName = '';
var Size = '';
var IsDev = false;

function Init() {
    InitilizeDdlState('ddlMovingToState');
    InitilizeDdlState('ddlAutoToState');
    InitilizeDdlCountry('ddlMovingFromCountry');
    InitilizeDdlCountry('ddlMovingToCountry');

    if (IsDev) {
        SCRIPTS_URL = 'http://www.journalrelocation.com/scripts/zips/';
        REDIRECT_URL = 'http://www.journalrelocation.com/results.aspx';
    }

    var oHead = document.getElementsByTagName('HEAD').item(0);

    if (oHead != null) {
        var oScript = document.createElement("script");
        oScript.type = "text/javascript";
        oScript.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js";
        oHead.appendChild(oScript);
    }

    AddJS('48');
}

function AddJS(state) {
    var src = SCRIPTS_URL + state + '.js';

    $.ajax({
        type: "GET",
        url: src,
        dataType: "script"
    });
}

function SHElement(el, dis) {
    el = document.getElementById(el);
    if (el != null) {
        el.style.display = dis;
    }
}

function GetValue(el) {
    el = document.getElementById(el);
    if (el != null
        && !(el.type == 'select-one' && el.selectedIndex == 0)) {
        return el.value;
    }

    return '';
}

function GetText(el) {
    el = document.getElementById(el);
    if (el != null && el.options != null && el.options.length > 0 && el.selectedIndex != 0) {
        return el.options[el.selectedIndex].innerHTML;
    }

    return '';
}

function GetMovingService(ddl) {
    var script = document.getElementById('zipjs');

    ddl = document.getElementById(ddl);

    if (ddl != null) {
        var val = ddl.value;
        if (val != '1013' && val != '1000') {

            var txt = document.getElementById('txtMovingZipCode');
            var ddlTo = document.getElementById('ddlMovingToState');

            var i = 0;
            while (typeof (z) == 'undefined') {
                setTimeout('', 1000);
                i++;
                if (i > 5) {
                    return '1001';
                }
            }

            if (z != null && txt != null) {
                val = z[parseInt(txt.value, 10)] == ddlTo.value ? '1012' : '1001';
            }
        }

        return val;
    }

    return '1001';
}

function ServiceType_change(selectedValue) {
    SERVICE_TYPE = selectedValue;
    switch (selectedValue) {
        case ('Moving'):
            SHElement('divMoving', 'block');
            SHElement('divStorage', 'none');
            SHElement('divAuto', 'none');
            break;
        case ('Storage'):
            SHElement('divMoving', 'none');
            SHElement('divStorage', 'block');
            SHElement('divAuto', 'none');
            break;
        case ('Auto Transport'):
            SHElement('divMoving', 'none');
            SHElement('divStorage', 'none');
            SHElement('divAuto', 'block');
            break;
    }
}

function MovingTypeChange(value) {
    switch (value) {
        case ('1001'):
        case ('1013'):
            SHElement('trMovingZipCode', 'block');
            SHElement('trMovingToState', 'block');
            SHElement('trMovingFromCountry', 'none');
            SHElement('trMovingToCountry', 'none');
            break;
        case ('1000'):
            SHElement('trMovingZipCode', 'none');
            SHElement('trMovingToState', 'none');
            SHElement('trMovingFromCountry', 'block');
            SHElement('trMovingToCountry', 'block');
            break;
    }
}


function ValidateFields(el, sp, val, err) {
    el = document.getElementById(el);
    sp = document.getElementById(sp);

    if (el != null && sp != null) {
        sp.style.backgroundColor = 'white';
        if (el.value == val) {
            sp.style.backgroundColor = 'lightpink';
            return err;
        }
    }

    return '';
}

function ValidateZipCode(el, sp, req, inv) {
    el = document.getElementById(el);
    sp = document.getElementById(sp);

    if (el != null && sp != null) {
        sp.style.backgroundColor = 'white';
        if (el.value == '') {
            sp.style.backgroundColor = 'lightpink';
            return req;
        }
        else {
            if (!el.value.match(/^\d\d\d\d\d$/)) {
                sp.style.backgroundColor = 'lightpink';
                return inv;
            }
        }
    }

    return '';
}

function ValidateZipState(zip, to, err) {

    var txt = document.getElementById(zip);
    var ddlTo = document.getElementById(to);

    var i = 0;
    while (typeof (z) == 'undefined') {
        setTimeout('', 1000);
        i++;
        if (i > 5) {
            return '';
        }
    }

    if (txt != null && ddlTo != null) {
        txt.style.backgroundColor = 'white';
        ddlTo.style.backgroundColor = 'white';

        if (z != null && z[parseInt(txt.value, 10)] == ddlTo.value) {
            txt.style.backgroundColor = 'lightpink';
            ddlTo.style.backgroundColor = 'lightpink';
            return err;
        }
    } 
    
    return '';
}

function Validate() {
    var Errors = '';
    var ddl = document.getElementById('ddlMovingType');
    
    switch (SERVICE_TYPE) {
        case 'Moving':            

            if (ddl != null) {
                switch (ddl.value) {
                    case '1000':
                        Errors += ValidateFields('ddlMovingFromCountry', 'ddlMovingFromCountry', '0', 'From Country - Required\n\r');
                        Errors += ValidateFields('ddlMovingToCountry', 'ddlMovingToCountry', '0', 'To Country - Required\n\r');
                        Errors += ValidateFields('ddlMovingSize', 'ddlMovingSize', '0000', 'Moving Size - Required\n\r');

                        break;

                    default:
                        Errors += ValidateZipCode('txtMovingZipCode', 'txtMovingZipCode', 'From ZipCode - Required\n\r', 'From ZipCode - Invalid\n\r');

                        Errors += ValidateFields('ddlMovingToState', 'ddlMovingToState', '-1', 'To State - Required\n\r');
                        Errors += ValidateFields('ddlMovingSize', 'ddlMovingSize', '0000', 'Moving Size - Required\n\r');

                        if (ddl.value == '1013') {
                            Errors += ValidateZipState('txtMovingZipCode', 'ddlMovingToState', 'U-Load is not available within the same state');
                        }

                        break;
                }
            }
            break;
        case 'Storage':
            Errors += ValidateFields('ddlStorageType', 'ddlStorageType', '0', 'Storage Type - Required\n\r');
            Errors += ValidateZipCode('txtStorageZipCode', 'txtStorageZipCode', 'Storage ZipCode - required\n\r', 'Storage ZipCode - Invalid\n\r');

            break;
        case 'Auto Transport':
            Errors += ValidateZipCode('txtAutoZipCode', 'txtAutoZipCode', 'From ZipCode - Required\n\r', 'From ZipCode - Invalid\n\r');
            Errors += ValidateFields('ddlAutoToState', 'ddlAutoToState', '-1', 'To State - Required\n\r');
            Errors += ValidateZipState('txtAutoZipCode', 'ddlAutoToState', 'Moving a Car is not available within the same state');

            break;
    }
    if (Errors != '') {
        if (ERROR_DISPLAY == 'ALERT') {
            alert(Errors);
        }
        else {
            var spn = document.getElementById('spnErrors');
            if (spn != null) {
                if (Errors.indexOf('U-Load is not available within the same state', 0) >= 0) {
                    spn.innerHTML = 'U-Load is not available within the same state';
                }
                else if (Errors.indexOf('Moving a Car is not available within the same state', 0) >= 0) {
                    spn.innerHTML = 'Moving a Car is not available within the same state';
                }
                else {
                    spn.innerHTML = ERROR;
                }
            }
            SHElement('spnErrors', 'block');
        }
        return false;
    }
    else {
        SHElement('spnErrors', 'none');
        return true;
    }
}

function SubmitForm() {
    var queryString = '';

    if (Validate()) {

        switch (SERVICE_TYPE) {
            case 'Moving':

                var ms = GetMovingService('ddlMovingType');
                if (ms == '') {
                    ms = '1001';
                }

                queryString += "?Type=Moving";
                queryString += "&Service=" + GetMovingService('ddlMovingType');
                queryString += ms != '1000' && GetValue('txtMovingZipCode') != '' ? "&FromPostal=" + GetValue('txtMovingZipCode') : '';
                queryString += ms == '1000' && GetValue('ddlMovingFromCountry') != '' ? "&FromCountry=" + GetValue('ddlMovingFromCountry') : '&FromCountry=1';
                queryString += ms == '1000' && GetText('ddlMovingFromCountry') != '' ? "&FromCountryName=" + GetText('ddlMovingFromCountry') : '';
                queryString += ms != '1000' && GetValue('ddlMovingToState') != '' ? "&ToState=" + GetValue('ddlMovingToState') : '';
                queryString += ms == '1000' && GetValue('ddlMovingToCountry') != '' ? "&ToCountry=" + GetValue('ddlMovingToCountry') : '&ToCountry=1';
                queryString += ms == '1000' && GetText('ddlMovingToCountry') != '' ? "&ToCountryName=" + GetText('ddlMovingToCountry') : '';
                queryString += GetValue('ddlMovingSize') != '' ? "&Size=" + GetValue('ddlMovingSize') : '';
                
                break;
            case 'Storage':
                queryString += "?Type=Storage";
                queryString += "&Service=" + GetValue('ddlStorageType');
                queryString += "&FromPostal=" + GetValue('txtStorageZipCode');
                break;
            case 'Auto Transport':
                queryString += "?Type=Moving";
                queryString += "&Service=1002";
                queryString += GetValue('txtAutoZipCode') != '' ? "&FromPostal=" + GetValue('txtAutoZipCode') : '';
                queryString += '&FromCountry=1';
                queryString += GetValue('ddlAutoToState') != '' ? "&ToState=" + GetValue('ddlAutoToState') : '';
                queryString += '&ToCountry=1';

                break;
        }

        queryString += PARTNER != '' ? "&Partner=" + PARTNER : '';
        queryString += SUB_PARTNER != '' ? "&Sub_Partner=" + SUB_PARTNER : '';

        window.location.href = REDIRECT_URL + queryString;
    }
}

var stateIdArray = new Array(-1, 4, 3, 6, 5, 7, 8, 9, 11, 10, 12, 13, 14, 15, 17, 18, 19, 16, 20, 21, 22, 25, 24, 23, 26, 27, 29, 28, 30, 33, 37, 34, 35, 36, 38, 31, 32, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 52, 51, 50, 53, 55, 54, 56);
var stateNameArray = new Array("Select a state", "Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "District of Columbia", "Florida", "Georgia", "Guam", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Puerto Rico", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virgin Islands", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming");
function InitilizeDdlState(objId) {
    document.getElementById(objId).options.length = 0;
    for (var i = 0; i < stateIdArray.length; i++) {
        var anOptionA = new Option(stateNameArray[i], stateIdArray[i]);
        document.getElementById(objId).options.add(anOptionA);
    }
}

var countryIdArray = new Array(0, 1, 67746, 67747, 67748, 67749, 67750, 67751, 67752, 67753, 67754, 67755, 67756, 67757, 67758, 67759, 67760, 67761, 67762, 67763, 67764, 67765, 67766, 67767, 67768, 67769, 67770, 67771, 67772, 67773, 67774, 67775, 67776, 67777, 67778, 67779, 67780, 67781, 67782, 67783, 2, 67784, 67785, 67786, 67787, 67788, 67789, 67790, 67791, 67792, 67793, 67794, 67795, 67796, 67797, 67798, 67799, 67800, 67801, 67802, 67803, 67804, 67805, 67806, 67807, 67808, 67809, 67810, 67811, 67812, 67813, 67814, 67815, 67816, 67817, 67818, 67819, 67820, 67821, 67822, 67823, 67824, 67825, 67826, 67827, 67828, 67829, 67830, 67831, 67832, 67833, 67834, 67835, 67836, 67837, 67838, 67839, 67840, 67841, 67842, 67843, 67844, 67845, 67846, 67847, 67848, 67849, 67850, 67851, 67852, 67853, 67854, 67855, 67856, 67857, 67858, 67859, 67860, 67861, 67862, 67863, 67864, 67865, 67866, 67867, 67868, 67869, 67870, 67871, 67872, 67873, 67874, 67875, 67876, 67877, 67878, 67879, 67880, 67881, 67882, 67883, 67884, 67885, 67886, 67887, 67888, 67889, 67890, 67891, 67892, 67893, 67894, 67895, 67896, 67897, 67898, 67899, 67900, 67901, 67902, 67903, 67904, 67905, 67906, 67907, 67908, 67909, 67910, 67911, 67912, 67913, 67914, 67915, 67916, 67917, 67918, 67919, 67920, 67921, 67922, 67923, 67924, 67925, 67926, 67927, 67928, 67929, 67930, 67931, 67932, 67933, 67934, 67935, 67936, 67937, 67938, 67939, 67940, 67941, 67942, 67943, 67944, 67945, 67946, 67947, 67948, 67949, 67950, 67951, 67952, 67953, 67954, 67955, 67956, 67957, 67958, 67959, 67960, 67961, 67962, 67963, 67964, 67965, 67966, 67967, 67968, 67969, 67970, 67971, 1, 67972, 67973, 67974, 67975, 67976, 67977, 67978, 67979, 67980, 67981, 67982, 67983, 67984, 67985, 67986);
var countryNameArray = new Array("Select a country", "United States of America", "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia-Herzegovina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "British Virgin Islands", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burma", "Burundi", "Cameroon", "Canada", "Canton And Enderbury Is.", "Cape Verde", "Cayman Islands", "Central African Rep.", "Chad", "Chile", "China", "Christmas Island", "Cocos (keeling) Island", "Colombia", "Comoros", "Congo", "Cook Islands", "Costa Rica", "Cote D'ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Czechoslovakia", "Democratic Kampuchea", "Democratic Yemen", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Dronning Maud Island", "East Timor", "Ecuador", "Egypt", "El Salvador", "England", "Equatorial Guinea", "Estonia", "Ethiopia", "Faeroe Islands", "Falkland Islands-Malvinas", "Fiji", "Finland", "France", "French Guiana", "French Polynesia", "French Southern Terr", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadaloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard and Mcdonald Is.", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Johnston Island", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Martinique", "Mauritania", "Mauritius", "Mexico", "Midway Islands", "Moldova", "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "Neutral Zone", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "North Korea", "Norway", "Oman", "Pacific Is. Trust Terr.", "Pakistan", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn Islands", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russia", "Rwanda", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Scotland", "Senegal", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Korea", "Spain", "Sri Lanka", "St. Helena", "St. Kitts-Nevis-Anguilla", "St. Lucia", "St. Pierre Et Miquelon", "St. Vincent and The Grenadines", "Sudan", "Suriname", "Svalbard and Jan Mayen Is.", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tokelau", "Tonga", "Trinidad And Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks And Caicos Is.", "Tuvalu", "U.S. Pacific Islands", "U.S. Virgin Islands", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States of America", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City State", "Venezuela", "Vietnam", "Wake Island", "Wales", "Wallis and Futuna Is.", "Western Sahara", "Yemen Arab Republic", "Yugoslavia", "Zaire", "Zambia", "Zimbabwe");
function InitilizeDdlCountry(objId) {
    document.getElementById(objId).options.length = 0;
    for (var i = 0; i < countryIdArray.length; i++) {
        var anOptionA = new Option(countryNameArray[i], countryIdArray[i]);
        document.getElementById(objId).options.add(anOptionA);
    }
}

function CreateForm() {
    var html = '';
    html += "<link href=\"http://www.relocation.com/JSForm/style_v1003.css\" rel=\"stylesheet\" type=\"text\/css\" \/>";
    html += "<div>";
    html += "<table width='100%' cellpadding='0' cellspacing='0' border='0'>";
    html += "	<tr valign='top'>";
    html += "		<td class='jsf_wrapperTD'>";
    html += "			<table class='jsf_maintbl' cellpadding='0' cellspacing='0'>";
    html += "               <tr>";
    html += "                   <td class='jsf_headline'>Find a Mover<\/td>";
    html += "               <\/tr>";
    html += "				<tr>";
    html += "					<td class='radiobtnstd'>";
    html += "						<table class='radiobtns' cellpadding='0' cellspacing='0'>";
    html += "                           <tr>";
    html += "                               <td class='jsf_radiobtns_headline'>Get Free Quotes<\/td>";
    html += "                           <\/tr>";
    html += "	                        <tr>";
    html += "	                            <td class='radiobtns'><input type='radio' name='serviceType' onclick=\"ServiceType_change('Moving')\" checked='checked' \/>Moving<\/td>";
    html += "					        <\/tr>";
    html += "				            <tr>";
    html += "                               <td class='radiobtns'><input type='radio' name='serviceType' onclick=\"ServiceType_change('Storage')\" \/>Storage<\/td>";
    html += "                           <\/tr>";
    html += "	                        <tr>";
    html += "                               <td class='radiobtns'><input type='radio' name='serviceType' onclick=\"ServiceType_change('Auto Transport')\" \/>Auto Transport<\/td>";
    html += "                           <\/tr>";
    html += "                           <tr><td class='bot_line'><\/td><\/tr>";
    html += "						<\/table>";
    html += "					<\/td>";
    html += "				<\/tr>";
    html += "                <tr>";
    html += "                    <td class='jsf_body'>";
    html += "			            <table width='100%' cellpadding='0' cellspacing='0' border='0'>";
    html += "            				<tr>";
    html += "			            		<td width='300px'><span id='spnErrors' class='ErrorMessage' >The fields marked in red are missing or invalid<\/span><\/td>";
    html += "            				<\/tr>";
    html += "			            	<tr>";
    html += "			            		<td class='mainareatbl_td'>";
    html += "						                <div id='divMoving' style='display:block'>";
    html += "			            				<table class='svcstbl_' cellpadding='0' cellspacing='0'>";
    html += "		            						<tr>";
    html += "								            	<td>Select Moving Service<br \/>";
    html += "								            		<select id='ddlMovingType' class='ddlStyle' onchange=\"MovingTypeChange(this.value)\" onkeyup=\"MovingTypeChange(this.value)\">";
    html += "					            						<option value='1001'>Full Service<\/option>";
    html += "			            								<option value='1013'>ULoad<\/option>";
    html += "										            	<option value='1000'>International<\/option>";
    html += "									            	<\/select>";
    html += "									            <\/td>";
    html += "								            <\/tr>";
    html += "								<tr>";
    html += "									<td><div id='trMovingZipCode' style='display:block'>Moving From Zip Code<br \/>";
    html += "									            	<input type='text' maxlength='5' class='txtStyle' id='txtMovingZipCode' \/>";
    html += "									<\/div><\/td>";
    html += "							            	<\/tr>";
    html += "								<tr>";
    html += "									<td><div id='trMovingToState' style='display:block'>Moving To State<br \/>";
    html += "									            	<select id='ddlMovingToState' class='ddlStyle' onchange=\"AddJS(this.value);setTimeout('', 2000);\"><\/select>";
    html += "									<\/div><\/td>";
    html += "							            	<\/tr>";
    html += "								<tr>";
    html += "									<td><div id='trMovingFromCountry' style='display:none;height:34px'>Moving From Country<br \/>";
    html += "								            		<select id='ddlMovingFromCountry' class='ddlStyle'><\/select>";
    html += "									<\/div><\/td>";
    html += "						            		<\/tr>";
    html += "								<tr>";
    html += "									<td><div id='trMovingToCountry' style='display:none'>Moving To Country<br \/>";
    html += "									            	<select id='ddlMovingToCountry' class='ddlStyle'><\/select>";
    html += "									<\/div><\/td>";
    html += "								            <\/tr>";
    html += "								            <tr>";
    html += "									            <td>Size Of Move<br \/>";
    html += "										            <select id='ddlMovingSize' class='ddlStyle'>";
    html += "									            	<option value='0000'>Select Weight<\/option>";
    html += "		                                            <option value='0602'>Studio 1500 lbs<\/option>";
    html += "                                                    <option value='0604'>1 BR Small 3000 lbs<\/option>";
    html += "		                                            <option value='0605'>1 BR Large 4000 lbs<\/option>";
    html += "		                                            <option value='0606'>2 BR Small 4500 lbs<\/option>";
    html += "		                                            <option value='0607'>2 BR Large 6500 lbs<\/option>";
    html += "		                                            <option value='0608'>3 BR Small 8000 lbs<\/option>";
    html += "		                                            <option value='0609'>3 BR Large 9000 lbs<\/option>";
    html += "		                                            <option value='0610'>4 BR Small 10000 lbs<\/option>";
    html += "		                                            <option value='0612'>4 BR Large 12000 lbs<\/option>";
    html += "		                                            <option value='0611'>Over 12000 lbs<\/option>";
    html += "									            	<\/select>";
    html += "									           <\/td>";
    html += "							            	<\/tr>";
    html += "							          <\/table>";
    html += "					            	<\/div>";
    html += "						<div id='divStorage' style='display:none'>";
    html += "							           <table class='svcstbl_' cellpadding='0' cellspacing='0'>";
    html += "							        	    <tr>";
    html += "									          <td>Storage Type<br \/>";
    html += "										           <select id='ddlStorageType' class='ddlStyle'>";
    html += "											            <option value='0'>Select Type<\/option>";
    html += "											            <option value='1010'>Self Storage<\/option>";
    html += "											            <option value='1022'>Mobile Storage<\/option>";
    html += "									            	<\/select>";
    html += "								            	<\/td>";
    html += "							        	    <\/tr>";
    html += "							            	<tr>";
    html += "								              	<td>Storage Zip Code<br \/>";
    html += "									            	<input type='text' maxlength='5' class='txtStyle' id='txtStorageZipCode' \/>";
    html += "								            	<\/td>";
    html += "							        	    <\/tr>";
    html += "							            <\/table>";
    html += "					        	    <\/div>";
    html += "						<div id='divAuto' style='display:none'>";
    html += "							            <table class='svcstbl_' cellpadding='0' cellspacing='0'>";
    html += "                                            <tr>";
    html += "                                                <td>Shipping Zip Code<br \/>";
    html += "									    	        <input type='text' maxlength='5' class='txtStyle' id='txtAutoZipCode' \/>";
    html += "                                                <\/td>";
    html += "                                            <\/tr>";
    html += "                                            <tr>";
    html += "                                                <td>State Shipping To<br \/>";
    html += "                                                    <select id='ddlAutoToState' class='ddlStyle' onchange=\"AddJS(this.value);setTimeout('', 2000);\"><\/select>";
    html += "                                                <\/td>";
    html += "                                            <\/tr>";
    html += "                                        <\/table>";
    html += "                                    <\/div>";
    html += "                                <\/td>";
    html += "                            <\/tr>";
    html += "                        <\/table>";
    html += "                    <\/td>";
    html += "                <\/tr>";
    html += "                <tr>";
    html += "                    <td class='tdSubmitButton'>";
    html += "                        <img src='http://www.relocation.com/files/buttons/v1003_getquote.jpg' onclick='SubmitForm()'  \/>";
    html += "                    <\/td>";
    html += "                <\/tr>";
    html += "                <tr>";
    html += "                    <td class='tdpwd_by'>";
    html += "                        <a href='http://www.relocation.com/' target='_blank'><img src='http://www.relocation.com/files/relo_powered_by_2.jpg' border='0' alt='Powered by Relocation.com'  \/><\/a>";
    html += "                    <\/td>";
    html += "                <\/tr>";
    html += "            <\/table>";
    html += "        <\/td>";
    html += "    <\/tr>";
    html += "<\/table>";
    html += "<\/div>";


    if (IsDev || IsExtLinkValid()) {
        SHElement('reloLink', 'none');
        document.write(html);
        setTimeout("Init();", 1500);
    }
}
function IsExtLinkValid() {
    var error = '';

    var lnk = document.getElementById('reloLink');
    if (lnk == null) {
        error = 'Link to Relocation.com does not exists on the page';
        document.write(error);
        return false;
    }

    if (lnk.innerHTML != 'Moving Companies') {
        error += 'Link has invalid anchor tag. it must be Moving Companies.<br />';
    }

    if (lnk.href != 'http://www.relocation.com/') {
        error += 'Link does not point to http://www.relocation.com';
    }

    if (lnk.style.display == 'none') {
        error += 'Link is hidden';
    }

    if (lnk.style.visibility == 'hidden') {
        error += 'Link is hidden';
    }

    if (error != '') {
        document.write(error);
        return false;
    }
    else {
        return true;
    }
}



