
// lgButtons array holds the large stars
var lgButtons = [];


//=========================================
// Show/hide address and phone information
function ContactDisplay(Type) {
	var CurrentInfo = document.getElementById("ContactInfo").innerHTML;
	var AddressInfo = "<STRONG>Chez Poulet:</STRONG> 3359 Army Street, San Francisco, CA 94110";
	var PhoneInfo = "<STRONG>Chicken's Phone:</STRONG> 415.215.1632";
	// Show contact info
	if (Type=="Address") { document.getElementById("ContactInfo").innerHTML = AddressInfo; }
	if (Type=="Phone") { document.getElementById("ContactInfo").innerHTML = PhoneInfo; }
	// Hide contact info if button is clicked and already visible
	if ( ( ( CurrentInfo.toLowerCase() == AddressInfo.toLowerCase()) && Type=="Address") ||  ( ( CurrentInfo.toLowerCase() == PhoneInfo.toLowerCase() ) && Type=="Phone")) {
		document.getElementById("ContactInfo").style.padding = "0px";
		document.getElementById("ContactInfo").innerHTML = "";
		document.getElementById("ContactInfo").style.background = "";
	
	}
	else {
		document.getElementById("ContactInfo").style.background = "#990000";
		document.getElementById("ContactInfo").style.color = "#fae95d";
	}
}
// END ====================================

//=========================================
// Pre-load images into lgButtons array
function LoadLargeButtons() {
	var path = "images/";
//	document.getElementById("MouseOverImg").innerHTML = '<img src="images/mouseoverimg_13.jpg">';
	var width = 300;
	var height = 300;
	var pics = ["mouseoverimg_13.jpg",
				"mouseoverimg_01.jpg", 
				"mouseoverimg_02.jpg", 
				"mouseoverimg_03.jpg", 
				"mouseoverimg_04.jpg", 
				"mouseoverimg_05.jpg", 
				"mouseoverimg_06.jpg", 
				"mouseoverimg_07.jpg", 
				"mouseoverimg_08.jpg", 
				"mouseoverimg_09.jpg", 
				"mouseoverimg_10.jpg", 
				"mouseoverimg_11.jpg", 
				"mouseoverimg_12.jpg"];
	var images = [];
	images[0] = new Image(width,height);
	images[0].src = (path + pics[0]);
	document.getElementById("MouseOverImg").src = images[0].src;
	
	for (var picNum=1; picNum<pics.length; picNum++) {
		images[picNum] = new Image(width,height);
		images[picNum].src = (path + pics[picNum]);
	}
	lgButtons = images;
}
// END ====================================

//=========================================
// Change large image on mouseover
function Link(LinkID) {
	LinkID = parseInt(LinkID,10);
	document.getElementById("MouseOverImg").src = lgButtons[LinkID-0].src;
	if (LinkID == "01") { LinkSummaryText = ""; }
	if (LinkID == "02") { LinkSummaryText = ""; }
	if (LinkID == "03") { LinkSummaryText = ""; }
	if (LinkID == "04") { LinkSummaryText = ""; }
	if (LinkID == "05") { LinkSummaryText = ""; }
	if (LinkID == "06") { LinkSummaryText = ""; }
	if (LinkID == "07") { LinkSummaryText = ""; }
	if (LinkID == "08") { LinkSummaryText = ""; }
	if (LinkID == "09") { LinkSummaryText = ""; }
	if (LinkID == "10") { LinkSummaryText = ""; }
	if (LinkID == "11") { LinkSummaryText = ""; }
	if (LinkID == "12") { LinkSummaryText = ""; }
	if (LinkID == "13") { LinkSummaryText = ""; }
	
	document.getElementById("LinkSummary").innerHTML = LinkSummaryText;
}
// END ====================================
//=========================================
// Change large image on mouseover
function LinkOut() {
	document.getElementById("MouseOverImg").src= "";
	document.getElementById("LinkSummary").innerHTML= "";
	document.getElementById("MouseOverImg").src = lgButtons[0].src;
}
// END ====================================


function OpenPopup(Type) {
if (Type=="Blog") {
	window.open('http://chickenjohn.wordpress.com/');
}
if (Type=="Videos") {
	//window.open("http://chickenjohn.com/mayor/videos.html", "myWin",   "status=no,scrollbars=yes,width=400,height=900");
	window.open("videos.html", "myWin",   "status=no,scrollbars=yes,width=520,height=420");
	window.event.cancelBubble = true;
	window.event.returnValue = false;
}
}

//=========================================
// Mailing List functions
   function removeDefault(el) {
    if(!el.rel || el.value == el.rel) {
		el.rel = el.value;
		el.value = '';
		var elName = el.id;
		el.onblur = function () { if(!el.value) {addDefault(elName);}}
		ClearCSS(el);
		return true;
    }
   }
   function addDefault(elName) {
    var el = document.getElementById(elName);
    el.value = el.rel;
	ResetCSS(el);
   }
   function ClearCSS(el) {
		// If Dynamic Style is supported, clear the style
		if (el.style) el.style.color = ""
	}
   function ResetCSS(el) {
		// If Dynamic Style is supported, clear the style
		if (el.style) {
			el.style.color = "#7c7c7c";
		}
	}
// END ====================================
