


function getcontent_height(){

iens6=document.all||document.getElementById
ns4=document.layers
if (iens6){
//var crossobj=document.getElementById? document.getElementById("content") : document.all.content 
contentheight=crossobj.offsetHeight
}else if(ns4){
document.nscontainer.document.nscontent.visibility="show"
}
}




function movedown(){
iens6=document.all||document.getElementById
ns4=document.layers
if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
crossobj.style.top=parseInt(crossobj.style.top)-speed+"px"
else if (ns4&&crossobj.top>=(contentheight*(-1)+100))
crossobj.top-=speed
movedownvar=setTimeout("movedown()",20)
}

function moveup(){
if (iens6&&parseInt(crossobj.style.top)<=0)
crossobj.style.top=parseInt(crossobj.style.top)+speed+"px"
else if (ns4&&crossobj.top<=0)
crossobj.top+=speed
moveupvar=setTimeout("moveup()",20)

}






function prendiElementoDaId(id_elemento) {
 // elemento da restituire
 var elemento;
 
 // se esiste il metodo getElementById
 // questo if sarà diverso da false, null o undefined
 // e sarà quindi considerato valido, come un true
 if(document.getElementById)
  elemento = document.getElementById(id_elemento);
 
 // altrimenti è necessario usare un vecchio sistema
 else
  elemento = document.all[id_elemento];

 // restituzione elemento
 return elemento;
}

function oggi(){
dayName = new Array("", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato", "Domenica")
monName = new Array("Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre")
now = new Date();
return dayName[now.getDay()]+" "+now.getDate()+" "+monName[now.getMonth()]+" "+now.getFullYear();
}



function vis(val)
{
	if (!DHTML) return;
	var f = new getObj('example');
	f.style.visibility = val;
}

function getObj(name)
{
  if (document.getElementById)
  {
    this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
    this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}




function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   //alert("Email non ha un formato valido")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   //alert("Email non ha un formato valido")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    //alert("Email non ha un formato valido")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    //alert("Email non ha un formato valido")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    //alert("Email non ha un formato valido")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    //alert("Email non ha un formato valido")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    //alert("Email non ha un formato valido")
		    return false
		 }

 		 return true					
	}	




function roll_css_over(nome,color){
			if (document.layers) {
				myBox=document.layers[nome];	 
				myBox.color=color;
			}
      else if (document.all && !document.getElementById) {
				myBox=nome; 
				leftpos=parseInt(myBox.style.left);
				leftpos++;
				myBox.style.color=color;
			}
      else if (document.getElementById && document.body.style) {
				divel=document.getElementById(nome);
				leftpos=parseInt(divel.style.left);
				leftpos++;
				divel.style.color=color;
			}
		} 


function roll_css_out(nome,color){
			if (document.layers) {
				myBox=document.layers[nome];	 
				myBox.color=color;
			}
      else if (document.all && !document.getElementById) {
				leftpos=parseInt(myBox.style.left);
				leftpos++;
				myBox.style.color=color;
			}
      else if (document.getElementById && document.body.style) {
				divel=document.getElementById(nome);
				divel.style.color=color;
			}
		} 
		
		
	
		
function MediaOpen(id,id_info){

window_a=window.open("http://209.227.245.14/demo/media.php?id="+id+"&id_info="+id_info,"win1","toolbar=no,dependent=yes,resizable=yes,menubar=no,scrollbars=yes,titlebar=no,width=650,height=350,top=150,left=150");

}		

function syneBall(url,W,H){
window_a=window.open(url,"win1","toolbar=no,dependent=no,resizable=no,menubar=no,scrollbars=no,titlebar=no,width="+W+",height="+H+",top=150,left=200");

}

function OpenImgWH(url,W,H)
{ 
//window_a=window.open(url,"win1","toolbar=no,dependent=yes,resizable=yes,menubar=no,scrollbars=yes,titlebar=no,width="+W+",height="+H+",top=150,left=150");

OpenWindow=window.open("","win1","toolbar=no,dependent=yes,resizable=yes,menubar=no,scrollbars=yes,titlebar=no,width="+W+",height="+H+",top=150,left=150");
OpenWindow.document.write('<HTML>')
OpenWindow.document.write('<TITLE>Cibic - Zoom</TITLE>')
OpenWindow.document.write('<BODY BGCOLOR=ffffff   onLoad=javascript:window.focus(); >')
OpenWindow.document.write('<a href=\"javascript:self.close()\" title=\"CHIUDI[X]\"><img src=../uploads/'+url+' border=0 alt=clic_to_close_window_[X]></a>')
OpenWindow.document.write('</HTML>')
OpenWindow.document.close()
self.name='main'

}

function OpenEmbedded(url)
{ 
OpenWindow=window.open('', 'newwin', 'height=500,width=500,toolbar=no,scrollbars=no,menubar=no, resizable=yes');
OpenWindow.document.write('<HTML>')
OpenWindow.document.write('<TITLE>Lg Studio - My Embedded Media</TITLE>')
OpenWindow.document.write('<BODY BGCOLOR=000000 topmargin=0 leftmargin=0>')
OpenWindow.document.write('<EMBED SRC='+url+' AUTOSTART=true height=100% width=100%></EMBED>')
OpenWindow.document.write('</HTML>')
OpenWindow.document.close()
self.name='main'
}


function SelectOnchange(php_self,id){

window.location.href=php_self+"?id="+id;

}

function NewWinUrl(url)
{ 
window_a=window.open(url,"win1","toolbar=no,dependent=yes,resizable=yes,menubar=no,scrollbars=no,titlebar=no,width=490,height=520,top=150,left=150");
}


function popup(img_big){
	window_a=window.open("img_big.php?img_big="+img_big,"win1","toolbar=no,dependent=yes,menubar=no,scrollbars=no,titlebar=no,width=384,height=388,top=150,left=150");
}
function popup2(){
	window_a=window.open("stampa.html","win2","toolbar=yes,dependent=yes,menubar=no,scrollbars=1,titlebar=no,width=680,height=480,top=150,left=150");
}

