

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function showDiv(divName)
{
	document.getElementById(divName).style.display="block";
	return true;
}

function showHideDiv(div)
{
	var divs=new Array();
	divs[0]='date_personale';
	divs[1]='adauga_loc_munca';
	divs[2]='adauga_loc_practica';
	
	for(i=0;i<3;i++)
	{
		document.getElementById(divs[i]).style.display='none';
	}
	
	document.getElementById(div).style.display='block';
	
}
function doInputNew(x)
{
	splited=x.id.split("_");
	
	newNr=parseInt(splited[1])+1;
	
	if(!document.getElementById("file_" + newNr))
	{
	
		var newdiv=document.createElement("div"); // asta este divul care o sa contina o inregistrare de fisier atasat 
		newdiv.setAttribute("class","single_stuff");
		
		//=================
		// numele fisierului
		//=================
		
		var newNameP=document.createElement("p");
		var newNameP=document.createTextNode("Nume Fisier: ");
		
		var newInputName=document.createElement("input");
		newInputName.setAttribute("type","text");
		newInputName.setAttribute("name","fileName_" + newNr);
		newInputName.setAttribute("id","fileName_" + newNr);
		
		//=================
		// sfarsit numele fsierului
		//=================
		
		var newNameP2=document.createElement("p");
		var newNameP2=document.createTextNode("Users Only: ");
		
		var newNameP21=document.createTextNode("Da: ");
		
		var newInputName0=document.createElement("input");
		newInputName0.setAttribute("type","radio");
		newInputName0.setAttribute("name","usersonly_" + newNr);
		newInputName0.setAttribute("class","usersonly");
		newInputName0.setAttribute("style","width:15px;");
		newInputName0.setAttribute("value","0");
		
		var newNameP22=document.createTextNode("Nu: ");
		
		var newInputName1=document.createElement("input");
		newInputName1.setAttribute("type","radio");
		newInputName1.setAttribute("name","usersonly_" + newNr);
		newInputName1.setAttribute("class","usersonly");
		newInputName1.setAttribute("style","width;15px");
		newInputName1.setAttribute("value","1");
		
		
		//=========================
		// asta face inputul de fisier
		//=========================
		var newTextFileNameTag=document.createElement("p");
		var newTextFileNameTag=document.createTextNode("Fisier: ");
		
		var newInputText=document.createElement("input");
		newInputText.setAttribute("type","file");
		newInputText.setAttribute("name","file_" + newNr);
		newInputText.setAttribute("id","file_" + newNr);
		newInputText.setAttribute("onclick","doInputNew(this);");
		//======================
		// pana aici e input fisier
		//=======================
		
		//============================
		// asta e cu descriere fisierului
		//============================
		var newTextDescription=document.createTextNode("Descriere: ");
		
		var newInputTextArea=document.createElement("textarea");
		newInputTextArea.setAttribute("name","desc_" + newNr);
		//==============================
		// pana aici e descrierea fisierului
		//===============================
	
		
		//breakimg
		
		var newBreaking=document.createElement("br");
		var newBreaking2=document.createElement("br");
		var newBreaking3=document.createElement("br");
		
		newdiv.appendChild(newNameP) ;	
		newdiv.appendChild(newInputName) ;newdiv.appendChild(newBreaking);
		
		newdiv.appendChild(newNameP2) ;
			newdiv.appendChild(newNameP21) ;	
		newdiv.appendChild(newInputName1) ;
			newdiv.appendChild(newNameP22) ;
		newdiv.appendChild(newInputName0) ;
	newdiv.appendChild(newBreaking3);
		newdiv.appendChild(newTextFileNameTag) ;
		newdiv.appendChild(newInputText) ;newdiv.appendChild(newBreaking2);
	
		
		 
		document.getElementById("stuffHolder").appendChild(newdiv);
	
		
	}
}
function doInputNew2(x)
{
	splited=x.id.split("_");
	
	newNr=parseInt(splited[1])+1;
	
	if(!document.getElementById("pfil_" + newNr))
	{
	
		var newdiv=document.createElement("div"); // asta este divul care o sa contina o inregistrare de fisier atasat 
		newdiv.setAttribute("class","single_stuff");
		newdiv.setAttribute("align","right");
		
		//=================
		// numele fisierului
		//=================
		
		var newNameP=document.createElement("p");
		var newNameP=document.createTextNode("Nume Fisier: ");
		
		var newInputName=document.createElement("input");
		newInputName.setAttribute("type","text");
		newInputName.setAttribute("name","pfilName_" + newNr);
		newInputName.setAttribute("id","pfilName_" + newNr);
		
		//=================
		// sfarsit numele fsierului
		//=================
		var newNameP2=document.createElement("p");
		var newNameP2=document.createTextNode("Users Only: ");
		
		var newNameP21=document.createTextNode("Da: ");
		
		var newInputName0=document.createElement("input");
		newInputName0.setAttribute("type","radio");
		newInputName0.setAttribute("name","usersonly_" + newNr);
		newInputName0.setAttribute("class","usersonly");
		newInputName0.setAttribute("style","width:15px;");
		newInputName0.setAttribute("value","0");
		
		var newNameP22=document.createTextNode("Nu: ");
		
		var newInputName1=document.createElement("input");
		newInputName1.setAttribute("type","radio");
		newInputName1.setAttribute("name","usersonly_" + newNr);
		newInputName1.setAttribute("class","usersonly");
		newInputName1.setAttribute("style","width:15px;");
		newInputName1.setAttribute("value","1");
		//=========================
		// asta face inputul de fisier
		//=========================
		var newTextFileNameTag=document.createElement("p");
		var newTextFileNameTag=document.createTextNode("Fisier: ");
		
		var newInputText=document.createElement("input");
		newInputText.setAttribute("type","file");
		newInputText.setAttribute("name","pfil_" + newNr);
		newInputText.setAttribute("id","pfil_" + newNr);
		newInputText.setAttribute("onclick","doInputNew2(this);");
		//======================
		// pana aici e input fisier
		//=======================
		
		//============================
		// asta e cu descriere fisierului
		//============================
		var newTextDescription=document.createTextNode("Descriere: ");
		
		var newInputTextArea=document.createElement("textarea");
		newInputTextArea.setAttribute("name","pfde_" + newNr);
		//==============================
		// pana aici e descrierea fisierului
		//===============================
	
		
		//breakimg
		
		var newBreaking=document.createElement("br");
		var newBreaking2=document.createElement("br");
		var newBreaking3=document.createElement("br");
		
		newdiv.appendChild(newNameP) ;	
		newdiv.appendChild(newInputName) ;newdiv.appendChild(newBreaking);
		
		newdiv.appendChild(newNameP2) ;
			newdiv.appendChild(newNameP21) ;	
		newdiv.appendChild(newInputName1) ;
			newdiv.appendChild(newNameP22) ;
		newdiv.appendChild(newInputName0) ;
	newdiv.appendChild(newBreaking3);
		newdiv.appendChild(newTextFileNameTag) ;
		newdiv.appendChild(newInputText) ;newdiv.appendChild(newBreaking2);
	
		 
		document.getElementById("stuffHolder2").appendChild(newdiv);
	
		
	}
}
