﻿//windows.onload() events
$(document).ready(function(){
            initContentSections();
            Rounded('contentSection', 5, 5, 1 , 1);
            });

function initContentSections(){
	$(document).find("div")
		.filter(".showHideTrigger").each(function(){
		if(cssCheck(this,'showIt')){
			this.onclick = _fnToggleShowHide;
			$(this).siblings().filter("div.content").show();
		}
		else{
			this.onclick = _fnToggleShowHide;
			$(this).siblings().filter("div.content").hide();				
		}
	});
}
	
_fnToggleShowHide = function(){
	if(cssCheck(this,'showIt')){
		$(this).siblings().filter("div.innerContent").slideUp("normal");
	}
	else{	
		$(this).siblings().filter("div.innerContent").slideDown("normal");
	}
	cssSwap(this,'showIt','hideIt');
}

function cssSwap(o,c1,c2){
    o.className=!cssCheck(o,c1) ? o.className.replace(c2,c1) : o.className.replace(c1,c2);
}
function cssAdd(o,c1,c2){
	if(!cssCheck(o,c1)){o.className+=o.className?' '+c1:c1;}
}
function cssRemove(o,c1,c2){
	var rep=o.className.match(' '+c1)?' '+c1:c1;
	o.className=o.className.replace(rep,'');
}
function cssCheck(o,c1,c2){
	return new RegExp('\\b'+c1+'\\b').test(o.className)
}


function showMenu(currentMenu) 
{
  var thisMenu = document.getElementById(currentMenu).style;
  thisMenu.display = "block";
  thisMenu.zIndex = "1";
  thisMenu.background = "#fff";
  return false;
}

function hideMenu(currentMenu) 
{ 
  var thisMenu = document.getElementById(currentMenu).style;
  thisMenu.display = "none";
  thisMenu.zIndex = "0";
  return false;
}