/****************************************************************************************/
function alternate(id){
	if(document.getElementById){						//check that browser has capabilities
		var theID = id;		
		var table = document.getElementById(id);		//get just the selected table not all of them
		var rows = table.getElementsByTagName("tr");	//get all table rows
		for(i = 0; i < rows.length; i++){				//alternate styles			
			//manipulate rows	
			if(theID == 'thetable'){
				doAlternate(rows[i], i, 2, row1="even", row2="odd");
			} else {
				t = i-1;
				doAlternate(rows[i], t, 4, row1="odd", row2="even");
			}
		}
	}
}

/****************************************************************************************/
function doAlternate(row, i, count, row1, row2){
	if(i % count == 0){
		row.className = row1;
	}else{
		row.className = row2;
	}
}
/****************************************************************************************/
// AJAX Stuff that adds and animates Contact Tracker
function getContact(theSeg,theID,theClient,theLoc) {
	var url = 'http://www.herecomestheguide.com/' + theSeg + '/tracker_contact/' + theClient + '/'+ theLoc + '/';
	//var pars = 'myVar='+theClient;
	var myAjax = new Ajax.Updater(theID, url, { method:'post', asynchronous: true, onSuccess: showResponse(theID)});
}

function showResponse(theID)
{
	var theReveal = new Effect.BlindDown(theID);
	//var theReveal = new Effect.toggle($(theID),'blind');
}

/****************************************************************************************/
// Generic ShowHide AJAX stuff for lists
function showHide(theID)
{
	var theReveal = new Effect.toggle($(theID),'blind');
}
/****************************************************************************************/
// Click Swap the Location and Service Detail Images
function swapDetailImage(theID, theImage, theObj) {
	if (document.images) {
		document[theID].src = theImage;
		document[theID].width = theObj.width;
		document[theID].height = theObj.height;
	}
}

/****************************************************************************************/
function go360(value,pop_name) 
        {
        windowname = window.open(value,pop_name,'resizable=yes,width=800,height=400,status=no,location=no,toolbar=no,menubar=no,scrollbars=yes');
        windowname.creator = self;
        }               
/****************************************************************************************/
function erase(box) {
   if (box.defaultValue == box.value)
	   box.value = ""
} 


/***************************************************** jQuery for ClueTip Tool Tips *****/
$(document).ready(function() {
  $('a.load-local').cluetip({local:true, hideLocal: false, arrows: true, cursor: 'pointer', width: 200});
  $('a.favlist').cluetip({local:true, hideLocal: false, arrows: false, cursor: 'pointer'});
  $('.inputImages').cluetip({local:true, hideLocal: false, arrows: true, cursor: 'pointer'});
});

