// JavaScript Document
pageType = 'normal';

function init() {
	if($('authimage')!=null) getAuthImage();
	
	if ($chk($("links"))) {
		$("links").getChildren().each(function(el){
			if(el.nodeName == 'LI') {
				el.addEvent('mouseenter',function (e) {
					this.addClass('over');
				});
				el.addEvent('mouseleave',function (e) {
					this.removeClass('over');
				});
			}
			
		});
	}
	var IE6 = (navigator.userAgent.toLowerCase().indexOf('msie 6') != -1) && (navigator.userAgent.toLowerCase().indexOf('msie 7') == -1);  
	if(IE6) {
		//alert('ie6');
	}
}

function getAuthImage() {
	var reference = Math.floor(Math.random() * 9999999);
	$('authimage').innerHTML = "<label style='width:120px'>Copy text (<a href=\"javascript:getAuthImage()\">refresh</a>)</label><img src='http://www.afxcms.com/getAuthImage.php?reference= " + reference + "' /><input type='hidden' name='imagereference' value='" + reference + "' /><input type='text' name='imagetext' style='width: 60px; height: 20px;' />";
}

/* DomReady Event fires when all Elements are ready, but not images. */
window.addEvent('domready', function() {
	init();	
});

function showTestimonials(id) {
	var url = domain + "ajaxtestimonials.php?id="+id;
	$('testimonial'+id).set('load', {method: 'get',evalScripts: false }).load(url);
}

function show(el) {
	$(el).setStyle('visibility','visible');
}

function hide(el) {
	$(el).setStyle('visibility','hidden');
}

function print(id) {
	window.location = domain + 'print.php?article_id=' + id;
}
