var pics = new Array();function insert(file, where){	if (window.ActiveXObject){	ie(file, where);	}	else{	ns(file, where);	}}function ns(file, where){	objXml = new XMLHttpRequest();	var datafile = file;     objXml.open("GET",datafile,false);     objXml.send(null);     display(objXml.responseText, where);}function ie(file, where){objXml = new ActiveXObject("Microsoft.XMLHTTP");// objXml = new ActiveXObject("Msxml2.XMLHTTP"); older versionvar datafile = file;objXml.open("GET", datafile, true);objXml.onreadystatechange=function() {   if (objXml.readyState==4) {       display(objXml.responseText, where);  } }objXml.send(null);}function display(msg, where) {document.getElementById(where).innerHTML= msg;}function fillPic(i,source){		document.images["pic"+i].src = source;}function choosePic(i){	parent.document.images["pic"].src= pics[i]+".jpg"; }function gallery(where){		insert('media.html',where);}function table(){	fillPics();	var gallery = "<table>";	gallery += body();	gallery += "</table>";	document.getElementById("table").innerHTML= gallery;	choosePic(5);}function body(){	var result = "";	for(var i = 0; i<31; i++)	{		result += "<tr>";		for(var j=0;j<5;j++)		{			var k=(i*5+j);			result += "<td><img src=\"images/gallery/thumbs/image ("+k+").jpg\" name=\"pic"+k+"\" class=\"clickable\" onclick=\"choosePic("+k+")\" /></td>";		}		result += "</tr>";	}	return result;}function fillPics(){	for(var i = 0; i<151; i++)	{		pics[i] = "images/gallery/image ("+i+")";	}}$(function(){	if(isBeforeBall())	{		showFlyer();		$("#flyer-link").show();	}});function showFlyer(){	$("#christmas-flyer").modal({onClose: showSavage});}function showSavage(){	$.modal.close();	$("#savage-popup").modal();}function isBeforeBall(){	var myDate=new Date();	myDate.setFullYear(2012,2,12);	var today = new Date();		if (myDate>today)	  {	  return true;	  }	else	  {	  return false;	  }}
