var watermarkClassName = "watermarked"; (function ($) { $.fn.watermark = function (settings) { var defaults = { className: watermarkClassName, text: this.val() }; settings = $.extend({}, defaults, settings); if ($(this).val().length == 0 || $(this).val() === settings.text) { $(this).addClass(settings.className); $(this).val(settings.text) } this.focus(function () { $(this).removeWatermark({ className: settings.className, text: settings.text }) }); this.blur(function () { $(this).addWatermark({ className: settings.className, text: settings.text }) }); var id = this.attr("id"); this.parents("form:first").submit(function () { $("#" + id).removeWatermark({ className: settings.className, text: settings.text }) }) }; $.fn.addWatermark = function (settings) { var defaults = { className: watermarkClassName, text: this.val() }; settings = $.extend({}, defaults, settings); if (this.val().length == 0 || this.val() === settings.text) { this.addClass(settings.className); this.val(settings.text) } }; $.fn.removeWatermark = function (settings) { var defaults = { className: watermarkClassName, text: this.val() }; settings = $.extend({}, defaults, settings); if (this.hasClass(settings.className) && this.val() === settings.text) { this.removeClass(settings.className); this.val("") } } })(jQuery); jQuery.fn.highlightFade = function (settings) { var o = (settings && settings.constructor == String) ? { start: settings} : settings || {}; var d = jQuery.highlightFade.defaults; var i = o['interval'] || d['interval']; var a = o['attr'] || d['attr']; var ts = { 'linear': function (s, e, t, c) { return parseInt(s + (c / t) * (e - s)) }, 'sinusoidal': function (s, e, t, c) { return parseInt(s + Math.sin(((c / t) * 90) * (Math.PI / 180)) * (e - s)) }, 'exponential': function (s, e, t, c) { return parseInt(s + (Math.pow(c / t, 2)) * (e - s)) } }; var t = (o['iterator'] && o['iterator'].constructor == Function) ? o['iterator'] : ts[o['iterator']] || ts[d['iterator']] || ts['linear']; if (d['iterator'] && d['iterator'].constructor == Function) t = d['iterator']; return this.each(function () { if (!this.highlighting) this.highlighting = {}; var e = (this.highlighting[a]) ? this.highlighting[a].end : jQuery.highlightFade.getBaseValue(this, a) || [255, 255, 255]; var c = jQuery.highlightFade.getRGB(o['start'] || o['colour'] || o['color'] || d['start'] || [255, 255, 128]); var s = jQuery.speed(o['speed'] || d['speed']); var r = o['final'] || (this.highlighting[a] && this.highlighting[a].orig) ? this.highlighting[a].orig : jQuery.curCSS(this, a); if (o['end'] || d['end']) r = jQuery.highlightFade.asRGBString(e = jQuery.highlightFade.getRGB(o['end'] || d['end'])); if (typeof o['final'] != 'undefined') r = o['final']; if (this.highlighting[a] && this.highlighting[a].timer) window.clearInterval(this.highlighting[a].timer); this.highlighting[a] = { steps: ((s.duration) / i), interval: i, currentStep: 0, start: c, end: e, orig: r, attr: a }; jQuery.highlightFade(this, a, o['complete'], t) }) }; jQuery.highlightFade = function (e, a, o, t) { e.highlighting[a].timer = window.setInterval(function () { var newR = t(e.highlighting[a].start[0], e.highlighting[a].end[0], e.highlighting[a].steps, e.highlighting[a].currentStep); var newG = t(e.highlighting[a].start[1], e.highlighting[a].end[1], e.highlighting[a].steps, e.highlighting[a].currentStep); var newB = t(e.highlighting[a].start[2], e.highlighting[a].end[2], e.highlighting[a].steps, e.highlighting[a].currentStep); jQuery(e).css(a, jQuery.highlightFade.asRGBString([newR, newG, newB])); if (e.highlighting[a].currentStep++ >= e.highlighting[a].steps) { jQuery(e).css(a, e.highlighting[a].orig || ''); window.clearInterval(e.highlighting[a].timer); e.highlighting[a] = null; if (o && o.constructor == Function) o.call(e) } }, e.highlighting[a].interval) }; jQuery.highlightFade.defaults = { start: [255, 255, 128], interval: 50, speed: 400, attr: 'backgroundColor' }; jQuery.highlightFade.getRGB = function (c, d) { var result; return jQuery.highlightFade.checkColorName(c) || d || null }; jQuery.highlightFade.asRGBString = function (a) { return "rgb(" + a.join(",") + ")" }; jQuery.highlightFade.getBaseValue = function (e, a, b) { var s, t; b = b || false; t = a = a || jQuery.highlightFade.defaults['attr']; do { s = jQuery(e).css(t || 'backgroundColor'); if ((s != '' && s != 'transparent') || (e.tagName.toLowerCase() == "body") || (!b && e.highlighting && e.highlighting[a] && e.highlighting[a].end)) break; t = false } while (e = e.parentNode); if (!b && e.highlighting && e.highlighting[a] && e.highlighting[a].end) s = e.highlighting[a].end; if (s == undefined || s == '' || s == 'transparent') s = [255, 255, 255]; return jQuery.highlightFade.getRGB(s) }; jQuery.highlightFade.checkColorName = function (c) { if (!c) return null; switch (c.replace(/^\s*|\s*$/g, '').toLowerCase()) { case 'lightred': return [231, 91, 91]; case 'lightgreen': return [144, 238, 144] } }; function isMarketOpen() { now = new Date(); hour = now.getHours(); day = now.getDay(); minute = now.getMinutes(); var openTime = 540; var closeTime = 1051; var actualTime = hour * 60 + minute; if (day == 0 || day == 6) return false; if ((actualTime < openTime) || (actualTime > closeTime)) return false } var popupStatus = 0; function loadPopupHelp(path) { if (popupStatus == 0) { $("#backgroundPopupHelp").css({ "opacity": "0.7" }).fadeIn("slow"); $("#helpContent").load("../help/" + path); $("#popupHelp").fadeIn("slow"); popupStatus = 1 } } function disablePopupHelp() { if (popupStatus == 1) { $("#backgroundPopupHelp").fadeOut("slow"); $("#popupHelp").fadeOut("slow"); popupStatus = 0 } } function centerPopupHelp() { var windowWidth = document.documentElement.clientWidth; var windowHeight = document.documentElement.clientHeight; var $popup = $("#popupHelp"); var popupHeight = $popup.height(); var popupWidth = $popup.width(); var top = windowHeight / 2 - popupHeight / 2; if (top < 100) { top = 100 } $popup.css({ "position": "absolute", "top": top, "left": windowWidth / 2 - popupWidth / 2 }); $("#backgroundPopupHelp").css({ "height": windowHeight }) } sas_tmstp = Math.round(Math.random() * 10000000000); sas_masterflag = 1; function SmartAdServer(sas_pageid, sas_formatid, sas_target) { if (sas_masterflag == 1) { sas_masterflag = 0; sas_master = 'M' } else { sas_master = 'S' }; document.write('<scr' + 'ipt src="http://www4.smartadserver.com/call/pubj/' + sas_pageid + '/' + sas_formatid + '/' + sas_master + '/' + sas_tmstp + '/' + escape(sas_target) + '?"></scr' + 'ipt>') }
