window.addEvent('domready', function() {
	if(document.getElementById('chaterea')){
//		alert('test');
		$('chaterea').addEvent('focus',function(){
			if(this.value=='тук можете да зададете своите въпроси за директен чат с оператор...'){
				this.value='';
			}
		});
	}
	$$('.leftsub').addEvent('click', function(e) {

		var list=$("dest"+this.name);

		if(list.getStyle("display")=="none"){

			list.setStyle("display","block");

		}else{

			list.setStyle("display","none");

		}

	});

	

	$$('.see_more').addEvent('click', function(e) {

		var list=$("prices"+this.name);

		if(list.getStyle("display")=="none"){

			list.setStyle("display","block");

			this.addClass('close');

			this.setText("затвори");

		}else{

			list.setStyle("display","none");

			this.removeClass('close');

			this.setText("още тарифи");

		}

	});

	// ACORDEON
	if($('accordion')){
			var myAccordion = new Accordion($('accordion'), '.toggler', 'div.editor', {
	
			opacity: false,
	
			alwaysHide : true,
	
			onActive: function(toggler, element){
	
				toggler.setStyle('color', '#41464D');
	
			},
	
			onBackground: function(toggler, element){
	
				toggler.setStyle('color', '#528CE0');
	
			}
	
		});
	}

	

	//Multibox

	//var box = {};
	//box = new MultiBox('mb', {descClassName: 'multiBoxDescription', useOverlay: true});

	//call multiBox
	var initMultiBox = new multiBox({
		mbClass: '.mb',//class you need to add links that you want to trigger multiBox with (remember and update CSS files)
		container: $(document.body),//where to inject multiBox
		descClassName: 'multiBoxDesc',//the class name of the description divs
		//path: './Files/',//path to mp3 and flv players
		path: 'img/objects/',//path to mp3 and flv players
		useOverlay: true,//use a semi-transparent background. default: false;
		maxSize: {w:600, h:400},//max dimensions (width,height) - set to null to disable resizing
		addDownload: false,//do you want the files to be downloadable?
		//pathToDownloadScript: './Scripts/forceDownload.asp',//if above is true, specify path to download script (classicASP and ASP.NET versions included)
		pathToDownloadScript: '',//if above is true, specify path to download script (classicASP and ASP.NET versions included)
		addRollover: true,//add rollover fade to each multibox link
		addOverlayIcon: true,//adds overlay icons to images within multibox links
		addChain: true,//cycle through all images fading them out then in
		recalcTop: true,//subtract the height of controls panel from top position
		addTips: true,//adds MooTools built in 'Tips' class to each element (see: http://mootools.net/docs/Plugins/Tips)
		autoOpen: 0//to auto open a multiBox element on page load change to (1, 2, or 3 etc)
	});
	
	
	
	if(document.getElementById("slider")){
			
		//slider variables for making things easier below
		var itemsHolder = $('container_slider');
		var myItems = $$(itemsHolder.getElements('.item'));
		
		//controls for slider
		var theControls = $('controls1');
		//var numNavHolder = $(theControls.getElement('div'));
	//	var thePlayBtn = $(theControls.getElement('.play_btn'));
	//	var thePrevBtn = $(theControls.getElement('.prev_btn'));
	//	var theNextBtn = $(theControls.getElement('.next_btn'));
	    var thePrevBtn = $('prev_btn');
        var theNextBtn = $('next_btn'); 
		
		//create instance of the slider, and start it up		
		var mySlider = new SL_Slider({
			slideTimer: 6000,
			orientation: 'none',      //vertical, horizontal, or none: None will create a fading in/out transition.
			fade: false,                    //if true will fade the outgoing slide - only used if orientation is != None
			isPaused: false,
			container: itemsHolder,
			items: myItems,
			numNavActive: false,
			//numNavHolder: numNavHolder,
			//playBtn: null,
            prevBtn: thePrevBtn,
            nextBtn: theNextBtn 
			
		});
		mySlider.start();

	}
	
	

});







   function ajaxLoader(url,id)

	{

		if (document.getElementById) {

			var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();

			}

			if (x)

				{

			x.onreadystatechange = function()

					{

				if (x.readyState == 4 && x.status == 200)

						{

						el = document.getElementById(id);

						el.innerHTML = x.responseText;

					}else{

						el = document.getElementById(id);
						el.innerHTML = '<span class="loading">зареждане</span>';

						

					}

					}

				x.open("GET", url, true);

				x.send(null);

				}

	    }
