window.addEvent('domready',function(){	forslides = $$('.forslide');	for (i=0;i<forslides.length;i++) {		var hidePanel = new Fx.Slide(forslides[i].get('id')).hide('vertical');		$(forslides[i].get('id') + 'Fade').fade('hide');		forslides[i].setStyle('display','block');	}	forfades = $$('.forfade');	for (i=0;i<forfades.length;i++) {		forfades[i].fade('hide');		forfades[i].setStyle('display','block');	}	// CAR SLIDER	setCH();	setTimeout(function(){ setCH(); },3000);	var cSlider = new ScrollBar('cList', 'cBar', 'cKnob', {		scroll: {			duration: 400,			transition: 'expo:out'		},		slider: {			mode: 'vertical',			offset: -1		},		knob: {			duration: 400,			transition: 'expo:out'		}	});});function setCH() {	var listHeight = (parseFloat($('leftdiv').getStyle('height')) - 99) + 'px';	if (parseFloat(listHeight) > parseFloat($$('#cList ul').getStyle('height'))) {		listHeight = $$('#cList ul').getStyle('height');	}	var barHeight = (parseFloat(listHeight) + 2) + 'px';	if (parseFloat(listHeight) > 400) {		$('cList').setStyle('height',listHeight);		$('cBar').setStyle('height',barHeight);	}}function slideCH() {	var listHeight = (parseFloat($('leftdiv').getStyle('height')) - 99) + 'px';	if (parseFloat(listHeight) > parseFloat($$('#cList ul').getStyle('height'))) {		listHeight = $$('#cList ul').getStyle('height');	}	var barHeight = (parseFloat(listHeight) + 2) + 'px';	if (parseFloat(listHeight) > 400) {		$('cBar').tween('height', [$('cBar').getStyle('height'), barHeight]);		$('cList').tween('height', [$('cList').getStyle('height'), listHeight]);	}}function inputSet (id,str) {	if ($(id).get('value') == str) { $(id).set('value',''); }	else if (!$(id).get('value')) { $(id).set('value',str); }}function caution (msg,type) {	var windowXY = getWindowXY();	req = new Request({		url: url + 'helpers/ajax.helper.php?function=caution&msg=' + msg + '&type=' + type,		onSuccess: function(txt){			var cautionDiv = new Element('div', {				'id': 'caution',				'class': type,				'html': txt,				'events': {					'click': function(){ cautionDispose(this); }				}			});			cautionDiv.inject($('body'),'top').fade('hide').setStyle('display','block');			cautionDiv.setStyle('margin-top',(((windowXY[1] - parseFloat(cautionDiv.getStyle('height'))) / 2) - 50) + 'px').fade('in');			setTimeout(function(){				cautionDispose(cautionDiv);			},5000);		},		onFailure: function(){ alert('Rendszerhiba | System error'); }	});	req.send();}function cautionDispose (cautionDiv) {	cautionDiv.fade('out');	setTimeout(function(){		cautionDiv.dispose();	},500);}function popUp(URL,id) {	var pop = true;	if (id) {		var items = getSeld(id);		if (items.length > 0) {			URL += '?function=coupons&id=' + items[0].value;			for (i=1;i<items.length;i++){ URL += ',' + items[i].value; }		}		else { pop = false; }	}	if (pop) {		day = new Date();		id = day.getTime();		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=700,height=600,left = 390,top = 212');");	}}function in_array (string, array) {    var key = '';	for (key in array) {		if (array[key] == string) { return true; }	}     return false;}function is_numeric (mixed_var) {    return (typeof(mixed_var) === 'number' || typeof(mixed_var) === 'string') && mixed_var !== '' && !isNaN(mixed_var);}function getWindowXY() {	var x = 0, y = 0;	if (typeof( window.innerWidth ) == 'number') {		x = window.innerWidth;		y = window.innerHeight;	} else if (document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight) ) {		x = document.documentElement.clientWidth;		y = document.documentElement.clientHeight;	} else if (document.body && ( document.body.clientWidth || document.body.clientHeight) ) {		x = document.body.clientWidth;		y = document.body.clientHeight;	}	return [ x, y ];}
