// function definition
function softIntercept(webSiteId, url, name, target, lang, intercept, breadcrumb){
	url = url.replace("+", " ");
	url = url.replace("?", "[asp_query_symbol]");
	url = url.replace("&", "[asp_concatenator_symbol]");
	var winHeight=335;

	//if the url is to a popup page then...
	if((url.indexOf('javascript')>=0)&&(url.indexOf('openPopup')>=0)){
		//replace char entities with chars
		url = unescape(url);
		var startPos = url.indexOf('(');
		var endPos = url.indexOf(')');
		var popupId = url.substring(startPos+1, endPos)
	
		//open the popup
		window.open("/includes/popup.asp?popup_id=" + popupId,"popup_page","scrollbars=yes,toolbar=no,titlebar=YES,width=554,height=410,left=50,top=50");
	}else{
		if(intercept == 'True'){
				//window.open("/includes/soft_intercept.asp?ref=" + document.location.pathname + "&url="+ unescape(url) + "&name=" + name + "&target=" + target + "&lang=" + lang,"NewWindow","scrollbars=no,toolbar=no,titlebar=YES,width=470,height="+winHeight+",left=200,top=50");
				window.open("/includes/soft_intercept.asp?ws_id=" + webSiteId + "&ref=" + document.location.pathname + "&url="+ url + "&name=" + name + "&target=" + target + "&lang=" + lang,"NewWindow","scrollbars=no,toolbar=no,titlebar=YES,width=470,height="+winHeight+",left=200,top=50");
		}else{
			if (target == 'new'){
				window.open(unescape(url),"NewWindow","scrollbars=YES,resizable=YES,toolbar=YES,titlebar=YES,width=600,height=600,left=200, top=10");
			}else{
				document.location.href = unescape(url);		
			}
		}
	}
}

function ltrim (s){
return s.replace(/^\s*/, "")
}

function rtrim (s){
return s.replace(/\s*$/, "");
}

function trim (s){
return rtrim(ltrim(s));
}

function open_window(url) 
{
	window.open(url, "Living",'toolbar=yes,location=1,directories=0,status=0,menubar=no,scrollbars=1,resizable=1,width=640,height=395')
}

function open_Window_b(url) 
{
	popupWin = window.open(url, 'tutorial', 'toolbar=no,location=0,directories=0,status=0,menubar=no,scrollbars=no,resizable=0,width=410,height=590,top=10,left=550')
}

function open_Window_a(url) 
{
	window.open(url, 'feature', 'scrollbars,width=640,height=395,left=10,top=10,toolbar,menubar,status,location,resizable')
}	

function open_Window_contact(url) 
{
	window.open(url, 'map', 'scrollbars,width=770,height=581,left=10,top=10,toolbar,menubar,status,location,resizable')
}

function emailThisPage(thisURL, thisTitle, thisLanguage) 
{
	window.open('/includes/email_this_page.asp?lang='+thisLanguage+'&url='+thisURL+'&title='+thisTitle, 'emailThisPage', 'toolbar=no,location=0,directories=0,status=0,menubar=no,scrollbars=no,resizable=0,width=470,height=300,top=10,left=10')
}

function openPopup(popupId){
	window.open("/includes/popup.asp?popup_id=" + popupId,"popup_page","scrollbars=yes,toolbar=no,titlebar=YES,width=554,height=410,left=50,top=50");
}

function filterToUpperCase(){
	if(window.event.keyCode>=97 && window.event.keyCode<=122) {
		window.event.keyCode=window.event.keyCode-32;
	} 
}	

