function sc_findStores(address,url) {
    var sc_zippattern = /^[0-9]{5}(-[0-9]{4})?$/;
    if (address != '') { address = address.replace(/^\s+|\s+$/g, ''); }
    if (!sc_zippattern.test(address)) { address = ''; }
    window.location = 'http://www.olukai.com/DealerLocator.aspx?address=' + escape(address);
}
function sc_handleStoreFocus(obj) {
    if (obj.value == 'enter postal code')
        obj.value = '';
}
function sc_handleGeneralClick(title,obj) {
    $(document).ready(function()
    {
        tb_remove();
        tb_show(title, obj.href + '?KeepThis=true&TB_iframe=true&height=465&width=590',null);
    });
    return false;
}
function sc_handleProductClick(obj) {
    sc_handleGeneralClick('Product Detail',obj);
}
function sc_handleSubscribe(obj) {
	var emailpattern = /^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+([;.](([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+)*$/;
	var email = document.getElementById('subscribe').value;
	if (email != '') { email = email.replace(/^\s+|\s+$/g, ''); }
	if (!emailpattern.test(email)) { email = ''; }
	window.location = 'http://www.olukai.com/Subscribe.aspx?email=' + escape(email);
}
function sc_handleSubscribeFocus(obj) {
    if (obj.value == 'enter email')
        obj.value = '';
}
function sc_updateCartStatus() {
	var t = cookieCart.itemCount();
    document.getElementById('cartQuantityStatus').innerHTML = t;
	if (t == 0) { document.getElementById('topnav_checkout_container').style.display='none'; }
	else { document.getElementById('topnav_checkout_container').style.display='inline'; }
}

$.preload([
    'product_h',
    'about_h',
    'design_h',
    'ohana_h',
    'news_h',
    'faq_h'
    ], {
    base:document.location.protocol + '//s3.amazonaws.com/web.hubsoft.com/olukai/images/',
    ext:'.png'
});
