

function swapBG(elem){
	if(elem.className == "latest-news-container"){
			elem.className = "latest-news-container-over";
		}else{
			elem.className = "latest-news-container";
		}
	}

	function removeLocation(listLocationID){
		
		//initiate the proxy with a local var 
		var r = new respond()
	
		//define the response function 
		r.setCallbackHandler(displayResponse)
	
		//define the error handler 
		r.setErrorHandler(errorHandler)
		
		//call the echo function from the CFC 
		r.removeListLocation(listLocationID)
	}
	
	function displayResponse(resp) {

		document.location.href = '/index.cfm/members/listing-business';
	}
	
	// Error handler for the asynchronous functions 
	function errorHandler(statusCode,statusMsg) {
		alert(statusCode+': '+statusMsg)
	}

/////////// BROWSER DETAILS //////////////
var browser = new Array();
browser["name"];
browser["version"];

var browserDims = new Array();



function detectBrowser(){
	browser["name"] = navigator.vendor;
	if(browser["name"] == undefined || browser["name"] == ''){
		browser["name"]  = navigator.appName;
	}
	browser["version"]=navigator.appVersion;
	var version=parseFloat(browser["version"]);
	//alert(browser);
	return browser;
}

function getBrowserSize() {

  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } 
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {

    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } 
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }

  browserDims["height"] = myHeight;
  browserDims["width"] = myWidth;

  return browserDims;
}


function openPreview(urlParam){

	browserDimensions = getBrowserSize();
	vbrowser = detectBrowser();
	
	//centre the window
	var openLeft = browserDimensions.width / 2 - 700;
	

	imageWin = dhtmlmodal.open('mapDetails', 'div', 'modalalertdiv', '', 'width=700px,height=700px,left='+openLeft+'px,top=100px,resize=0,scrolling=0',"recal");
 	
	imageWin.onclose=function(){
		if (vbrowser.name == "Apple Computer, Inc."){
			//this is to fix a bug in Safari where it wouldn't close the flash video player on close of the modal window
			imageWin.contentDoc.getElementById('showDetails').document.getElementById('flashcontent').innerHTML = '';
		}else{
			document.getElementById('ContentDiv').src = "";
		}
		return true;
	}
	
	//Added this because of a bug in safari that can't handle obj.src being set
	if (vbrowser.name == "Apple Computer, Inc."){
		imageWin.load('iframe', urlParam, '');
		imageWin.frames[0].style.border = "0px";
		imageWin.moveTo("middle", "middle");
		imageWin.setSize(width,height);		
	} else {
		
		document.getElementById('contentFrame').src = urlParam;
	}
}


function openpreviewWindow(URL){
	window.open(URL, 'Noosa_popup', 'height=700,width=700,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,top=200,left=200,resizable=1');
	//locationWindow = dhtmlmodal.open('locationBox', 'iframe', URL , '', 'height=700,width=800,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,top=50,left=200,resizable=1')
	

}
