function moduletabs(thesection, thename, therows) {
	// Turn all off
	for (var i=1; i <= therows; i++) {
		document.getElementById(thename+i).className = 'module_tab_off';
	}
	
	// Turn On Clicked
	document.getElementById(thename+thesection).className = 'module_tab_on';
}

function profiletabs(thesection) {
	// Turn all off
	document.getElementById('personal_info').className = 'media_tab_off';
	document.getElementById('change_pass').className = 'media_tab_off';
	
	// Turn On Clicked
	document.getElementById(thesection).className = 'media_tab_on';
}

function calendartabs(thesection) {
	// Turn all off
	document.getElementById('full_calendar').className = 'media_tab_off';
	document.getElementById('full_list').className = 'media_tab_off';
	
	// Turn On Clicked
	document.getElementById(thesection).className = 'media_tab_on';
}

function mediatabs(thesection) {
	// Turn all off
	document.getElementById('contenido').className = 'media_tab_off';
	document.getElementById('fotogaleria').className = 'media_tab_off';
	document.getElementById('videogaleria').className = 'media_tab_off';
	document.getElementById('audiogaleria').className = 'media_tab_off';
	document.getElementById('comentarios').className = 'media_tab_off';
	
	// Turn On Clicked
	document.getElementById(thesection).className = 'media_tab_on';
}

//OPEN POPUP
function wpopopen(theURL,winName,features) {setTimeout("winp.focus()",100);winp=window.open(theURL,winName,features);}

//OPEN AND CLOSE CF WINDOWS
function wopen(wname,wtitle,wurl,wheight,wwidth) {
	wdestroy(wname);
	//CONVERT STRING TO INTEGER
	wheight = wheight * 1;
	wwidth = wwidth * 1;
	//OPEN WINDOW
	ColdFusion.Window.create(wname, wtitle, wurl, {height:wheight,width:wwidth,center:true,draggable:false,modal:true,resizable:false,initshow:true});
}
function wdestroy(wname) {
	// CHECK IF CFWINDOW EXIST AND CLOSE
	try {
  		if(ColdFusion.Window.getWindowObject(wname))
		// IF EXISTS THEN CLOSE
		{ColdFusion.Window.destroy(wname,true);}
  	}
	catch(err)	{ } //Handle errors here
}

//SCRIPT CHANGE CSS TEST
function changeRule() {
	var theRules = new Array();
	if (document.styleSheets[0].cssRules) {
		theRules = document.styleSheets[0].cssRules;
	} else if (document.styleSheets[0].rules) {
		theRules = document.styleSheets[0].rules;
	}
	theRules[6].style.backgroundColor = 'red';
}




