function checkField( t, str, defaultColor, setColor )
{
		if ( t.value == str ) t.value = '';
		t.onkeydown = function(){ 
				 t.style.color = setColor;
		}
		t.onblur = function(){
					if ( t.value == '' ) { 
							 t.value = str;
							 t.style.color = defaultColor;
					} else if ( t.value == str ) { t.style.color = defaultColor; } else { t.style.color = setColor; }
		}
}

function displayElement( ElementId )
{		
			return ElementId.style.display = ( ElementId.style.display == 'block' ) ? 'none' : 'block';
}



function randomString( strLen ) 
{
		RandStr = "";
		
		for (i = 0; i < strLen; i++) 
		{
				 RandSign = String.fromCharCode(Math.round(Math.random()*(122-48))+48);
				 if (RandSign.match(/[0-9a-zA-Z]/)) RandStr += RandSign;
				 else i--;
		}
		
		return RandStr;
}


function makeUrl ( str ) 
{
		str = str.toLowerCase();
		str = str.replace(/ą/gi, "a");
		str = str.replace(/ć/gi, "c");
		str = str.replace(/ę/gi, "e");
		str = str.replace(/ł/gi, "l");
		str = str.replace(/ń/gi, "n");
		str = str.replace(/ó/gi, "o");
		str = str.replace(/ś/gi, "s");
		str = str.replace(/ż/gi, "z");
		str = str.replace(/ź/gi, "z");
		str = str.replace(/[^a-zA-Z0-9]/gi, "-");
		
		return str;
}


function autoHeight()
{		
		var objFrame = document.getElementById('iframe');
		var autoheight = objFrame.contentWindow.document.body.scrollHeight;

		objFrame.height = autoheight;
}
