//This function is used to submit login form $('#login_form form').live('submit', function() { if($.active > 0) { //or $.active return false; } else { $('.blueButton').attr('disabled', 'disabled'); var login_type = $('input:radio[name=member_type]:checked').val(); var referral_url = $('#referral_url').val(); // alert($(this).serialize()); // alert(login_type); // alert(document.domain); $.ajax({ type: $(this).attr('method'), url: $(this).attr('action'), data:$(this).serialize(), dataType: 'json', success: function(response) { $('.blueButton').removeAttr('disabled', 'disabled'); var login_error = response.login_error; if(login_error=='yes') { var dialog_title = response.dialog_title; var dialog_message = response.dialog_message; var $dialog = $("
") .html("

"+dialog_message+"

") .dialog({ autoOpen: false, modal:true, title: dialog_title, width: 500, buttons:{ 'OK': function() { $(this).dialog('close'); } } }); $dialog.dialog('open'); } else if(login_error=='no') { // if($.trim(referral_url)!='') if ( ($.trim(referral_url)!='') && ( (referral_url.indexOf("entrepreneur_tools") > -1) || (referral_url.indexOf("investor_tools") > -1) ) ) window.location.replace("http://"+document.domain+"/"+referral_url); else window.location.replace(login_type+"_tools"); } } }); return false; } }); //This function is used to submit forgot password form $('#forgot_password form').live('submit', function() { if($.active > 0) { //or $.active return false; } else { $('#submit_forgot_pass').attr('disabled', 'disabled'); var email_address = $("#email_address").val(); var login_type = $('input:radio[name=login_type]:checked').val(); // alert('login_type:'+login_type); $.ajax({ type: $(this).attr('method'), url: $(this).attr('action'), data: $(this).serialize(), dataType: 'json', success: function(response) { $('#submit_forgot_pass').removeAttr('disabled', 'disabled'); var email_ok = response.email_ok; var send_ok = response.send_ok; if (email_ok == "no") { var $dialog = $("
") .html("

"+response.dialog_message+"

") .dialog({ autoOpen: false, modal:true, title: response.dialog_title, width: 500, buttons:{ 'OK': function() { $(this).dialog('close'); } } }); $dialog.dialog('open'); } else if (send_ok == "yes") { var $dialog = $("
") .html("

"+response.dialog_message+"

") .dialog({ autoOpen: false, modal:true, title: response.dialog_title, width: 500, buttons:{ 'OK': function() { $(this).dialog('close'); } } }); $dialog.dialog('open'); } else if (send_ok == "no") { var $dialog = $("
") .html("

"+response.dialog_message+"

") .dialog({ autoOpen: false, modal:true, title: response.dialog_title, width: 500, buttons:{ 'OK': function() { $(this).dialog('close'); } } }); $dialog.dialog('open'); } } }); return false; } }); function show_forgot_password_form() { var login_type = $('input:radio[name=member_type]:checked').val(); var email_address = $('input[name=login_user]').val(); var block_visibility = document.getElementById('forgot_password').style.display; if(block_visibility=='none') { $('#login_form').hide(); $('#forgot_password').show(); $('#forgot_password input[name=login_type]').filter("[value="+login_type+"]").click(); $('#forgot_password input[name=email_address]').val(email_address); $('#forgot_password input[name=email_address]').focus(); } return false; } function show_login_form() { var block_visibility = document.getElementById('login_form').style.display; if(block_visibility=='none') { $('#forgot_password').hide(); $('#login_form').show(); } } function vticker() { //cache the ticker var ticker = $("#vticker"); //wrap dt:dd pairs in divs ticker.children().filter("dt").each(function() { var dt = $(this); var container = $("
"); dt.next().appendTo(container); dt.prependTo(container); container.appendTo(ticker); }); //hide the scrollbar ticker.css("overflow", "hidden"); //animator function function animator(currentItem) { //work out new anim duration var distance = currentItem.height(); duration = (distance + parseInt(currentItem.css("marginTop"))) / 0.025; //animate the first child of the ticker currentItem.animate({ marginTop: -distance }, duration, "linear", function() { //move current item to the bottom currentItem.appendTo(currentItem.parent()).css("marginTop", 0); //recurse animator(currentItem.parent().children(":first")); }); }; //start the ticker animator(ticker.children(":first")); //set mouseenter ticker.mouseenter(function() { //stop current animation ticker.children().stop(); }); //set mouseleave ticker.mouseleave(function() { //resume animation animator(ticker.children(":first")); }); }; $("#forgot_pass_link").click(function(e) { var block_visibility = document.getElementById('login_form').style.display; if(block_visibility=='none') { $('#forgot_password').hide(); $('#login_form').show(); } // e.preventDefault(); }); $(window).load(function() { $("div#scrollingText").smoothDivScroll({autoScroll: "always", autoScrollDirection: "endlessloopright", autoScrollStep: 1, autoScrollInterval: 15}); $("div#scrollingText").bind("mouseover", function(){ $("div#scrollingText").smoothDivScroll("stopAutoScroll"); }); $("div#scrollingText").bind("mouseout", function(){ $("div#scrollingText").smoothDivScroll("startAutoScroll"); }); }); $(window).load(function(){vticker()});