<!--
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 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'>";
   }
}
function Expand() {
   divs=document.getElementsByTagName("DIV");
   for (i=0;i<divs.length;i++) {
     divs[i].style.display="block";
     key=document.getElementById("x" + divs[i].id);
     key.innerHTML="<img src='/images/icon_minus.jpg' border='0'>";
   }
}
function Collapse() {
   divs=document.getElementsByTagName("DIV");
   for (i=0;i<divs.length;i++) {
     divs[i].style.display="none";
     key=document.getElementById("x" + divs[i].id);
     key.innerHTML="<img src='/images/icon_plus.jpg' border='0'>";
   }
}
function show(id1, id2, pic1, pic2) 
{
	var layerToShow = document.getElementById(id1);
	var layerToHide = document.getElementById(id2);
	var picToShow = document.getElementById(pic1);
	var picToHide = document.getElementById(pic2);
	
	picToShow.src = "/images/" + pic1 + "_on.jpg";
	picToHide.src = "/images/" + pic2 + "_off.jpg";
	layerToShow.style.display = "block";
	layerToHide.style.display = "none";
	setCookie("layerTab", id1);
}
function showWindowsMedia(w,h,src) {
	if (pluginlist.indexOf("Windows Media Player")!=-1) {
		document.write('<OBJECT ID="MediaPlayer" WIDTH="' + w + '" HEIGHT="' + h + '" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" TYPE="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Se incarca...">');
		document.write('<PARAM NAME="FileName" VALUE="' + src + '">');
		document.write('<PARAM NAME="autostart" VALUE="1">');
		document.write('<PARAM NAME="showcontrols" VALUE="1">');
		document.write('<param name="ShowStatusBar" value="True">');
		document.write('<param name="ShowDisplay" value="False">');
		document.write('<param name="AutoRewind" value="True">');
		document.write('<EMBED TYPE="application/x-mplayer2"');
		document.write('SRC="' + src + '"');
		document.write('WIDTH="' + w + '" HEIGHT="' + h + '" AUTOSTART="1" SHOWCONTROLS="1" showstatusbar="False" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" showdisplay="False" autorewind="True"></EMBED></OBJECT>');
	} else {
		document.write('Nu aveti Media Player instalat!');
	}
}
function showQuicktime(w,h,src) {
	if (pluginlist.indexOf("QuickTime")!=-1) {	
		document.write('<OBJECT WIDTH="' + w + '" HEIGHT="' + h + '" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab"');
		document.write('<PARAM NAME="src" VALUE="' + src + '">');
		document.write('<PARAM NAME="autoplay" VALUE="true">');
		document.write('<PARAM NAME="controller" VALUE="true">');
		document.write('<PARAM NAME="kioskmode" VALUE="true">');
		document.write('<EMBED ');
		document.write('SRC="' + src + '"');
		document.write('WIDTH="' + w + '" HEIGHT="' + h + '" autoplay="true" kioskmode="true" controller="true" pluginspace="http://www.apple.com/quicktime/download/"></EMBED></OBJECT>');
	} else {
		document.write('Nu aveti Quicktime instalat!');
	}
}
function showRealMedia(w,h,src) {
	if (pluginlist.indexOf("QuickTime")!=-1) {	
		document.write('<OBJECT ID="RVOCX" WIDTH="' + w + '" HEIGHT="' + h + '" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"');
		document.write('<PARAM NAME="src" VALUE="' + src + '">');
		document.write('<PARAM NAME="autostart" VALUE="true">');
		document.write('<PARAM NAME="controls" VALUE="imagewindow">');
		document.write('<param name="loop" value="false">');
		document.write('<EMBED type="audio/x-pn-realaudio-plugin"');
		document.write('SRC="' + src + '"');
		document.write('WIDTH="' + w + '" HEIGHT="' + h + '" autostart="true" controls="imagewindow" loop="false"></EMBED></OBJECT>');
	} else {
		document.write('Nu aveti RealPlayer instalat!');
	}
}
var dynamicPlaceholder;
function AjaxShow(originalRequest){
	$(dynamicPlaceHolder).innerHTML = originalRequest.responseText;
	if($("Descriere") != null){
		if(typeof(oFCKeditor) == "undefined") {
			__FCKeditorNS = null; 
			oFCKeditor = new FCKeditor("Descriere");
        	oFCKeditor.BasePath = "dcs/FCKeditor/";
			oFCKeditor.ToolbarSet = "Basic";
			oFCKeditor.ReplaceTextarea();
		}
	} else {
		if($("Content") != null){
			if(typeof(aFCKeditor) == "undefined") {
				__FCKeditorNS = null; 
				aFCKeditor = new FCKeditor("Content");
    		    aFCKeditor.BasePath = "dcs/FCKeditor/";
				aFCKeditor.ToolbarSet = "Basic";
	        	aFCKeditor.ReplaceTextarea();
			}
		}
	}
	//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_addFree(){
	var theForm = document.addFree;
	var numRE = /^\d+$/;
	var emailRE = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	var errMsg = "";
	var setfocus = "";

	if (!theForm['_read'].checked){
		errMsg = "Trebuie sa fiti de acord cu conditiile de utilizare";
		setfocus = "['_read']";
	}
	if (!emailRE.test(theForm['email'].value)){
		errMsg = "Adresa de e-mail trebuie sa fie de forma 'nume@domeniu.com'";
		setfocus = "['email']";
	}
	if (theForm['AddressCity'].value == ""){
		errMsg = "Nu ati introdus localitatea/sectorul";
		setfocus = "['AddressCity']";
	}
	if (theForm['AddressNumber'].value == ""){
		errMsg = "Nu ati introdus numarul strazii";
		setfocus = "['AddressNumber']";
	}
	if (theForm['AddressStreet'].value == ""){
		errMsg = "Nu ati introdus strada";
		setfocus = "['AddressStreet']";
	}
	if (theForm['surname'].value == ""){
		errMsg = "Nu ati introdus prenumele";
		setfocus = "['surname']";
	}
	if (theForm['name'].value == ""){
		errMsg = "Nu ati introdus numele";
		setfocus = "['name']";
	}
	if (theForm['__password'].value == "" || (theForm['__password'].value != theForm['_password'].value)){
		errMsg = "Parolele nu corespund";
		setfocus = "['__password']";
	}
	if (theForm['login'].value.length < 6){
		errMsg = "Numele de utilizator trebuie sa aiba minim 6 caractere";
		setfocus = "['login']";
	}
	if (theForm['_password'].value.length < 4){
		errMsg = "Parola trebuie sa aiba minim 4 caractere";
		setfocus = "['_password']";
	}
	if (errMsg != ""){
		alert(errMsg);
		eval("theForm" + setfocus + ".focus()");
	}
	else theForm.submit();
}
function redirect(url){
    window.location = url;
}
function previewContent(){
	theForm = document.createElement('FORM');
	theForm.method = 'POST';
	theForm.name = 'serverPreviewForm';
	theForm.id=theForm.name;
	theForm.style.display = 'none';
	theForm.action = '/_preview.asp';
	theForm.target='_blank';
	document.body.appendChild(theForm);

	var input = document.createElement('INPUT');
	input.type = 'hidden';
	input.name = 'htmlData';
	if(typeof(oFCKeditor) != "undefined") {
		var oEditor = FCKeditorAPI.GetInstance('Descriere');
		input.value = oEditor.GetXHTML(true) ;
	} else {
			var oEditor = FCKeditorAPI.GetInstance('Content');
			input.value = oEditor.GetXHTML(true) ;
	}
	theForm.appendChild(input);
	theForm.submit();
}
var urlobj;
function Browse(obj, resourceType)
{
	urlobj = obj;
	var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes" ;
	sOptions += ",width=800" ;
	sOptions += ",height=600";
	window.open('/dcs/FCKEditor/editor/filemanager/browser/netrube/browser.html?Type=' + resourceType + '&Connector=connectors/asp/connector.asp', 'FCKBrowseWindow', sOptions ) ;
}
function SetUrl( url, width, height, alt )
{
	document.getElementById(urlobj).value = url ;
	oWindow = null;
}
function YY_checkform() {
  var a=YY_checkform.arguments,oo=true,v='',s='',err=false,r,o,at,o1,t,i,j,ma,rx,cd,cm,cy,dte,at;
  for (i=1; i<a.length;i=i+4){
    if (a[i+1].charAt(0)=='#'){r=true; a[i+1]=a[i+1].substring(1);}else{r=false}
    o=MM_findObj(a[i].replace(/\[\d+\]/ig,""));
    o1=MM_findObj(a[i+1].replace(/\[\d+\]/ig,""));
    v=o.value;t=a[i+2];
    if (o.type=='text'||o.type=='password'||o.type=='hidden'){
      if (r&&v.length==0){err=true}
      if (v.length>0)
      if (t==1){ //fromto
        ma=a[i+1].split('_');if(isNaN(v)||v<ma[0]/1||v > ma[1]/1){err=true}
      } else if (t==2){
        rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");if(!rx.test(v))err=true;
      } else if (t==3){ // date
        ma=a[i+1].split("#");at=v.match(ma[0]);
        if(at){
          cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]];
          dte=new Date(cy,cm,cd);
          if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.getMonth()!=cm){err=true};
        }else{err=true}
      } else if (t==4){ // time
        ma=a[i+1].split("#");at=v.match(ma[0]);if(!at){err=true}
      } else if (t==5){ // check this 2
            if(o1.length)o1=o1[a[i+1].replace(/(.*\[)|(\].*)/ig,"")];
            if(!o1.checked){err=true}
      } else if (t==6){ // the same
            if(v!=MM_findObj(a[i+1]).value){err=true}
      }
    } else
    if (!o.type&&o.length>0&&o[0].type=='radio'){
          at = a[i].match(/(.*)\[(\d+)\].*/i);
          o2=(o.length>1)?o[at[2]]:o;
      if (t==1&&o2&&o2.checked&&o1&&o1.value.length/1==0){err=true}
      if (t==2){
        oo=false;
        for(j=0;j<o.length;j++){oo=oo||o[j].checked}
        if(!oo){s+='* '+a[i+3]+'\n'}
      }
    } else if (o.type=='checkbox'){
      if((t==1&&o.checked==false)||(t==2&&o.checked&&o1&&o1.value.length/1==0)){err=true}
    } else if (o.type=='select-one'||o.type=='select-multiple'){
      if(t==1&&o.selectedIndex/1==0){err=true}
    }else if (o.type=='textarea'){
      if(v.length<a[i+1]){err=true}
    }
    if (err){s+='* '+a[i+3]+'\n'; err=false}
  }
  if (s!=''){alert('Au aparut urmatoarele erori la completarea formularului:\t\t\t\t\t\n\n'+s)}
  document.MM_returnValue = (s=='');
}
//-->
