
var CONTENTBLOCK = new Array();

function showContent(unique, id){
	var next = getObj("Content_"+unique+"_"+id);
	if(next){
		var nextstyle = getObjStyle("Content_"+unique+"_"+id);
		if(nextstyle.display == "block"){
			nextstyle.display = "none";
		}else{
			nextstyle.display = "block";
		}
	}
}

try {
	document.execCommand("BackgroundImageCache", false, true);
}catch(x){}

var CUSTOMPOPUPWINPROPS;
	function openWin(URL, name, props){
	
		// check for URL
		if(URL == ""){
			alert("Error!\n\nThe URL for the link could not be determined.");
		}
		
		// if we have one then setup window
		else{
		
			var newwindow = null;
			var windowprops;
			
			if(typeof(props) !== 'undefined' && props && props != null && props != ""){
				windowprops = props;
			}else if(typeof(CUSTOMPOPUPWINPROPS) !== 'undefined' && CUSTOMPOPUPWINPROPS && CUSTOMPOPUPWINPROPS != null && CUSTOMPOPUPWINPROPS != ""){
				windowprops = CUSTOMPOPUPWINPROPS;
			}
			
			// doesn't have custom features
			if(!windowprops){
				newwindow = window.open(URL, name);
			}
			
			// has custom features
			else{
				
				// container for window features
				var features = "";
				
				// set width and height (needed if centered or fullscreen)
				var width = 0;
				if(typeof(windowprops.width) !== 'undefined' && windowprops.width && windowprops.width != null && windowprops.width != ""){
					width = (windowprops.width-0);
				}
				
				var height = 0;
				if(typeof(windowprops.height) !== 'undefined' && windowprops.height && windowprops.height != null && windowprops.height != ""){
					height = (windowprops.height-0);
				}
				
				// set top, update top to center vertically if necessary
				var top = 0;
				if(typeof(windowprops.top) !== 'undefined' && windowprops.top && windowprops.top != null && windowprops.top != ""){
					top = windowprops.top;
					if(height > 0 && windowprops.centerv == 'yes'){
						top = (window.screen.height/2) - ((height/2) + 58); // 58 = status bar(25px) and title bar(25px) and browser window borders(4px)
					}
				}
				
				// set left, update left to center horizontally if necessary
				var left = 0;
				if(typeof(windowprops.left) !== 'undefined' && windowprops.left && windowprops.left != null && windowprops.left != ""){
					left = windowprops.left;
					if(width > 0 && windowprops.centerh == 'yes'){
						left = (window.screen.width/2) - ((width/2) + 8); // 8 = 4px browser window borders
					}
				}
				
				// reset top, left and calculate new width, height for full screen
				if(windowprops.fullscreen == 'yes'){
					top = 0;
					left = 0;
					width = window.screen.width - 8; // 8 = 4px browser window borders
					height = window.screen.height - 58; // 58 = status bar(25px) and title bar(25px) and browser window borders(4px)
				}
				
				var directories = "yes";
				if(typeof(windowprops.directories) !== 'undefined' && windowprops.directories && windowprops.directories != null && windowprops.directories != "" && windowprops.directories.toLowerCase() == "no"){
					directories = "no";
				}
				
				var location = "yes";
				if(typeof(windowprops.location) !== 'undefined' && windowprops.location && windowprops.location != null && windowprops.location != "" && windowprops.location.toLowerCase() == "no"){
					location = "no";
				}
				
				var menubar = "yes";
				if(typeof(windowprops.menubar) !== 'undefined' && windowprops.menubar && windowprops.menubar != null && windowprops.menubar != "" && windowprops.menubar.toLowerCase() == "no"){
					menubar = "no";
				}
				
				var resizable = "yes";
				if(typeof(windowprops.resizable) !== 'undefined' && windowprops.resizable && windowprops.resizable != null && windowprops.resizable != "" && windowprops.resizable.toLowerCase() == "no"){
					resizable = "no";
				}
				
				var scrollbars = "yes";
				if(typeof(windowprops.scrollbars) !== 'undefined' && windowprops.scrollbars && windowprops.scrollbars != null && windowprops.scrollbars != "" && windowprops.scrollbars.toLowerCase() == "no"){
					scrollbars = "no";
				}
				
				var status = "yes";
				if(typeof(windowprops.status) !== 'undefined' && windowprops.status && windowprops.status != null && windowprops.status != "" && windowprops.status.toLowerCase() == "no"){
					status = "no";
				}
				
				var toolbar = "yes";
				if(typeof(windowprops.toolbar) !== 'undefined' && windowprops.toolbar && windowprops.toolbar != null && windowprops.toolbar != "" && windowprops.toolbar.toLowerCase() == "no"){
					toolbar = "no";
				}

				// build window feature settings
				features += "directories=" + directories;
				features += ",location=" + location;
				features += ",menubar=" + menubar;
				features += ",resizable=" + resizable;
				features += ",scrollbars=" + scrollbars;
				features += ",status=" + status;
				features += ",toolbar=" + toolbar;
				features += ",top=" + top;
				features += ",screenY=" + top;
				features += ",left=" + left;
				features += ",screenX=" + left;
				features += ",width=" + width;
				features += ",height=" + height;

				newwindow = window.open(URL, name, features);

			}
			
			// set focus to new window
			if(window.focus){
				try{
					newwindow.focus();
				}catch(x){
					// do nothing
				}
			}
		
		}
		//window.history.back();
		// always stop the link (if necessary)
		return false;
		
	}
