function changeLinks() {
	if (document.links && document.links.length>0) {
		for (i=0;i<document.links.length;i++) {
			
			//external links
			if (document.links[i].hostname != '' && (document.links[i].protocol=='http:' || document.links[i].protocol=='https:') && document.links[i].hostname.toLowerCase().indexOf(document.location.hostname.toLowerCase())==-1){
				document.links[i].target = 'externalwebsite';
			}
			
			//ajax links
			if (typeof useAJAX != 'undefined' && useAJAX && document.links[i].hostname != '' && (document.links[i].protocol=='http:' || document.links[i].protocol=='https:') && document.links[i].hostname.toLowerCase().indexOf(document.location.hostname.toLowerCase())!=-1){
				var id=document.links[i].pathname.replace(/.*-(\d+)\/*/,"$1");
				if(id!=document.links[i].pathname){
					document.links[i].hash=document.links[i].pathname;
					$(document.links[i]).data('path',document.links[i].pathname);					
					document.links[i].onclick=function(){ajaxLoadPage(escape($(this).data('path')));return false;};
					document.links[i].pathname = '';
				}
			}
		}
	}
}

function ajaxLoadPage(url){
	//leftcol
	//midcol
	$("#innermiddlecol").load(url+'&template_id=1193&_nocc='+Math.random(),null,changeLinks);
	//rightcol
}

function changeHeight(id,h,dummy){
	//$('#'+id).css('height',h+'px');
	return;
	var elm = document.getElementById(id);
	if (elm){
		console.log(h);
		elm.style.height=h+'px';
	}
}
function testEmail(str){
	if (!str) return false;
	return /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(str);
}