<!--
function MM_swapImgRestore() {
  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() {
  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) {
  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() {
	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 jumpTo(formID, selectID){
    var newIndex = document.getElementById(selectID).selectedIndex; 
    cururl = document.getElementById(selectID).options[newIndex].value; 
    window.location.assign(cururl); 
}
function openWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}
function scrambleEmail(emailAddress,linkClass) {
	chEmail = emailAddress.split("@");
	if(linkClass != '')
		document.write('<a class="' + linkClass + '" href="ma' + 'ilto:' + chEmail[0] + '@' + chEmail[1] + '">' + chEmail[0] + '@' + chEmail[1] + '</a>');
	else
		document.write('<a href="ma' + 'ilto:' + chEmail[0] + '@' + chEmail[1] + '">' + chEmail[0] + '@' + chEmail[1] + '</a>');
}
function URLEncode(sStr) {
    return escape(sStr).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27').replace(/\//g,'%2F');
}
function trimLength(textarea, maxChars)
{
	if(textarea.value.length <= maxChars) return;

	textarea.value = textarea.value.substr(0, maxChars)
}
function canAddCharacter(textarea, maxChars)
{
	if(typeof(textarea.onkeypress.arguments[0]) != 'undefined')
		var keyCode = textarea.onkeypress.arguments[0].keyCode;
	else
	{
		if(document.selection.createRange().text.length != 0) return true;
		var keyCode = event.keyCode;
	}

	var allowedChars = new Array(8, 37, 38, 39, 40, 46);	//Backspace, delete and arrow keys
	for(var x=0; x<allowedChars.length; x++) if(allowedChars[x] == keyCode) return true;

	if(textarea.value.length < maxChars) return true;

	return false;
}
function toggleTab(divPrefix, divID, tabPrefix, tabID) {
	divs = document.getElementsByTagName("div");
   	for (i=0; i<divs.length; i++) {
		if(divs[i].id != "") {
			if (divs[i].id.indexOf(divPrefix) >= 0) {
				if (divs[i].id != divID) {
		    		divs[i].style.display = "none";
				} else {
					divs[i].style.display = "block";
				}
			}
	   	}
	}
	tabs = document.getElementsByTagName("li");
   	for (i=0; i<tabs.length; i++) {
		if(tabs[i].id != "") {
			if (tabs[i].id.indexOf(tabPrefix) >= 0) {
				if (tabs[i].id != tabID) {
		    		//tabs[i].style.display = "none";
					tabs[i].className = "tabLink";
				} else {
					//tabs[i].style.display = "block";
					tabs[i].className = "activeTabLink";
				}
			}
	   	}
	}
}
function Toggle(item) {
   obj=document.getElementById(item);
   visible=(obj.style.display!="none")
   key=document.getElementById("x" + item);
   if (visible) {
     obj.style.display="none";
     key.innerHTML="<img src='/images/icon_plus.jpg' border='0'>";
   } else {
      obj.style.display="block";
      key.innerHTML="<img src='/images/icon_minus.jpg' border='0'>";
   }
}
var dynamicPlaceholder;
function AjaxShow(originalRequest){
	$(dynamicPlaceHolder).innerHTML = originalRequest.responseText;
	//alert("AjaxShow");
}
function AjaxError(originalRequest) {
	alert("Ajax Error - " + originalRequest.responseText);
}
function AjaxLoad(u, p, c, placeholder) {
	dynamicPlaceHolder = placeholder;
	var Ajax0 = new Ajax.Updater (
		{
			success: placeholder,
			failure: placeholder
		},
		u, 
		{
			method: 'post',
			evalScripts: true,
			parameters: p,
			onFailure: AjaxError,
			onComplete: c
		}
	)
	
}
function AjaxSubmit(formID, container, c) {
    var params = Form.serialize(formID);
	var callBackFunction = c;
	dynamicPlaceHolder = container;
	//new Ajax.Updater("contentBox", $(formID).action, {method:"post", evalScripts:true, postBody:params, onComplete: callBackFunction});
	new Ajax.Request($(formID).action, {method: "post", parameters: params, onComplete: callBackFunction, onFailure: AjaxError} );
}
function chLoc(lid)
{
	document.location = decodeBase64(lid);
}
function al(aid)
{
	var ds = decodeBase64(aid);
	var pa = ds.split("|")
	AjaxLoad(pa[0],pa[1],pa[2],pa[3]);
}
function getRadioValue(radioObj) {
	if(!radioObj) return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked) return radioObj.value;
		else return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}
function VF_Mailer(){ //v2.0
	var theForm = document.mailer;
	var numRE = /^\d+$/;
	var emailRE = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	var errMsg = "";
	var setfocus = "";

	if (!emailRE.test(theForm['Email'].value)){
		errMsg = "Adresa de e-mail trebuie sa fie de forma 'nume@domeniu.com'";
		setfocus = "['Email']";
	}
	if (theForm['Mesaj'].value == ""){
		errMsg = "Nu ati introdus mesajul";
		setfocus = "['Mesaj']";
	}
	if (theForm['Nume'].value == ""){
		errMsg = "Nu v-ati introdus numele";
		setfocus = "['Nume']";
	}
	if (theForm['Subiect'].value == ""){
		errMsg = "Nu ati introdus subiectul";
		setfocus = "['Subiect']";
	}
	if (errMsg != ""){
		alert(errMsg);
		eval("theForm" + setfocus + ".focus()");
	}
	else theForm.submit();
}
function redirect(url){
    window.location = url;
}
//-->
