			/*****************************************************************************
	*  clearNewsLetter(id, tip)
	*  Clear clearNewsLetter function
	*
	*****************************************************************************/
	
	function clearNewsLetter(id, tip){
		
		var value = 'email@email.com';
		if(tip=='click'){
			document.getElementById(id).value = '';
		}
		else if(tip=='blur'){
			if(document.getElementById(id).value==''){
				if(id!='news'){
					value = "email@email.com";
				}
				document.getElementById(id).value = value;
			}
		}
	}
	
	/*****************************************************************************
	*  clearLogin(id, tip)
	*  Clear login function
	*
	*****************************************************************************/
	
	function clearLogin(id, tip){
		
		var value = 'User';
		if(tip=='click'){
			document.getElementById(id).value = '';
		}
		else if(tip=='blur'){
			if(document.getElementById(id).value==''){
				if(id!='name'){
					value = "Password";
				}
				document.getElementById(id).value = value;
			}
		}
	}
	
	/*****************************************************************************
	*
	*****************************************************************************/
	
	function doLoginForm(){
		
		if(document.loginform.name.value=='' || document.loginform.password.value==''){
			return;
		}
		newvin = window.open('','adminWindow','width=900, height=700, toolbar=no, location=no, directories = no, status=no, statusbar=no, menubar=no, copyhistory=no, scrollbars=yes, resizable=yes');
		document.loginform.submit();
		document.loginform.name.value='';
		document.loginform.password.value='';
	}

	/*****************************************************************************
	*
	*****************************************************************************/
	var cache_last_country = 1;
	
	function updateOrash(sel1, sel2, sel3, sel4){
		
		var functionPath = appPath + 'ajax/updateselectoras';
		
		var country = $(sel1).getSelected().getProperty('value');
		
		var request = new Request/*.JSON*/({
			url: functionPath,
			onRequest: function (){ 	$(sel2).innerHTML = '<option>Please wait...</option>';	},
			onComplete: function(jsonObj) {
				
				$('url_search_0').value = country;
				$('url_search_2').value = '';
			
				cache_last_country = country;
				var pn = document.getElementById(sel2).parentNode; 
				$(sel2).destroy();
				
				pn.innerHTML = '';
				pn.innerHTML += '<select id="sel_1" onchange="updateElement(this.id, \'sel_2\' );"><option value="0">Toate...</option>'+ jsonObj +'</select>';				
				
				var pn3 = document.getElementById(sel3).parentNode; 
				$(sel3).destroy();
				
				pn3.innerHTML = '';
				pn3.innerHTML += '<select id="sel_2" onchange="updateTip1( \'sel_1\', this.id, \'sel_3\' );"><option value="0">Toate...</option></select>';
				
				var pn4 = document.getElementById(sel4).parentNode; 
				$(sel4).destroy();
				
				pn4.innerHTML = '';
				pn4.innerHTML += '<select id="sel_3" onchange="updateTip2(this.id);"><option value="0">Toate...</option></select>';
				
				updateLinkCautare();
			}
		}).send('country=' + country);
	}
	
	/*****************************************************************************
	*
	*****************************************************************************/
	var cache_last_city = 'arad';
		
	function updateElement(sel1, sel2){
		
		var votingPath = appPath + 'ajax/updateselect';
		
		var oras = $(sel1).getSelected().getProperty('value');
		var request = new Request/*.JSON*/({
			url: votingPath,
			onRequest: function (){
				$(sel2).innerHTML = '<option>Please wait...</option>';
			},
			onComplete: function(jsonObj) {
				
				$('url_search_0').value = $('sel_0').getSelected().getProperty('value');
				
				$('url_search_2').value = oras;
				var str = $('url_search_3').value;
				$('url_search_3').value = str.replace(cache_last_city, oras);
				 
				var str1 = $('url_search_3_cache').value;
				$('url_search_3_cache').value = str1.replace(cache_last_city, oras);
				
				$('url_search_3').value =  $('url_search_3_cache').value;
				
				$('url_search_4').value = '';
				cache_last_city = oras;
				
				var pn = document.getElementById(sel2).parentNode; 
				$(sel2).destroy();
				
				pn.innerHTML = '';
				pn.innerHTML += '<select id="sel_2" onchange="updateTip1( \'sel_1\', this.id, \'sel_3\' );"><option value="0">Toate...</option>'+ jsonObj +'</select>';
				
				var pn1 = document.getElementById('sel_3').parentNode; 
				$('sel_3').destroy();
				
				pn1.innerHTML = '';
				pn1.innerHTML += '<select id="sel_3" onchange="updateTip2( this.id );"><option value="0">Toate...</option></select>';
				
				
				updateLinkCautare();
			}
		}).send('oras=' + oras);
		
		showOras(oras);
	}
	/*****************************************************************************
	*
	*****************************************************************************/
	
	function updateLinkCautare(){
		
		var url0 = document.getElementById('url_search_0').value;
		var url1 = document.getElementById('url_search_1').value;
		var url2 = document.getElementById('url_search_2').value;
		var url3 = document.getElementById('url_search_3').value;
		var url4 = document.getElementById('url_search_4').value;
		
		var url = url0 + '/';
		
		if (url2.length > 0){
			
			url += url2;
			
			if(url3.length > 0){
				if(url4.length>0){
					url += '/' + url3 + '-' + url4 + '-' + url2 + '/';
				}
				else{
					url += '/' + url3 + '-' + url2 + '/';
				}
			}
			else{
				url += '/';
			}
		}
		
		document.getElementById('cautare_url').href = prefix_link  + url;
		document.getElementById('cautare_url2').href = prefix_link + url;
		document.getElementById('cautare_url3').href = prefix_link + url;
	}
	

	
	function makeSeoUrl(str){
		str = str.toLowerCase();
		str = str.split('/').join('_');
		str = str.split(', ').join('_');
		str = str.split(',').join('_');
		//str = str.split('. ').join('_');
		//str = str.split('.').join('_');
		str = str.split(' ').join('_');
		str = str.split('&nbsp;').join('_');
		str = str.split('\u00A0').join('_');
		return replaceDiacritics(str);
	}
	
	function replaceDiacritics(s){
		var s;

		var diacritics =[
			/[\300-\306]/g, /[\340-\346]/g, // A, a
			/[\310-\313]/g, /[\350-\353]/g, // E, e
			/[\314-\317]/g, /[\354-\357]/g, // I, i
			/[\322-\330]/g, /[\362-\370]/g, // O, o
			/[\331-\334]/g, /[\371-\374]/g,  // U, u
			/[\321]/g, /[\361]/g, // N, n
			/[\307]/g, /[\347]/g, // C, c
		];
	
		var chars = ['A','a','E','e','I','i','O','o','U','u','N','n','C','c'];
	
		for(var i = 0; i < diacritics.length; i++){
			s = s.replace(diacritics[i],chars[i]);
		}
		
		return s;
	}
	
	//var cache_tip1 = 'cazari-arad';
	/*******************************************************************************************
	*
	********************************************************************************************/
	function updateTip1(oras, sel, elem){
		
		$('url_search_4').value = '';
		
		var votingPath = appPath + 'ajax/updateselect';
		var tip1 = $(sel).getSelected().getProperty('value');
		var oras = $(oras).getSelected().getProperty('value');
		
		var request = new Request/*.JSON*/({
			url: votingPath,
			onRequest: function (){
				$(elem).innerHTML = '<option>Please wait...</option>';
			},
			onComplete: function(jsonObj) {
				
				var cache_tip1 = $(sel).getSelected().get('text');
				cache_tip1 = cache_tip1[0];
				cache_tip1 = makeSeoUrl(cache_tip1);
				$('url_search_3').value = cache_tip1; // + '-' +cache_last_city;
				
			//	$(elem).innerHTML = '<option value="0">Toate...</option>' + jsonObj;
				var pn1 = document.getElementById(elem).parentNode; 
				$(elem).destroy();
				
				pn1.innerHTML = '';
				pn1.innerHTML += '<select id="sel_3" onchange="updateTip2( this.id );"><option value="0">Toate...</option>' + jsonObj + '</select>';
			
				var opts = $$('option.sel_3');
				var toate = '';
				
				var lung = opts.length;
				var i=0;
				opts.each(function(el){
					var lit_toate = el.get('text');
					lit_toate = makeSeoUrl(lit_toate);
					i++;
					toate += lit_toate + (i<lung ? '-' : '');
				});
				
				var sel_3_v = $('sel_3').getSelected().getProperty('value');
			//	$('url_search_4').value = toate;
			
				if(tip1==0){
					$('url_search_3').value = $('url_search_3_cache').value;
				}
				
				updateLinkCautare();
			}
		}).send( 'oras='+oras+'&tip1=' + tip1);
	}
	/*******************************************************************************************
	*
	********************************************************************************************/
	function updateTip2(elemId){
		
		if($(elemId).getSelected().getProperty('value')==0){
			$('url_search_4').value = '';
			updateLinkCautare();
			return;
		}
		
		if($('sel_2').getSelected().getProperty('value')==0){
			$('sel_2').selectedIndex = 1;
		}
		
		var sel_3_v = $(elemId).getSelected().getProperty('value');
		if(sel_3_v==0){
			var opts = $$('option.sel_3');
			var toate = '';
			
			var lung = opts.length;
			var i=0;
			opts.each(function(el){
				var lit_toate = el.get('text');
				lit_toate = makeSeoUrl(lit_toate);
				i++;
				toate += lit_toate + (i<lung ? '-' : '');
			});
			$('url_search_4').value = toate;
		}
		else{
			sel_3_v = sel_3_v[0];
			sel_3_v = makeSeoUrl(sel_3_v);
			$('url_search_4').value = sel_3_v; // + '-' +cache_last_city;
		}
		updateLinkCautare();
	}
	
	function progress(){
		alert('we sorry but this functionality is disable for the moment !');
	}
	
	function noMoreInfo(){
		alert('No more info !');
	}


	if(!readCookie('baner_inchis')){
		createCookie('baner_inchis', true);	
	}
	
	/***************************************************************************************************************************
	*
	****************************************************************************************************************************/
	function resizeCenter(page){
		var baner_state = readCookie('baner_inchis');
		if(document.getElementById('topbaner')!=null){
			if(!baner_state || baner_state=='false' || baner_state==false){
				document.getElementById('topbaner').style.display = "none";
				document.getElementById('butt_down').style.display = "inline";
				document.getElementById('butt_up').style.display = "none";
				var ul_elem = document.getElementById('last_top_link');
				ul_elem.className = "";
				for(var i=0; i<=5; i++){
					var id = 'xtra_links_' + i;
					if(document.getElementById(id)){
						document.getElementById(id).style.display = "inline";
					}
				}
			}
		}
			
		var ct = document.getElementById('ct');
		var west = document.getElementById('west');
		var east = document.getElementById('east');
		var center = document.getElementById('center');
			
		var rez = eval(ct.clientWidth - west.clientWidth - east.clientWidth - 10 );
		switch(page){
			case 'vremea':
				if(navigator.appName!='Netscape' && navigator.appName!='Mozilla'){
					rez += 5;
				}
				break;
			case 'despre':
			case 'contact':
			case 'article':
			case 'guestbook':
			case 'decenoi':
			case 'despreserv':
			case 'jobs':
			case 'media':
			case 'webcam':
			case 'localizare':
			case 'colaboratori':
			case 'parteneri':
			case 'partenerimedia':
			case 'linkexchange':
			case 'ofertelimitate':
			case 'rentcar':
			case 'publicitate':
			case 'eshop':
			case 'mediasite':
			case 'concurs':
			case 'autentificare':
			case 'snapshots':
			case 'sitemap':
			case 'inregistrare':
			case 'home':
			case 'destinatiituristice':
				if(navigator.appName=='Netscape' || navigator.appName=='Mozilla'){
					rez += 5;
				}
			break;
			
			case 'oferteturistice':
			case 'prezentarechisinau':
			case 'telefoanechisinau':
				if(navigator.appName!='Netscape' && navigator.appName!='Mozilla'){
					rez -= 5;
				}
			break;
			default:
			//rez = rez + 16;
			break;
		}
	//	alert(rez);
		setTimeout ( "removeBeta()", 1000 );
		
		center.style.width = rez + 'px';
		
		if (page=='harti') 
			center.style.width = '590px';
		
		center.style.visibility = 'visible';
		afterLoad();
	}
	

	function removeBeta (){
		if(document.getElementById("alert_beta")){
			document.getElementById("alert_beta").style.display = "none";
		}
	}

	
	function emptyUpdate(){}
	
	function afterLoad(){}
	
	/**
	*	Function for expand - colapse a box
	*	 - el: element that we click	
	*	 - id: element for hide/show
	*	 - exp: expand class name for el
	*	 - col: collapse class name for el
	*/
	function expcol(el, id, exp, col){
		var classN = el.className;
		
		if(classN==exp){
			el.className = col;
		}
		else{
			el.className = exp;
		}
		if(document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display="block";
		}
		else{
			document.getElementById(id).style.display="none";
		}
	}
	
	/*******************************************************************************************
	*
	********************************************************************************************/
	function redirectBrowser(address, self){
		if(self=='new'){
			window.open(address, 'print', 'width=800,height=800,resizable=yes');
			return;
		}
		
		if(address=='back'){
			history.back();
		}
		else if(address=='forward'){
			history.forward();
		}
		else{
			window.location = address;
		}
	}
	/*******************************************************************************************
	*
	********************************************************************************************/
	function changeTab(el){
		for(var i = 1; i<5; i++){
			document.getElementById('content_tab_'+i).style.display = "none";
			document.getElementById('tab_'+i).className = 'tab_'+i+'_inactiv';
		}
		document.getElementById('content_'+el.id).style.display = 'block';
		document.getElementById(el.id).className = el.id+'_activ';
	}
	/*******************************************************************************************
	*
	*
	********************************************************************************************/
	function changeTabCazareDestinatii(el, country){
		
		for(var i = 1; i<3; i++){
			document.getElementById('content_tab_cazare_destinatii_'+i).style.display = "none";
			document.getElementById('tab_cazare_destinatii_'+i).className = 'tab_cazare_destinatii_'+i+'_inactiv';
		}
		document.getElementById('content_'+el.id).style.display = 'block';
		document.getElementById(el.id).className = el.id+'_activ';
		
		if (country == 'moldova'){
			oferteAjaxMd();
			//myMooFlowPage_moldova.start();
		}
		else
			oferteAjaxRo();
			//myMooFlowPage_romania.start();
	}
	/*******************************************************************************************
	*
	********************************************************************************************/
	function changeTabHarti(el, country){
		
		for(var i = 1; i<3; i++){
			document.getElementById('content_tab_harti_' + i).style.display = "none";
			document.getElementById('tab_harti_' + i).className = 'tab_harti_' + i + '_inactiv';
		}
		document.getElementById('content_' + el.id).style.display = 'block';
		document.getElementById(el.id).className = el.id + '_activ';
		
		if (country == 'moldova'){
			//updateCountryTab('moldova');
		}
		else{
			//updateCountryTab('romania');
		}s
	}
	
	/*******************************************************************************************
	*
	********************************************************************************************/
	function findPosX(obj){
		var curleft = 0;
		if (obj.offsetParent) {
			while (1) {
				curleft += obj.offsetLeft;
				if (!obj.offsetParent) {
					break;
				}
				obj = obj.offsetParent;
			}
		}
		else {
			if (obj.x) {
				curleft += obj.x;
			}
		}
		
		return curleft;
	}
	
	/*******************************************************************************************
	*
	********************************************************************************************/
	function findPosY(obj){
		var curtop = 0;
		if (obj.offsetParent) {
			while (1) {
				curtop += obj.offsetTop;
				if (!obj.offsetParent) {
					break;
				}
				obj = obj.offsetParent;
			}
		}else {
			if (obj.y) {
				curtop += obj.y;
			}
		}
		return curtop;
	}
	
	function doclick(area){
		if(document.getElementById('show' + area).style.display == "none"){
			document.getElementById('show' + area).style.display="block";
			document.getElementById('pm' + area).innerHTML="<font class='a-nat-text8hb'>-</font>";
		}else{
			document.getElementById('show' + area).style.display="none";
			document.getElementById('pm' + area).innerHTML="<font class='a-nat-text8hb'>+</font>";
		}
	}
	
	function toggleArea(id){
		
		var afisat = false;
		if(document.getElementById(id).style.display == "none"){
			afisat = true;
			document.getElementById(id).style.display="block";
		}
		else{
			document.getElementById(id).style.display="none";
		}
		
		if(id=='topbaner'){
			if(afisat == true){
				createCookie('baner_inchis', true);
			}else{
				createCookie('baner_inchis', false);
			}
		}
	}
	
	function toggleXtraLinks(el){
		for(var i=0; i<=5; i++){
			var id = el + i;
			if(document.getElementById(id)){
				if(document.getElementById(id).style.display == "none"){
					document.getElementById(id).style.display="inline";
				}
				else{
					document.getElementById(id).style.display="none";
				}
			}
		}
		var ul_elem = document.getElementById('last_top_link');
		if(ul_elem.className == "noseparator"){
			ul_elem.className = "";
			document.getElementById('butt_down').style.display = "inline";
			document.getElementById('butt_up').style.display = "none";
		}
		else{
			ul_elem.className = "noseparator";
			document.getElementById('butt_down').style.display = "none";
			document.getElementById('butt_up').style.display = "inline";
		}
	}
	
	/***********************************************************************************************************
	 * Cookies functions
	 **********************************************************************************************************/
	function createCookie(name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	}
	/***********************************************************************************************************
	 * Cookies functions
	 **********************************************************************************************************/
	function readCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}
	/***********************************************************************************************************
	 * Cookies functions
	 **********************************************************************************************************/
	function eraseCookie(name) {
		createCookie(name,"",-1);
	}
	/**
	 * End cookies functions
	 */
	


function domRollover() {
	if (navigator.userAgent.match(/Opera (\S+)/)) {
		var operaVersion = parseInt(navigator.userAgent.match(/Opera (\S+)/)[1]);
	}
	if (!document.getElementById||operaVersion <7) return;
	var imgarr=document.getElementsByTagName('img');
	var imgPreload=new Array();
	var imgSrc=new Array();
	var imgClass=new Array();
	for (i=0;i<imgarr.length;i++){
		if (imgarr[i].className.indexOf('domroll')!=-1){
			imgSrc[i]=imgarr[i].getAttribute('src');
			imgClass[i]=imgarr[i].className;
			imgPreload[i]=new Image();
			if (imgClass[i].match(/domroll (\S+)/)) {
				imgPreload[i].src = imgClass[i].match(/domroll (\S+)/)[1]
			}
			imgarr[i].setAttribute('xsrc', imgSrc[i]);
			imgarr[i].onmouseover=function(){
				this.setAttribute('src',this.className.match(/domroll (\S+)/)[1])
			}
			imgarr[i].onmouseout=function(){
				this.setAttribute('src',this.getAttribute('xsrc'))
			}
		}
	}
}
domRollover();





