<!--
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 ToggleItem(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 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 addLoadEvent(_function) { 
	var _onload = window.onload; 
	if ( typeof window.onload != 'function' ) { 
		if ( window.onload ) { 
			window.onload = _function; 
		} else { 
			var _addEventListener = window.addEventListener || document.addEventListener; 
			var _attachEvent = window.attachEvent || document.attachEvent; 

			if ( _addEventListener ) { 
				_addEventListener('load', _function, true); 
				return true; 
			} else if ( _attachEvent ) { 
				var _result = _attachEvent('onload', _function); 
				return _result; 
			} else { 
				//todo: preloading fix for ie5.2 on mac os 
				return false; 
			} 
		} 
	} else { 
		window.onload = function() { 
			_onload(); 
			_function(); 
		} 
	} 
}
//-->