function ch_upload() {
    var grade = true;
    if (document.form_izrada.name.value == "") {grade = false; alert("Niste uneli ime."); return grade;}
    if (document.form_izrada.surname.value == "") {grade = false; alert("Niste uneli prezime."); return grade;}
    if (document.form_izrada.phone.value == "") {grade = false; alert("Niste uneli telefon."); return grade;}
}
function ch_reg() {
    var grade = true;
    if (document.form_registracija.username.value == "") {grade = false; alert("Niste uneli korisničko ime."); return grade;}
    if (document.form_registracija.name.value == "") {grade = false; alert("Niste uneli ime."); return grade;}
    if (document.form_registracija.surname.value == "") {grade = false; alert("Niste uneli prezime."); return grade;}
    if (document.form_registracija.phone.value == "") {grade = false; alert("Niste uneli telefon."); return grade;}
    if (document.form_registracija.password.value == "") {grade = false; alert("Niste uneli lozinku."); return grade;}
    if (document.form_registracija.password2.value == "") {grade = false; alert("Niste ponovili lozinku."); return grade;}
}
// function getStyleObject(string) -> returns style object
//  given a string containing the id of an object
//  the function returns the stylesheet of that object
//  or false if it can't find a stylesheet.  Handles
//  cross-browser compatibility issues.
//
function getStyleObject(objectId) {
  // checkW3C DOM, then MSIE 4, then NN 4.
  //
  if(document.getElementById && document.getElementById(objectId)) {
	return document.getElementById(objectId).style;
   }
   else if (document.all && document.all(objectId)) {  
	return document.all(objectId).style;
   } 
   else if (document.layers && document.layers[objectId]) { 
	return document.layers[objectId];
   } else {
	return false;
   }
}

function rowsHide(tableId) {
	
	tbl = document.getElementById(tableId);
	var len = tbl.rows.length;
	for(i=0 ; i< len-1; i++){
		 tbl.rows[i].style.display = 'none';
	}
}

function rowsShow(tableId) {
	
	tbl = document.getElementById(tableId);
	var len = tbl.rows.length;
	for(i=0 ; i< len-1; i++){
		 tbl.rows[i].style.display = '';
	}
}

function incQty() {
	for (i=0; i<document.picForm.quantity.length; i++) {
		var tNum=parseInt(document.picForm.quantity[i].value);
		var num = tNum+1;
		document.picForm.quantity[i].value=num;
	}
}

function decQty() {
	for (i=0; i<document.picForm.quantity.length; i++) {
		var tNum=parseInt(document.picForm.quantity[i].value);
		if (tNum != 1){
			var num = tNum-1;
			document.picForm.quantity[i].value=num;
		}
	}
}

function hideshow(hideId, showId) {

	var allPageTags = new Array(); 
	allPageTags=document.getElementsByTagName("*");  
	for (i=0; i<allPageTags.length; i++) {  
		if (allPageTags[i].className==hideId) { 
			allPageTags[i].style.display='none';  
		}  
		if (allPageTags[i].className==showId) {
			allPageTags[i].style.display='';
		}
	} 
} 

function confirmSubmit() {
	var agree=confirm("Slanje slika još uvek nije završeno. Da li ste sigurni da želite prekinuti slanje i preći na sledeći korak?");
	if (agree)
		return true ;
	else
		return false ;
}

