function switchContent(ev) {
	var aM, aC;
	if (typeof(ev) != 'string') {
		var el = ev.element();
		aM = el.id;
		aC = aM.substring(aM.indexOf('-') + 1); 
	} else {
		aM = 'swmenu-' + ev;
		aC = ev;
		$$('li a[id^=swmenu-]').each(function(el) { el.observe('mouseover', switchContent); });
	}
	$$('li a[id^=swmenu-]').each(function(el) { el.removeClassName('swmenuhover'); });
	$(aM).addClassName('swmenuhover');
	$$('div[id^=swcontent-]').each(function(el) { el.hide(); });
	$('swcontent-' + aC).style.display = '';
	$('swcontent-' + aC).removeClassName('contsw-hidden');
	$('swcontent-' + aC).show();
	return 1;
}

function resetBox(box, defaultvalue) {
  if (box.value == defaultvalue) {
   box.value = "";
   }
}

function createMenu(id){
	var ul1 = $(id).childNodes;
	var li1 = ul1[0].childNodes;
	var ul2;
	var a;
	var ov_id = new Array(li1.length);
	
	for(var i=1;i<li1.length;i++){
		if(li1[i].childNodes.length>1){
			ul2 = li1[i].childNodes[1];
			if(ul2!=null){
				if(ul2.id==''){
					ul2.id = 'sub_'+li1[i].id;
				}
				
				a = li1[i].getElementsByTagName('a')[0];
				createLinks(a,ul2,ul2.id)
			}
		}
	}
}

function createLinks(a,ul2,id){
	a.onmouseover = function (e) { document.getElementById(id).style.display='block'; }
	a.onmouseout = function (e) { document.getElementById(id).style.display='none'; }
	ul2.onmouseover = function (e) { document.getElementById(id).style.display='block'; }
	ul2.onmouseout = function (e) { document.getElementById(id).style.display='none'; }
}

function catalogpopup() { //v2.0
  window.open('http://www.flipmag.com/swf/WINW3i9QVa','popup','width=1000,height=500');
}