/*copyRight: Liviu-Constantin Olaru*/

//aîâstAÎÂST
///u0103/u00ee/u00e2/u015f/u0163/u0102/u00ce/u00C2/u015e/u0162
function qInputPassword(tag)
{
if(tag.name==='password')
{
if(tag.value==='')
{
tag.form.noPassword.style.display='';
tag.form.password.style.display='none';
tag.form.password.value='password';
tag.form.password.blur();
}
}
else
{
tag.form.noPassword.style.display='none';
tag.form.password.value='';
tag.form.password.style.display='';
tag.form.password.focus();
}
}
function qInputValoare(tag,valoare)
{
tag.value=valoare;
}
function tranzitivActiuneFormLogin(tagFormLogin,tagInputUsername,tagInputPassword)
{
document.getElementById(tagFormLogin).action="javascript:ajaxPost('resurse/link_privat.php', 'actiune=login&membruNume="+document.getElementById(tagInputUsername).value+"&membruParola="+document.getElementById(tagInputPassword).value+"', 'continut');"
}
function tranzitivActiuneFormRegister(tagFormRegister,tagInputUsername,tagInputPassword,tagInputEmail)
{
document.getElementById(tagFormRegister).action="javascript:ajaxPost('resurse/link_privat.php', 'actiune=register&membruNume="+document.getElementById(tagInputUsername).value+"&membruParola="+document.getElementById(tagInputPassword).value+"&membruEmail="+document.getElementById(tagInputEmail).value+"', 'continut');"
}
function tranzitivActiuneFormReset(tagFormReset,tagInputUsername,tagInputPassword)
{
document.getElementById(tagFormReset).action="javascript:ajaxPost('resurse/link_privat.php', 'actiune=reset&membruNume="+document.getElementById(tagInputUsername).value+"&membruParola="+document.getElementById(tagInputPassword).value+"', 'continut');"
}
function tranzitivActiuneFormLoginCP(tagFormLogin,tagInputUsername,tagInputPassword)
{
document.getElementById(tagFormLogin).action="javascript:ajaxPost('infolight.ro.conectareStrict.php', 'actiune=login&membruNume="+document.getElementById(tagInputUsername).value+"&membruParola="+document.getElementById(tagInputPassword).value+"', 'continut');"
}
function tranzitivActiuneFormRegisterCP(tagFormRegister,tagInputUsername,tagInputPassword,tagInputEmail)
{
document.getElementById(tagFormRegister).action="javascript:ajaxPost('infolight.ro.conectareStrict.php', 'actiune=register&membruNume="+document.getElementById(tagInputUsername).value+"&membruParola="+document.getElementById(tagInputPassword).value+"&membruEmail="+document.getElementById(tagInputEmail).value+"', 'continut');"
}
function tranzitivActiuneFormContacteazaInfoLight(tagFormContacteazaInfoLight,tagInputTitlu,tagTextareaDespreMine)
{
document.getElementById(tagFormContacteazaInfoLight).action="javascript:ajaxPost('resurse/privat_management_privat_strict_contacteaza_infolight_ro.php', 'actiune=contacteazaInfoLight&contacteazaInfoLightTitlu="+document.getElementById(tagInputTitlu).value+"&contacteazaInfoLightDespreMine="+document.getElementById(tagTextareaDespreMine).value+"', 'continut');";
}
function tranzitivActiuneFormProfilulMeu(tagFormProfilulMeu,tagInputNume,tagInputPrenume,tagInputParola,tagInputEmail,tagTextareaDespreMine)
{
document.getElementById(tagFormProfilulMeu).action="javascript:ajaxPost('resurse/privat_management_privat_strict_profilul_meu.php', 'actiune=profilulMeu&profilulMeuNume="+document.getElementById(tagInputNume).value+"&profilulMeuPrenume="+document.getElementById(tagInputPrenume).value+"&profilulMeuParola="+document.getElementById(tagInputParola).value+"&profilulMeuEmail="+document.getElementById(tagInputEmail).value+"&profilulMeuDespreMine="+document.getElementById(tagTextareaDespreMine).value+"', 'continut');";
//alert(document.getElementById(tagFormProfilulMeu).action);
}
function asincronInput(tagInputUnu,tagInputDoi,classOk,classKo)
{
if(document.getElementById(tagInputUnu).value==document.getElementById(tagInputDoi).value)
document.getElementById(tagInputUnu).className=document.getElementById(tagInputDoi).className=classOk;
else
document.getElementById(tagInputUnu).className=document.getElementById(tagInputDoi).className=classKo;
}
function validare(tagInputParola,classKo)
{
if(document.getElementById(tagInputParola).className==classKo) {alert('Valorile pentru parol\u0103 nu se potrivesc!'); return false;} else return true;
}

function windowWidth()
{
var myWidth=0;
if(typeof(window.innerWidth)=='number')
{
//Non-IE
myWidth=window.innerWidth;
}
else
if(document.documentElement && document.documentElement.clientWidth)
{
//IE 6+ in 'standards compliant mode'
myWidth=document.documentElement.clientWidth;
}
else
if(document.body && document.body.clientWidth)
{
//IE 4 compatible
myWidth=document.body.clientWidth;
}
return myWidth;
}
function windowHeight()
{
var myHeight=0;
if(typeof(window.innerWidth)=='number')
{
//Non-IE
myHeight=window.innerHeight;
}
else
if(document.documentElement && document.documentElement.clientHeight)
{
//IE 6+ in 'standards compliant mode'
myHeight = document.documentElement.clientHeight;
}
else
if(document.body && document.body.clientHeight)
{
//IE 4 compatible
myHeight=document.body.clientHeight;
}
return myHeight;
}

function spreadHW()
{
/*if(chkObject(false,'mesajCenter')){
	//alert(document.getElementById('continut').offsetWidth);
	//alert(document.getElementById('continut_stanga').offsetWidth);
	//alert(document.getElementById('programming_3_1').style.paddingLeft);
document.getElementById('mesajCenter').style.width=String(windowWidth()-document.getElementById('programming_3_1').offsetWidth-document.getElementById('continut_stanga').offsetWidth-document.getElementById('continut_dreapta').offsetWidth-2*6-17-17)+'px';}
*/
}

function emailDestinatarEditStandard(tString)
{
tString=String(tString);
tString=convertHexNCR2Ascii(convertChar2HexNCR(tString)).replace('prenume.nume::furnizorEduca&#x163;ional', '');
if(tString.length>0)
{
while(tString.indexOf(',')==0||tString.indexOf(' ')==0||tString.indexOf(':')==0||tString.indexOf('.')==0||tString.indexOf('_')==0)
tString=tString.substr(1);
while(tString.lastIndexOf(',')==tString.length-1||tString.lastIndexOf(' ')==tString.length-1||tString.lastIndexOf(':')==tString.length-1||tString.lastIndexOf('.')==tString.length-1||tString.lastIndexOf('_')==tString.length-1)
tString=tString.substr(0,tString.length-1);
tString=tString.replace(/,/g, ', ');
while(tString.indexOf('  ')>=0)
tString=tString.replace(/  /g, ' ');
while(tString.indexOf(' ,')>=0)
tString=tString.replace(/ ,/g, ',');
while(tString.indexOf(',,')>=0)
tString=tString.replace(/,,/g, ',');
}
return tString;
}

function emailDestinatarEdit(tagInputDestinatar, tagInputCheckbox)
{
//alert(document.getElementById((String(document.getElementById(tagInputCheckbox).id)+'_SPAN')).innerHTML);
//alert(document.getElementById(tagInputCheckbox).checked);
if(chkObject(false,tagInputDestinatar))
{
if(document.getElementById(tagInputCheckbox).checked)
{
var tString=emailDestinatarEditStandard(String(document.getElementById(tagInputDestinatar).value));
if(tString.length>0)
document.getElementById(tagInputDestinatar).value=tString+', '+document.getElementById((String(document.getElementById(tagInputCheckbox).id)+'_SPAN')).innerHTML;
else
document.getElementById(tagInputDestinatar).value=document.getElementById((String(document.getElementById(tagInputCheckbox).id)+'_SPAN')).innerHTML;
}
else
{
var tString=emailDestinatarEditStandard(String(document.getElementById(tagInputDestinatar).value)).replace(String(document.getElementById((String(document.getElementById(tagInputCheckbox).id)+'_SPAN')).innerHTML), '');
tString=emailDestinatarEditStandard(tString);
document.getElementById(tagInputDestinatar).value=tString;
}
return true;
}
return false;
}

function membruIdentificatorEdit(tagInputDestinatar, tagInputRadio)
{
if(chkObject(false,tagInputDestinatar))
{
var tString=String(document.getElementById((String(document.getElementById(tagInputRadio).id)+'_SPAN')).innerHTML);
tString=emailDestinatarEditStandard(tString);
document.getElementById(tagInputDestinatar).value=tString;
return true;
}
return false;
}

function mesajPrimitView(divMesajPrimitMainId, divMesajPrimitListaId, spanMesajPrimitId, spanMesajPrimitClasa, spanMesajPrimitClasaView, divMesajPrimitId, divMesajPrimitClasa)
{
//alert(spanMesajPrimitClasa);
var ttt=0;
for(var x=0; document.getElementById(divMesajPrimitListaId).childNodes[x]; x++)
if(document.getElementById(divMesajPrimitListaId).childNodes[x].nodeName=='DIV')
{
document.getElementById(divMesajPrimitListaId).childNodes[x].className='continutTextComun';
ttt++;
//alert((document.getElementById(divMesajPrimitListaId).childNodes[x]).id);
//document.getElementById('ancora_'+(document.getElementById(divMesajPrimitListaId).childNodes[x]).id).removeAttribute('class'); 
document.getElementById('ancora_'+(document.getElementById(divMesajPrimitListaId).childNodes[x]).id).className='ancora_continutTextComun';
}
//alert(ttt);
if(spanMesajPrimitClasa!=spanMesajPrimitClasaView)
{
if(!chkObject(false,divMesajPrimitId))
{
//alert(0);
//newDivMesajPrimit=document.createElement("div");
//newDivMesajPrimit.setAttribute('id',divMesajPrimitId);
//newDivMesajPrimit.className=divMesajPrimitClasa;
//document.getElementById(divMesajPrimitMainId).appendChild(newDivMesajPrimit);
}
//document.getElementById(divMesajPrimitListaId).style.width='50%';
document.getElementById(spanMesajPrimitId).className=spanMesajPrimitClasaView;
document.getElementById('ancora_'+spanMesajPrimitId).className='ancora_'+spanMesajPrimitClasaView;
return true;
}
else
{
//alert(1);
//if(chkObject(false,divMesajPrimitId))
//document.getElementById(divMesajPrimitMainId).removeChild(document.getElementById(divMesajPrimitId));
//document.getElementById(divMesajPrimitListaId).style.width='99.8%';
return false
}
}

function mesajTrimisView(divMesajTrimisMainId, divMesajTrimisListaId, spanMesajTrimisId, spanMesajTrimisClasa, spanMesajTrimisClasaView, divMesajTrimisId, divMesajTrimisClasa)
{
//alert(spanMesajTrimisClasa);
var ttt=0;
for(var x=0; document.getElementById(divMesajTrimisListaId).childNodes[x]; x++)
if(document.getElementById(divMesajTrimisListaId).childNodes[x].nodeName=='DIV')
{
document.getElementById(divMesajTrimisListaId).childNodes[x].className='continutTextComun';
ttt++;
//alert((document.getElementById(divMesajTrimisListaId).childNodes[x]).id);
//document.getElementById('ancora_'+(document.getElementById(divMesajTrimisListaId).childNodes[x]).id).removeAttribute('class'); 
document.getElementById('ancora_'+(document.getElementById(divMesajTrimisListaId).childNodes[x]).id).className='ancora_continutTextComun';
}
//alert(ttt);
if(spanMesajTrimisClasa!=spanMesajTrimisClasaView)
{
if(!chkObject(false,divMesajTrimisId))
{
//alert(0);
//newDivMesajTrimis=document.createElement("div");
//newDivMesajTrimis.setAttribute('id',divMesajTrimisId);
//newDivMesajTrimis.className=divMesajTrimisClasa;
//document.getElementById(divMesajTrimisMainId).appendChild(newDivMesajTrimis);
}
//document.getElementById(divMesajTrimisListaId).style.width='50%';
document.getElementById(spanMesajTrimisId).className=spanMesajTrimisClasaView;
document.getElementById('ancora_'+spanMesajTrimisId).className='ancora_'+spanMesajTrimisClasaView;
return true;
}
else
{
//alert(1);
//if(chkObject(false,divMesajTrimisId))
//document.getElementById(divMesajTrimisMainId).removeChild(document.getElementById(divMesajTrimisId));
//document.getElementById(divMesajTrimisListaId).style.width='99.8%';
return false
}
}

function arhivaMesajTrimisView(divMesajTrimisMainId, divMesajTrimisListaId, spanMesajTrimisId, spanMesajTrimisClasa, spanMesajTrimisClasaView, divMesajTrimisId, divMesajTrimisClasa)
{
//alert(spanMesajTrimisClasa);
var ttt=0;
for(var x=0; document.getElementById(divMesajTrimisListaId).childNodes[x]; x++)
if(document.getElementById(divMesajTrimisListaId).childNodes[x].nodeName=='DIV')
{
document.getElementById(divMesajTrimisListaId).childNodes[x].className='continutTextComun';
ttt++;
//alert((document.getElementById(divMesajTrimisListaId).childNodes[x]).id);
//document.getElementById('ancora_'+(document.getElementById(divMesajTrimisListaId).childNodes[x]).id).removeAttribute('class'); 
document.getElementById('ancora_'+(document.getElementById(divMesajTrimisListaId).childNodes[x]).id).className='ancora_continutTextComun';
}
//alert(ttt);
if(spanMesajTrimisClasa!=spanMesajTrimisClasaView)
{
if(!chkObject(false,divMesajTrimisId))
{
//alert(0);
//newDivMesajTrimis=document.createElement("div");
//newDivMesajTrimis.setAttribute('id',divMesajTrimisId);
//newDivMesajTrimis.className=divMesajTrimisClasa;
//document.getElementById(divMesajTrimisMainId).appendChild(newDivMesajTrimis);
}
//document.getElementById(divMesajTrimisListaId).style.width='50%';
document.getElementById(spanMesajTrimisId).className=spanMesajTrimisClasaView;
document.getElementById('ancora_'+spanMesajTrimisId).className='ancora_'+spanMesajTrimisClasaView;
return true;
}
else
{
//alert(1);
//if(chkObject(false,divMesajTrimisId))
//document.getElementById(divMesajTrimisMainId).removeChild(document.getElementById(divMesajTrimisId));
//document.getElementById(divMesajTrimisListaId).style.width='99.8%';
return false
}
}

function arhivaMesajPrimitView(divMesajPrimitMainId, divMesajPrimitListaId, spanMesajPrimitId, spanMesajPrimitClasa, spanMesajPrimitClasaView, divMesajPrimitId, divMesajPrimitClasa)
{
//alert(spanMesajPrimitClasa);
var ttt=0;
for(var x=0; document.getElementById(divMesajPrimitListaId).childNodes[x]; x++)
if(document.getElementById(divMesajPrimitListaId).childNodes[x].nodeName=='DIV')
{
document.getElementById(divMesajPrimitListaId).childNodes[x].className='continutTextComun';
ttt++;
//alert((document.getElementById(divMesajPrimitListaId).childNodes[x]).id);
//document.getElementById('ancora_'+(document.getElementById(divMesajPrimitListaId).childNodes[x]).id).removeAttribute('class'); 
document.getElementById('ancora_'+(document.getElementById(divMesajPrimitListaId).childNodes[x]).id).className='ancora_continutTextComun';
}
//alert(ttt);
if(spanMesajPrimitClasa!=spanMesajPrimitClasaView)
{
if(!chkObject(false,divMesajPrimitId))
{
//alert(0);
//newDivMesajPrimit=document.createElement("div");
//newDivMesajPrimit.setAttribute('id',divMesajPrimitId);
//newDivMesajPrimit.className=divMesajPrimitClasa;
//document.getElementById(divMesajPrimitMainId).appendChild(newDivMesajPrimit);
}
//document.getElementById(divMesajPrimitListaId).style.width='50%';
document.getElementById(spanMesajPrimitId).className=spanMesajPrimitClasaView;
document.getElementById('ancora_'+spanMesajPrimitId).className='ancora_'+spanMesajPrimitClasaView;
return true;
}
else
{
//alert(1);
//if(chkObject(false,divMesajPrimitId))
//document.getElementById(divMesajPrimitMainId).removeChild(document.getElementById(divMesajPrimitId));
//document.getElementById(divMesajPrimitListaId).style.width='99.8%';
return false
}
}

function uploadFile_OLD(idElementInsertBefore)
{
	 // create an empty element node
 // without an ID, any attributes, or any content
 var divFrame = document.createElement("div");

 // give it an id attribute called 'newSpan'
var nowMiliseconds = new Date().getTime();
divFrame.setAttribute("id", "newDiv."+nowMiliseconds);
divFrame.className='continutTextComun';

/*
 // create some content for the newly created element.
 var sp1_content = document.createTextNode("This is a new span element. ");

 // apply that content to the new element
 divFrame.appendChild(sp1_content);
*/
 
var inputFile = document.createElement("input");
inputFile.setAttribute("type", "file"); 
inputFile.id=String("newInputFile."+nowMiliseconds);
inputFile.name=String("newInputFile."+nowMiliseconds);

divFrame.appendChild(inputFile);

if(inputFile.addEventListener)//Mozilla
{
//inputFile.addEventListener("mouseover", function(event){state=onMouseOverAction(state, this); disableContextMenu(this.id);}, false);
inputFile.addEventListener("mouseover", function(event){alert(document.getElementById("newDiv."+nowMiliseconds).innerHTML);}, false);
}
else//IE
{
//inputFile.onmouseover =function(){state=onMouseOverAction(state, this); disableContextMenu(this.id);};
inputFile.onmouseover =function(){alert(document.getElementById("newDiv."+nowMiliseconds).innerHTML);};
}

var inputHidden = document.createElement("input");
inputHidden.setAttribute("type", "hidden"); 
inputHidden.id=String("newInputHidden."+nowMiliseconds);
inputHidden.name=String("newInputHidden."+nowMiliseconds);
inputHidden.value='clientSide';

divFrame.appendChild(inputHidden);

var inputButton = document.createElement("input");
inputButton.setAttribute("type", "button"); 
inputButton.id=String("newInputButton."+nowMiliseconds);
inputButton.name=String("newInputButton."+nowMiliseconds);
inputButton.value='\u015fterge';
inputButton.className='continutTextComunAtentionare';

divFrame.appendChild(inputButton);

if(inputButton.addEventListener)//Mozilla
{
//inputFile.addEventListener("mouseover", function(event){state=onMouseOverAction(state, this); disableContextMenu(this.id);}, false);
inputButton.addEventListener("click", function(event){this.parentNode.parentNode.removeChild(this.parentNode);}, false);
}
else//IE
{
//inputFile.onmouseover =function(){state=onMouseOverAction(state, this); disableContextMenu(this.id);};
inputButton.onclick =function(){this.parentNode.parentNode.removeChild(this.parentNode);};
}

 

 // apply that content to the new element
 
 
 /*
 <input id="file<?php echo(ucfirst($arrayFileItem)); ?>"   name="file<?php echo(ucfirst($arrayFileItem)); ?>"   type="file"   style="" onchange="numeFisier('<?php echo(strtolower($arrayFileItem)); ?>');" <?php if($clientServerSide==='server') { ?>disabled="disabled" <?php } ?>/>
<input id="hidden<?php echo(ucfirst($arrayFileItem)); ?>" name="hidden<?php echo(ucfirst($arrayFileItem)); ?>" type="hidden" style="" value="<?php echo(strtolower($clientServerSide)); ?>" />
<input id="button<?php echo(ucfirst($arrayFileItem)); ?>" name="button<?php echo(ucfirst($arrayFileItem)); ?>" type="button" style="" class="continutTextComunAtentionare" value="&#537;terge" onclick="newLife('<?php echo(strtolower($arrayFileItem)); ?>');" />

<input id="button<?php echo(ucfirst($arrayFileItem)); ?>" name="button<?php echo(ucfirst($arrayFileItem)); ?>" type="button" style="" class="continutTextComunAtentionare" value="&#537;terge" onclick="newLife('<?php echo(strtolower($arrayFileItem)); ?>');" />
 */

 var elementInsertBefore = document.getElementById(idElementInsertBefore);
 var parentElementInsertBefore = elementInsertBefore.parentNode;

 // insert the new element into the DOM before sp2
 parentElementInsertBefore.insertBefore(divFrame, elementInsertBefore);
}























function uploadFile(idDivUploadMain,sessionValue)
{
/*
<div id="divUploadFile<?php echo($i); ?>" class="divUploadFile">
<form method="post" enctype="multipart/form-data" name="form<?php echo($i); ?>" id="form<?php echo($i); ?>" action="upload.cgi?sID=<?php echo($session); ?>form<?php echo($i); ?>" target="form<?php echo($i); ?>_iframe" class="formUploadFile">
<div id="divUploadFileSpread" class="divUploadFileSpread">
<input type="file" name="file<?php echo($i); ?>" onchange="uploadForm('<?php echo 'form'.$i; ?>', '<?php echo $session . 'form' .$i; ?>');" class="inputUploadFile" />
<div class="divUploadFileInfo">
<input id="inputUploadFile<?php echo($i); ?>" name="button<?php echo(ucfirst($arrayFileItem)); ?>" type="button" class="continutTextComunAtentionare" value="&#537;terge" onclick="this.parentNode.parentNode.removeChild(this.parentNode);" />
<div class="fileName" id="<?php echo($session.'form'.$i.'_fileName'); ?>"></div>
</div>
<div class="progressBox"><div class="progressBar" id="<?php echo($session.'form'.$i.'_progress'); ?>"></div></div>
</div>
</form>
<iframe name="form<?php echo($i); ?>_iframe" id="form<?php echo($i); ?>_iframe" src="blank.html" class="loader"></iframe>
</div>
*/

//divUploadFile(1)
var divUploadFile=document.createElement("div");
var nowMiliseconds=new Date().getTime();
divUploadFile.setAttribute("id", "divUploadFile"+nowMiliseconds);
divUploadFile.className='divUploadFile';

var divUploadMain=document.getElementById(idDivUploadMain);
divUploadMain.appendChild(divUploadFile);

//formUpload(1.1)
var formUpload=null;
try
{
formUpload=document.createElement("<form name=\""+String("form"+nowMiliseconds)+"\"></form>");
} catch( e ) {};
if(!formUpload||formUpload.name.toLowerCase()!=String("form"+nowMiliseconds).toLowerCase())
{
formUpload=document.createElement("form");
formUpload.setAttribute("name","form"+nowMiliseconds);
};
formUpload.setAttribute("enctype", "multipart/form-data");
formUpload.setAttribute("encoding", "multipart/form-data");
formUpload.method="post";
formUpload.id=String("form"+nowMiliseconds);
formUpload.action='upload.cgi?sID='+String(sessionValue)+'form'+nowMiliseconds;
formUpload.target="form"+nowMiliseconds+"_iframe";
formUpload.className='formUploadFile';

divUploadFile.appendChild(formUpload);

//var inputFile = document.createElement("input");
//inputFile.setAttribute("type", "multipart/form-data"); 
//inputFile.id=String("newInputFile."+nowMiliseconds);
//inputFile.name=String("newInputFile."+nowMiliseconds);

//formUpload.appendChild(inputFile);

//divUploadFileSpread(1.1.1)
var divUploadFileSpread=document.createElement("div");
divUploadFileSpread.setAttribute("id", "divUploadFileSpread."+nowMiliseconds);
divUploadFileSpread.className='divUploadFileSpread';

formUpload.appendChild(divUploadFileSpread);

//inputUploadFile(1.1.1.1)
var inputUploadFile=null;
try
{
inputUploadFile=document.createElement("<input name=\""+"file"+nowMiliseconds+"\" />");
} catch( e ) {};
if(!inputUploadFile||inputUploadFile.name.toLowerCase()!=String("file"+nowMiliseconds).toLowerCase())
{
inputUploadFile=document.createElement("input");
inputUploadFile.setAttribute("name","file"+nowMiliseconds);
};
inputUploadFile.setAttribute("type","file");
inputUploadFile.id="inputUploadFile."+nowMiliseconds;
inputUploadFile.className='inputUploadFile';

divUploadFileSpread.appendChild(inputUploadFile);

if(inputUploadFile.addEventListener)//Mozilla
{
inputUploadFile.addEventListener("change",function(event){uploadForm('form'+nowMiliseconds,String(sessionValue)+'form'+nowMiliseconds); /*alert(document.getElementById("inputUploadFile."+nowMiliseconds).value);*/},false);
}
else//IE
{
inputUploadFile.onchange=function(){uploadForm('form'+nowMiliseconds,String(sessionValue)+'form'+nowMiliseconds); /*alert(document.getElementById("inputUploadFile."+nowMiliseconds).value);*/};
}

//divUploadFileInfo(1.1.1.2)
var divUploadFileInfo=document.createElement("div");
divUploadFileInfo.setAttribute("id", "divUploadFileInfo."+nowMiliseconds);
divUploadFileInfo.className='divUploadFileInfo';

divUploadFileSpread.appendChild(divUploadFileInfo);

if(divUploadFileInfo.addEventListener)//Mozilla
{
divUploadFileInfo.addEventListener("click", function(event){this.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode);}, false);
}
else//IE
{
divUploadFileInfo.onclick=function(){this.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode);};
}

//(1.1.1.2.1)
//<input id="inputUploadFile<?php echo($i); ?>" name="button<?php echo(ucfirst($arrayFileItem)); ?>" type="button" class="continutTextComunAtentionare" value="&#537;terge" onclick="this.parentNode.parentNode.removeChild(this.parentNode);" />
//<div class="fileName" id="<?php echo($session.'form'.$i.'_fileName'); ?>"></div>
var buttonUploadFile=null;
try
{
buttonUploadFile=document.createElement("<input name=\""+"button."+nowMiliseconds+"\" />");
} catch( e ) {};
if(!buttonUploadFile||buttonUploadFile.name.toLowerCase()!=String("button."+nowMiliseconds).toLowerCase())
{
buttonUploadFile=document.createElement("input");
buttonUploadFile.setAttribute("name","button."+nowMiliseconds);
};
buttonUploadFile.setAttribute("type","button");
buttonUploadFile.id="button."+nowMiliseconds;
buttonUploadFile.className='continutTextComunAtentionare';
buttonUploadFile.value='\u015fterge';

divUploadFileInfo.appendChild(buttonUploadFile);

//DDDfileName(1.1.1.2.2)
var DDDfileName=document.createElement("div");
DDDfileName.setAttribute("id",String(sessionValue)+'form'+nowMiliseconds+'_fileName');
DDDfileName.className='fileName';

divUploadFileInfo.appendChild(DDDfileName);

/*
if(inputFile.addEventListener)//Mozilla
{
//inputFile.addEventListener("mouseover", function(event){state=onMouseOverAction(state, this); disableContextMenu(this.id);}, false);
inputFile.addEventListener("mouseover", function(event){alert(document.getElementById("divUploadFile."+nowMiliseconds).innerHTML);}, false);
}
else//IE
{
//inputFile.onmouseover =function(){state=onMouseOverAction(state, this); disableContextMenu(this.id);};
inputFile.onmouseover =function(){alert(document.getElementById("divUploadFile."+nowMiliseconds).innerHTML);};
}

var inputHidden = document.createElement("input");
inputHidden.setAttribute("type", "hidden"); 
inputHidden.id=String("newInputHidden."+nowMiliseconds);
inputHidden.name=String("newInputHidden."+nowMiliseconds);
inputHidden.value='clientSide';

divUploadFile.appendChild(inputHidden);

var inputButton = document.createElement("input");
inputButton.setAttribute("type", "button"); 
inputButton.id=String("newInputButton."+nowMiliseconds);
inputButton.name=String("newInputButton."+nowMiliseconds);
inputButton.value='\u015fterge';
inputButton.className='continutTextComunAtentionare';

divUploadFile.appendChild(inputButton);

if(inputButton.addEventListener)//Mozilla
{
//inputFile.addEventListener("mouseover", function(event){state=onMouseOverAction(state, this); disableContextMenu(this.id);}, false);
inputButton.addEventListener("click", function(event){this.parentNode.parentNode.removeChild(this.parentNode);}, false);
}
else//IE
{
//inputFile.onmouseover =function(){state=onMouseOverAction(state, this); disableContextMenu(this.id);};
inputButton.onclick =function(){this.parentNode.parentNode.removeChild(this.parentNode);};
}
*/

 

 // apply that content to the new element
 
 
 /*
 <input id="file<?php echo(ucfirst($arrayFileItem)); ?>"   name="file<?php echo(ucfirst($arrayFileItem)); ?>"   type="file"   style="" onchange="numeFisier('<?php echo(strtolower($arrayFileItem)); ?>');" <?php if($clientServerSide==='server') { ?>disabled="disabled" <?php } ?>/>
<input id="hidden<?php echo(ucfirst($arrayFileItem)); ?>" name="hidden<?php echo(ucfirst($arrayFileItem)); ?>" type="hidden" style="" value="<?php echo(strtolower($clientServerSide)); ?>" />
<input id="button<?php echo(ucfirst($arrayFileItem)); ?>" name="button<?php echo(ucfirst($arrayFileItem)); ?>" type="button" style="" class="continutTextComunAtentionare" value="&#537;terge" onclick="newLife('<?php echo(strtolower($arrayFileItem)); ?>');" />

<input id="button<?php echo(ucfirst($arrayFileItem)); ?>" name="button<?php echo(ucfirst($arrayFileItem)); ?>" type="button" style="" class="continutTextComunAtentionare" value="&#537;terge" onclick="newLife('<?php echo(strtolower($arrayFileItem)); ?>');" />
 */

//divProgressBox(1.1.3)
var divProgressBox=document.createElement("div");
divProgressBox.setAttribute("id", "divProgressBox."+nowMiliseconds);
divProgressBox.className='progressBox';

divUploadFileSpread.appendChild(divProgressBox);

//divProgressBar(1.1.3.1)
var divProgressBar=document.createElement("div");
divProgressBar.setAttribute("id",sessionValue+"form"+nowMiliseconds+"_progress");
divProgressBar.className='progressBar';

divProgressBox.appendChild(divProgressBar);

//iframeUpload(1.2)
var iframeUpload=null;
try
{
iframeUpload=document.createElement("<iframe name=\""+"form"+nowMiliseconds+"_iframe"+"\"></iframe>");
} catch( e ) {};
if(!iframeUpload||iframeUpload.name.toLowerCase()!=String("form"+nowMiliseconds+"_iframe").toLowerCase())
{
iframeUpload=document.createElement("iframe");
iframeUpload.setAttribute("name","form"+nowMiliseconds+"_iframe");
}; 
iframeUpload.setAttribute("src", "blank.html");
iframeUpload.id="form"+nowMiliseconds+"_iframe";
iframeUpload.className='loader';

divUploadFile.appendChild(iframeUpload);

}

function attachmentExplode(idDivUploadMain,sessionValue)
{
var tString=sessionValue;
var ttt=0;
for(var x=0; document.getElementById(idDivUploadMain).childNodes[x]; x++)
if(document.getElementById(idDivUploadMain).childNodes[x].nodeName=='DIV')
{
//if(ttt>0)
tString+='|';
nowMiliseconds=(document.getElementById(idDivUploadMain).childNodes[x].id).replace('divUploadFile','');
tString+=nowMiliseconds;
tString+='::';
var fileName=convertHexNCR2Ascii(convertChar2HexNCR(document.getElementById("inputUploadFile."+nowMiliseconds).value));
if(fileName.lastIndexOf('\\')>=0)
fileName=fileName.substring(fileName.lastIndexOf('\\')+1);
tString+=fileName;
ttt++;
}
return tString;
}

function OLD_attachmentExplode(idDivDownloadMain)
{
var tString='';
if(chkObject(false,idDivDownloadMain))
{
//alert(document.getElementById(idDivDownloadMain).innerHTML);
//return false;
var tttQ=0;
for(var x=0;document.getElementById(idDivDownloadMain).childNodes[x];x++)
if(document.getElementById(idDivDownloadMain).childNodes[x].nodeName=='FORM')
{
var ttt=0;
formGlobal=document.getElementById(idDivDownloadMain).childNodes[x];
for(var y=0;formGlobal.childNodes[y];y++)
if(formGlobal.childNodes[y].nodeName=='INPUT')
{
ttt++;
if(ttt==2)
qString=formGlobal.childNodes[y].value;
if(ttt==3&&formGlobal.childNodes[y].checked==true)
{
/*
//alert(String(qString.indexOf('.')+1)+qString);
fileName=qString.substring(0,qString.indexOf('.'))+qString.substring(qString.lastIndexOf('.'));
lungimeCopiere=qString.lastIndexOf('.')-qString.indexOf('.')-1;
nowMiliseconds=qString.substr(qString.indexOf('.')+1,lungimeCopiere);
//if(tttQ>=1)
tString+='|';
tString+=nowMiliseconds+'::'+fileName;
*/
if(tttQ>=1)
tString+='|';
tString+=qString;
}
/*
nowMiliseconds=(document.getElementById(idDivUploadMain).childNodes[x].id).replace('divUploadFile','');
tString+=nowMiliseconds;
tString+='::';
var fileName=convertHexNCR2Ascii(convertChar2HexNCR(document.getElementById("inputUploadFile."+nowMiliseconds).value));
if(fileName.lastIndexOf('\\')>=0)
fileName=fileName.substring(fileName.lastIndexOf('\\')+1);
tString+=fileName;
ttt++;
*/
}
tttQ++;
}
}
return tString;
}
function setFocus(inputTextId)
{
document.getElementById(inputTextId).focus();
}
function loseFocus(inputTextId)
{
document.getElementById(inputTextId).blur();
}

function pause(numberMillis) 
{
var now=new Date();
var exitTime=now.getTime()+numberMillis;
while(true) 
{
now=new Date();
if(now.getTime()>exitTime)
return true;
}
}

function apartenentaArrayPrefix(tablou,prefix)
{
for(var i=0;i<=tablou.length-1;i++)
if(tablou[i].indexOf(prefix)==0)
return true;
return false;
}

function getRadioByPrefix(radioName_prefix){
var inputRadioArray = new Array();
var inputRadioArrayPlus = new Array();
var inputs = document.getElementsByTagName('input');
for(var i=0;i<inputs.length;i++)
{
if(inputs[i].type.toLowerCase()=='radio' && String(inputs[i].name).indexOf(radioName_prefix)==0 && inputs[i].checked)
inputRadioArray.push(String(inputs[i].name).replace(/\&/g, '|ampersand|').replace(/\#/g, '|diez|').replace(/\./g, '|punct|')+'='+String(inputs[i].value));
if(inputs[i].type.toLowerCase()=='radio' && String(inputs[i].name).indexOf(radioName_prefix)==0 && !inputs[i].checked && !apartenentaArrayPrefix(inputRadioArrayPlus,String(inputs[i].name)))
inputRadioArrayPlus.push(String(inputs[i].name));
}
for(var i=0;i<inputRadioArrayPlus.length;i++)
if(!apartenentaArrayPrefix(inputRadioArray,inputRadioArrayPlus[i].replace(/\&/g, '|ampersand|').replace(/\#/g, '|diez|').replace(/\./g, '|punct|')))
inputRadioArray.push(inputRadioArrayPlus[i].replace(/\&/g, '|ampersand|').replace(/\#/g, '|diez|').replace(/\./g, '|punct|')+'='+String("noWay"));
return inputRadioArray.join('&');
}
