/* --------------------------------
| FUNCTION:	
| CREATED:	
| MODIFIED:	
| AUTHOR: 	Seth DeSantis	
| PURPOSE: 	
|-------------------------------- */

/* --------------------------------
| FUNCTION:	toggle_display(divIn)
| CREATED:	2/14/09
| MODIFIED:	
| AUTHOR: 	Seth DeSantis	
| PURPOSE: 	determine display status of divIn and toggle it
|-------------------------------- */
function toggle_display(divIn) {
	//alert(divIn.style.display);
	var divIn = document.getElementById(divIn);
	if( divIn.style.display=="none") {
		divIn.style.display="";
	} else {
		divIn.style.display="none";
	}
}

/* --------------------------------
| FUNCTION:	toggle_div_background(divIn)
| CREATED:	3/5/09
| MODIFIED:	1/27/10
| AUTHOR: 	Seth DeSantis	
| PURPOSE: 	
|
|	type : type of background swap
|		class 	- class
|		c 		- color
|-------------------------------- */

function toggle_div_background(divIn, type ,bg_on, bg_off) {
	//alert(divIn.style.display);
	var divIn = document.getElementById(divIn);
	
	switch (type) {
		case 'class':
			if( divIn.className==  bg_on) {
				divIn.className=bg_off;
			} else {
				divIn.className=bg_on;
			}
		break;
		case 'c':
			if( divIn.style.backgroundColor==bg_on) {
				divIn.style.backgroundColor==bg_off;
			} else {
				divIn.style.backgroundColor==bg_on;
			}
		break;
		default :
		
		break;
		
	}
	
}

/* --------------------------------
| FUNCTION:	toggle_div_class(divIn ,bg_on, bg_off)
| CREATED:	1/3/10
| MODIFIED:	
| AUTHOR: 	Seth DeSantis	
| PURPOSE: 	
|
|-------------------------------- */

function toggle_div_class(divIn ,class_1, class_2) {
	if (divIn.className == class_1) {
		divIn.className = class_2;
	} else {
		divIn.className = class_1;
	}
}


/* --------------------------------
| FUNCTION:	s10_button1()
| CREATED:	1/3/10
| MODIFIED:	
| AUTHOR: 	Seth DeSantis	
| PURPOSE: 	
|
|-------------------------------- */

function s10_button1(text,id,class_off,class_on) {
	var s10_button1 = document.createElement('a');

	s10_button1.innerHTML=text;
	s10_button1.id=id;
	s10_button1.className = class_off;
	s10_button1.onmouseover= function() {
		s10_button1.className = class_on;
	};
	s10_button1.onmouseout = function() {
		s10_button1.className = class_off;
	};
	
	return s10_button1;
}


/* --------------------------------
| FUNCTION:	journalStyle_box()
| CREATED:	1/14/10
| MODIFIED:	
| AUTHOR: 	Seth DeSantis	
| PURPOSE: 	
|
|-------------------------------- */

function journalStyle_box (width, idIn) {
	var adjWidthNum = (width - 140) ;
	var adjWidth =  adjWidthNum + 'px';
	
	var journalStyle_box = document.createElement("div");
	
	var top = document.createElement("div");
	journalStyle_box.appendChild(top);
	
	var topLeft = document.createElement("div");
	topLeft.className="js_topLeft";
	top.appendChild(topLeft);
	
	var topCenter = document.createElement("div");
	topCenter.className="js_topCenter";
	topCenter.style.width=adjWidth;
	top.appendChild(topCenter);
	
	var topRight = document.createElement("div");
	topRight.className="js_topRight";
	top.appendChild(topRight);
	
	var mid = document.createElement("div");
	journalStyle_box.appendChild(mid);
	mid.id=idIn;
	mid.appendChild(document.createTextNode("no"));
	
	var midLeft = document.createElement("div");
	midLeft.className="js_midLeft";
	mid.appendChild(midLeft);
	
	var midCenter = document.createElement("div");
	midCenter.className="js_midCenter";
	midCenter.style.width=adjWidth;
	mid.appendChild(midCenter);
	
	var midRight = document.createElement("div");
	midRight.className="js_midRight";
	mid.appendChild(midRight);
	
	var bot = document.createElement("div");
	journalStyle_box.appendChild(bot);
	
	var botLeft = document.createElement("div");
	botLeft.className="js_botLeft";
	bot.appendChild(botLeft);
	
	var botCenter = document.createElement("div");
	botCenter.className="js_botCenter";
	botCenter.style.width=adjWidth;
	bot.appendChild(botCenter);
	
	var botRight = document.createElement("div");
	botRight.className="js_botRight";
	bot.appendChild(botRight);
	
}

