﻿//registerwatermark onload, just in case it wasn't registered in the usercontrol.
$(document).ready(registerWatermark);
var hasWatermarkRegistered = false; var swapValues = []; var swapResolverValues = [];
function registerWatermark() {
    if (!hasWatermarkRegistered) {
        $(".watermark").each(function(i) {
            swapValues[i] = $(this).val();
            $(this).focus(function() {
                
                resetResolvedFields();
                if ($(this).val() == swapValues[i]) {
                    $(this).val("")
                }
            }).blur(function() {
                if ($.trim($(this).val()) == "") { rollbackResolvedFields(); $(this).val(swapValues[i]) }
            })
        }); 
 hasWatermarkRegistered = true; } }
function resetResolvedFields() { $(".resolver").each(function(i) { swapResolverValues[i] = $(this).val(); $(this).val('') }); }
function rollbackResolvedFields() { $(".resolver").each(function(i) { $(this).val(swapResolverValues[i]); }); }

function showDialog(selector, delay) {
    
    $(selector + '_test').facebox();
   
}
