	var globbandsize = '';
	var globcupsize = '';

        function MM_findObj(n) {
         var p,i,x; d=document; if(!(x=d[n])&&d.all)x = d.all[n];
         for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);
         if(!x&&document.getElementById)x=document.getElementById(n);return x; }

        function MM_showHideLayers() {
         var i,p,v,obj,args=MM_showHideLayers.arguments; i=0;
         if((obj=MM_findObj(args[i]))!=null) { v=args[i+1];
         if(obj.style) {obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v;
         } obj.visibility=v; } }

	function show_layer (thislayer) {
		MM_showHideLayers('band_sizes', 'hide');
		MM_showHideLayers('cup_sizes', 'hide');

		if (thislayer != 'none') {
			MM_showHideLayers(thislayer, 'show');
		}
	}

	function search_by_size () {
		if (globbandsize != '' && globcupsize != '') {
			cupsize = globcupsize.toLowerCase();
			location.href = 'http://www.saysomething.co.uk/products/size_' + globbandsize + cupsize + '_bras.html';
		}
	}

	function select_cup_size (cupsize) {
		MM_showHideLayers('cup_sizes', 'hide');
		modifyText('selected_cup_size', 'Cup size ' + cupsize);
		globcupsize = cupsize;
		search_by_size();
	}

	function select_band_size (bandsize) {
		MM_showHideLayers('band_sizes', 'hide');
		modifyText('selected_band_size', 'Band size ' + bandsize);
		globbandsize = bandsize;
		search_by_size();
	}

	function modifyText(id, text) {
		obj = MM_findObj(id);
		obj.childNodes[0].data = text;
	}
