/* ============================================================================================
 * Copyright (c) 2008 Muhammet TURŞAK (tursoft@gmail.com, www.tursoft.net)
 * Dual licensed
 *   - GPL http://www.gnu.org/licenses/gpl.html and 
 *   - MIT http://www.opensource.org/licenses/mit-license.php
 
===============================================================================================
# INFORMATION and META DATA ABOUT LIBRARY
-----------------------------------------------------------------------------------------------
NAME                : MyTextboxEffects
VERSION             : v1.0
UPDATE DATE         : 23.11.2008

AUTHOR              : Muhammet TURŞAK (tursoft@gmail.com, www.tursoft.net)
DESCRIPTION         : A jquery plugin change appearence of form input controls 
LICENSING           : 
            - GPL http://www.gnu.org/licenses/gpl.html and 
            - MIT http://www.opensource.org/licenses/mit-license.php

DEPENDENT FILES     : 
    - jquery-1.2.6.js  (or higher)
    - tursoft.shared.v1.1.js
    - default.css (MyTextboxEffects styles)

TESTED BROWSERS     : IE 8 Beta, Firefox 3.0.4

KNOWN BUGS / ISSUES : 
    - No known bugs or issues
    
===============================================================================================
# DOCUMENTATION
-----------------------------------------------------------------------------------------------
SUPPORTED TAGS      : *

METHODS             : 
    - MyTextboxEffects()
        Function Options; 
            - <empty>
             		
		Source Attributes;
		    - <empty>   
 ============================================================================================ */
 
(function($){

	// ==================================================================
	var $$ = $.fn.MyTextboxEffects = function() {

		return $(this).each(function() {
							var $this=$(this);
							$this.$=function() {};
							$this.$.ID=this.id;
	
							$$.onParseData($this);
							$$.onInitView($this);
						});
	};

	// ==================================================================
	$$.SupportedTags=new Array();
	$$.isSupportedTag=function($this) {
		if ($$.SupportedTags.length<=0)
			return true;
		
		var i=0;
		for(i=0;i<$$.SupportedTags.length;i++)
		{
			if ($this[0].nodeName.toUpperCase()==$$.SupportedTags[i].toUpperCase())
				return true;
		}
		
		return false;
	};
	
	$$.onParseData=function($this) {
		// check tagname is supported
		if (!$$.isSupportedTag($this))
			return;
		
		// parseData
		var tagName=$this[0].nodeName.toLowerCase().trim();
	};

	// ==================================================================
	$$.onInitView=function($this) {
		$this.addClass("TextboxEffects_normal");
		
		$this.focus(function(){
				$this.addClass("TextboxEffects_focused");			 
			});
		
		$this.blur(function(){
				$this.removeClass("TextboxEffects_focused");			 
			});		
	}
		
})(jQuery);
