﻿//Params: swf file name, id, width, height, flash version, bg color
var $url = location.href;
function init_swf_content() {
//var eso = new SWFObject("flash/empty.swf", "latisse_intro_brooke_empty", "1", "1", "8", "#000000");

//if (gethtmlVersion() != "true") {
//    eso.write("flash_content");
//}
    if ($("#real_flash_content").html().indexOf(".swf") == -1) {
        $("#real_flash_content").hide();
        $("#flash_content").show();
//        fadeInFooter();
    }
    else {
        $("#real_flash_content").show();
        $("#flash_content").html('');
//        fadeInFooter();
    }
    $.cookie("isHavecome", "true");
}

function getQueStr(url, ref) {
    var str = url.substr(url.indexOf('?') + 1);
    if (str.indexOf('&') != -1) {
        var arr = str.split('&');
        for (i in arr) {

            if (arr[i].split('=')[0] == ref)
                return arr[i].split('=')[1];
        }
    }
    else {
        return url.substr(url.indexOf('=') + 1)
    }
}
//var ishide = false;
var picurl, newurl;
$(function() {
    $(".menu2").hover(function() {
        picurl = $(this).find("img").eq(0).attr("src");
        newurl = picurl.replace("off", "over");
        $(this).find("img").eq(0).attr("src", newurl);
        $(this).find(".home_sec_ul").animate({ "opacity": 0.8 }, 600);
    }, function() {
        $(this).find("img").eq(0).attr("src", picurl);
        ishide = false;
        $(this).find(".home_sec_ul").animate({ "opacity": 0 }, 1);
    })
})

//function fadeInFooter() {
//    if (getQueStr($url, "return") == "true" || $.cookie('isHavecome') == "true") {
////    if (getQueStr($url, "return") == "true") {
//        $(".fade_txt").fadeIn(1);
//        $(".footer").fadeIn(1);
//    }
//    else {
//        $(".fade_txt").fadeIn(1000);
//        $(".footer").fadeIn(1000);
//    }
//}


//globle find a doctor
$(function() {
    $("#floatBoxBg").animate({ "opacity": 0 }, 1);
    $(".zip_go > input").mouseover(function() {
        if ($(this).val() == "Zip Code") {
            $(this).val("");
            $(this).focus();
        }
    }).mouseout(function() {
        if ($(this).val() == "") {
            $(this).val("Zip Code");
        }
    });
    $(".zip_go > img").click(function() {
        if ($(".zip_go > input").val() != "") {
            var reg = new RegExp("^[0-9]{5}");
            if (reg.test($(".zip_go > input").val())) {
                $(".zip_go > input").removeClass("input_err");
            }
            else {
                $(".zip_go > input").addClass("input_err");
            }
        }
        else {
            $(".zip_go > input").addClass("input_err");
        }
        location.href = "FindaDoctor.aspx?state=15";
    });
});
$.pageWidth = function() {
    return window.innerWidth != null ? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
}

$.pageHeight = function() {
    return window.innerHeight != null ? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null ? document.body.clientHeight : null;
}