function voidLink(){
	//empty function for blank links
}

function zipmatch(zipcode) {
    var re = /^((\d{5}-\d{4})|(\d{5})|([AaBbCcEeGgHhJjKkLlMmNnPpRrSsTtVvXxYy]\d[A-Za-z]\s?\d[A-Za-z]\d))$/
    if (zipcode.match(re)) {
    	return 1;
    } else {
    	return 0;
    }
}

function validate_zip(){
    if($('#zipcode').val() == ""){
    	alert("Please enter your zip code.");
    	return false;
    } else if (!zipmatch($('#zipcode').val())){
    	alert("Please enter a valid zip code.");
    	return false;
    } else
        return true;
}

function int_poi(hover) {
    var $item = '';
    initialize();
    $('.map-content .map-item').mouseenter(function(){
        var info_raw = unescape($(this).attr('ref')).replace(/\+/g, " ");
        var info = info_raw.split('||');
        codeAddress(info[0], info[3], info[1], info[2], info[4], 'click', hover);
    });

    $item = $('.map-content .map-item');
    $.each($item, function(){
        var info_raw = unescape($(this).attr('ref')).replace(/\+/g, " ");
        var info = info_raw.split('||');
        codeAddress(info[0], info[3], info[1], info[2], info[4], '', hover);
    });
}

function int_wheels(id, obj) {
    var ref = (id > 0) ? id : $('#wheels-top .wheels-make .items:first').css({'border-left': '8px solid #00eb64'}).attr('ref');
    $.post("/_ajax_wheels.php", {'id' : ""+ref+"", 'type' : "1"}, function(dat){
        var $_this = $('#wheels-top .wheels-model .model-container');
        if(dat.length > 0) {
            if(obj)
                obj.empty();
            $_this.html(dat).fadeIn(200, function() {
               int_details();
               $('#wheels-top .wheels-model .items:first').triggerHandler('click');
          });
        }
        else
            $_this.html('<div class="items-error">Sorry, no results found.</div>');
    });
}

function int_details() {
    $('#wheels-top .wheels-model .items').unbind().click(function() {
        $('#wheels-top .wheels-model .items').css({'border-left': '8px solid #F3F3F3'});
        $(this).css({'border-left': '8px solid #00eb64'});
        var ref = $(this).attr('ref');
        $.post("/_ajax_wheels.php", {'id' : ""+ref+"", 'type' : "2"}, function(data){
        if(data.length > 0) {
            $('#wheels-top .wheels-detail .block-wheel-box').html(data).fadeIn(200, function() {
               $('a.fancybox').fancybox({
                    'overlayColor'		: '#000'
                });
            });
        }
        else
            $('#wheels-top .wheels-detail .block-wheel-box').html('<div class="items-error">Sorry, no results found.</div>');
        });
    });
}

function isValidEmail(input){
	return true;
}
