
// AJAX - SM4 - Goweb 2008
function scrollMenu() {
	window.scrollTo(0,290);
}

function get_info(url, all) {
	if (!all) all = true;
//alert(url);
	
	var pars = 'pars=1';
	var div  = 'cms_content';
	$(div).style.textAlign = "center";
	if ($('bkgs')){
		$('bkgs').innerHTML= '';
	}
	if (all){
		$(div).innerHTML= '<img src="/media/images/ajax-loader.gif"/>';
	
		var myAjax = new Ajax.Updater(div,
                                  url,
                                  {
                                      method: 'get',
									  encoding: 'ISO-8859-1', //UTF-8
                                      evalScripts: true,
									  onSuccess: function(transport) {
										// Executa incio
                                      },
									  onComplete: function(transport) {
									  	$(div).style.textAlign = "";
									  	pageTracker._trackPageview(url); 
									  	setTimeout('addReflections()', 400);


										// Executa depois de todo o load
										//addReflections();
									  },
                                      parameters: pars
                                  });
	}
    var myAjax = new Ajax.Updater('bkgs',
                                  url.replace(/view/,'viewSon'),
                                  {
                                      method: 'get',
									  encoding: 'ISO-8859-1', //UTF-8
									  onSuccess: function(transport) {
										// Executa incio
                                      },
									  onComplete: function(transport) {
										// Executa depois de todo o load
									  	//setTimeout('adjustPage()', 120);
									  },
                                      parameters: pars
                                  });

}

function checkMenuLeft(){
	//setTimeout('scrollMenu()', 800);
	if (Browser.is_ie){
		if($('menu_left')){$('menu_left').style.display = "";}
	} else {
		if($('menu_left')){
			$('menu_left').style.visibility = "visible";
			$('menu_left').style.width = "205px";
			$('menu_left').style.height = "252px";
			$('menu_left').style.position = "static";
		}
	}
}


function homepage() {
//alert('home');
	if($('not_destaques')) $('not_destaques').style.display = "";
	if($('cms_content')) $('cms_content').style.display = "none";
	if (Browser.is_ie){
		if($('loader')){$('loader').style.display = "";}
		if($('menu_left')){$('menu_left').style.display = "";}
	} else {
		if($('loader')){
			$('loader').style.visibility = "visible";
			$('loader').style.position = "static";
			$('loader').style.width = "";
			$('loader').style.height = "253px";
		}
		if($('menu_left')){
			$('menu_left').style.visibility = "visible";
			$('menu_left').style.width = "205px";
			$('menu_left').style.height = "252px";
			$('menu_left').style.position = "static";
		}
	}
}

function topo() {
//alert('topo');
	if($('not_destaques')){$('not_destaques').style.display = "none";}
	if($('cms_content')) $('cms_content').style.display = "";
	if($('push')) $('push').style.display = "none";
	if (Browser.is_ie){
		if($('loader')){$('loader').style.display = "none";}
		if($('menu_left')){$('menu_left').style.display = "none";}
	} else {
		if($('loader')){
			$('loader').style.visibility = "hidden";
			//$('loader').style.position = "absolute";
			$('loader').style.width = "0px";
			$('loader').style.height = "0px";
		}
		if($('menu_left')){
			$('menu_left').style.visibility = "hidden";
			$('menu_left').style.width = "0px";
			$('menu_left').style.height = "0px";
			//$('menu_left').style.position = "absolute";
		}
	}
}

function menudomeio() {
//alert('meio');
	if($('cms_content')) $('cms_content').style.display = "";
	if($('not_destaques')) $('not_destaques').style.display = "none";
	if($('push')) $('push').style.display = "";
	if (Browser.is_ie){
		if($('loader')){$('loader').style.display = "none";}
		if($('menu_left')){$('menu_left').style.display = "";}
	} else {
		if($('loader')){
			$('loader').style.visibility = "hidden";
			//$('loader').style.position = "absolute";
			$('loader').style.width = "0px";
			$('loader').style.height = "0px";
		}
		if($('menu_left')){
			$('menu_left').style.visibility = "visible";
			$('menu_left').style.width = "205px";
			$('menu_left').style.height = "252px";
			$('menu_left').style.position = "static";
		}
	}
}

function portfolio(){
//alert('port');
	if ($('bkgs')){
		$('bkgs').innerHTML= '';
	}
	if($('cms_content')) $('cms_content').style.display = "none";
	if($('push')) $('push').style.display = "";
	if (Browser.is_ie){
		if($('loader')){$('loader').style.display = "";}
		if($('menu_left')){$('menu_left').style.display = "";}
		//if($('not_destaques')) $('not_destaques').style.display = "none";
	} else {
		if($('loader')){
			$('loader').style.visibility = "visible";
			$('loader').style.position = "static";
			$('loader').style.width = "";
			$('loader').style.height = "253px";
		}
		if($('menu_left')){
			$('menu_left').style.visibility = "visible";
			$('menu_left').style.width = "205px";
			$('menu_left').style.height = "252px";
			$('menu_left').style.position = "static";
		}
	}
}

/*
function ajaxSubmit(form, div) {
    var params = Form.serialize(form);
    new Ajax.Updater(div,
    				 form.action, {
    				 method:'post',
    				 postBody:params,
					 encoding: 'ISO-8859-1', //UTF-8
    				 onComplete: function(response) {

    				 }
    });
}
*/