// SafetyPay Custom Scripts

$(document).ready(function() {
    //debugger;
    // jFlow setup
    var currentSlice = 0; //welcome is the default
    if (window.location.href.indexOf('?view=shopper') != -1) {
        currentSlice = 1

    }
    else
        if (window.location.href.indexOf('?view=e-merchants') != -1) {
        currentSlice = 2

    }
    else
        if (window.location.href.indexOf('?view=banks') != -1) {
        currentSlice = 3

    }
    $("#jFlowController").jFlow({
        slides: "#jFlowSlides",
        controller: ".jFlowControl",
        slideWrapper: "#jFlowSlide",
        selectedWrapper: "jFlowSelected",
        cur: currentSlice,
        width: "960px",
        height: "300px",
        duration: 200
        // prev: ".jFlowPrev",
        // next: ".jFlowNext"
    });

    $("#jFlowController2").jFlow({
        slides: "#jFlowSlides2",
        controller: ".jFlowControl2",
        slideWrapper: "#jFlowSlide2",
        selectedWrapper: "jFlowSelected2",
        width: "477px",
        height: "274px",
        duration: 200,
        prev: ".jFlowPrev2",
        next: ".jFlowNext2"
    });

    //$(".selector-content").hide();
    $("#language-selector").hover(
		function() {
		    $(this).addClass("language-selected");
		    $("#language-selector-content").show();
		},
		function() {
		    $(this).removeClass("language-selected");
		    $("#language-selector-content").hide();
		}
	);

    $("#country-selector").hover(
		function() {
		    $(this).addClass("country-selected");
		    $("#country-selector-content").show();
		},
		function() {
		    $(this).removeClass("country-selected");
		    $("#country-selector-content").hide();
		}
	);
});