// JavaScript Document
				
function openWin(name, url, w, h) {
	//var w = 910; 
	//var h = 810;
	//alert(url);
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	//winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable=1,scrollbars=yes'
	//window.open("picturedetail.html?"+sPicURL+"&"+title+"", "", winprops) //'width=900,height=800,status=1'
	//window.open('/map.php?condoid=<?=$review['condoid']?>&title=<?=$review['title']?>&address=<?=$address?>','map',winprops)	
	winprops = 'height='+screen.height+',width='+screen.width+',top='+0+',left='+0+',resizable=1,scrollbars=yes'
	var win = window.open(url,name ,winprops);

	win.focus();	
} 


function showBookmark(){
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
		var url="http://www.livinguptowncharlotte.com/";
		var title="Living Uptown Charlotte";
		window.external.addFavorite(url,title);
	}
	else {
		var msg = "To bookmark us, please press ";
		if(navigator.appName == "Netscape") msg += " CTRL-D";
		alert(msg);
	}
}


function submitForm(val){
	//alert('Under construction'); return false;
	//alert(val);
	if ((val=='') || (val == 'Search Living Uptown Charlotte')){
		alert('Please enter condo name to search.');
		document.getElementById('condoSearch').focus();
		return false;
	}else{		
		location.href = '/condo_search.php?condo='+val;
		return true;
	}
}
function quickCondo(url){
	//alert(url);
	//Change also in review target="_blank" 
	//location.href = '/quick_condo_search.php?q=' + escape(url);
	window.open(url, "quickCondo");
}
//Open inframe
function quickCondoFr(url){
	//alert(url);
	//Change also in review target="_blank" 
	location.href = '/quick_condo_search.php?q=' + escape(url);
	//window.open(url, "searchWin");
}


function displayPicture(imgId, imgSrc){
	if (document.getElementById('condoid').value != imgId){ 
		document.getElementById('condoid').value=imgId;			
	}								
}
		
		
/************Start Cookie Functions********/
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}
/*******End*********************************/



