//**********************************
//
// 39th LD Website JavaScript
//
//**********************************

function resize_iframe()
{

	var height=window.innerWidth;//Firefox
	if (document.body.clientHeight)
	{
		height=document.body.clientHeight;//IE
	}
	//resize the iframe according to the size of the
	//window (all these should be on the same line)
	document.getElementById("glu").style.height=parseInt(height-
	document.getElementById("glu").offsetTop-8)+"px";
}

//**********************************
// Days Until Next President
//**********************************

// acquire current date

var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";

var today = new Date();
var curr_year = today.getFullYear();
var lmonth=months[today.getMonth() + 1];
var day_of_month=today.getDate();
var now = new Date(lmonth + " " + day_of_month + " " + curr_year);

// days left until Inauguration
var president = new Date(("January 20,") + curr_year);
var president_left = president.getTime() - now.getTime();
var president_days = Math.floor(president_left / (1000 * 60 * 60 * 24));

var eoy = new Date(("December 31,") + curr_year);
var eoy_left = eoy.getTime() - now.getTime();
var eoy_days = Math.floor((eoy_left / (1000 * 60 * 60 * 24)) + 20);

// days left until Election
var election = new Date(("November 4,") + curr_year);
var election_left = election.getTime() - now.getTime();
var election_days = Math.floor(election_left / (1000 * 60 * 60 * 24));

// days left until Primary
var primary = new Date(("August 19,") + curr_year);
var primary_left = primary.getTime() - now.getTime();
var primary_days = Math.floor(primary_left / (1000 * 60 * 60 * 24));


function festival() {

// if (primary_days > 1)
//	document.write("<p class=\"counter\"><b>" + primary_days + "</b> days to<br>Primary Election</p>");
//else if (primary_days == 1)
//	document.write("<p class=\"counter\"><b>" + primary_days + "</b> day to<br>Primary Election</p>");
//else
//	document.write("Today is Primary Election Day!");

//if (election_days > 1)
//	document.write("<p class=\"counter\"><b>" + election_days + "</b> days to<br>General Election</p>");
//else if (election_days == 1)
//	document.write("<p class=\"counter\"><b>" + election_days + "</b> day to<br>General Election</p>");
//else
//	document.write("<p class=\"counter\">Today is General Election Day!</p>");

//if (president_days > 1)
//	document.write("<p class=\"counter\"><b>" + president_days + "</b> days to</p><h3>Presidential Inauguration Day!</h3>");
//else if (president_days == 1)
//	document.write("<p class=\"counter\"><b>" + president_days + "</b> day to</p><h3>Presidential Inauguration Day!</h3>");
//else if (president_days == 0)
//	document.write("<p>&nbsp;</p><h3>Celebrate Presidential Inauguration Day!</h3>");
//else // end of year
//	document.write("<p class=\"counter\"><b>" + eoy_days + "</b> days to</p><h3>Presidential Inauguration Day!</h3>")

document.write("<p class=\"counter\"><b> Welcome to </b></p><h3>The 39th LD Democrats website!</h3>")

};

