/* Generato automaticamente con Jyingo in data 15-01-2008 02:33 */ 

/*
 * Jyingo, PHP Ajax Toolkit http://www.jyingo.com
 * Copyright 2007-2008 by SiberianSTAR aka Andrea Pezzino
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */

jyingo.autocomplete = function(name, element)
{
		
	jyingo.initializeBase(name, this, element);
	
	this.update_interval = null;
  this.last_update = null;
  this.minlength = null;
  this.visible = false;
  this.classprefix = null;
  
  this.animation_scale = null;
  this.animation_fade = null;
  
  this.div_element = null;
  
  this.keyup_handler = null;
  this.blur_handler = null;
  this.autocompletecb_handler = null;
  this.animationend_handler = null;
  
  this.arr_values = null;
  
}

jyingo.autocomplete.prototype = {
	
	initialize : function(params_json)
	{
		
		 var params = eval('(' + unescape(params_json) + ')');
		 
		 this.update_interval = params['update_interval'];
		 this.minlength       = params['minlength'];
		 this.classprefix     = params['classprefix'];
		 this.last_update     = 0;
		 
		 this.keyup_handler = Function.createDelegate(this, this.keyup);
		 this.blur_handler = Function.createDelegate(this, this.blur);
		 this.load_handler = Function.createDelegate(this, this.load);
		 this.autocompletecb_handler = Function.createDelegate(this, this.autocomplete_cb);
		 this.animationend_handler = Function.createDelegate(this, this.animationend);
		 jyingo.addEvent( this.get_element(),
		                  'keyup',
		                  this.keyup_handler );

		 jyingo.addEvent( this.get_element(),
		                  'blur',
		                  this.blur_handler );
		          
	   if (jyingo.is_postback == false)
	    jyingo.addEvent( window,
	                     'load',
	                     this.load_handler );   
	   else
	    this.load();	
		 	                  
	 
	},
	
  load : function()
  {
    var el = document.createElement('div');
	  el.id = 'ctl_ac_'+this.get_name();
	  
	  if (document.body)
	   document.body.appendChild(el);
	  else
	   document.documentElement.appendChild(el);		   
	  
	  el.style.className = this.classprefix;
	  el.style.position = 'absolute';
	  el.style.top = '0px';
	  el.style.left='0px';
	  el.style.zIndex='9999';
	  el.style.visibility='hidden';
	  el.className = this.classprefix;

	  this.div_element = el;   
	  
	  var animation_scale = new jyingo.animations(this.get_name()+'_animationscale', this.div_element);
	  var arr = new Array();
	  arr['duration'] = 250;
	  arr['animation_type'] = 'scale_y';
	  arr['begin_value'] = 0;
	  arr['end_value'] = 0;
	  arr['current_val'] = 0;
	  arr['catch_events'] = false;
	  
	  animation_scale.initialize(arr);
	  
	  this.animation_scale = animation_scale;
	  
	  var animation_fade = new jyingo.animations(this.get_name()+'_animationfade', this.div_element);
	  arr['animation_type'] = 'fade';
	  animation_fade.initialize(arr);
	  
	  this.animation_fade = animation_fade;
	  
	  if (jyingo.is_postback == false)
	  jyingo.removeEvent( window,
	                      'load',
	                      this.load_handler );
	      	
  },
	
	animationend : function()
	{
    if ( this.div_element != null )
	   this.div_element.style.visibility='hidden';	
	  this.animation_scale.client_end = null;
	},
	
	keyup : function()
	{
		var k = this.get_element().value;
		var current = new Date().valueOf();
		
		if (current-this.last_update < this.update_interval)
		 return;
		
		if (this.get_element().value.length < this.minlength)
		{
			if (this.visible == true)
			{
				 this.div_element.style.visibility='hidden';
				 this.visible=false;
			}
			return;
		}
		
		this.last_update = current;
		
		var arr = new Array();
		arr[0] = this.get_element().value;
		
		callservicemethod('sm_'+this.get_name(), arr, this.autocompletecb_handler);
		
	},
	
	blur : function()
	{
		 if (this.visible == true)
		 {
		 	  
		 	  this.animation_fade.end_value = 0;
		 	  this.animation_scale.end_value = 0;
		 	 	this.animation_scale.begin_value = this.get_element_height(this.div_element);
		 	 	this.animation_fade.begin_value = 100;
		 	 	
		 	  this.animation_fade.stop();
		 	  this.animation_scale.stop();	
		 	  
		 	  this.visible = false;	 	 	
		 	  this.animation_scale.client_end = this.animationend_handler;
		 	  this.animation_fade.play();
		 	  this.animation_scale.play();
		 	  
		 	 
		 }
	},
	
	select_value : function(index)
	{
		 
		 if (this.arr_values[index])
		  this.get_element().value = this.arr_values[index];
		 
	},
	
	autocomplete_cb : function(data)
	{
		var arr = eval('('+unescape(data)+')');
		var code ='<ul>';
		 
		 for (var i = 0; i < arr.length; i++)
		   code += '<li><a href="#" onclick="$get(\''+this.get_name()+'\').select_value('+i+'); return false">'+arr[i]+'</a></li>';
		 
	  code += '</ul>';
		this.arr_values = arr;
		 
		this.div_element.innerHTML = code;
		this.div_element.style.visibility='';		 		
		if (this.visible == false)
		{		 

		 
		 this.div_element.style.width = this.get_element_width(this.get_element())+'px';
		 this.animation_fade.change_opacity(this.div_element, 0);
		 this.div_element.style.height='';
		 
		 this.div_element.style.left = this.get_element_left(this.get_element())+'px';
     this.div_element.style.top = (this.get_element_top(this.get_element())+this.get_element_height(this.get_element())+2)+'px';
     
     
		 this.animation_fade.begin_value = 0;
		 this.animation_scale.begin_value = 0;    
		 this.animation_fade.end_value = 100;
		 this.animation_scale.end_value = this.get_element_height(this.div_element);
		 
		 this.animation_fade.stop();
		 this.animation_scale.stop();			
		 
		 this.animation_scale.client_end = null;
		 
		 this.animation_fade.play();
		 this.animation_scale.play();
		 
		 
		 this.visible = true;
		 
		 
		} else {
			 
			 if (this.animation_scale.active == true)
			 	 this.animation_scale.stop(true);

			 if (this.animation_fade.active == true)
			 	 this.animation_fade.stop(true);
			 	 
			 this.animation_fade.change_opacity(this.div_element, 100);
			 this.div_element.style.height='';
		}
	},

	dispose : function()
	{
		 
		 if (this.keyup_handler != null && this.get_element())
		 jyingo.removeEvent( this.get_element(),
		                     'keyup',
		                     this.keyup_handler );


     if (this.blur_handler != null && this.get_element())
		 jyingo.removeEvent( this.get_element(),
		                     'blur',
		                     this.blur_handler );
		
		 
		 if (this.div_element != null)
		 {
		 	if (document.getElementById(this.div_element.id)){
		 	
		   if (document.body)
	      document.body.removeChild(this.div_element);
	     else
	      document.documentElement.removeChild(this.div_element);
	     
	    }		 	 	
		 }
		 
		 if (this.animation_fade != null)
		  this.animation_fade.dispose();

		 if (this.animation_scale != null)
		  this.animation_scale.dispose();		  
	},
	
	get_update_value : function()
	{
		return null;
	},
	
  get_element_width : function(Elem) {
   var xPos;	
   var elem = Elem;

	 if (elem.clip) {
		return elem.clip.width;
	 } else {

		if (elem.style.pixelWidth) {
			xPos = elem.style.pixelWidth;
		} else {
			xPos = elem.offsetWidth;
		}
		
		return xPos;
	 }
  },

  get_element_height : function(Elem) {
   var xPos;
   var elem = Elem;

	 if (elem.clip) {
		return elem.clip.height;
	 } else {

		if (elem.style.pixelHeight) {
			xPos = elem.style.pixelHeight;
		} else {
			xPos = elem.offsetHeight;
		}
		
		return xPos;
	 }
  },
  
  get_element_left : function(elem) {
   var xPos;
	 if (elem.pageX) {
		return elem.pageX;
	 } else {
		xPos = elem.offsetLeft;
		tempEl = elem.offsetParent;
  		while (tempEl != null) {
  			xPos += tempEl.offsetLeft;
	  		tempEl = tempEl.offsetParent;
  		}
		return xPos;
	 }
  },
  
  get_element_top : function(elem) {
   var xPos;
	 if (elem.pageY) {
		return elem.pageY;
	 } else {
		xPos = elem.offsetTop;
		tempEl = elem.offsetParent;
  		while (tempEl != null) {
  			xPos += tempEl.offsetTop;
	  		tempEl = tempEl.offsetParent;
  		}
		return xPos;
	 }
  }
  	
};



/*
 * Jyingo, PHP Ajax Toolkit http://www.jyingo.com
 * Copyright 2007-2008 by SiberianSTAR aka Andrea Pezzino
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */

jyingo.filteredtext = function(name, element)
{
		
	jyingo.initializeBase(name, this, element);
 
  this.valid_chars = 0;
  this.validate_mode = 0;
  this.filter_interval = 250;

  this.custom_chars = "";
  this.lowercase_letters = "abcdefghijklmnopqrstuvwxyz";
  this.uppercase_letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  this.numbers = "0123456789";
  
  this.validchar_string = "";
  
  this.interval_id = null;
  
  this.interval_handler = null;

}

jyingo.filteredtext.prototype = {
	
	initialize : function(update_interval, validate_mode, valid_chars, custom_chars)
	{
		this.update_interval = update_interval;
		this.validate_mode = validate_mode;
		this.valid_chars = valid_chars;
		this.custom_chars = unescape(custom_chars);

		
		var v = "";
		
		if (valid_chars & 1)
		 v += this.numbers;

		if (valid_chars & 2)
		 v += this.lowercase_letters;		 
		 
		if (valid_chars & 4)
		 v += this.uppercase_letters;		 	
		 
		if (valid_chars & 8)
		 v += this.custom_chars;

    this.validchar_string = v;
		
		this.interval_handler = Function.createDelegate(this, this.change);
		this.interval_id = setInterval(this.interval_handler, this.update_interval);
		
		this.change_handler = Function.createDelegate(this, this.change);
		this.keypress_handler = Function.createDelegate(this, this.keypress);
		
		jyingo.addEvent(this.get_element(), 
		                'change',
		                this.change_handler );
		                
		jyingo.addEvent(this.get_element(),
		                'keypress',
		                this.keypress_handler );
				 
		 	
	},
	
	dispose : function()
	{
		
		if (this.interval_id != null)
		{
			 clearInterval(this.interval_id);
		}
		
		jyingo.removeEvent( this.get_element(),
		                    'change',
		                    this.change_handler );

		jyingo.removeEvent( this.get_element(),
		                    'keypress',
		                    this.keypress_handler );		                    
		
	},
	
	keypress : function(evt)
	{
        var scanCode;
        var tcharCode;
        
        if (evt.charCode)
         tcharCode = evt.charCode;
        else
         tcharCode = evt.keyCode;
        
        /*
        if (!evt.charCode)
         evt.charCode = evt.keyCode;
        */
        
        if ((tcharCode == 33) ||
               (tcharCode == 34) ||
               (tcharCode == 38) ||
               (tcharCode == 40) ||
               (tcharCode == 37) ||
               (tcharCode == 39) ||
               (tcharCode == 36) ||
               (tcharCode == 35) ||
               (tcharCode == 8 /* Delete */) ||
               (evt.ctrlKey /* Control keys */)) {
            return;
        }

        if (evt.rawEvent && evt.rawEvent.keyIdentifier) {
            // Safari
            // Note (Garbin): used the underlying rawEvent insted of the DomEvent instance.
            if (evt.rawEvent.ctrlKey || evt.rawEvent.altKey || evt.rawEvent.metaKey) {
                return;
            }
            
            if (evt.rawEvent.keyIdentifier.substring(0,2) != "U+") {
                return;
            }
            
            scanCode = evt.rawEvent.charCode; 
            if (scanCode == 63272 /* Delete */) {
                return;
            }
        } else {
            scanCode = tcharCode;
        }  
           
        if (scanCode && scanCode >= 0x20 /* space */) {
            var c = String.fromCharCode(scanCode);
            
            if(!this.process_key(c)) {
            	 
                jyingo.cancelEvent(evt);
            }
        }
	},
	
	change : function(evt)
	{
		

		var txt = this.get_element().value;
		var result = "";
		
		for (var i = 0; i < txt.length; i++)
		{
		   if (this.process_key(txt.substr(i, 1)))
		    result += txt.substr(i,1);	
		}
		
		if (result != txt)
		 this.get_element().value = result;
		
	},
	
	process_key : function(s)
	{
		
		var found = this.validchar_string.indexOf(s) != -1;
		
		if (this.validate_mode == 1)
		 found = !found;
		
		return found;
		
	},
	
	get_update_value : function()
	{
		
		if( document.forms.form1.elements[this.get_element().name] == undefined )
		 return null;

		
		this.change();
		return this.get_element().value;
		
	}
	
};



/*
 * Jyingo, PHP Ajax Toolkit http://www.jyingo.com
 * Copyright 2007-2008 by SiberianSTAR aka Andrea Pezzino
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
 
jyingo.rating = function(name, element)
{
	jyingo.initializeBase(name, this, element);
	
	this.clientclick = null;
	this.prevent_postback = false;
	this.currentvalue = null;
	this.maxvalue = null;
	this.img_over = null;
	this.img_empty = null;
	this.img_filled = null;
	
	this.click_handlers = null;
	this.over_handlers = null;
	this.out_handlers = null;
	
}

jyingo.rating.prototype = {
	
	initialize : function(params_json)
	{
		
		var params;
		if (params_json.constructor.toString().indexOf("Array") != -1)
		 params = params_json;
		else
		 params = eval('(' + unescape(params_json) + ')');
	  
	  this.currentvalue = params['currentvalue'];
	  this.maxvalue     = params['maxvalue'];
	  this.prevent_postback = params['prevent_postback'];
	  
	  if (params['clientclick'])
	   this.clientclick = Function(params['clientclick']);
	  
	  this.img_over = params['img_over'];
	  this.img_empty = params['img_empty'];
	  this.img_filled = params['img_filled'];
	  
	  this.click_handlers = new Array();
	  this.over_handlers = new Array();
	  this.out_handlers = new Array();
	  
	  this.disabled = params['disabled'];
	  
	  if (this.disabled == false)
	  for (var i = 0; i < this.maxvalue; i++)
	  {
	  	 this.click_handlers[i] = Function("$get('"+this.get_name()+"').click("+i+")");
	     this.over_handlers[i] = Function("$get('"+this.get_name()+"').mouseover("+i+")");
	     this.out_handlers[i] = Function("$get('"+this.get_name()+"').mouseout("+i+")");
	     
	     jyingo.addEvent( $get(this.get_element()+'_'+i),
	                      'click',
	                      this.click_handlers[i] );

	     jyingo.addEvent( $get(this.get_element()+'_'+i),
	                      'mousemove',
	                      this.over_handlers[i] );

	     jyingo.addEvent( $get(this.get_element()+'_'+i),
	                      'mouseout',
	                      this.out_handlers[i] );	                     	                      
	     
	  }
	  
	  
	},
	
	click : function(index)
	{
		
		var val = index+1;
		if (val < 0 || val > this.maxvalue)
		 return;
		
		this.currentvalue = val; 
		this.select(this.currentvalue, this.img_filled);
		
		if (this.clientclick)
		 this.clientclick();
		
		if (this.prevent_postback == false)
		 dopostback(this.get_name(), 'click');
		
	},
	
	mouseover : function(index)
	{
		this.select(index+1, this.img_over);
	},
	
	mouseout : function(index)
	{
		this.select(this.currentvalue, this.img_filled);
	},
	
	select : function(val, filledimg)
	{
		 for (var i = 0; i < this.maxvalue; i++)
		 {
		 	 
		 	 var img;
		 	 if (i < val)
		 	  img = filledimg;
		 	 else
		 	 	img = this.img_empty;
		 	 
		 	 var obj = $get(this.get_element()+'_'+i);
		 	 obj.src = img;
		 	 
		 	 
		 }
	},
	
	dispose : function()
	{
		
	  for (var i = 0; i < this.maxvalue; i++)
	  {

	     jyingo.removeEvent( $get(this.get_element()+'_'+i),
	                      'click',
	                      this.click_handlers[i] );

	     jyingo.removeEvent( $get(this.get_element()+'_'+i),
	                      'mousemove',
	                      this.over_handlers[i] );

	     jyingo.removeEvent( $get(this.get_element()+'_'+i),
	                      'mouseout',
	                      this.out_handlers[i] );	                     	                      
	     
	  }
	
	},
	

	get_update_value : function()
	{
		
		return this.currentvalue;
		
	}
	
};

/*
 * Jyingo, PHP Ajax Toolkit http://www.jyingo.com
 * Copyright 2007-2008 by SiberianSTAR aka Andrea Pezzino
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */

jyingo.passwordstrength = function(name, element)
{
	jyingo.initializeBase(name, this, element);
}

jyingo.passwordstrength.prototype = {
	
	initialize : function(targetcontrol, minlength, classprefix, arrstrings)
	{
		
		this.arrstrings = eval('(' + unescape(arrstrings) + ')');
		
    this.targetcontrol = targetcontrol;
    this.minlength = minlength;
    this.classprefix = classprefix;
    
    this.keydown_handler = Function.createDelegate(this, this.keydown);
    this.checkpwd_handler = Function.createDelegate(this, this.checkpwd);
    
    jyingo.addEvent( targetcontrol,
                    'keydown',
                    this.keydown_handler );
    
    this.checkpwd();
     
    
	},
	
	checkpwd : function()
	{
    var password = this.targetcontrol.value;
    
		if(password.length < this.minlength)
		{
				$get('obj_'+this.get_name()+'_leftBar').className = this.classprefix+'_leftBar0';
				$get('obj_'+this.get_name()+'_rightBar').className = this.classprefix+'_rightBar0';
				$get('obj_'+this.get_name()+'_text').className = this.classprefix+'_text0';
				$get('obj_'+this.get_name()+'_text').innerHTML = this.arrstrings['tooshort'];
				
						if(password.length == 0)
							$get('obj_'+this.get_name()+'_text').innerHTML = '';
		}
		else
		{
						switch(this.test_password(password))
						{
							case 1:
								$get('obj_'+this.get_name()+'_leftBar').className = this.classprefix+'_leftBar1';
								$get('obj_'+this.get_name()+'_rightBar').className = this.classprefix+'_rightBar1';
								$get('obj_'+this.get_name()+'_text').className = this.classprefix+'_text1';
								$get('obj_'+this.get_name()+'_text').innerHTML = this.arrstrings['weak'];
								break;
							case 2:
								$get('obj_'+this.get_name()+'_leftBar').className = this.classprefix+'_leftBar2';
								$get('obj_'+this.get_name()+'_rightBar').className = this.classprefix+'_rightBar2';
								$get('obj_'+this.get_name()+'_text').className = this.classprefix+'_text2';
								$get('obj_'+this.get_name()+'_text').innerHTML = this.arrstrings['fair'];
								break;
							case 3:
								$get('obj_'+this.get_name()+'_leftBar').className = this.classprefix+'_leftBar3';
								$get('obj_'+this.get_name()+'_rightBar').className = this.classprefix+'_rightBar3';
								$get('obj_'+this.get_name()+'_text').className = this.classprefix+'_text3';
								$get('obj_'+this.get_name()+'_text').innerHTML = this.arrstrings['good'];
								break;
							case 4:
								$get('obj_'+this.get_name()+'_leftBar').className = this.classprefix+'_leftBar4';
								$get('obj_'+this.get_name()+'_rightBar').className = this.classprefix+'_rightBar4';
								$get('obj_'+this.get_name()+'_text').className = this.classprefix+'_text4';
								$get('obj_'+this.get_name()+'_text').innerHTML = this.arrstrings['strong'];
								break;
							
						}
		    }		
	},
	
	keydown : function(evt)
	{
		setTimeout(this.checkpwd_handler, 10);
	},
	
	dispose : function()
	{
		
		jyingo.removeEvent( this.targetcontrol,
		                    'keydown',
		                    this.keydown_handler );

		
	},
	

	get_update_value : function()
	{
		
		return "";
		
	},
	
	test_password : function(passwd)
	{
		var intScore   = 0
		var intVerdict = 0;
		
		if (passwd.length<5)
		{
			intScore = (intScore+3)
		}
		else if (passwd.length>4 && passwd.length<8)
		{
			intScore = (intScore+6)
		}
		else if (passwd.length>7 && passwd.length<16)
		{
			intScore = (intScore+12)
		}
		else if (passwd.length>15)
		{
			intScore = (intScore+18)
		}
		
		if (passwd.match(/[a-z]/))
			intScore = (intScore+1)

		if (passwd.match(/[A-Z]/))
			intScore = (intScore+5)

		if (passwd.match(/\d+/))
			intScore = (intScore+5)

		if (passwd.match(/(.*[0-9].*[0-9].*[0-9])/))
			intScore = (intScore+5)

		if (passwd.match(/.[!,@,#,$,%,^,&,*,?,_,~]/))
			intScore = (intScore+5)
		
		if (passwd.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/))
			intScore = (intScore+5)
		
	
		if (passwd.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/))
			intScore = (intScore+2)
		
		if (passwd.match(/([a-zA-Z])/) && passwd.match(/([0-9])/))
			intScore = (intScore+2)
		
		if (passwd.match(/([a-zA-Z0-9].*[!,@,#,$,%,^,&,*,?,_,~])|([!,@,#,$,%,^,&,*,?,_,~].*[a-zA-Z0-9])/))
			intScore = (intScore+2)
		
		if(intScore < 10)
		{
		   intVerdict = 1;
		}
		else if (intScore >= 10 && intScore < 18)
		{
		   intVerdict = 2
		}
		else if (intScore >= 18 && intScore < 25)
		{
		   intVerdict = 3;
		}
		else if (intScore >= 25)
		{
		   intVerdict = 4;
		}

    return intVerdict;
		
	}

};



/*
 * Jyingo, PHP Ajax Toolkit http://www.jyingo.com
 * Copyright 2007-2008 by SiberianSTAR aka Andrea Pezzino
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */

jyingo.calendar = function(name, element)
{
		
	jyingo.initializeBase(name, this, element);
	this.day = 0;
	this.month = 0;
	this.year = 0;
}

jyingo.calendar.prototype = {
	
	initialize : function(day, month, year)
	{
		this.day = day;
		this.month = month;
		this.year = year;
	},
	
	get_update_value : function()
	{
	  var arr = new Array();
	  arr[0] = this.day;
	  arr[1] = this.month;
	  arr[2] = this.year;
	  return JSON.stringify(arr);
	},
	
	selectDay : function(day, month, year)
	{
		 this.day = day;
		 this.month = month;
	   this.year = year;
	   
	   jyingo.postback(this.get_name(), 'change');
	},
	
	selectMonth : function(month, year)
	{
	   this.day = 1;
	   this.year = year;
	   this.month = month;
	   
	   jyingo.postback(this.get_name(), 'select_month');
	},
	
	dispose : function()
	{
		
	}
	
};

/*
 * Jyingo, PHP Ajax Toolkit http://www.jyingo.com
 * Copyright 2007-2008 by SiberianSTAR aka Andrea Pezzino
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */

function jyingo_modalpopup_add_maskdiv()
{
		 var el = document.createElement('div');
	 el.id = 'jyingo_mpopup_mask_div';
	 el.style.display='none';
	
	 if (document.body)
	  document.body.appendChild(el);
	 else
	  document.documentElement.appendChild(el);
}

jyingo.addEvent(window, 'load', function(evt) {
		 
	 jyingo_modalpopup_add_maskdiv();
	 
});

jyingo.modalpopup = function(name, element)
{
	jyingo.initializeBase(name, this, element);
  this.visible = false;
  this.mask_classname = "jyingo_modalpopup_mask";  
}

jyingo.modalpopup.prototype = {
	
	initialize : function(mask_classname, visible)
	{
    this.mask_classname  = mask_classname;
    this.show_handler = Function.createDelegate(this, this.js_timershow);
    this.visible = visible;
	},
	
	show : function()
	{
		
		if (this.visible == true)
		  return;
		 
		 this.visible = true;
		
		dopostback(this.get_name(), 'js_show');
	},
	
	hide : function()
	{
		
		
		if (this.visible == false)
		 return;
		
		this.visible = false;
		
		dopostback(this.get_name(), 'js_hide');
	},
	
	js_show : function()
	{
		 setTimeout(this.show_handler, 0); 
	},
	
	update_element : function()
	{
		this.set_element($get('obj_' + this.get_name()));
	},
	
	js_timershow : function()
	{
		this.disable_window_scrolling();
		var el = document.getElementById('jyingo_mpopup_mask_div');
		
		if (!el) {
			jyingo_modalpopup_add_maskdiv();
		  el = document.getElementById('jyingo_mpopup_mask_div');
		}
		
		el.className = this.mask_classname;
		el.style.position='absolute';
		el.style.left='0';

		if (document.body.scrollTop)
		el.style.top=document.body.scrollTop+'px';
		else
		el.style.top=document.documentElement.scrollTop+'px';
		
		el.style.zIndex='10000';
		
		el.style.width=this.get_window_width()+'px';
		el.style.height=this.get_window_height()+'px';
		el.style.display='';
		
	  this.update_element();
	  el = this.get_element();
	  
	  if (el)
	  {    
	   el.style.position='absolute';
	   el.style.left='50%';
	   el.style.top='50%';
	   el.style.display=''; 
	   el.style.zIndex='10001';
	  }
	},
	
	js_hide : function()
	{
		
		this.enable_window_scrolling();
		var el = document.getElementById('jyingo_mpopup_mask_div');
		
		if (el)
		 el.style.display='none';
	},



	dispose : function()
	{
		

		
	},
	

	get_update_value : function()
	{
		
		return null;
		
	},

  enable_window_scrolling : function()
  {
        if (document.body.offsetHeight > this.get_window_height())
        {
         document.documentElement.style.paddingRight="";
         document.documentElement.style.overflow = ""; 
        }
  },

  disable_window_scrolling : function()
  {

      
        if (document.body.offsetHeight > this.get_window_height())
        {
         document.documentElement.style.paddingRight="16px";
         document.documentElement.style.overflow = "hidden"; 
        }
  },
  
  get_window_height : function() {
     
     if (window.innerHeight ) return window.innerHeight;
     if (document.documentElement.clientHeight ) return document.documentElement.clientHeight;    
     if (document.body.clientHeight ) return document.body.clientHeight;
  },

  get_window_width : function() {
     
     if (window.innerWidth ) return window.innerWidth;
     if (document.documentElement.clientWidth ) return document.documentElement.clientWidth;    
     if (document.body.clientWidth ) return document.body.clientWidth;
  }
  
	
};



/*
 * Jyingo, PHP Ajax Toolkit http://www.jyingo.com
 * Copyright 2007-2008 by SiberianSTAR aka Andrea Pezzino
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */

jyingo.animations = function(name, element)
{
		
	jyingo.initializeBase(name, this, element);
  this.animation_type = null;
  this.active = false; 
  this.current_val = 0;
  
  this.client_start = null;
  this.client_end   = null;
  this.catch_events = null;
  
  this.begin_value = 0;
  this.end_value   = 0;
  this.timer_id    = null;
  
  
}

jyingo.animations.prototype = {
	
	initialize : function(params_json)
	{
		 var params;
		 if (params_json.constructor.toString().indexOf("Array") != -1)
		  params = params_json;
		 else
		  params = eval('(' + unescape(params_json) + ')');
		  
		 this.animation_type = params['animation_type'];
	 
		 
		 switch (this.animation_type)
		 {
				 	
				/*
				 *  fade in / fade out
				 *
				 */
		 
		 
		  case 'scale_x':
			  this.duration =    parseInt(params['duration']);
		 	  this.begin_value = parseInt(params['begin_value']);
			  this.end_value =   parseInt(params['end_value']);	  
			  this.current_val = parseInt(params['current_val']);
		    break; 

		  case 'scale_y':
			  this.duration =    parseInt(params['duration']);
		 	  this.begin_value = parseInt(params['begin_value']);
			  this.end_value =   parseInt(params['end_value']);	  
			  this.current_val = parseInt(params['current_val']);
		    break; 
		    
			case 'fade':
			
				this.duration =    parseInt(params['duration']);
				this.begin_value = parseInt(params['begin_value']);
				this.end_value =   parseInt(params['end_value']);
				
				this.begin_value = this.cap(this.begin_value, 0, 100);
				this.end_value = this.cap(this.end_value, 0, 100);
				
				this.current_val = this.cap(parseInt(params['current_val']), 0, 100);
			  break;		
					 
		 }
		 
		 if (params['client_start'])
		 {
		 	 this.client_start = Function(params['client_start']);
		 }
		 
		 if (params['client_end'])
		 {
		 	 this.client_end = Function(params['client_end']);
		 }
		 
		 this.catch_events = params['catch_events'];
		 
		 this.start_handler = Function.createDelegate(this, this.start);
		 this.timertick_handler = Function.createDelegate(this, this.timer_tick);
		 

		 
		 if (params["active"] == true)
		 {
		 	 this.start(true);
		 }
		 
	 
	},
	cap : function(x, m, M)
	{
	  
	  if (m > M)
	  {
	  	 var c;
	  	 c = M;
	  	 M = m;
	  	 m = c;
	  }
	  
	  if (x < m)
	   return m;
	  
	  if (x > M)
	   return M;
	  
	  return x;
	  	
	},
	
	dispose : function()
	{
		 
		 if (this.timer_id != null)
		  clearInterval(this.timer_id);                    
	
	},
	
	timer_tick : function()
	{	
		switch (this.animation_type)
		{
			case 'scale_x':
			 
		  
		  if (this.current_val > this.end_value)
		   this.current_val-=this.tick_step;
		  else
		   this.current_val+=this.tick_step;			 
			
			this.current_val = this.cap(this.current_val, this.begin_value, this.end_value);
			this.get_element().style.width=this.current_val+'px';
			
			break;

			case 'scale_y':
			 
		  if (this.current_val > this.end_value)
		   this.current_val-=this.tick_step;
		  else
		   this.current_val+=this.tick_step;			 
		   
		  this.current_val = this.cap(this.current_val, this.begin_value, this.end_value);
		  
			this.get_element().style.height=this.current_val+'px';
			
			break;
			
			case 'fade':
		 
		  if (this.current_val > this.end_value)
		   this.current_val-=this.tick_step;
		  else
		   this.current_val+=this.tick_step;
		   
	    this.current_val = this.cap(this.current_val, this.begin_value, this.end_value);
	    
		  this.change_opacity(this.get_element(), this.current_val);	 
			break;
		
		}

		
		if ((this.current_val >= this.end_value && this.end_value >= this.begin_value) ||
		    (this.current_val <= this.end_value && this.end_value <= this.begin_value))
		{
			 this.stop(false, true);
			 return;
		}		
		
	},
	
	play : function(skip)
	{
		this.start(skip);
	},

  start : function(skip)
  {

  	if (this.active == true)
  	 return;
  	
  	this.active = true;
  	var delay_ms = parseInt(this.duration / Math.abs(this.end_value - this.begin_value));
    if (delay_ms < 16)
     delay_ms = 16;
    
    var steps = this.duration / delay_ms;
    var total_step = Math.abs(this.end_value - this.begin_value);
    
    this.tick_step = total_step/steps;    
  	this.timertick_handler();
    this.timer_id = setInterval(this.timertick_handler, delay_ms);
    
  	if (skip == true)
  	 return;  	

  	if (this.client_start != null)
  	 this.client_start();
  	
  	/*
  	if (this.catch_events == true)
  	 dopostback(this.get_name(), 'true'); */
  	
  },
  
  stop : function(skip, noreset)
  {
  	this.active = false;
  	
  	//if (noreset != true)
  	 this.current_val = this.begin_value;
  	
  	if (this.timer_id != null)
  	{
  	  clearInterval(this.timer_id);
  	  this.timer_id = null;
  	}
  	
  	if (skip == true)
  	 return;
 
  	if (this.client_end != null)
  	 this.client_end();
  	 
  	if (this.catch_events == true)
  	 dopostback(this.get_name(), 'end');
  	
  },
  
  pause : function()
  {
  	this.active = false;
 
 
  	if (this.timer_id != null)
  	{
  	  clearInterval(this.timer_id);
  	  this.timer_id = null;
  	}  	
  },	

	get_update_value : function()
	{
		
		return JSON.stringify(new Array(this.active, this.current_val));
	},
	
	change_opacity : function(obj, opacity)
	{
    obj.style.opacity = (opacity / 100); 
    obj.style.MozOpacity = (opacity / 100); 
    obj.style.KhtmlOpacity = (opacity / 100); 
    obj.style.filter = "alpha(opacity=" + opacity + ")"; 
  }
	
};



