/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
//add event function from http://www.dynarch.com/projects/calendar/
function addAnEvent(el, evname, func) {
    if (el.attachEvent) { // IE
        el.attachEvent("on" + evname, func);
    } else if (el.addEventListener) { // Gecko / W3C
        el.addEventListener(evname, func, true);
    } else {
        el["on" + evname] = func;
    }
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
function targetNew(anchor) {
	window.open(anchor.href);
	return false;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
function imageWin(imgSrc, imgW, imgH, captionTxt, node) {
	function remove(event) {
		backdrop.parentNode.removeChild(backdrop);
		container.parentNode.removeChild(container);
		onScroll=function(){};

		// w3c
		event.stopPropagation();
		event.preventDefault();
		// ie
		event.returnValue=false;
		event.cancelBubble=true;
	}

	// Create backdrop.
	var backdrop=document.createElement('div');
	with (backdrop.style) {
		background='black';
		opacity='0.66';
		filter='alpha(opacity = 50)';
		position='fixed';
		top='0';
		left='0';
		width='100%';
		height=window.innerHeight+'px';
		zIndex='9999';
	}
	addAnEvent(backdrop, 'click', remove);
	document.body.appendChild(backdrop);

	// Figure out width and height.
	var ratioW=(window.innerWidth-40)/imgW;
	var ratioH=(window.innerHeight-80)/imgH;
	var ratio=Math.min(ratioW, ratioH);
	ratio=Math.min(1.0, ratio);
	
	// Create container.
	var container=document.createElement('div');
	var w=Math.floor(imgW*ratio);
	var h=Math.floor(imgH*ratio - 60);
	with (container.style) {
		background='white';
		margin='20px '+( (window.innerWidth - w) / 2)+'px';
		padding='20px';
		position='fixed';
		top='0';
		left='0';
		width=w+'px';
		height=(h+60)+'px';
		zIndex='10000';
		fontSize='0.8em';
		lineHeight='0.9';
	}
	addAnEvent(container, 'click', remove);
	document.body.appendChild(container);

	// Add image and caption.
	var img=document.createElement('img');
	img.width=w;
	img.height=h;
	img.src=imgSrc;
	container.appendChild(img);
	var caption=document.createElement('div');
	with (caption.style) {
		background='LightGrey';
		color='black';
		height='20px';
		padding='10px';
		overflow='hidden';
		marginTop='17px';
	}
	caption.innerHTML=captionTxt;
	container.appendChild(caption);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
function verifyPostForm(f) {
	if (''==f.subject.value) alert('You must provide a subject.');
	else if (''==f.comment.value) alert('You must enter a comment.');
	else return true;
	return false;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
//frame breaker
if (top!=self) top.location.href=self.location.href;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
var google_ad_client = "pub-4766989499348746";
var google_ad_width = 468;
var google_ad_height = 15;
var google_ad_format = "468x15_0ads_al";
var google_ad_channel ="0642364825";
var google_color_border = "FFFFFF";
var google_color_bg = "FFFFFF";
var google_color_link = "0000CC";
var google_color_url = "0000CC";
var google_color_text = "000000";
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
if (String(document.cookie).match(/doReload=1/)) {
	document.cookie='doReload=2;path=/';
	document.location.reload();
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

