function goUploadStep2() {
	if (document.forms['a_form'].elements['title'].value!="") {
		if (document.forms['a_form'].elements['description'].value!="") {
			if (document.getElementById('type').value==3) { //galeria
				//alert('gallery');
				document.getElementById('uploadstep1').style.display='none';
				document.getElementById('uploadstep2').innerHTML=document.getElementById('uploadstep2d').innerHTML;
				document.getElementById('uploadstep2').style.display='block';				
			} else if (document.getElementById('type').value==2) { //film
				//alert('movie');
				document.getElementById('uploadstep1').style.display='none';
				document.getElementById('uploadstep2').innerHTML=document.getElementById('uploadstep2c').innerHTML;				
				document.getElementById('uploadstep2').style.display='block';	
			} else if (document.getElementById('type').value==1) { //muzyka
				//alert('music');
				document.getElementById('uploadstep1').style.display='none';
				document.getElementById('uploadstep2').innerHTML=document.getElementById('uploadstep2b').innerHTML;				
				document.getElementById('uploadstep2').style.display='block';	
			}
		} else {
			document.forms['a_form'].elements['description'].style.background='red';
			document.forms['a_form'].elements['title'].style.background='white';
		}
	} else {
		document.forms['a_form'].elements['title'].style.background='red';
	}
}

function goUploadStep2a() {
	if (document.forms['addgroup_form'].elements['title'].value!="") {
		if (document.forms['addgroup_form'].elements['description'].value!="") {
			document.getElementById('uploadstep1a').style.display='none';
			document.getElementById('uploadstep2a').style.display='block';	
			document.getElementById('zatwierdz').style.display='none';		
			document.getElementById('type2').value=1;
			document.getElementById('step1from2a').innerHTML='(krok 2 z 2)';
		} else {
			document.forms['addgroup_form'].elements['description'].style.background='red';
			
			document.forms['addgroup_form'].elements['title'].style.background='white';
		}
	} else {
		document.forms['addgroup_form'].elements['title'].style.background='red';
	}
}











function uploadimg (theform){
//Submit the form.
	document.forms['uploadform'].submit();
}
//Function to determine when the process_upload.php file has finished executing.
function doneloading(theframe,thefile){
var theloc = "src.php?thefile=" + thefile
theframe.processajax ("showimg",theloc);
}
function uploadimg (theform){
//Submit the form.
	document.forms[theform].submit();
//Then display a loading message to the user.
	setStatus ("Wysylam...","showimg");
}
//Function to set a loading status.
function setStatus (theStatus, theObj){
obj = document.getElementById(theObj);
if (obj){
obj.innerHTML = "<div class=\"bold\">" + theStatus + "</div>";
}
}
function highlight(field) {
        field.focus();
        field.select();
}

//Create a boolean variable to check for a valid Internet Explorer instance.
var xmlhttp = false;
//Check if we are using IE.
try {
	//If the Javascript version is greater than 5.
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
//If not, then use the older active x object.
try {
	//If we are using Internet Explorer.
	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (E) {
		//Else we must be using a non-IE browser.
		xmlhttp = false;
	}
}
//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
	xmlhttp = new XMLHttpRequest();
}
function makerequest(serverPage, objID) {
	var obj = document.getElementById(objID);
	xmlhttp.open("GET", serverPage);
	obj.innerHTML="<img src='img/loading.gif'> Pobieram dane.";
	xmlhttp.onreadystatechange = function() {

		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			obj.innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
}

//Function to create an XMLHttp Object.
function getxmlhttp (){
//Create a boolean variable to check for a valid Microsoft ActiveX instance.
var xmlhttp = false;
//Check if we are using Internet Explorer.
try {
//If the JavaScript version is greater than 5.
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
//If not, then use the older ActiveX object.
try {
//If we are using Internet Explorer.
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
//Else we must be using a non-Internet Explorer browser.
xmlhttp = false;
}
}
// If we are not using IE, create a JavaScript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
//Function to process an XMLHttpRequest.
function processajax (obj, serverPage){
//Get an XMLHttpRequest object for use.
var theimg;
xmlhttp = getxmlhttp ();
xmlhttp.open("GET", serverPage);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById(obj).innerHTML = xmlhttp.responseText;
}
}
xmlhttp.send(null);
}
