function chgBody(typSex) {
	if(typSex == 'h')
	{
		document.forms["formIns"].elements["hidSex"].value = typSex;
		document.getElementById("imgH").style.borderWidth = '1px';
		document.getElementById("imgF").style.borderWidth = '0px';
		document.forms["formIns"].elements["hidSex"] == 'h';
	}
	else if(typSex == 'f')
	{
		document.forms["formIns"].elements["hidSex"].value = typSex;
		document.getElementById("imgF").style.borderWidth = '1px';
		document.getElementById("imgH").style.borderWidth = '0px';
		document.forms["formIns"].elements["hidSex"] == 'f';
	}
	
}

function complexityPassword() {
	this.type="keypress";
	this.obj=null;
	this.o_backgroundColor='';
	this.check=function () {
		var score=0;
		var match;
		_this=this;
 
		if (this.obj!=null)
			_this=this.obj;
 
		match = new RegExp("[a-z]+","");
		if (match.test(_this.value))
			score+=1;
		
		match = new RegExp("[A-Z]+","");
		if (match.test(_this.value))
			score+=1;
		
		match = new RegExp("[0-9]+","");
		if (match.test(_this.value))
			score+=1;
		
		match = new RegExp("[^A-Za-z0-9]+","");
		if (match.test(_this.value))
			score+=1;
	
		score+=_this.value.length/15;
	
		if (score>5) score=5;
		
		_this.style.backgroundColor='rgb('+Math.round(255-((score*255)/5))+','+Math.round((score*255)/5)+',0)';
 
	}
 
	this.connect = function (obj) {
		//John Resig : http://ejohn.org/projects/flexible-javascript-events/
		if ( obj.attachEvent ) {
			obj['e'+this.type+this.check] = this.check;
			obj[this.type+this.check] = function(){obj['e'+this.type+this.check]( window.event );}
			obj.attachEvent( 'on'+this.type, obj[this.type+this.check] );
		} else
			obj.addEventListener( this.type, this.check, false );
 
		this.o_backgroundColor=obj.style.backgroundColor;
		
		this.obj=obj;
		this.check();
		this.obj=null;
	}
	this.disconnect = function removeEvent(obj) {
		//John Resig : http://ejohn.org/projects/flexible-javascript-events/
		if ( obj.detachEvent ) {
			obj.detachEvent( 'on'+this.type, obj[this.type+this.check] );
			obj[this.type+this.check] = null;
		} else
			obj.removeEventListener( this.type, this.check, false );
 
		obj.style.backgroundColor=this.o_backgroundColor;
	}	
}
 
var PassColor=new complexityPassword();