
function Aktywacja(Element,Aktywacja){

	var Kolor;
	var Objekt;


	if(Aktywacja==1){Kolor="#ffffdd";KolorBG="#0066cc"}else {Kolor="#0066cc";KolorBG="transparent"}

	Objekt=document.getElementById(Element);

	Objekt.style.borderColor=Kolor;
	Objekt.style.backgroundColor=KolorBG;

}

function MenuOver(Element,Color){

	Objekt=document.getElementById(Element);

	Objekt.style.borderColor=Color;

}

function FocusIn(A){

	A.style.backgroundColor="transparent";
	if(A.value==A.defaultValue)A.value="";
}

function FocusOut(A){

	A.style.backgroundColor="#3366cc";
	if(A.value=="")A.value=A.defaultValue;
}


function OznaczPuste(t){

var x;
var MyColor;

MyColor="#cc0000";
Wzor=/^[a-zA-Z0-9\._-]+@[a-zA-Z0-9\.-]+\.[a-zA-Z]{2,4}$/;
	Objekt=document.getElementById(t);

	for(var i=0,j;j=Objekt.elements[i++];){ 
		if((j.value==j.defaultValue || j.value=="") && (j.type=="text" || j.type=="textarea")){
			j.style.backgroundColor=MyColor;
			x=true;		
		}else{
			j.style.backgroundColor="#3366cc";
		}
	}

	if(!Wzor.test(Objekt.elements[2].value)){x=true;Objekt.elements[2].style.backgroundColor=MyColor}

	if(!x)Objekt.submit(Objekt);

}

function mDisplay(o,Id){

	objekt=document.getElementById(Id);

	if(o.value!=Id){
		
		o.value=Id;
		objekt.style.display="none";
	
	}else{

		o.value="Ukryj";
		objekt.style.display="";

	}

}

function copyText( obj ) {

	if (obj.type=="text" || obj.type=="textarea"){
		var rng = obj.createTextRange();
	} else {
		var rng = document.body.createTextRange();
		rng.moveToElementText(obj);
	}

	rng.scrollIntoView();
	rng.select();

	if (confirm('Kliknij OK aby skopiować zaznaczony tekst do schowka.\nUżyj klawiszy CTRL+V, aby wkleić go w odpowiednim miejscu.')) rng.execCommand("Copy");
	rng.collapse(false);
	rng.select();
}


