String.prototype.trim = function() {

	return this.replace(/^\s+|\s+$/, '');
	
}

function clean(obj) {
	obj.value = '';
}

/*function sliding-box(box1,box2) {
	$(box1).style.top = '0px';
	$(box2).style.top = '50px';
}*/

/*jezdzacy pasek logowania*/
function slidingBox(box1, box2, obj) {
	/*var start1 = parseInt( $(box1).offsetTop );*/
	var start1 = parseInt( $(box1).offsetTop );
	/*var start2 = parseInt( $(box2).offsetTop );*/
	var start2 = parseInt( $(box2).top );
	var timer = 0;
	var speed = Math.round(700 / 100);
	var k = 0;
	if( start1 < 0 ) {		/*DO POPRAWIENIA, DLA IE I FIREFOX'a*/
		obj.childNodes[0].style.color = '#b1b1b1';
		/*alert( start2 );*/
		for(i = start1; i <= 0; i++) {
			k++;
			/*console.info( 'drop ' + k + ' ' + i );*/

            setTimeout("changePosition(" + i + "," + k + ",'" + box1 + "','" + box2 + "')",(timer * speed));
            timer++;
    	}
    	$(box2).style.marginTop = '0px';
	}
	else {
		obj.childNodes[0].style.color = '#d181c3';
		/*alert( start2 );*/
		start2 = 68;
		for(i = start1; i >= -65; i--) {
			k = start2 + i;
			/*alert( k );*/
			/*console.info( 'pull ' + k + ' ' + i );*/
	        setTimeout("changePosition(" + i + "," + k + ",'" + box1 + "','" + box2 + "')",(timer * speed));
	        timer++;
	    }
	    $(box1).top = '-65px';
	    /*$(box2).top = '15px;';*/
	    $(box2).top = '3px;';
	}
}

function changePosition(i, k, id1, id2) {
	var object1 = document.getElementById(id1).style;
	var object2 = document.getElementById(id2).style;
	object1.top = i + 'px';
	object2.top = k + 'px';
}

function opwindo( url, width, height ) {
	width = parseInt( width ) + 20;
	height = parseInt( height ) + 30;
	var objWindo = window.open( url, '', 'width=' + width + ', height=' + height );
}


function init_logo() {
	function pad(n){return n<10 ? '0'+n : n}
	var data = new Date();
	var md = pad(data.getMonth()+1) + '' + pad(data.getDate());
	var ymd = data.getFullYear() + '' + pad(data.getMonth()+1) + '' + pad(data.getDate());
	if (ymd == '20100301') {
		document.getElementById('logo').src = '/img/logo_lansik_chopin.gif';
	}
	if (md == '0308') {
		document.getElementById('logo').src = '/img/logo_lansik_kobiety.gif';
	}
}

window.onload = init_logo;
