function roundedCorners() {
	
	var store_h1s = [];
	var store_div = document.getElementById('maincolumn');
	if (store_div && store_div.className == 'store_content') {
		store_h1s = store_div.getElementsByTagName('h1');
		for (var h1_i = 0; h1_i < store_h1s.length; h1_i++) {
			store_h1s[h1_i].className = 'titlebar';
		}
	}
	/* Now add additional divs to each of the divs we have found */
	round_nodes( store_h1s, 'titlebar', 'rounded' );
		
	var rounded_divs = [];
	var divs = document.getElementsByTagName('div');
	/* First locate all divs with 'titlebar' in their class attribute */
	for (var i = 0; i < divs.length; i++) {
		if (/\btitlebar\b/.exec(divs[i].className)) {
			rounded_divs[rounded_divs.length] = divs[i];
		}
	}
	
	/* Now add additional divs to each of the divs we have found */
	round_nodes( rounded_divs, 'titlebar', 'rounded' );
}

/* Run the function once the page has loaded: */



function roundedCorners2() {
 var divs = document.getElementsByTagName('div');
 var rounded_divs = [];
 /* First locate all divs with 'box' in their class attribute */
 for (var i = 0; i < divs.length; i++) {
   if (/\bbox\b/.exec(divs[i].className)) {
     rounded_divs[rounded_divs.length] = divs[i];
   }
 }
	/* Now add additional divs to each of the divs we have found */
	round_nodes( rounded_divs, 'box', 'roundedbox' );
}



function round_nodes( node_list, class_name, new_class_name) {
	
	for (var i = 0; i < node_list.length; i++) {
		var original = node_list[i];
		/* Make it the inner div of the four */
		original.className = original.className.replace(class_name, '');
		/* Now create the outer-most div */
		var tr = document.createElement('div');
		tr.className = new_class_name;
		/* Swap out the original (we'll put it back later)*/
		original.parentNode.replaceChild(tr, original); 
		/* Create the two other inner nodes */
		var tl = document.createElement('div');
		var br = document.createElement('div');
		/* Now glue the nodes back in to the document */
		tr.appendChild(tl);
		tl.appendChild(br);
		br.appendChild(original);
	}
}



/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
*/

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_over'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_over'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

function go(formname)
{
	box = formname;
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = destination;
}



/* Run the function once the page has loaded: */

function init(){
	roundedCorners();
	roundedCorners2();

	initRollovers()
}

window.onload=init;
