/* ARGUS HUMAN RESOURCES made by Valentin Damian */
function getObj(_obj) {
  return document.getElementById(_obj);
}
function evalScript(s) {
    var matchAll = new RegExp('(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)', 'img');
    var matchOne = new RegExp('(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)', 'im');
    var scripts = s.match(matchAll);
    if (scripts!=null) for(i = 0; i< scripts.length; i++) eval(scripts[i].match(matchOne)[1]);
}
function ajax_con(_destination,_url,_variables,_method) {
  //-- Read parameters --
  if (_destination==undefined) this._destination="";
  else this._destination=_destination;
  if (_method==undefined) this._method="GET";
  else this._method=_method;
  this._url=_url;
  this._variables=_variables;
  //-- Now we create the object --
  this.xmlHttp=getXmlHttpObject();
  if (this.xmlHttp==null) {
    alert ("Browser-ul dumneavoastra nu suporta AJAX!");
    return;
  }
  this.xmlHttp.onreadystatechange=stateChanged(this._destination,this.xmlHttp);
  if (this._method=="GET") {
    this.xmlHttp.open(this._method,this._url+"?"+this._variables,true);
    this.xmlHttp.send(null);
  } else {
    this.xmlHttp.open(this._method,this._url,true);
    this.xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    this.xmlHttp.setRequestHeader("Content-length", this._variables.length);
    this.xmlHttp.setRequestHeader("Connection", "close");
    this.xmlHttp.send(this._variables);
  }
  //-- Functions --
  function getXmlHttpObject() {
    var xmlHttp=null;
    try {
      // Firefox, Opera 8.0+, Safari
      xmlHttp=new XMLHttpRequest();
      } catch (e) {
        // Internet Explorer
        try {
          xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
          xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      }
    return xmlHttp;
  }
  function stateChanged (_destination,xmlHttp) {
    this.showState = function() {
      if (xmlHttp.readyState==4) {
        if (xmlHttp.responseText!=0) {
          if (_destination!="") getObj(_destination).innerHTML=xmlHttp.responseText;
          evalScript(xmlHttp.responseText);
        }
      } else if (_destination!="") getObj(_destination).innerHTML="<table style='height:300px; width:100%; text-align:center; vertical-align:middle;' <tr><td><img alt='Se incarca...' src='seincarca.gif' /><br><br>Se incarca...</td></tr></table>";
    }
    return this.showState;
  }
}


//--FUNCTIILE MELE



function change(no) {

if (no==1) {document.getElementById("banner").onclick = function() { var con=new ajax_con("content","fisier1.php"); }; } else document.getElementById("banner").onclick = null;

//if (no==1) {document.getElementById("banner").onclick = function() { var con=new ajax_con("content","fisier1.php"); }; } else document.getElementById("banner").onclick = null;

  document.getElementById("banner").src="imag"+no+".jpg";
for (var i=1;i<=9;i++) document.getElementById("but"+i).style.background="url(img/n"+i+".gif)";
  document.getElementById("but"+no).style.background="url(img/o"+no+".gif)";
 var con=new ajax_con("content","fisier"+no+".php");

}
function r1(no) {
document.getElementById("mediapress").src="rec/mediapress_"+no+".jpg";

}
function r2(no) {
document.getElementById("toppublicitate").src="rec/toppublicitate_"+no+".jpg";
}
function r3(no) {
document.getElementById("bestmedia").src="rec/bestmedia_"+no+".jpg";
}
function r4(no) {
document.getElementById("imprimariobiecte").src="rec/imprimariobiecte_"+no+".jpg";
}
function r5(no) {
document.getElementById("anunturiziare").src="rec/anunturiziare_"+no+".jpg";
}
function r6(no) {
document.getElementById("inmatricularimasini").src="rec/inmatricularimasini_"+no+".jpg";
}
function r7(no) {
document.getElementById("asigurariauto").src="rec/asigurariauto_"+no+".jpg";
}


function submitContact() {
  var s="";
  s+="ip="+document.getElementById("ip").value;
  s+="&httpagent="+document.getElementById("httpagent").value;
  s+="&nume="+document.getElementById("nume").value;
  s+="&telefon="+document.getElementById("telefon").value;
  s+="&email="+document.getElementById("email").value;
  s+="&subiect="+document.getElementById("subiect").value;
  s+="&mesaj="+document.getElementById("mesaj").value;
  //CUM SE NUMESTE DIV-ul (CONTENT) TREBUIE SCHIMBAT
  var con=new ajax_con("content","mesajtrimis.php",s,"POST");
}



function pagina(pg) {
   for (var i=1;i<=9;i++) document.getElementById("but"+i).style.background="url(img/n"+i+".gif)";
  //CUM SE NUMESTE DIV-ul (CONTENT) TREBUIE SCHIMBAT
  var con=new ajax_con("content",pg+".php");

}



function idjob(id) {
  var pv="";
  pv+="idjob="+id;

  //CUM SE NUMESTE DIV-ul (CONTENT) TREBUIE SCHIMBAT
  var con=new ajax_con("content","posturi_vacante.php",pv,"POST");

}


function idjob_c(id) {
  var pv="";
  pv+="idjob_c="+id;

  //CUM SE NUMESTE DIV-ul (CONTENT) TREBUIE SCHIMBAT
  var con=new ajax_con("content","fisier7.php",pv,"POST");

}


function submitCerere() {
  var c="";
  c+="ip="+document.getElementById("ip").value;
  c+="&httpagent="+document.getElementById("httpagent").value;
  c+="&post_solicitat="+document.getElementById("post_solicitat").value;
  c+="&program_lucru="+document.getElementById("program_lucru").value;
  c+="&nume="+document.getElementById("nume").value;
  c+="&adresa="+document.getElementById("adresa").value;
  c+="&starea_civila="+document.getElementById("starea_civila").value;
  c+="&studii="+document.getElementById("studii").value;
  c+="&calificare="+document.getElementById("calificare").value;
  c+="&limbi="+document.getElementById("limbi").value;
  c+="&ocupatie="+document.getElementById("ocupatie").value;
  c+="&locuri_anterioare="+document.getElementById("locuri_anterioare").value;
  c+="&experienta="+document.getElementById("experienta").value;
  c+="&varsta="+document.getElementById("varsta").value;
  c+="&telefon="+document.getElementById("telefon").value;
  c+="&recomandari="+document.getElementById("recomandari").value;
  //CUM SE NUMESTE DIV-ul (CONTENT) TREBUIE SCHIMBAT
  var con=new ajax_con("content","cereretrimisa.php",c,"POST");
}


function submitComanda() {
  var v="";
  v+="ip="+document.getElementById("ip").value;
  v+="&httpagent="+document.getElementById("httpagent").value;
  v+="&nume="+document.getElementById("nume").value;
  v+="&mail="+document.getElementById("mail").value;
  v+="&tel="+document.getElementById("tel").value;
  v+="&detalii="+document.getElementById("detalii").value;
  v+="&serviciu="+document.getElementById("serviciu").value;
  v+="&program="+document.getElementById("program").value;
  v+="&zona="+document.getElementById("zona").value;
  //CUM SE NUMESTE DIV-ul (CONTENT) TREBUIE SCHIMBAT
  var con=new ajax_con("content","comandatrimisa.php",v,"POST");
}


function submitComanda_c() {
  var v="";
  v+="ip="+document.getElementById("ip").value;
  v+="&httpagent="+document.getElementById("httpagent").value;
  v+="&nume="+document.getElementById("nume").value;
  v+="&mail="+document.getElementById("mail").value;
  v+="&tel="+document.getElementById("tel").value;
  v+="&detalii="+document.getElementById("detalii").value;
  v+="&id="+document.getElementById("id").value;
  v+="&denumire_job="+document.getElementById("denumire_job").value;
  v+="&varsta="+document.getElementById("varsta").value;
  v+="&program="+document.getElementById("program").value;
  v+="&zona_disp="+document.getElementById("zona_disp").value;
  v+="&studii="+document.getElementById("studii").value;
  v+="&experienta="+document.getElementById("experienta").value;
  v+="&pagina="+document.getElementById("pagina").value;
  //CUM SE NUMESTE DIV-ul (CONTENT) TREBUIE SCHIMBAT
  var con=new ajax_con("content","comandatrimisa_c.php",v,"POST"); 
  
}


function submitId(id,denumire,locatie,pagina) {
  var i="";
  i+="id_loc="+id;
  i+="&denumire_job="+denumire;
  i+="&locatie="+locatie;
  i+="&pagina="+pagina;
   var con=new ajax_con("content","aplicatie.php",i,"POST");
}

function submitId_c(id,denumire_job,varsta,program,zona_disp,studii,experienta,pagina,lb_straine,cursuri_calif,ocupatie,recomandari) {
  var i="";
  i+="id="+id;
  i+="&denumire_job="+denumire_job;
  i+="&varsta="+varsta;
  i+="&program="+program;
  i+="&zona_disp="+zona_disp;
  i+="&studii="+studii;
  i+="&experienta="+experienta;
  i+="&pagina="+pagina;
  i+="&lb_straine="+lb_straine;
  i+="&cursuri_calif="+cursuri_calif;
  i+="&ocupatie="+ocupatie;
  i+="&recomandari="+recomandari;  
   var con=new ajax_con("content","angajeaza.php",i,"POST");
}

function cauta() {
  var ca="";
  ca+="cauta="+document.getElementById("cauta").value;

	var con=new ajax_con("content","rezultat_cautare.php",ca,"POST");
}






function submitAplicatie() {
  var a="";
  a+="ip="+document.getElementById("ip").value;
  a+="&httpagent="+document.getElementById("httpagent").value;
  a+="&id_loc="+document.getElementById("id_loc").value;
  a+="&denumire_job="+document.getElementById("denumire_job").value;
  a+="&locatie="+document.getElementById("locatie").value;
  a+="&nume="+document.getElementById("nume").value;
  a+="&adresa="+document.getElementById("adresa").value;
  a+="&starea_civila="+document.getElementById("starea_civila").value;
  a+="&studii="+document.getElementById("studii").value;
  a+="&calificare="+document.getElementById("calificare").value;
  a+="&limbi="+document.getElementById("limbi").value;
  a+="&ocupatie="+document.getElementById("ocupatie").value;
  a+="&locuri_anterioare="+document.getElementById("locuri_anterioare").value;
  a+="&experienta="+document.getElementById("experienta").value;
  a+="&varsta="+document.getElementById("varsta").value;
  a+="&telefon="+document.getElementById("telefon").value;
  a+="&recomandari="+document.getElementById("recomandari").value;
  a+="&pagina="+document.getElementById("pagina").value;
  //CUM SE NUMESTE DIV-ul (CONTENT) TREBUIE SCHIMBAT
  var con=new ajax_con("content","aplicatietrimisa.php",a,"POST");
}


//nifty corners




function NiftyCheck()
{
if(!document.getElementById || !document.createElement)
    return(false);
var b=navigator.userAgent.toLowerCase();
if(b.indexOf("msie 5")>0 && b.indexOf("opera")==-1)
    return(false);
return(true);
}

function Rounded(selector,bk,color,size){
var i;
var v=getElementsBySelector(selector);
var l=v.length;
for(i=0;i<l;i++){
    AddTop(v[i],bk,color,size);
    AddBottom(v[i],bk,color,size);
    }
}

function RoundedTop(selector,bk,color,size){
var i;
var v=getElementsBySelector(selector);
for(i=0;i<v.length;i++)
    AddTop(v[i],bk,color,size);
}

function RoundedBottom(selector,bk,color,size){
var i;
var v=getElementsBySelector(selector);
for(i=0;i<v.length;i++)
    AddBottom(v[i],bk,color,size);
}

function AddTop(el,bk,color,size){
var i;
var d=document.createElement("b");
var cn="r";
var lim=4;
if(size && size=="small"){ cn="rs"; lim=2}
d.className="rtop";
d.style.backgroundColor=bk;
for(i=1;i<=lim;i++){
    var x=document.createElement("b");
    x.className=cn + i;
    x.style.backgroundColor=color;
    d.appendChild(x);
    }
el.insertBefore(d,el.firstChild);
}

function AddBottom(el,bk,color,size){
var i;
var d=document.createElement("b");
var cn="r";
var lim=4;
if(size && size=="small"){ cn="rs"; lim=2}
d.className="rbottom";
d.style.backgroundColor=bk;
for(i=lim;i>0;i--){
    var x=document.createElement("b");
    x.className=cn + i;
    x.style.backgroundColor=color;
    d.appendChild(x);
    }
el.appendChild(d,el.firstChild);
}

function getElementsBySelector(selector){
var i;
var s=[];
var selid="";
var selclass="";
var tag=selector;
var objlist=[];
if(selector.indexOf(" ")>0){  //descendant selector like "tag#id tag"
    s=selector.split(" ");
    var fs=s[0].split("#");
    if(fs.length==1) return(objlist);
    return(document.getElementById(fs[1]).getElementsByTagName(s[1]));
    }
if(selector.indexOf("#")>0){ //id selector like "tag#id"
    s=selector.split("#");
    tag=s[0];
    selid=s[1];
    }
if(selid!=""){
    objlist.push(document.getElementById(selid));
    return(objlist);
    }
if(selector.indexOf(".")>0){  //class selector like "tag.class"
    s=selector.split(".");
    tag=s[0];
    selclass=s[1];
    }
var v=document.getElementsByTagName(tag);  // tag selector like "tag"
if(selclass=="")
    return(v);
for(i=0;i<v.length;i++){
    if(v[i].className==selclass){
        objlist.push(v[i]);
        }
    }
return(objlist);
}




///functia pentru over

<!--
function na_preload_img()
{
  var img_list = na_preload_img.arguments;
  if (document.preloadlist == null)
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length; i++) {
    document.preloadlist[top+i] = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  }
}

function na_change_img_src(name, nsdoc, rpath, preload)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  }
}

function na_restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  }
}

// -->







