Event.observe(window, 'load',function(){

	if (window.XMLHttpRequest) {
	// IE 7, mozilla, safari, opera 9
		var ie6=false;
	} else {
	// IE6, older browsers
		var ie6=true;
	}
	
	// boxEmail is a DIV which is ONLY used on the gallery detail pages for HV and for the contest
	// if it finds it then dont apply the rounded corners - we were having problems with the
	// expanding boxes
	
	if ($('boxEmail')==null) {
		
	// suss out whether theres a banner or not. If there *is*, then we dont want to apply the round corners
	var isBanner=($('banner')!=null || $('flashbannerholder')!=null || $('mainpic_work')!=null || $('mainpic_play')!=null || $('mainpic_rest')!=null || $('mainpic_welcome')!=null ) ? true : false;
	function applyPNG(ele,strGraphic) {
		// ie6 - applies the png alpha channel to the corners
		ele.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/img/corners/"+strGraphic+".png',sizingMethod='scale')";
		ele.src="/img/blank.gif";			
	}
							  
	// assign rounded corners
	$$('div.roundtl').each(function(s, index) {
		if (isBanner || s.id=="bottommenu") {
		var elem=new Element('img', {src:"/img/corners/tl.png", width:"7", height:"7"});
		s.appendChild(elem);	
		elem.setStyle({
			position:"absolute",
			top:"-1px",
			left:"-1px",
			zindex:"1"
		});	
		if (ie6) { applyPNG(elem,"tl"); }
		}
	});
	
	$$('div.roundtr').each(function(s, index) {
		if (isBanner || s.id=="bottommenu") {
		var elem=new Element('img', {src:"/img/corners/tr.png", width:"7", height:"7"})
		s.appendChild(elem);
		elem.setStyle({
			position:"absolute",
			top:"-1px",
			left:s.offsetWidth-6+"px",
			zindex:"2"			
		})	  
		if (ie6) { applyPNG(elem,"tr"); }
		}
	});	
	$$('div.roundbl').each(function(s, index) {
		var elem=new Element('img', {src:"/img/corners/bl.png", width:"7", height:"7"})
		s.appendChild(elem);
		elem.setStyle({
			position:"absolute",
			left:"-1px",
			bottom:"-1px",
			zindex:"3"			
		})
		if (ie6) { applyPNG(elem,"bl"); }		
	});	
	$$('div.roundbr').each(function(s, index) {
		var elem=new Element('img', {src:"/img/corners/br.png", width:"7", height:"7"})
		s.appendChild(elem);
		elem.setStyle({
			position:"absolute",
			left:s.offsetWidth-6+"px",
			bottom:"-1px",
			zindex:"4"				
		})
		if (ie6) { applyPNG(elem,"br"); }		
	});	
	
	
	// add the bottom curves to the faux columns
	if ($('leftRightWrapper')) {
		s=$('leftRightWrapper');

		// left column, left curve
		var elem=new Element('img', {src:"/img/corners/bl.png", width:"7", height:"7"})
		s.appendChild(elem);
		elem.setStyle({
			position:"absolute",
			left:"-1px",
			top:s.offsetHeight-14+"px",
			zindex:"5"				
		})	
		if (ie6) { applyPNG(elem,"bl"); }		
		
		// left column, right curve
		var elem=new Element('img', {src:"/img/corners/br.png", width:"7", height:"7"})
		s.appendChild(elem);
		elem.setStyle({
			position:"absolute",
			left:"505px",
			top:s.offsetHeight-14+"px",
			zindex:"6"				
		})
		if (ie6) { applyPNG(elem,"br"); }		
		
		// right column, left curve
		var elem=new Element('img', {src:"/img/corners/bl.png", width:"7", height:"7"})
		s.appendChild(elem);
		elem.setStyle({
			position:"absolute",
			left:"511px",
			top:s.offsetHeight-14+"px",
			zindex:"7"				
		})
		if (ie6) { applyPNG(elem,"bl"); }		
		
		// right column, right curve
		var elem=new Element('img', {src:"/img/corners/br.png", width:"7", height:"7"})
		s.appendChild(elem);
		elem.setStyle({
			position:"absolute",
			left:s.offsetWidth-6+"px",
			top:s.offsetHeight-14+"px",
			zindex:"8"				
		})	
		if (ie6) { applyPNG(elem,"br"); }		
		
		}
	}
	
	// assign jump menu
	if ($('jumpMenuGo')) {
		Event.observe($('jumpMenuGo'),'click',function() {
			//location.href=$F('slcFindOutMore');
			window.open($F('slcFindOutMore'));
		});
	}
	
	
});

