// Script to select CSS adjustment file, depending on browser
function browserSniffer(){

	if ((navigator.appName).indexOf("Microsoft")!=-1) {
	// For IE, extract version
	var ua = navigator.userAgent;
	var ie_offset = ua.indexOf("MSIE ");
	var version = parseFloat(ua.substring(ie_offset+5, ua.indexOf(";", ie_offset)));

	 switch (version){
	 	case 6:
			document.write('<link rel="stylesheet" href="css/IE6_styles.css" type="text/css"/>');
	 		break;
		case 7:
			document.write('<link rel="stylesheet" href="css/IE7_styles.css" type="text/css"/>');
	 		break;
		case 8:
			document.write('<link rel="stylesheet" href="css/IE8_styles.css" type="text/css"/>');
	 		break;
	 }	
}
	// For non-IE:
	else {
  	document.write('<link rel="stylesheet" href="css/otherbrowser_styles.css" type="text/css"/>');
	}
}



// Script to render date
function myDateString(dateValues){
	strMonthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
	strDayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];

 	var intMyDay = strDayNames[dateValues.getDay()];
 	var intMyMonth = strMonthNames[dateValues.getMonth()];
 	var intMyYear = dateValues.getFullYear();
 	return intMyDay + " " + intMyMonth + " " + dateValues.getDate() + ", " + intMyYear;
}

// Script to render countdown to Primary
function countdownprimary(x){
	RightNow = x;
	targetDate = new Date("September 14, 2010");
	targetDate.setYear = RightNow.getYear;
	day = (1000*60*60*24);
	computeDay = (targetDate.getTime() - RightNow.getTime())/day;
	DayResult = Math.round(computeDay) + 1;
	if(DayResult >1){
	return DayResult + " days until Primary";
	}
	else{
		if(DayResult ==1){
		return "Primary Tomorrow";
		}
		else{
			if(DayResult <1){
			return "Primary Tomorrow";
			}	
		}
	}
}

// Script to render countdown to General Election
function countdownelection(x){
	RightNow = x;
	targetDate = new Date("November 6, 2012");
	targetDate.setYear = RightNow.getYear;
	day = (1000*60*60*24);
	computeDay = (targetDate.getTime() - RightNow.getTime())/day;
	DayResult = Math.round(computeDay) + 1;
	if(DayResult >1){
	return DayResult + " days till Election 2012";
	}
	else{
		if(DayResult ==1){
		return "Election Day Tomorrow";
		}
		else{
			if(DayResult <1){
			return "2010 Election is Over";
			}	
		}
	}
}

	// Scriptto randomly select main image CSS file/image
function renderCssFile(){
	// 1) Generate random number; upper limit = 7:
	var intRandomNumber = Math.floor(Math.random() * 7) +1;
	var strCssFile = "alt_pg_schemes/" + intRandomNumber + ".css";
	// 2) Generate link to external CSS file 
	var myCssFile ="<link href='" + strCssFile + "' rel='stylesheet' type='text/css'/>";
	document.write(myCssFile);
}



//Script to render copyright year

function cpyrtYear(dateValue){
	var intYear = dateValue.getFullYear();
	return intYear;
}

// Script to show Details containers on mouseover:

function displayPopUp(Color)
 { 
 	myColor = Color;
	document.getElementById(myColor + "_popup").style.display = "block";
 }
 
function hidePopUp(Color)
 { 
 	myColor = Color;
	document.getElementById(myColor + "_popup").style.display = "none";
 }


function renderQuote(){

// Listing of quotes:  Serves as the "data" for the Javascript Switch below.

// Line breaks have been included in the quote "var" script to facilitate editing.

// Explanatory comments are included for Quote 1 (only).  These are typical of all entries below.

//QUOTE 1
	var strQuote1 = "<style type='text/css'>.quote_container p{margin-top: 40px; width: 700px; margin-left: 50px;}</style><p class ='quote_container p'>" + 
	
	"&ldquo;Noah must have taken into the Ark two taxes, one male and one female. And did they multiply bountifully! Next to guinea pigs, taxes must have been the most prolific animals.&rdquo;" +
	
	"<span>~Will Rogers</span></p>";

//QUOTE 2
	var strQuote2 = "<style type='text/css'>.quote_container p{margin-top:" +
	
	"40px" + 
	
	"}</style><p class ='quote_container p'>" + 
	
	"&ldquo;There's no trick to being a humorist when you have the whole government working for you. &rdquo;" +

	"<span>~Will Rogers<</span></p>";

//QUOTE 3
	var strQuote3 = "<style type='text/css'>.quote_container p{margin-top:" +
	
	"40px" + 
	
	"}</style><p class ='quote_container p'>" + 
	
	"&ldquo;This country has come to feel the same when Congress is in session as when the baby gets hold of a hammer.&rdquo;" +

	"<span>~Will Rogers</span></p>";

//QUOTE 4
	var strQuote4 = "<style type='text/css'>.quote_container p{margin-top: 40px; text-align: left;}</style><p class ='quote_container p'>" + 
	
	"&ldquo;On account of being a democracy and run by the people, we are the only nation in the world that has to keep a government four years, no matter what it does.&rdquo;" +

	"<span>~Will Rogers</span></p>";

//QUOTE 5
	var strQuote5 = "<style type='text/css'>.quote_container p{margin-top:" +
	
	"40px" + 
	
	"}</style><p class ='quote_container p'>" + 
	
	"&emsp;I don't make jokes. I just watch the government and report the facts. &rdquo;" +

	"<span>~Will Rogers</span></p>";

//QUOTE 6
	var strQuote6 = "<style type='text/css'>.quote_container p{margin-top:" +
	
	"40px" + 
	
	"}</style><p class ='quote_container p'>" + 
	
	"&ldquo;Ancient Rome declined because it had a Senate; now what's going to happen to us with both a Senate and a House? &rdquo;" +

	"<span>~Will Rogers</span></p>";

//QUOTE 7
	var strQuote7 = "<style type='text/css'>.quote_container p{margin-top:" +
	
	"40px" + 
	
	"}</style><p class ='quote_container p'>" + 
	
	"&ldquo;Our constitution protects aliens, drunks and U.S. Senators.&rdquo;" +

	"<span>~Will Rogers</span></p>";

//QUOTE 8
	var strQuote8 = "<style type='text/css'>.quote_container p{margin-top:" +
	
	"40px" + 
	
	"}</style><p class ='quote_container p'>" + 
	
	"&ldquo;There ought to be one day-- just one-- when there is open season on senators.&rdquo;" +

	"<span>~Will Rogers</span></p>";

//QUOTE 9
	var strQuote9 = "<style type='text/css'>.quote_container p{margin-top:" +
	
	"40px" + 
	
	"}</style><p class ='quote_container p'>" + 
	
	"&ldquo;I belong to no organized party. I am a Democrat.&rdquo;" +

	"<span>~Will Rogers</span></p>";

//QUOTE 10
	var strQuote10 = "<style type='text/css'>.quote_container p{margin-top:" +
	
	"40px" + 
	
	"}</style><p class ='quote_container p'>" + 
	
	"&ldquo;Be thankful we're not getting all the government we're paying for. &rdquo;" +

	"<span>~Will Rogers</span></p>";

//QUOTE 11
	var strQuote11 = "<style type='text/css'>.quote_container p{margin-top: 40px; text-align: left;}</style><p class ='quote_container p'>" + 
	
	"&ldquo;I see a good deal of talk from Washington about lowering taxes. I hope they do get 'em lowered enough so people can afford to pay 'em.&rdquo;" +

	"<span>~Will Rogers</span></p>";

//QUOTE 12
	var strQuote12 = "<style type='text/css'>.quote_container p{margin-top:" +
	
	"40px" + 
	
	";}</style><p class ='quote_container p'>" + 
	
	"&ldquo;I am opposed to millionaires, but it would be dangerous to offer me the position.&rdquo;"  +

	"<span>~Mark Twain</span></p>";

//QUOTE 13
	var strQuote13 = "<style type='text/css'>.quote_container p{margin-top:" +
	
	"40px" + 
	
	"}</style><p class ='quote_container p'>" + 
	
	"&ldquo;Don't go around saying the world owes you a living. The world owes you nothing. It was here first.&rdquo;" +

	"<span>~Mark Twain</span></p>";

//QUOTE 14
	var strQuote14 = "<style type='text/css'>.quote_container p{margin-top: 40px; text-align: left;}</style><p class ='quote_container p'>" + 
	
	"&ldquo;In religion and politics, people's beliefs and convictions are in almost every case gotten at second hand, and without examination.&rdquo;" +

	"<span>~Mark Twain</span></p>";

//QUOTE 15
	var strQuote15 = "<style type='text/css'>.quote_container p{margin-top:" +
	
	"40px" + 
	
	"}</style><p class ='quote_container p'>" + 
	
	"&ldquo;In the first place, God made idiots. That was for practice. Then he made school boards. &rdquo;" +

	"<span>~Mark Twain</span></p>";

//QUOTE 16
	var strQuote16 = "<style type='text/css'>.quote_container p{margin-top:" +
	
	"40px" + 
	
	"}</style><p class ='quote_container p'>" + 
	
	"&ldquo;It could probably be shown by facts and figures that there is no distinctly American criminal class except Congress.&rdquo;" +

	"<span>~Mark Twain</span></p>";
	
//QUOTE 17
	var strQuote17 = "<style type='text/css'>.quote_container p{margin-top: 40px; text-align: left;}</style><p class ='quote_container p'>" + 
	
	"&ldquo;Keep away from people who try to belittle your ambitions. Small people always do that, but the really great make you feel that you, too, can become great.&rdquo;" +

	"<span>~Mark Twain</span></p>";
	
//QUOTE 18
	var strQuote18 = "<style type='text/css'>.quote_container p{margin-top:" +
	
	"40px" + 
	
	"}</style><p class ='quote_container p'>" + 
	
	"&ldquo;Suppose you were an idiot and suppose you were a member of Congress. But I repeat myself.&rdquo;" +

	"<span>~Mark Twain</span></p>";

//QUOTE 19
	var strQuote19 = "<style type='text/css'>.quote_container p{margin-top:" +
	
	"40px" + 
	
	"}</style><p class ='quote_container p'>" + 
	
	"&ldquo;A lie can travel halfway around the world while the truth is putting on its shoes.&rdquo;" +

	"<span>~Mark Twain</span></p>";
	
//QUOTE 20
	var strQuote20 = "<style type='text/css'>.quote_container p{margin-top:" +
	
	"40px" + 
	
	"}</style><p class ='quote_container p'>" + 
	
	"&ldquo;Any idiot can face a crisis- it's day to day living that wears you out.&rdquo;" +

	"<span>~Anton Checkov</span></p>";
//QUOTE 20
	var strQuote21 = "<style type='text/css'>.quote_container p{margin-top:" +
	
	"40px" + 
	
	"}</style><p class ='quote_container p'>" + 
	
	"&ldquo;We base all our experiments on the capacity of mankind for self-government &rdquo;" +

	"<span>~James Madison</span></p>";

// Script to randomly select a quote
// 1) Generate random number; upper limit = 20.  UPPER LIMIT MUST EQUAL THE LARGEST QUOTE NUMBER
var intQuoteRandomNumber = Math.floor(Math.random() * 21) +1;
//var intQuoteRandomNumber = 21;

// 2} Render Quote in Home Page. THE LAST CASE LABEL (NUMBER) MUST EQUAL THE LARGEST QUOTE NUMBER
 switch (intQuoteRandomNumber){
	 	case 1:
			document.write(strQuote1); 
	 		break;
 		case 2:
			document.write(strQuote2); 
	 		break; 
	 	case 3:
			document.write(strQuote3); 
	 		break;
 		case 4:
			document.write(strQuote4); 
	 		break; 
	 	case 5:
			document.write(strQuote5); 
	 		break;
 		case 6:
			document.write(strQuote6); 
	 		break; 
	 	case 7:
			document.write(strQuote7); 
	 		break;
 		case 8:
			document.write(strQuote8); 
	 		break;
 		case 9:
			document.write(strQuote9); 
	 		break;
 		case 10:
			document.write(strQuote10); 
	 		break; 
	 	case 11:
			document.write(strQuote11); 
	 		break;
 		case 12:
			document.write(strQuote12); 
	 		break;
	 	case 13:
			document.write(strQuote13); 
	 		break;
 		case 14:
			document.write(strQuote14); 
	 		break;
 		case 15:
			document.write(strQuote15); 
	 		break;	
 		case 16:
			document.write(strQuote16); 
	 		break;
 		case 17:
			document.write(strQuote17); 
	 		break; 
	 	case 18:
			document.write(strQuote18); 
	 		break;
 		case 19:
			document.write(strQuote19); 
	 		break;
 		case 20:
			document.write(strQuote20); 
	 		break;
 		case 21:
			document.write(strQuote21); 
	 		break;
	 		 	
	}	
}
