function ieonload(){
}
function resetForm(){
	$('casinofinder').reset()
	new runTabulator();
}
function resetSliders(){
	new rollupSliders();
	var bigT = $('bigT'),
		sT = $('sT'),
		pT = $('pT'),
		mT = $('mT'),
		dT = $('dT'),
		gT = $('gT'),
		nT = $('nT'),
		prT = $('prT');		
	
	sT.update('*');
	bigT.update('<b style="color:red">PANIC!</b>');
	pT.update('$$$$$');
	mT.update('&laquo;-&raquo;');
	dT.update('&laquo;-&raquo;');	
	gT.update('&laquo;-&raquo;');
	nT.update('&laquo;-&raquo;');
	prT.update('&laquo;-&raquo;');
	new resetForm();
}
function rollupSliders(){
//	alert('ieonload');
	var bigT = $('bigT'),
		bTL = new Control.Slider('xhandle','xtrack',{
		increment:1,
		range: $R(0,100),
		values: $R(0,100),
		sliderValue:3
	});
	bTL.options.onSlide = function(value){
		if (value >= '78' && value <= '100'){
			bigT.update('That\'s me!');
		}else if (value =='11'){
			bigT.update('Hi.');
		}else if (value =='21'){
			bigT.update('Encore');
		}else if (value =='23'){
			bigT.update('Circus2');
		}else if (value =='33'){
			bigT.update('F-bleu');
		}else if (value =='38'){
			bigT.update('Food');
		}else if (value =='44'){
			bigT.update('Excalibur');
		}else if (value =='55'){
			bigT.update('Aria');
		}else if (value =='59'){
			bigT.update('TI');
		}else if (value =='64'){
			bigT.update('Wynn');
		}else if (value =='69'){
			bigT.update('Mandalay');
		}else if (value =='72'){
			bigT.update('Hooters');
		}else if (value =='77'){
			bigT.update('777');
		}else{
			bigT.update();
		};
	};
	bTL.options.onChange = function(value){
		if (value >= '78' && value <= '100'){
			bigT.update('That\'s me!');
		}else if (value =='7'){
			bigT.update('7 7 7');
		}else if (value =='9'){
			bigT.update('Natural!');
		}else if (value =='11'){
			bigT.update('Peekaboo');
		}else if (value =='21'){
			bigT.update('<a href="http://www.vegastripping.com/features/feature.php?feature_id=160" target=_blank>Review</a>');
		}else if (value =='23'){
			bigT.update('<a href="http://www.vegastripping.com/features/feature.php?feature_id=158" target=_blank>Review</a>');
		}else if (value =='33'){
			bigT.update('<a href="http://www.vegastripping.com/news/news.php?news_id=2481" target=_blank>News</a>');
		}else if (value =='38'){
			bigT.update('<a href="http://photos.vegastripping.com/tags/food" target=_blank>Pics</a>');
		}else if (value =='44'){
			bigT.update('<a href="http://www.vegastripping.com/features/feature.php?feature_id=159" target=_blank>Rooms</a>');
		}else if (value =='55'){
			bigT.update('<a href="http://www.vegastripping.com/features/feature.php?feature_id=152" target=_blank>Preview</a>');
		}else if (value =='59'){
			bigT.update('<a href="http://www.vegastripping.com/features/feature.php?feature_id=149" target=_blank>Review</a>');
		}else if (value =='64'){
			bigT.update('<a href="http://www.vegastripping.com/features/feature.php?feature_id=96" target=_blank>Suite</a>');
		}else if (value =='69'){
			bigT.update('<a href="http://www.vegastripping.com/features/feature.php?feature_id=146" target=_blank>Review</a>');
		}else if (value =='72'){
			bigT.update('<a href="http://www.vegastripping.com/features/feature.php?feature_id=143" target=_blank>Review</a>');
		}else if (value =='77'){
			bigT.update('<a href="http://www.vegastripping.com/jackpots" target=_blank>Jackpot!</a>');
		}else{
			bigT.update();
		};
	};
	var sT = $('sT'),
		rating = $('rating')
	sliderLimited = new Control.Slider('handle','track',{
			range: $R(1,5),
			sliderValue:1,
			values:[1,2,3,4,5]
	});
	sliderLimited.options.onSlide = function(value){
		$('rating').value = value;
		switch(value){
			case 1:
				vstar="*";
				break;
			case 2:
				vstar="**";
				break;
			case 3:
				vstar="***";
				break;
			case 4:
				vstar="****";
				break;
			case 5:
				vstar="*****";
				break;
			default:
		}
		sT.update(vstar);
	};
	sliderLimited.options.onChange = function(value){
		$('rating').value = value;
		runTabulator();
		switch(value){
			case 1:
				vstar="*";
				break;
			case 2:
				vstar="**";
				break;
			case 3:
				vstar="***";
				break;
			case 4:
				vstar="****";
				break;
			case 5:
				vstar="*****";
				break;
			default:
		}
		sT.update(vstar);
	};

	var	pT = $('pT'),
		pricing = $('pricing'),
		priceLimited = new Control.Slider('handlePrice','trackPrice',{
			range: $R(1,5),
			sliderValue:5,
			values:[1,2,3,4,5]
	});
	priceLimited.options.onSlide = function(value){
		$('pricing').value = value;
		switch(value){
			case 1:
				pdollar="$";
				break;
			case 2:
				pdollar="$$";
				break;
			case 3:
				pdollar="$$$";
				break;
			case 4:
				pdollar="$$$$";
				break;
			case 5:
				pdollar="$$$$$";
				break;
			default:
		}
		pT.update(pdollar);
	};
	priceLimited.options.onChange = function(value){
		$('pricing').value = value;
		runTabulator();
		switch(value){
			case 1:
				pdollar="$";
				break;
			case 2:
				pdollar="$$";
				break;
			case 3:
				pdollar="$$$";
				break;
			case 4:
				pdollar="$$$$";
				break;
			case 5:
				pdollar="$$$$$";
				break;
			default:
		}
		pT.update(pdollar);
	};

	// spa + attractions 

	var morningLimited = new Control.Slider('handleMorning','trackMorning',{
		increment:2,
		range: $R(-50,50),
		values: $R(-50,50),
		sliderValue:1
	});
	morningLimited.options.onSlide = function(value){
		value = parseFloat(value);
		var	left = 'spa',
			right = 'attractions',
			handle = 'mT'
		new parseValues(value,left,right,handle);
	};
	morningLimited.options.onChange = function(value){
		value = parseFloat(value);
		var left = 'spa',
			right = 'attractions',
			handle = 'mT'
		new parseValues(value,left,right,handle);
		runTabulator();
	};

	// pool + shopping

	var dayLimited = new Control.Slider('handleDay','trackDay',{
		increment:2,
		range: $R(-50,50),
		values: $R(-50,50),
		sliderValue:1
	});
	dayLimited.options.onSlide = function(value){
		value = parseFloat(value);
		var left = 'pool',
			right = 'shopping',
			handle = 'dT'
		new parseValues(value,left,right,handle);
	};
	dayLimited.options.onChange = function(value){
		value = parseFloat(value);
		var left = 'pool',
			right = 'shopping',
			handle = 'dT'
		new parseValues(value,left,right,handle);
		runTabulator();
	};

	// bars + dining 

	var gluttonyLimited = new Control.Slider('handleGluttony','trackGluttony',{
		increment:2,
		range: $R(-50,50),
		values: $R(-50,50),
		sliderValue:1
	});
	gluttonyLimited.options.onSlide = function(value){
		value = parseFloat(value);
		var left = 'bars',
			right = 'dining',
			handle = 'gT'
		new parseValues(value,left,right,handle);
	};
	gluttonyLimited.options.onChange = function(value){
		value = parseFloat(value);
		var left = 'bars',
			right = 'dining',
			handle = 'gT'
		new parseValues(value,left,right,handle);
		runTabulator();
	};

	// clubs + shows 

	var nightLimited = new Control.Slider('handleNight','trackNight',{
		increment:2,
		range: $R(-50,50),
		values: $R(-50,50),
		sliderValue:1
	});
	nightLimited.options.onSlide = function(value){
		value = parseFloat(value);
		var left = 'clubs',
			right = 'shows',
			handle = 'nT'
		new parseValues(value,left,right,handle);
	};
	nightLimited.options.onChange = function(value){
		value = parseFloat(value);
		var left = 'clubs',
			right = 'shows',
			handle = 'nT'
		new parseValues(value,left,right,handle);
		runTabulator();
	};

	// sex + casino - two great tastes that taste great together

	var prioritiesLimited = new Control.Slider('handlePriorities','trackPriorities',{
		increment:2,
		range: $R(-50,50),
		values: $R(-50,50),
		sliderValue:1
	});
	prioritiesLimited.options.onSlide = function(value){
		value = parseFloat(value);
		var left = 'sex',
			right = 'casino',
			handle = 'prT'
		new parseValues(value,left,right,handle);
	};
	prioritiesLimited.options.onChange = function(value){
		value = parseFloat(value);
		var left = 'sex',
			right = 'casino',
			handle = 'prT'
		new parseValues(value,left,right,handle);
		runTabulator();
	};
}
function parseValues(value,left,right,handle){
	handle = $(handle);
	if(value<0){
		vper = (value*-1);
		Rvper = (value+50);
		$(left).value = (vper+50);
		$(right).value = Rvper;
	}else{
		vper=value;
		Rvper=(value+50);
		$(left).value = (100-Rvper);
		$(right).value = Rvper;
	}
	vper = (vper+50);
	vper = vper+'%';
	handle.update(vper);
}
function runTabulator(){
	// the special sauce
	var loading = "<div id=loader></div>",
		bigT = $('bigT'),
		target = $('target');
	
	$('casinofinder').request({
		onCreate: function(){
			target.update(loading)
		},
		onSuccess: function(transport){
		},
		onComplete: function(transport){
			var response = transport.responseText;
			target.update(response);
//			new appearCurrent(target)
		}	
	});
}
