if (/msie/i.test (navigator.userAgent)) {//only override IE
	document.nativeGetElementById = document.getElementById; 
	document.getElementById = function(id){
		var elem = document.nativeGetElementById(id);
		if(elem){
			if(elem.attributes['id'].value == id){
				return elem;
			}else{
			//otherwise find the correct element
				for(var i=1;i<document.all[id].length;i++){
					if(document.all[id][i].attributes['id'].value == id){
						return document.all[id][i];
					}
				}
			}
		}
		return null;
	}
}

var month = ['Januar', 'Februar', 'Mart', 'April', 'Maj', 'Jun', 'Jul', 'Avgust', 'Septembea', 'Octobar', 'Novembar', 'Decembar'];

function showIMGover(){
	document.getElementById("home").src="images/home_white_hover.png";
}

function showIMGout(){
	document.getElementById("home").src="images/home_white.png";
}

function fill_field(elem,val){
	elem.value = val;
//	document.getElementById(id).value = val;
}

function showMember(id){
	hideMembers();
	document.getElementById(id).style.display = "inline-block";
}

function subMyForm(){
	document.forms["my_form"].submit();
}

function subEditPhoto(){
	document.forms["capt_edt"].submit();
}

function subEditAdd(){
	document.forms["add_edt"].submit();
}

function subMyDel(){
	if(document.forms["pom"]){
		document.forms["pom"].submit();
	}
	if(document.forms["clan"]){
		document.forms["clan"].submit();
	}
}

function subMyQuestion(){
	if(document.forms["appquest"].quest.value!="" && document.forms["appquest"].answer.value!=""){
		document.forms["appquest"].submit();
	}else{
		alert("Polje pitanje i odgovor moraju biti popunjena.");
	}
}
function subMySugestion(){
	if(document.forms["appsug"].commentarea.value!=""){
		document.forms["appsug"].submit();
	}else{
		alert("Polje sugestija mora biti popunjeno.");
	}
}

function validate_required(e){
	var key = window.event ? e.keyCode : e.which;
	if(key!=8 && key!=0){
		var keychar = String.fromCharCode(key);
		var numericExpression = /^[0-9]+$/;
		return numericExpression.test(keychar)
	}else{
		return true
	}
}


