function oceniaj(ocena){
					var ocena;					
					
					for (i=1;i<=10;i++){
							 if (i<=ocena) document.getElementById('ocena'+i).src='gfx/starYES.gif';
							 else document.getElementById('ocena'+i).src='gfx/starNO.gif';
					}
}

function glosuj(idw,ocena,div){
		advAJAX.get({
				
				 url :  '/inc/glosuj.php',
				 parameters : {
						"idw" : idw,
						"ocena" : ocena
				 },
				 onSuccess : function(obj) {
					document.getElementById(div).innerHTML =obj.responseText;
					},
				 onError : function(obj) {
					document.getElementById(div).innerHTML = "Error: " + obj.status;
				 }
				});
}

function pokazOceny(idw,div){
		advAJAX.get({
				
				 url :  '/inc/glosuj.php?akcja=pokaz',
				 parameters : {
						"idw" : idw
				 },
				 onSuccess : function(obj) {
					document.getElementById(div).innerHTML =obj.responseText;
					},
				 onError : function(obj) {
					document.getElementById(div).innerHTML = "Error: " + obj.status;
				 }
				});
}


function checkForm( obj, str )
{				
					if ( obj.value == str ) obj.value = '';					
					
					obj.onblur=function(){
								if ( obj.value == '' ) obj.value = str;
					}
}


function autoHeight()
{		
      var objFrame = document.getElementById('iframe');
			var autoheight = objFrame.contentWindow.document.body.scrollHeight;

      objFrame.height = autoheight;
}


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 displayElement( obj )
{				
					$(obj).style.display = $(obj).style.display == "block" ? "none" : "block";
}

