// Copyright 2006,2007 Bontrager Connection, LLC
// http://bontragerconnection.com/ and http://www.willmaster.com/
// Version: July 28, 2007
var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
	rX = self.pageXOffset;
	rY = self.pageYOffset;
	}
else if(document.documentElement && document.documentElement.scrollTop) {
	rX = document.documentElement.scrollLeft;
	rY = document.documentElement.scrollTop;
	}
else if(document.body) {
	rX = document.body.scrollLeft;
	rY = document.body.scrollTop;
	}
if(document.all) {
	cX += rX; 
	cY += rY;
	}
d.style.left = (cX+10) + "px";
d.style.top = (cY+10) + "px";
}
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
dd.style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}

function launchPlayer(url)
{
	newwindow=window.open(url,'name','height=400,width=640,resizable=1');
	if (window.focus) {newwindow.focus()}
	return false;
}

function setTable(what){
if(document.getElementById(what).style.display=="none"){
document.getElementById(what).style.display="block";
}
else if(document.getElementById(what).style.display=="block"){
document.getElementById(what).style.display="none";
}
}

function clearDefault(el) {
		if (el.defaultValue==el.value) el.value = ""
	}
	
	
	function showHeadlines(what){
if(document.getElementById(what).style.display=="none"){
document.getElementById(what).style.display="block";
document.headlinesImage.src="http://www.greendayauthority.com/site_images/headlinesLink2.gif";
}
else if(document.getElementById(what).style.display=="block"){
document.getElementById(what).style.display="none";
document.headlinesImage.src="http://www.greendayauthority.com/site_images/headlinesLink.gif";
}
}

$('#showAffliates').click(function(){
if ($('#tblaff').is(":hidden"))
               {
                    $('#tblaff').slideDown("slow");
               } else {
                    $('#tblaff').slideUp("slow");
               }
             });
             
	$('#showContact').click(function(){
	if ($('#contactForm').is(":hidden"))
	               {
	                    $('#contactForm').slideDown("slow");
	               } else {
	                    $('#contactForm').slideUp("slow");
	               }
	 });	
	 