// JavaScript Document
//Check for Mac IE
var platform = navigator.platform;
var browser = navigator.appName;

if ((platform=="MacPPC") && (browser=="Microsoft Internet Explorer") && ((location.href.indexOf("index.php") != -1))) {
	alert("This site does not display properly in Internet Explorer for Mac.\nPlease consider upgrading to another browser like Safari, \nFirefox, or Opera.");
}
function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}

function checkFile() {
	alert("Made It!");
}

function validate(temp1,temp2,temp3,temp4,temp5,temp6) {
	location.href='process_cart.php?action=Update&item='+temp1+'&quantity='+temp2+'&url='+temp3+'&size='+temp4+'&color='+temp5+'&year='+temp6;
}

function checkPass() {
 while(''+data.pw.value.charAt(0)==' ')data.pw.value=data.pw.value.substring(1,data.pw.value.length);
	if (data.pw.value=="") { 
		data.pw.value=data.Pass.value;
		alert("Passwords can not be blank. Your password, was not changed!");
	} else { 
		data.pwChange.value=1;
	}
}

function checkPhoto() {
var temp;
// if () {
  data.school_photo.value.lastIndexOf('.'); var fileExt = this.value.charAt(temp+1); 
  if(fileExt !='j' && fileExt !='J') { 
   alert('Only JPEG files can be uploaded!'); 
   this.disabled = true;
  } else {
   this.disabled = true;
  }
// }
}

function daysTill() {
  //----------  EDIT THE VARIABLES BELOW  ------------------
  // EDIT THE VARIABLES BELOW
  var day=	26 // Day
  var month=	8 // Month
  var year=	2010 //Year
  var event=	"Virginia Beach Reunion"
  var end = 	"days left until the"
  //----------  END OF EDIT  -------------------------------
  var daystocount=new Date(year, month -1, day)
  today=new Date()
  if (today.getMonth()==month && today.getDate()>day)
  daystocount.setFullYear(daystocount.getFullYear())
  var oneday=1000*60*60*24
  var write = (Math.ceil((daystocount.getTime()-today.getTime())/(oneday)))
  document.write('<font color="white">There are <strong>'+write +'</strong> '+end+' '+event+'</font>')
}

function chatLogin(username, password, lang) {

	// the size of the popup window
	var width = 800;
	var height = 600;

	// the x,y position of the popup window
	// NOTE: this formula will auto-center the popup on the screen
	var y = (screen.height - height) / 2;
	var x = (screen.width - width) / 2;

	var url = 'chat/flashchat.php?username=' + username + '&password=' + password + '&lang=' + lang;
	var options = 'width=' + width + ',height=' + height + ',top=' + y + ',left=' + x + ',resizable';

	// open the chat window as a popup, instead of embedded in webpage
	window.open( url, 'chat', options );
}

function open_window (url, width, height) {
	var options = 'width=' + width + ',height=' + height;
	alert (options);
	window.open(url, 'Vote', options);
}

//Google Metrics
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-12245117-1");
pageTracker._trackPageview();
} catch(err) {}