function newModal(link) {
var zIndex = null;
//zIndex = new Boxy('<div style="width: 300px"><div style="width: 200px;"><div class="arial11bold">Intraţi în contul Dvs.</div><form action="" method="post" class="login"><input type="hidden" name="usertype" value="aplicant" /><input type="hidden" name="from_popup" value="pop" /><input type="hidden" name="job_link" value="' + link + '" /><div style="margin: 5px 0px 0px 0px"><input type="text" name="popup_email" id="popup_email" value="adresa de e-mail" class="textInput" style="width:195px" onblur="defaultEmail(\'show\',\'popup_email\');" onfocus="defaultEmail(\'clear\',\'popup_email\');" /></div><div style="margin: 5px 0px 0px 0px"><input type="password" name="popup_password" value="" class="textInput" style="width:195px" /></div><div style="float: left; margin: 8px 0px 5px 0px; text-align: left;"><a href="{#index#}am-uitat-parola.html">Am uitat parola</a></div><div style="margin: 5px 0px 5px 0px; text-align: right;"><button type="submit" >Intraţi</button></div></form><div class="arial09normalgray">Dupã ce v-aţi logat, aplicarea se face automat.</div></div></div><div id="new_browser" style="width: 300px; text-align: justify; color:#6D6E71;"></div><div style="width: 300px;font-weight:bold; text-align: center; color:#da251d;">Dacă nu aveţi cont daţi click aici<br /><br /><a href="'+link+'"><img src="imgs/style/button-bg-gigant1.png" alt="Vreau jobul" border="0" /></a></div>', { modal: false, title: 'Aplica job', closeText: '[ închide ]', unloadOnHide: true });
//zIndex = new Boxy('<div style="width: 300px"><div style="width: 200px;"><div class="arial11bold">Intraţi în contul Dvs.</div><form action="" method="post" class="login"><input type="hidden" name="usertype" value="aplicant" /><input type="hidden" name="from_popup" value="pop" /><input type="hidden" name="job_link" value="' + link + '" /><div style="margin: 5px 0px 0px 0px"><input type="text" name="popup_email" id="popup_email" value="adresa de e-mail" class="textInput" style="width:195px" onblur="defaultEmail(\'show\',\'popup_email\');" onfocus="defaultEmail(\'clear\',\'popup_email\');" /></div><div style="margin: 5px 0px 0px 0px"><input type="password" name="popup_password" value="" class="textInput" style="width:195px" /></div><div style="float: left; margin: 8px 0px 5px 0px; text-align: left;"><a class="forgot_passwd" href="{#index#}am-uitat-parola.html">Am uitat parola</a></div><div style="margin: 5px 0px 5px 0px; text-align: right;"><button type="submit" >Intraţi</button></div><div class="arial09normalgray">Aplicati cu CV in limba: <br />Romana&nbsp;<input type="radio" name="cv_lang" value="ro" />&nbsp;&nbsp;&nbsp;Engleza&nbsp;<input type="radio" name="cv_lang" value="en" /><br /><br /><span style="color:red;">Atenţie!</span> Dacă agenţia acceptă CV-uri într-o anumită limbă, aplicarea se face automat cu acea limbă. În caz că nu aveţi CV completat în limba respectivă, vă vom redirecţiona la pagina de completare!</div></form></div></div><div id="new_browser" style="width: 300px; text-align: justify; color:#6D6E71;"></div><div style="width: 300px;font-weight:bold; text-align: center; color:#da251d;">În cazul în care nu aveţi cont daţi click aici<br /><br /><a href="'+link+'"><img src="'+index_url+'imgs/style/button-bg-gigant1.png" alt="Vreau jobul" border="0" /></a></div>', { modal: false, title: 'Aplica job', closeText: '[ închide ]', unloadOnHide: true });
zIndex = new Boxy('<div style="width: 300px"><div style="width: 200px;"><div class="arial11bold">Intraţi în contul Dvs.</div><form action="" method="post" class="login"><input type="hidden" name="usertype" value="aplicant" /><input type="hidden" name="from_popup" value="pop" /><input type="hidden" name="job_link" value="' + link + '" /><div style="margin: 5px 0px 0px 0px"><input type="text" name="popup_email" id="popup_email" value="adresa de e-mail" class="textInput" style="width:195px" onblur="defaultEmail(\'show\',\'popup_email\',\'adresa de e-mail\');" onfocus="defaultEmail(\'clear\',\'popup_email\',\'adresa de e-mail\');" /></div><div style="margin: 5px 0px 0px 0px"><input type="password" name="popup_password" value="" class="textInput" style="width:195px" /></div><div style="float: left; margin: 8px 0px 5px 0px; text-align: left;"><a class="forgot_passwd" href="{#index#}am-uitat-parola.html">Am uitat parola</a></div><div style="margin: 5px 0px 5px 0px; text-align: right;"><button type="submit" >Intraţi</button></div><div class="arial09normalgray">Aplicati cu CV in limba: <br />Romana&nbsp;<input type="radio" name="cv_lang" value="ro" />&nbsp;&nbsp;&nbsp;Engleza&nbsp;<input type="radio" name="cv_lang" value="en" /><br /><br /><span style="color:red;">Atenţie!</span> Dacă agenţia acceptă CV-uri într-o anumită limbă, aplicarea se face automat cu acea limbă. În caz că nu aveţi CV completat în limba respectivă, vă vom redirecţiona la pagina de completare!</div></form></div></div><div id="new_browser" style="width: 300px; text-align: justify; color:#6D6E71;"></div><div style="width: 300px;font-weight:bold; text-align: center; color:#da251d;">În cazul în care nu aveţi cont daţi click aici<br /><br /><button class="gigant" onclick="javascript:location.href=\''+link+'\'">Creare cont</button></div>', { modal: true, title: 'Aplica job', closeText: '[ închide ]', unloadOnHide: true });
zIndex.toTop();
GetBrowserInfo();
}

function newModalAniversarMessage(mes) {
var zIndex = null;
zIndex = new Boxy('<div style="width: 300px;"><div style="margin: 5px 0px 0px 0px">'+mes+'</div></div>', { modal: false, title: 'Tjobs.ro are 2 Ani', closeText: '[ închide ]', unloadOnHide: true });
zIndex.toTop();
GetBrowserInfo();
}

function newModalAniversarInfo(numeProdus) {
var swfVersionStr = "10.1.52";
			var xiSwfUrlStr = "";
			var flashvars = {};
            flashvars.textcontent = numeProdus;
			var params = {};
			params.quality = "high";
			params.bgcolor = "#ffffff";
			params.play = "true";
			params.loop = "true";
			params.wmode = "transparent";
			params.scale = "exactfit";
			params.menu = "true";
			params.devicefont = "false";
			params.salign = "";
            
			params.allowscriptaccess = "sameDomain";
			var attributes = {};
			attributes.id = "confeti";
			attributes.name = "confeti";
			attributes.align = "middle";
			swfobject.createCSS("html", "height:100%; background-color: #ffffff;");
			swfobject.createCSS("body", "margin:0; padding:0; overflow:auto; height:100%;");
			swfobject.embedSWF(
				"/imgs/style/aniversare/confeti.swf", "flashContent",
				"750", "500",
				swfVersionStr, xiSwfUrlStr,
				flashvars, params, attributes);

var zIndex = null;
zIndex = new Boxy('<div style="width: 750px;height:500px"><div style="margin: 5px 0px 0px 0px" id="flashContent"><a href="http://www.adobe.com/go/getflash"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a><p>This page requires Flash Player version 10.1.52 or higher.</p></div></div>', { modal: true, title: 'Tjobs.ro are 2 Ani', closeText: '[închide]', unloadOnHide: true });
zIndex.toTop();
GetBrowserInfo();
}

function newModalAniversarInfo1(numeProdus) {
alert(numeProdus);
var swfVersionStr = "10.1.52";
			var xiSwfUrlStr = "";
			var flashvars = {};
            flashvars.textcontent = numeProdus;
			var params = {};
			params.quality = "high";
			params.bgcolor = "#ffffff";
			params.play = "true";
			params.loop = "true";
			params.wmode = "transparent";
			params.scale = "exactfit";
			params.menu = "true";
			params.devicefont = "false";
			params.salign = "";
            
			params.allowscriptaccess = "sameDomain";
			var attributes = {};
			attributes.id = "confeti";
			attributes.name = "confeti";
			attributes.align = "middle";
			swfobject.createCSS("html", "height:100%; background-color: #ffffff;");
			swfobject.createCSS("body", "margin:0; padding:0; overflow:auto; height:100%;");
			swfobject.embedSWF(
				"/imgs/style/aniversare/confeti.swf", "flashContent",
				"600", "500",
				swfVersionStr, xiSwfUrlStr,
				flashvars, params, attributes);

var zIndex = null;
zIndex = new Boxy('<div style="width: 600px;height:500px"><div style="margin: 5px 0px 0px 0px" id="flashContent"><a href="http://www.adobe.com/go/getflash"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a><p>This page requires Flash Player version 10.1.52 or higher.</p></div></div>', { modal: true, title: 'Tjobs.ro are 2 Ani', closeText: '[închide]', unloadOnHide: true });
zIndex.toTop();
GetBrowserInfo();
}

function newModalLogged(link) {
var zIndex = null;
zIndex = new Boxy('<div style="width: 300px"><div style="width: 200px;"><form action="" method="post" class="login"><input type="hidden" name="from_popup_modal_logged" value="pop" /><input type="hidden" name="job_link" value="' + link + '" /><div class="arial09normalgray">Aplicati cu CV in limba: <br />Romana&nbsp;<input type="radio" name="cv_lang" value="ro" checked />&nbsp;&nbsp;&nbsp;Engleza&nbsp;<input type="radio" name="cv_lang" value="en" /><br /><div style="margin: 5px 0px 5px 0px; text-align: right;"><button type="submit" >Aplicati</button></div><br /><span style="color:red;">Atenţie!</span> Dacă agenţia acceptă CV-uri într-o anumită limbă, aplicarea se face automat cu acea limbă. În caz că nu aveţi CV completat în limba respectivă, vă vom redirecţiona la pagina de completare!</div></form></div></div><div id="new_browser" style="width: 300px; text-align: justify; color:#6D6E71;"></div>', { modal: true, title: 'Aplica job', closeText: '[inchide]', unloadOnHide: true });
zIndex.toTop();
GetBrowserInfo();
}
function newModalCvPro(link) {
var zIndex = null;
zIndex = new Boxy('<div style="width: 300px"><div style="width: 200px;"><div class="arial11bold">Intraţi în contul Dvs.</div><form action="" method="post" class="login"><input type="hidden" name="usertype" value="aplicant" /><input type="hidden" name="from_popup" value="pop" /><input type="hidden" name="job_link" value="' + link + '" /><div style="margin: 5px 0px 0px 0px"><input type="text" name="popup_email" id="popup_email" value="adresa de e-mail" class="textInput" style="width:195px" onblur="defaultEmail(\'show\',\'popup_email\',\'adresa de e-mail\');" onfocus="defaultEmail(\'clear\',\'popup_email\',\'adresa de e-mail\');" /></div><div style="margin: 5px 0px 0px 0px"><input type="password" name="popup_password" value="" class="textInput" style="width:195px" /></div><div style="float: left; margin: 8px 0px 5px 0px; text-align: left;"><a class="forgot_passwd" href="{#index#}am-uitat-parola.html">Am uitat parola</a></div><div style="margin: 5px 0px 5px 0px; text-align: right;"><button type="submit" >Intraţi</button></div></form></div></div><div id="new_browser" style="width: 300px; text-align: justify; color:#6D6E71;"></div><div style="width: 300px;font-weight:bold; text-align: center; color:#da251d;">Dacă nu aveţi cont daţi click aici<br /><br /><button class="gigant" onclick="javascript:location.href=\''+index_url+'creaza-cont\'">Creare cont</button></div>', { modal: true, title: 'Cumpara CV promovat', closeText: '[ închide ]', unloadOnHide: true });
zIndex.toTop();
GetBrowserInfo();
}
function newModalDownload(link) {
var zIndex = null;
zIndex = new Boxy('<div style="width: 300px"><div style="width: 200px;"><div class="arial11bold">Intraţi în contul Dvs.</div><form action="" method="post" class="login"><input type="hidden" name="usertype" value="aplicant" /><input type="hidden" name="from_popup" value="pop" /><input type="hidden" name="job_link" value="' + link + '" /><div style="margin: 5px 0px 0px 0px"><input type="text" name="popup_email" id="popup_email" value="adresa de e-mail" class="textInput" style="width:195px" onblur="defaultEmail(\'show\',\'popup_email\',\'adresa de e-mail\');" onfocus="defaultEmail(\'clear\',\'popup_email\',\'adresa de e-mail\');" /></div><div style="margin: 5px 0px 0px 0px"><input type="password" name="popup_password" value="" class="textInput" style="width:195px" /></div><div style="float: left; margin: 8px 0px 5px 0px; text-align: left;"><a class="forgot_passwd" href="{#index#}am-uitat-parola.html">Am uitat parola</a></div><div style="margin: 5px 0px 5px 0px; text-align: right;"><button type="submit" >Intraţi</button></div></form></div></div><div id="new_browser" style="width: 300px; text-align: justify; color:#6D6E71;">Pentru a descărca ghidurile, trebuie să vă logaţi!</div><div style="width: 300px;font-weight:bold; text-align: center; color:#da251d;">Dacă nu aveţi cont daţi click aici<br /><br /><button class="gigant" onclick="javascript:location.href=\''+index_url+'creaza-cont\'">Creare cont</button></div>', { modal: true, title: 'Descarcă ghid', closeText: '[ închide ]', unloadOnHide: true });
zIndex.toTop();
GetBrowserInfo();
}
function newModalMareaLaudarosenie(link) {
var zIndex = null;
zIndex = new Boxy('<div style="width: 300px;"><div style="width: 200px;"><div class="arial11bold">Intraţi în contul Dvs.</div><form action="" method="post" class="login"><input type="hidden" name="usertype" value="aplicant" /><input type="hidden" name="from_popup" value="pop" /><input type="hidden" name="job_link" value="' + link + '" /><div style="margin: 5px 0px 0px 0px"><input type="text" name="popup_email" id="popup_email" value="adresa de e-mail" class="textInput" style="width:195px" onblur="defaultEmail(\'show\',\'popup_email\',\'adresa de e-mail\');" onfocus="defaultEmail(\'clear\',\'popup_email\',\'adresa de e-mail\');" /></div><div style="margin: 5px 0px 0px 0px"><input type="password" name="popup_password" value="" class="textInput" style="width:195px" /></div><div style="float: left; margin: 8px 0px 5px 0px; text-align: left;"><a class="forgot_passwd" href="{#index#}am-uitat-parola.html">Am uitat parola</a></div><div style="margin: 5px 0px 5px 0px; text-align: right;"><button type="submit" >Intraţi</button></div></form></div></div><div id="new_browser" style="width: 300px; text-align: justify; color:#6D6E71;">Pentru a putea vota trebuie să vă logaţi!</div><div style="width: 300px;font-weight:bold; text-align: center; color:#da251d;">Dacă nu aveţi cont daţi click aici<br /><br /><button class="gigant" onclick="javascript:location.href=\''+index_url+'creaza-cont\'">Creare cont</button></div>', { modal: true, title: 'Fii Mândria Ţării', closeText: '[ închide ]', unloadOnHide: true });
zIndex.toTop();
GetBrowserInfo();
}
function scrisoarePopup(text) {
var zIndex = null;
zIndex = new Boxy('<div id="my_letter" style="width: 550px; height: 400px; overflow: auto;">'+ text +'</div>', { modal: false, title: 'Model scrisoare', closeText: '[ închide ]', unloadOnHide: true });
zIndex.toTop();
}
function newModalInfo(mes) {
var zIndex = null;
zIndex = new Boxy('<div style="width: 300px;"><div style="margin: 5px 0px 0px 0px">'+mes+'</div></div>', { modal: true, title: 'Informaţii', closeText: '[ închide ]', unloadOnHide: true });
zIndex.toTop();
GetBrowserInfo();
}
function newModalSmsInfo(mes, link) {
var zIndex = null;
zIndex = new Boxy('<div style="width: 300px;"><div style="margin: 5px 0px 0px 0px">'+mes+'</div></div>', { modal: true, title: 'Informaţii', closeText: '[ închide ]', unloadOnHide: true, afterHide: function(){if(link != null){ document.location.href = link;} jQuery("#msgTcnt").hide();jQuery("#msgTcnt").html();} });
zIndex.toTop();
GetBrowserInfo();
}
function newModalSmsConfirm(mes,frm) {
var zIndex = null;
zIndex = new Boxy.confirm('<div style="width: 300px;"><div style="margin: 5px 0px 0px 0px">'+mes+'</div></div>',function() { jQuery('#'+frm).submit(); }, { modal: true, title: 'Trimitere MSG-T', closeText: '[ închide ]', unloadOnHide: true });
GetBrowserInfo();
}
function defaultEmail(value) {
if (value == "show") {
if ($("email").value == "") {
$("email").value = "adresa de e-mail";
}
}
if (value == "clear") {
if ($("email").value == "adresa de e-mail") {
$("email").value = "";
}
}
}
function defaultEmail(value, field) {
if (value == "show") {
if ($(field).value == "") {
$(field).value = "adresa de e-mail";
}
}
if (value == "clear") {
if ($(field).value == "adresa de e-mail") {
$(field).value = "";
}
}
}

function defaultEmail(value, field, txte) {
if (value == "show") {
if ($(field).value == "") {
//$(field).value = "adresa de e-mail";
$(field).value = txte;
}
}
if (value == "clear") {
//if ($(field).value == "adresa de e-mail") {
if ($(field).value == txte) {
$(field).value = "";
}
}
} 
//GET BROWSER INFO
function GetBrowserInfo(){
var x = navigator;
var Version= x.appVersion;
var searchIE;
searchIE = Version.indexOf("MSIE ", 0);
if(searchIE > 0){
var vers = Version.substring(searchIE + 5, searchIE + 6);
try{
if((vers == "5")||((vers == "6"))){
$("new_browser").innerHTML = "Pentru a vizualiza corect site-ul vă recomandăm să upgradaţi Internet Explorer la <a href='http://www.microsoft.com/downloads/details.aspx?FamilyId=9AE91EBE-3385-447C-8A30-081805B2F90B&displaylang=en'>Internet Explorer 7</a>.<br /><br />Sau să folosiţi unul din urmatoarele browsere:<br /><a href='http://www.mozilla.com/products/download.html?product=firefox-3.5.4&os=win&lang=en-US'>Mozilla Firefox</a><br /><a href='http://www.opera.com/download/get.pl?id=32560&thanks=true&sub=true'>Opera</a><br /><a href='http://www.google.com/chrome/eula.html?hl=ro&brand=CHMB&utm_campaign=ro&utm_source=ro-ha-emea-ro-sk&utm_medium=ha'>Chrome</a>";
}
}catch(Err){}
}
}
// SAVE CV
function saveCV(uid) {
var nocontact = 0;
nocontact = jQuery('input[name=\"nocontact\"]:checked').length;
if(nocontact > 0 ){
	var url = 'ajax.php?function=savecv&uid=' + uid + '&nocontact=noc';
}else{
	var url = 'ajax.php?function=savecv&uid=' + uid;
}
location.href = url;
}
// SEND CV
function sendCV(uid) {
var url = 'ajax.php?function=ssendcv&uid=' + uid;
location.href = url;
}
// SEND JOB WHEN USER IS NOT LOGGED
function sendCVPopup(aid,reg_a,reg_b,from, see_cv_rand) {
var zIndex = null;
Boxy.ask('<div style="width: 400px; height: 200px;"><form action="#" method="post" class="login" id="friendFrm"><input type="hidden" name="section" value="sendcv" /><input type="hidden" name="enforcer" value="send" /><input type="hidden" name="aid" value="'+aid+'" /><input type="hidden" name="from_page" value="' + from + '" /><input type="hidden" name="see_cv_rand" value="' + see_cv_rand + '" /><ul><li><label for="from">Expeditor&nbsp;<font color="#da251d">*</font></label><br/><input type="text" name="from" id="from" value="" class="textInput" style="width: 300px" /><br/><br/></li><li><label for="to">Destinatar&nbsp;<font color="#da251d">*</font></label><br/><input type="text" name="to" id="to" value="" style="width: 300px" /><br/><br/></li><li>Completaţi căsuţa de mai jos cu rezultatul sumei!<br/><label for="sum" style="width: 50px">&nbsp;' + reg_a + '&nbsp;+&nbsp;' + reg_b + '&nbsp;=?&nbsp;<font color="#da251d">*</font></label>&nbsp;<input type="text" name="sum" id="sum" value="" size="5" /><br/></li></ul></form><div class="arial11normal">Toate campurile marcate cu <font color="#da251d">*</font> sunt obligatorii.</div></div>', {"1":"Trimite","2":"Renunţă"}, function(r) {if (r == 1) submitSendCV(aid);});

}
// SUBMIT SEND JOB
function submitSendCV(uid) {
var parameters = jQuery("#friendFrm").serialize();
jQuery.ajax({
url: 'ajax.php?function=ssendcv&uid=' + uid,
type: 'POST',
cache: false,
dataType: 'html',
data: parameters,
error: function(){
alert('Eroare comunicare!');
},
success: function(response){
alert(response);
}
});
}
// SEND JOB WHEN USER IS LOGGED
function sendJob(aid,reg_a,reg_b,from,details_rand) {
var zIndex = null;
Boxy.ask('<div style="width: 400px; height: 200px;"><form action="#" method="post" class="login" id="friendFrm"><input type="hidden" name="section" value="sendjob" /><input type="hidden" name="enforcer" value="send" /><input type="hidden" name="aid" value="'+aid+'" /><input type="hidden" name="from_page" value="' + from + '" /><input type="hidden" name="details_rand" value="' + details_rand + '" /><ol><li><label for="to">Destinatar&nbsp;<font color="#da251d">*</font></label><input type="text" name="to" id="to" value="" class="textInput" style="width: 350px" /><br/><span class="arial11normal">Mai multe adrese pot fi despărţite de ( <font color="#DA251D"><b>;</b></font> ) !</span></li><li>&nbsp;</li><li>Completaţi căsuţa de mai jos cu rezultatul sumei!</li><li><label for="sum" style="width: 50px">' + reg_a + '&nbsp;+&nbsp;' + reg_b + '&nbsp;=?&nbsp;<font color="#da251d">*</font></label>&nbsp;<input type="text" name="sum" id="sum" value="" size="5" /></li><li>&nbsp;</li></ol></form><div class="arial11normal">Toate campurile marcate cu <font color="#DA251D">*</font> sunt obligatorii.</div></div>', {"1":"Trimite","2":"Renunţă"}, function(r) {if (r == 1) submitSendJob(); });
}
// SEND JOB WHEN USER IS NOT LOGGED
function sendJobUnlogged(aid,reg_a,reg_b,from,details_rand) {
var zIndex = null;
Boxy.ask('<div style="width: 400px; height: 200px;"><form action="#" method="post" class="login" id="friendFrm"><input type="hidden" name="section" value="sendjob" /><input type="hidden" name="enforcer" value="send" /><input type="hidden" name="aid" value="'+aid+'" /><input type="hidden" name="from_page" value="' + from + '" /><input type="hidden" name="details_rand" value="' + details_rand + '" /><ol><li><label for="from">Expeditor&nbsp;<font color="#da251d">*</font></label><input type="text" name="from" id="from" value="" class="textInput" style="width: 350px" /></li><li>&nbsp;</li><li><label for="to">Destinatar&nbsp;<font color="#da251d">*</font></label><input type="text" name="to" id="to" value="" class="textInput" style="width: 350px" /><br/><span class="arial11normal">Mai multe adrese pot fi despărţite de ( <font color="#DA251D"><b>;</b></font> ) !</span></li><li>&nbsp;</li><li>Completaţi căsuţa de mai jos cu rezultatul sumei!</li><li><label for="sum" style="width: 50px">' + reg_a + '&nbsp;+&nbsp;' + reg_b + '&nbsp;=?&nbsp;<font color="#da251d">*</font></label>&nbsp;<input type="text" name="sum" id="sum" value="" size="5" /></li><li>&nbsp;</li></ol></form><div class="arial11normal">Toate campurile marcate cu <font color="Red">*</font> sunt obligatorii.</div></div>', {"1":"Trimite","2":"Renunţă"}, function(r) {if (r == 1) submitSendJob();});
}
// SUBMIT SEND JOB
function submitSendJob() {
var parameters = jQuery("#friendFrm").serialize();
jQuery.ajax({
url: index_url+'ajax.php?function=sendjob',
type: 'POST',
cache: false,
dataType: 'html',
data: parameters,
error: function(){
alert('Eroare comunicare!');
},
success: function(response){
alert(response);
}
});
}
// SAVE JOB
function saveJob(aid) {
jQuery.ajax({
url: index_url+'ajax.php?function=savejob',
type: 'GET',
cache: false,
dataType: 'html',
data: 'aid='+aid,
error: function(){
alert('Eroare comunicare!');
},
success: function(response){
alert(response);
}
});
}
//////////////////////////////////////////////////
//////////////////////////////////////////////////
// SEND NEW ACTIVATION EMAIL SECURITY QUESTION
function sendNewAct(reg_a,reg_b, inactiv_rand) {
var zIndex = null;
Boxy.ask('<div style="width: 400px; height: 200px;"><form action="#" method="post" id="nacFrm" name="nacFrm"><input type="hidden" name="enforcer" value="send" /><input type="hidden" name="from_page" value="cont_invalid" /><input type="hidden" name="inactiv_rand" value="' + inactiv_rand + '" /><ol><li>Completaţi căsuţa de mai jos cu rezultatul sumei!</li><li><label for="sum" style="width: 50px">' + reg_a + '&nbsp;+&nbsp;' + reg_b + '&nbsp;=?&nbsp;<font color="#da251d">*</font></label>&nbsp;<input type="text" name="sum" id="sum" value="" size="5" maxlength="2" /></li><li>&nbsp;</li></ol></form><div class="arial11normal">Toate campurile marcate cu <font color="#DA251D">*</font> sunt obligatorii.</div></div>', {"1":"Trimite","2":"Renunţă"}, function(r) {if (r == 1) resendActivation(); });
}

function resendActivation(){
var dataString = 'function=resendActivation';
var parameters = jQuery("#nacFrm").serialize();
jQuery.ajax({
url: index_url+'ajax.php?' + dataString,
type: 'POST',
cache: false,
dataType: 'html',
data: parameters,
error: function(){
alert('Eroare comunicare!');
},
success: function(response){
alert(response);
window.location='cont-inactiv';
}
});
}
//////////////////////////////////////////////////
//////////////////////////////////////////////////



// SAVE POLL
function savepoll() {
var parameters = jQuery("#pollFrm").serialize();
jQuery('#sondaj').html('<div style="text-align: center"><img src="imgs/backend/loading.gif" /></div>');
jQuery.ajax({
url: index_url+'ajax.php?function=savepoll',
type: 'POST',
cache: false,
dataType: 'html',
data: parameters,
error: function(){
alert('Eroare comunicare!');
},
success: function(response){
jQuery('#sondaj').html(response);
myJsProgressBarHandler = new JS_BRAMUS.jsProgressBarHandler();
}
});
}
// GET POLL RESULTS
function getpollresults() {
var parameters = jQuery("#pollFrm").serialize();
jQuery('#sondaj').html('<div style="text-align: center"><img src="imgs/backend/loading.gif" /></div>');
jQuery.ajax({
url: index_url+'ajax.php?function=getpollresults',
type: 'POST',
cache: false,
dataType: 'html',
data: parameters,
error: function(){
alert('Eroare comunicare!');
},
success: function(response){
jQuery('#sondaj').html(response);
myJsProgressBarHandler = new JS_BRAMUS.jsProgressBarHandler();
}
});
}
// LIMIT CHARS
function limitText(limitField, limitNum) {
if (limitField.value.length > limitNum) {
limitField.value = limitField.value.substring(0, limitNum);
}
}
// ADD LANGUAGE
function addLanguage() {
if ($('limbi').value) {
$('limbi_straine').value = $('limbi_straine').value + $('limbi').value + " - " + $('nivel').value + "\n";
}
}
// ADD EXPERIENTA
function addExperienta() {
if ($('pstart_y').value > $('pstop_y').value) {
alert('Ati introdus gresit data.');
} else {
if ($('functia').value) {
$('cv_experienta').value = $('cv_experienta').value + 'Functia:' + $('functia').value + '\nDepartamentul: ' + $('departament').value + "\nPerioada: " + jQuery('#pstart_m :selected').text() + " " + $('pstart_y').value + " - " + jQuery('#pstop_m :selected').text() + " " + $('pstop_y').value +
"\nActivităţi: " + $('activitati').value + "\nAngajator: " + $('angajator').value + "\n\n";
$('functia').value = "";
$('activitati').value = "";
$('angajator').value = "";
}
}
}
// ADD EDUCATIE
function addEducatie() {
if ($('estart_y').value > $('estop_y').value) {
alert('Ati introdus gresit data.');
} else {
if ($('calificare').value) {
$('cv_educatie').value = $('cv_educatie').value + 'Specializare:' +$('calificare').value + "\n Perioada: " + jQuery('#estart_m :selected').text() + " " + $('estart_y').value + " - " + jQuery('#estop_m :selected').text() + " " + $('estop_y').value + "\n" +
"Domenii studiate: " + $('competente').value + "\nInstituţia: " + $('institutie').value + "\n\n";
$('calificare').value = "";
$('competente').value = "";
$('institutie').value = "";
}
}
}
// ADD PERMIS
function addPermis() {
if ($('permis').value == 'da') {
if(($('permis_categorie').value =='Alegeţi categorie') || jQuery('#valabil_m :selected').text().length < 0 || $('valabil_y').value.length < 0){alert('                    Selectaţi Categoria, \r\n\r\n                    luna şi anul valabilităţii!');}else{
$('cv_permis_auto').value = $('cv_permis_auto').value + 'Categorie: ' + $('permis_categorie').value + '\nValabil din: ' + jQuery('#valabil_m :selected').text() + " " + $('valabil_y').value + "\n\n";
$('permis_categorie').value = "";

}
}else if ($('permis').value != 'nu')if($('permis_categorie').value !='Alegeţi categorie'){alert('                    Selectaţi permisul auto!');}
}

// CHECK/UNCHECK ALL
function selectAll(withMessage) {
var fr = document.getElementsByTagName('input');
for (var i = 0; i < fr.length; ++i){
if (fr[i].type == 'checkbox') {
fr[i].checked = document.getElementById('selectall').checked;
if(withMessage != null){
checkAllEvents(fr[i].id);
}
}
}
if(withMessage != null){
if(ap_ids != null && ap_ids.length > 0 && aid != null && pid != null ){
ap_ids = encodeURIComponent(Base64.encode(ap_ids));
initLoc = 0;
sendAllCheckStatus(aid, pid, initLoc, ap_ids, marks);
ap_ids = '';
}
}
}
function postHere() {
document.addFrm.onsubmit = "";
document.addFrm.target = "_self";
document.addFrm.submit();
}
function redirectOutput() {
var w = window.open('about:blank','preview','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=1100,height=860,top=20,left=100');
document.addFrm.target = "preview";
return true;
}
// ALERT SUBMIT FORM
function submitMe() {
if (confirm('Sunteţi sigur că doriţi să salvati datele introduse?')) {
return true;
} else {
return false;
}
}
function submitMe2() {
if (confirm('Sunteţi sigur că doriţi să ştergeţi contul Dvs. la Tjobs.ro?')) {
return true;
} else {
return false;
}
}
function submitMe3() {
if (confirm('Sunteţi sigur că doriţi să suspendaţi contul Dvs. pe Tjobs.ro?')) {
return true;
} else {
return false;
}
}
function DoNav(theUrl)
{
document.location.href = theUrl;
}
function DoNavNTab(theUrl)
{
window.open(theUrl);
return false;
}
var adclosed = false;
var winresized = false;
/*CHECK IF FIELD IS NUMERIC*/
function IsNumeric(sText)
{
var sText = sText;
var ValidChars = "0123456789";
var IsNumber=true;
var Char;
if(sText.length == 0){
IsNumber = false;
}else{
for (i = 0; i < sText.length && IsNumber == true; i++){
Char = sText.charAt(i); 
if (ValidChars.indexOf(Char) == -1){
IsNumber = false;
}
}
}
return IsNumber;
}
/*SET PRICE PER BOUGHT JOB*/
function pricePerJobs(quantField,price){
	var costField = quantField + 'cost';
	if(IsNumeric($(quantField).value)){
		var quant = parseInt($(quantField).value);
		var sum = price * quant;
		$(costField).innerHTML = 'Cost: '+ sum +' &euro;';
	}else{
		$(costField).innerHTML = 'Cost: 0 &euro;';
	}
}
/*EMPTY QUANTITY FIELD AND PRICE ON ADD TO BASKET*/
function clearQuant(quantField){
	var costField = quantField + 'cost';
	$(quantField).value = '';
	$(costField).innerHTML = 'Cost: 0 &euro;';
}
function toggleEditDiv(){
	if(document.getElementById('edit_letter').style.display == 'none'){
		document.getElementById('edit_letter').style.display = 'inline';
	}else{
		document.getElementById('edit_letter').style.display = 'none';
	}
}
var previousClassName = "";
function toggleExplOn(expl){
	if($(expl+"_exp").style.display=='none')
		$(expl+"_exp").style.display='inline';
	if(document.getElementById("cv_"+expl) != null){
		previousClassName = $("cv_"+expl).className;
		$("cv_"+expl).className = "focus";
	}
}
function toggleExplOff(expl){
	if($(expl+"_exp").style.display=='inline')
		$(expl+"_exp").style.display='none';
	if(document.getElementById("cv_"+expl) != null)
		$("cv_"+expl).className = previousClassName;
}
var previousClassNameAn = "";
function toggleExplOnAn(expl){
	if($(expl+"_exp").style.display=='none')
		$(expl+"_exp").style.display='inline';
	if(document.getElementById(expl) != null){
		previousClassNameAn = $(expl).className;
		$(expl).className = "focus";
	}
}
function toggleExplOffAn(expl){
	if($(expl+"_exp").style.display=='inline')
		$(expl+"_exp").style.display='none';
	if(document.getElementById(expl) != null)
		$(expl).className = previousClassNameAn;
}
function toggleStudii(){
	var studii = $("cv_nivel_studii");
	if(studii.options[studii.selectedIndex].value == "Altul"){
		if($("nivel_studii_alt").style.display != ""){
			$("nivel_studii_alt").style.display = "";
		}
	}else
		$("nivel_studii_alt").style.display = "none";
}
function UncheckLangOld(lang)
{
	for(var i=1;i<4;i++){
		if($(lang+i).id != null){
			$(lang+i).checked = false;
		}
	}
}/*  */
function UncheckLang(lang)
{
	if(document.getElementById(lang).checked == true || document.getElementById(lang + "2").checked == true || document.getElementById(lang + "3").checked == true){
		document.getElementById(lang).checked = false;
		document.getElementById(lang + "2").checked = false;
		document.getElementById(lang + "3").checked = false;
	}
}

function CheckExp(){
	if(document.getElementById("nuam").id != null){
		if($("nuam").checked ==  true){
			$("next").style.display = "none";
			
			$("nextpage").value = "next";
			$("submitnext").style.display = "inline";
			$("submitnext").focus();
			$("save").style.display = "none";
			toggleFormElements(true);
		}else{
			$("submitnext").style.display = "none";
			$("next").style.display = "none";
			$("next").blur();
			$("nextpage").value = "";
			$("save").style.display = "inline";
			
			toggleFormElements(false);
		}
	}
}
//DISABLE INPUTS IN CV EXPERIENCE IF USER HAS CHECKED "NO EXPERIENCE"
function toggleFormElements(disable)
{
	var elem = document.getElementById('regFrm').elements;
	for(var i = 0; i < elem.length; i++)
	{
		if(elem[i].type != "hidden"){
			elem[i].disabled = disable;
		}
		$("submitnext").disabled = false;
		$("nuam").disabled = false;
	}
}
function toggleEduTr(){
	if($("cv_absolventDa").checked == true)
		$("edu_tr").style.display='table-row';
	if($("cv_absolventDa").checked == false)
		$("edu_tr").style.display='none';
}
function toggleIntent(){
	if($("send_scrisoare").checked == true)
		$("intent").style.display='inline';
	else
		$("intent").style.display='none';
}
function toggleCatAr(taradiv){
	
	if($(taradiv).style.display == "none"){
		$('tara_a_c').style.display = "none";
		$('tara_d_i').style.display = "none";
		$('tara_j_p').style.display = "none";
		$('tara_q_u_z').style.display = "none";
		$(taradiv).style.display = "inline-block";
	}else{
		$('tara_a_c').style.display = "none";
		$('tara_d_i').style.display = "none";
		$('tara_j_p').style.display = "none";
		$('tara_q_u_z').style.display = "none";
		$(taradiv).style.display = "none";
	}
}
function findPos1(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
		
		return [curleft,curtop];
	}else 
		return false;
}
function toggle_adv_search(advs){
	if(document.getElementById(advs) != null){
		if($(advs).style.display == "none"){
			$(advs).style.display = "block";
		} else {
			$(advs).style.display = "none";
		}
	}
}
function setMinMaxMession() {
jQuery.ajax({
url: index_url+'ajax.php?function=setMinMaxMession',
type: 'GET',
cache: false,
dataType: 'html',
error: function(){
//alert('Eroare comunicare!');
},
success: function(response){
}
});
}

function deleteMessage(id,ip) {
jQuery.ajax({
url: index_url+'ajax.php?function=deleteMessage',
type: 'GET',
cache: false,
dataType: 'html',
data: 'id='+id+'&ip='+ip,
error: function(){
alert('Eroare comunicare!');
},
success: function(response){
}
});
}

function setPopupSession() {
jQuery.ajax({
url: index_url+'ajax.php?function=setPopupSession',
type: 'GET',
cache: false,
dataType: 'html',
error: function(){
//alert('Eroare comunicare!');
},
success: function(response){
}
});
}

function findPos1(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
		
		return [curleft,curtop];
	}
}
function showProforma(){
		jQuery("form:#addFrm").submit();
}

function printField(field_id) {
	var s = document.getElementById(field_id).value;
	var regExp=/\n/gi;
	s = s.replace(regExp,'<br>');
	pWin = window.open('','pWin','location=yes, menubar=yes, toolbar=yes');
	pWin.document.open();
	pWin.document.write('<html><head></head><body>');
	pWin.document.write(s);
	pWin.document.write('</body></html>');
	pWin.print();
	pWin.document.close();
	pWin.close();
}

function setVizPrice(per_v) {
	var dataString = index_url+'ajax.php?function=setVizPrice&per_v='+jQuery('#'+per_v).val()+'&pck='+per_v;
	jQuery.getJSON(dataString,
		function(data){
			var pv = per_v.substr(10,(per_v.length - 10));
			jQuery.each(data, 
				function(i,item){
					if (item.field == "pret") {
						jQuery('#price'+pv).html('<strong>'+item.value+'</strong>');
					} else if (item.field == "comment") {
						if(item.value != null){
							jQuery("#comment"+pv).html('<p>'+item.value+'</p>');
						}else{
							jQuery("#comment"+pv).html('');
						}
						
					}
				}
			);
		}
	);
} 
function insertSMSdata(orderId,id_tip_produs,tip_produs,agentieid,userid,jobid) 
{
	if(orderId != null){
		var dataString = "function=insert_SMS_data&orderId=" + orderId ;
		if(id_tip_produs)
			dataString = dataString + '&id_tip_produs=' + id_tip_produs ;
		if(tip_produs)
			dataString = dataString + '&tip_produs=' + tip_produs ;
		if(agentieid)
			dataString = dataString + '&agentieid=' + agentieid ;
		if(userid)
			dataString = dataString + '&userid=' + userid ;
		if(jobid)
			dataString = dataString + '&jobid=' + jobid ;
			jQuery.ajax({
				type: "POST",
				url: index_url+"ajax.php",
				data: dataString,
				cache: false,
				success: function(html){
					if(html == 'success'){
						jQuery("#frmPaymentRedirect").submit();
						
					}
				}
			});
	}
	return false;
};
function isNumber(n) {
	return !isNaN(parseFloat(n)) && isFinite(n);
}
