﻿/*

A small function library made by Coded Gems
http://www.codedgems.com

Used to easily attach mouseover events and onfocus states for elements.

*/
function cg_prep(){
    $("input[oc!='']").each(function() {
        var t;
        t = $(this);
        if (t.attr("oc") != undefined) {
            t.val(t.attr("oc"));
            $(this).focus(function() { if (this.value == t.attr("oc")) { this.value = ''; } });
            $(this).blur(function() { if (this.value == '') { this.value = t.attr("oc"); } });
        }
    });

    $("input[cgover!='']").each(function() {
        var t;
        t = $(this);
        if (t.attr("cgover") != undefined) {
            t.attr("orig", t.attr("src"));

            $(this).mouseover(function() { this.src = t.attr("cgover"); });
            $(this).mouseout(function() { this.src = t.attr("orig"); });
        }
    });
    $("img[cgover!='']").each(function() {
        var t;
        t = $(this);
        if (t.attr("cgover") != undefined) {
            t.attr("orig", t.attr("src"));

            $(this).mouseover(function() { this.src = t.attr("cgover"); });
            $(this).mouseout(function() { this.src = t.attr("orig"); });
        }
    });
}