// JavaScript Document

//Set the s.prop for advertisers on information page
function track_advertisers(advertiser) {
	s=s_gi(s_account);
	s.linkTrackVars = "prop29";
	s.prop29 = advertiser;
	s.tl(this,'o',"Advertiser");
}

// 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"; 
		}
	}
}
window.onload = externalLinks;

// will add site to favorites/bookmarks
function createBookmark(url,title){
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite(url,title); }
	else { // does nothing
		alert("Your browser doesn't support adding bookmarks in this manner. Please use your browser's standard favorites/bookmarking functionality.");
	}
}

// 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');
}

// used on accommodations.cfm for image rollovers
function showImg(imgName,theImageWidth,theImageHeight){
	document.getElementById('roomImageDisplay').src = imgName;
	document.getElementById('roomImageDisplay').width = theImageWidth;	
	//document.getElementById('roomImageDisplay').height = theImageHeight;	
}

// -------------------------------------------
// coupons page popup
// -------------------------------------------
function setUpCouponPopup(){
	$('a.couponPic').click(function(){
		var dimensions = new Array();
		dimensions = $(this).attr('rel').split('-');
		window.open(this.href,'viewer','width='+dimensions[0]+',height='+dimensions[0]);
		return false;
	});
}
// -------------------------------------------