function LeftStr(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
function RightStr(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}

function pesquisaSelecionaCombo(sItem, input) {
	if (sItem.className == "pesquisaPaginasComboItemOn") {
		input.checked = false;
		sItem.className = "pesquisaPaginasComboItem";
	}else{
		input.checked = true;
		sItem.className = "pesquisaPaginasComboItemOn";
	}
}
	$(document).ready(function(){
		//Examples of how to assign the ColorBox event to elements
		$("a[rel='ShowImage1']").colorbox();
		$("a[rel='ShowImage2']").colorbox({transition:"fade"});
		$("a[rel='ShowSlide']").colorbox({slideshow:true});
		$(".FrameYouTube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
		$(".WebPage").colorbox({width:"80%", height:"80%", iframe:true});
		$(".CadastreSeuImovel").colorbox({width:"600", height:"90%", iframe:true});
		$(".EncontreSeuImovel").colorbox({width:"600", height:"80%", iframe:true});
		$(".ExtratoOnline").colorbox({width:"780", height:"90%", iframe:true});
		$(".BoletoOnline").colorbox({width:"780", height:"90%", iframe:true});
		
		$(".GoogleMaps").colorbox({width:"90%", height:"90%", iframe:true});
		
		$(".ImovelIndica").colorbox({width:"550", height:"365", iframe:true});
		$(".MaisInformacoes").colorbox({width:"565", height:"355", iframe:true});
		$(".TermoDeVisita").colorbox({width:"680", height:"90%", iframe:true});
		$(".ImovelProposta").colorbox({width:"590", height:"90%", iframe:true});
		$(".ImovelFicha").colorbox({width:"650", height:"80%", iframe:true});
		
		//Example of preserving a JavaScript event for inline calls.
		$("#click").click(function(){ 
			$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
			return false;
		});
	});

