﻿
function TableRowClickable() {
    jQuery('.stock-list tbody tr').click(function () {
        window.open(jQuery("td.stock a", this).attr('href'), 'newwin').focus();
        return false;
    });
}



jQuery(document).ready(function () {

    TableRowClickable();

    PEPS.rollover.init();





    var watermark = "Your Email Address";

    if (jQuery(".subscriber-email").val() == "") {

        jQuery(".subscriber-email").val(watermark);

    }

    jQuery(".subscriber-email").focus(function () {

        if (this.value == watermark) {

            this.value = "";

        }

    }).blur(function () {

        if (this.value == "") {

            this.value = watermark;

        }

    });
});



PEPS = {};

PEPS.rollover =
{
    init: function () {
        this.preload();

        jQuery(".ro").hover(
         function () { jQuery(this).attr('src', PEPS.rollover.newimage(jQuery(this).attr('src'))); },
         function () { jQuery(this).attr('src', PEPS.rollover.oldimage(jQuery(this).attr('src'))); }
      );
    },

    preload: function () {
        jQuery(window).bind('load', function () {
            jQuery('.ro').each(function (key, elm) { jQuery('<img>').attr('src', PEPS.rollover.newimage(jQuery(this).attr('src'))); });
        });
    },

    newimage: function (src) {
        return src.substring(0, src.search(/(\.[a-z]+)$/)) + '_o' + src.match(/(\.[a-z]+)$/)[0];
    },

    oldimage: function (src) {
        return src.replace(/_o\./, '.');
    }
};


// Postback
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
