// JavaScript Document

// will add target to external links
function externalLinks() {
	if (!document.getElementsByTagName){
		return;
	}
	var anchors = document.getElementsByTagName("a"); 
	for (var i=0; i<anchors.length; i++) { 
		var anchor = anchors[i]; 
		if (anchor.getAttribute("href") &&  anchor.getAttribute("rel") == "external"){
			anchor.target = "_blank"; 
		}
	}
}
// popup function for the tee times system
function openit(UID,SiteID,PID,SystemType,urlCourseID,showRates){
	myhandle=window.open('https://secure.guestdesk.com/reservations/?UID='+UID+'&SiteID='+SiteID+'&PID='+PID+'&SystemType='+SystemType+'&urlCourseID='+urlCourseID+'&showRates='+showRates,'windowName','toolbar=no,scrollbars=no,location=no,resizable=no,directories=no,status=yes,menubar=no,width=800,height=505,titlebar=TeeTimes,left=2,top=2');
}


window.onload = openit;
window.onload = externalLinks;

//for photo gallery
function showImage(imgName) {
	var curImage = document.getElementById('currentImg');
	var thePath = '';
	var theSource = thePath + imgName;
	
	curImage.src = theSource;
	curImage.alt = imgName;
	curImage.title = imgName;
}
jQuery().ready(function(){
	if (jQuery('.golf-pack-link').length > 0){
		jQuery('.golf-pack-link').click(function(){
			s=s_gi(s_account);
			s.linkTrackVars = 'events';
			s.linkTrackEvents = 'event4';
			s.events = 'event4';
			s.tl(this, 'o', 'Golf Package Link Click');
		});
	}
	//Add the google stuff to the url
   jQuery("a[href*='iqrez.com']").click(function() {
		pageTracker._link(this.href);
		return false;
	});
});