function init(){
	orol();
	window.status ="Crusader's page loaded correctly!"
	if (document.getElementById('new_neg')){
		setTimeout("hideSWF()",30000)
	}
}
function hideSWF(){
	document.getElementById('new_neg').innerHTML=""
}
function orol(){
	var or = new Date();
	var finalu = new String();
	if(or.getHours()<10){
		hor = "0"+or.getHours()
	}else{hor = or.getHours()}
	if(or.getMinutes()<10){
		mi = "0"+or.getMinutes()
	}else{mi = or.getMinutes()}
	if(or.getSeconds()<10){
		se = "0"+or.getSeconds()
	}else{se = or.getSeconds()}
	finalu = hor+":"+mi+":"+se
	document.getElementById('ora').innerHTML = finalu
	setTimeout("orol()",1000)
}
function keyprs(str,num){
	if (parseInt(str.length)>=num-1){
		alert("Hai raggiunto il numero massimo di caratteri inseribili ("+num+" char)")
		document.frm.txt.value = str.substring(0,num)
	}
}
function setact(idus,target){
	if(confirm('Vuoi confermare questa azione?')){
		location.href = "admin.php?pg="+target+"&idact="+idus
	}else{location.href = "admin.php?pg="+target}
}
function popoff(idn){
	document.getElementById('det').innerHTML = "Apertura dettagli in modalità popup..."
	window.open("include/offerte.php?idof="+idn,"nuovo","scrollbars=no,width=550,height=500,left=300,top=150")
	setTimeout(document.getElementById('det').innerHTML = "",2000)
}
function whereImg(flag){
	document.forms['upimg'].elements['file'].disabled = flag
	document.forms['upimg'].elements['up'].disabled = flag
	document.getElementById('extimg').disabled = !flag
}
function fromPCtoImg(frm1,frm2,pre){
	frm1.submit();
	comp = frm1.file.value;
	ini = comp.lastIndexOf("\\");
	nome = comp.substr(ini+1,comp.length);
	if (frm2.name=="global"){ pre = "img/noteb/";}
	frm2.img.value = pre+nome;
}
function prevImg(path){
	document.images['imma'].src = path;
}
function chkFilled(hand){
	theFo = document.global;
	if (theFo.nart.value!="" && theFo.marca.value!="" && theFo.modello.value!="" && theFo.cpu.value!="" && theFo.disp.value!="" && theFo.hdd.value!="" && theFo.ram.value!="" && theFo.opt.value!="" && theFo.vga.value!="" && theFo.ifaces.value!="" && theFo.net.value!="" && theFo.os.value!="" && theFo.prezzo.value!=""){
		document.getElementById("attore").disabled = false;
		document.getElementById("lbAttore").innerHTML = "";
	}else{
		document.getElementById("attore").disabled = true;
		document.getElementById("lbAttore").innerHTML = "I campi obbligatori(<font color=\"#FF0000\">*</font>) non sono completati...";
	}
	//if (hand.name == "prezzo"){
		//if (parseInt(hand.value))
	//}
}
