//<![CDATA[
function decover(status){
	if(switchCover) {
		if(status==1){
			document.getElementById('clip').style.position = 'absolute';
			document.getElementById('clip').zIndex = 1000;
		}
		else
			document.getElementById('clip').style.position = 'static';
	}
}

function hilightImage(divID,fileNameIncPathFromImages){
	document.getElementById(divID).src = 'img/' + fileNameIncPathFromImages;
}

function ratingHover(number,state){
	var prefix = 'rating';
	var hover = '-hover';
	if(state==1){
		for(i=1;i<=number;i++){
			wholestring = prefix+i;
			document.getElementById(wholestring).setAttribute('id',wholestring+hover);
		}
	}
	else{
		for(u=1;u<=number;u++){
			wholestring2 = prefix+u+hover;
			document.getElementById(wholestring2).setAttribute('id',prefix+u);
		}
	}
}

function toggleCommentForm(){
	if(document.getElementById('commentform').style.display=='block'){
		document.getElementById('commentform').style.display='none';
		/* document.getElementById('commentlink').style.color=''; */
	}
	else{
		document.getElementById('commentform').style.display='block';
		/* document.getElementById('commentlink').style.color='#333333'; */
	}
}

function openArticleMail(article){
	window.open('/articlesend.cfm?article=' + article , 'ArticleMail', 'resizable=no,scrollbars=no,width=368,height=280,toolbar=no,left=300,top=300');
}



// Implementing annoying StickyAd Sidebar
window.onload = function ()
{
	/**
	* fix for IE < 7 since it doesn't properly handle either
	* (1) the CSS box model; or
	* (2) position: absolute
	*/
	if ( document.all && !window.XMLHttpRequest ) {
		document.getElementById('stickyad').style.position = 'relative';
		document.getElementById('stickyad').style.top = '122px';
	}
}

window.onscroll = function()
{
	// http://www.derekallard.com/blog/post/conditionally-sticky-sidebar
	if( window.XMLHttpRequest ) { // IE 6 doesn't implement position fixed nicely...
		leftwhite = (document.body.clientWidth - 994)/2;
		leftmargin = (parseInt(leftwhite) + 994) - 162 + 'px';
		if (document.documentElement.scrollTop > 122 || self.pageYOffset > 122) {
			document.getElementById('stickyad').style.position = 'fixed';
			document.getElementById('stickyad').style.top = 0;
			document.getElementById('stickyad').style.left = leftmargin;
		} else if (document.documentElement.scrollTop < 122 || self.pageYOffset < 122) {
			document.getElementById('stickyad').style.position = 'absolute';
			document.getElementById('stickyad').style.top = '122px';
			document.getElementById('stickyad').style.left = leftmargin;
		}
	}
}

//]]>