window.addEvent('domready', function() {
	var status = {
		'true': 'open',
		'false': 'close'
	};
	
	var orderByShapePoolShape="";
	var manu = "loopLock";
	
	$('rect').addEvent('click', function(e){
				orderByShapePoolShape = "rect";	
		});
	$('rectOffset').addEvent('click', function(e){
				orderByShapePoolShape = "rectOffset";
	});
	$('rectSide').addEvent('click', function(e){
				orderByShapePoolShape = "rectSide";
	});
	$('rectEnd').addEvent('click', function(e){
				orderByShapePoolShape = "rectEnd";
	});
	$('grecEnd').addEvent('click', function(e){
				orderByShapePoolShape = "grecEnd";
	});
	$('grecSide').addEvent('click', function(e){
				orderByShapePoolShape = "grecSide";
	});
	$('irregular').addEvent('click', function(e){
				orderByShapePoolShape = "irregular";
	});
	
	//When Manufactor link is clicked
	$('loopLock').addEvent('click', function(e){
				manu = "loopLock";
	});
	$('yardGuard').addEvent('click', function(e){
				manu = "yardGuard";
	});
	$('buffSafety').addEvent('click', function(e){
				manu = "buffSafety";
	});
	$('merlin').addEvent('click', function(e){
				manu = "merlin";
	});
	$('meyco').addEvent('click', function(e){
				manu = "meyco";
	});
	$('gli').addEvent('click', function(e){
				manu = "gli";
	});
	
	$('beginHere').addEvent('click', function(e){
		if(orderByShapePoolShape == "rect") {
			if(manu=="loopLock") {
				window.location.href='http://www.poolsafetycover.com/loop-loc-rectangle-mesh-safety-covers.asp?&step=1';
			}
			if(manu=="yardGuard") {
				window.location.href='http://www.poolsafetycover.com/yard-guard-rectangle-mesh-safety-covers.asp?&step=1';
			}
			if(manu=="buffSafety") {
				window.location.href='http://www.poolsafetycover.com/buffalo-safety-covers.asp';
			
			}
			if(manu=="merlin") {
				window.location.href='http://www.poolsafetycover.com/merlin-rectangle-dura-mesh-safety-covers.asp?&step=1';
			}
			if(manu=="meyco") {
				window.location.href='http://www.poolsafetycover.com/meyco-rectangle-meyco-lite-mesh-safety-covers.asp?&step=1';
			}
			if(manu=="gli") {
				window.location.href='http://www.poolsafetycover.com/gli-rectangle-secur-a-pool-mesh-safety-covers.asp?&step=1';
			}
		}
		if(orderByShapePoolShape == "rectOffset") {
			if(manu=="loopLock") {
				window.location.href='http://www.poolsafetycover.com/custom-safety-covers.asp';
			
			}
			if(manu=="yardGuard") {
				window.location.href='http://www.poolsafetycover.com/custom-safety-covers.asp';
			
			}
			if(manu=="buffSafety") {
				window.location.href='http://www.poolsafetycover.com/buffalo-safety-covers.asp';
			
			}
			if(manu=="merlin") {
				window.location.href='http://www.poolsafetycover.com/custom-safety-covers.asp';
			
			}
			if(manu=="meyco") {
				window.location.href='http://www.poolsafetycover.com/custom-safety-covers.asp';
			
			}
			if(manu=="gli") {
				window.location.href='http://www.poolsafetycover.com/gli-rectangle-with-offset-steps-secur-a-pool-mesh-safety-covers.asp?&step=1';
			}
		}
		if(orderByShapePoolShape == "rectSide") {
			if(manu=="loopLock") {
				window.location.href='http://www.poolsafetycover.com/loop-loc-rectangle-with-steps-mesh-safety-covers.asp?&step=1';
			}
			if(manu=="yardGuard") {
				window.location.href='http://www.poolsafetycover.com/custom-safety-covers.asp';
			
			}
			if(manu=="buffSafety") {
				window.location.href='http://www.poolsafetycover.com/buffalo-safety-covers.asp';
			
			}
			if(manu=="merlin") {
				window.location.href='http://www.poolsafetycover.com/custom-safety-covers.asp';
			
			}
			if(manu=="meyco") {
				window.location.href='http://www.poolsafetycover.com/custom-safety-covers.asp';
			
			}
			if(manu=="gli") {
				window.location.href='http://www.poolsafetycover.com/gli-rectangle-with-steps-secur-a-pool-mesh-safety-covers.asp?&step=1';
			}
		}
		if(orderByShapePoolShape == "rectEnd") {
			if(manu=="loopLock") {
				window.location.href='http://www.poolsafetycover.com/loop-loc-rectangle-with-end-steps-mesh-safety-covers.asp?&step=1';
			}
			if(manu=="yardGuard") {
				window.location.href='http://www.poolsafetycover.com/yard-guard-rectangle-with-end-step-mesh-safety-covers.asp?&step=1';
			}
			if(manu=="buffSafety") {
				window.location.href='http://www.poolsafetycover.com/buffalo-safety-covers.asp';
			
			}
			if(manu=="merlin") {
				window.location.href='http://www.poolsafetycover.com/custom-safety-covers.asp';
			
			}
			if(manu=="meyco") {
				window.location.href='http://www.poolsafetycover.com/meyco-rectangle-with-end-steps-lite-mesh-safety-covers.asp?&step=1';
			}
			if(manu=="gli") {
				window.location.href='http://www.poolsafetycover.com/gli-rectangle-with-end-steps-secur-a-pool-mesh-safety-covers.asp?&step=1';
			}
		}
		if(orderByShapePoolShape == "grecEnd") {
			if(manu=="loopLock") {
				window.location.href='http://www.poolsafetycover.com/loop-loc-grecian-with-end-steps-mesh-safety-covers.asp?&step=1';
			}
			if(manu=="yardGuard") {
				window.location.href='http://www.poolsafetycover.com/custom-safety-covers.asp?&step=1';
			
			}
			if(manu=="buffSafety") {
				window.location.href='http://www.poolsafetycover.com/buffalo-safety-covers.asp';
			
			}
			if(manu=="merlin") {
				window.location.href='http://www.poolsafetycover.com/merlin-grecian-with-end-steps-dura-mesh-safety-covers.asp?&step=1';
			}
			if(manu=="meyco") {
				window.location.href='http://www.poolsafetycover.com/meyco-grecian-with-steps-meyco-lite-mesh-safety-covers.asp?&step=1';
			}
			if(manu=="gli") {
				window.location.href='http://www.poolsafetycover.com/gli-grecian-with-end-steps-secur-a-pool-mesh-safety-covers.asp?&step=1';
			}
		}
		if(orderByShapePoolShape == "grecSide") {
			if(manu=="loopLock") {
				window.location.href='http://www.poolsafetycover.com/loop-loc-grecian-with-steps-mesh-safety-covers.asp?&step=1';
			}
			if(manu=="yardGuard") {
				window.location.href='http://www.poolsafetycover.com/custom-safety-covers.asp';
			}
			if(manu=="buffSafety") {
				window.location.href='http://www.poolsafetycover.com/buffalo-safety-covers.asp';
			}
			if(manu=="merlin") {
				window.location.href='http://www.poolsafetycover.com/custom-safety-covers.asp';
			}
			if(manu=="meyco") {
				window.location.href='http://www.poolsafetycover.com/custom-safety-covers.asp';
			}
			if(manu=="gli") {
				window.location.href='http://www.poolsafetycover.com/gli-grecian-with-steps-secur-a-pool-mesh-safety-covers.asp?&step=1';
			}
		}
		if(orderByShapePoolShape == "irregular") {
			window.location.href='http://www.poolsafetycover.com/custom-safety-covers.asp';
		}
	});
});