function changeActiveSite(){

}

$(document).ready(function(){
	$("#selSITCodigo").change(function(event){
		$.cookie('active_site', $("#selSITCodigo").attr('value'));
		top.location.href='index1.php';
	});
	resizeContentDiv();
});

$(window).bind('resize', function(e) {
	resizeContentDiv();
}); 
function resizeContentDiv(){
	newWidth = ($(window).width()) - 230;
	newHeight = ($(window).height()) - 140;
	document.getElementById('div_content').style.width = newWidth+'px';
	document.getElementById('div_content').style.height = newHeight+'px';
}

function deleteSelected(snippet, formName){
		to_delete = "";

		_SITCodigo = $.cookie('active_site');
		for(i=0; i<document.getElementById(formName).elements.length; i++){
			if(document.getElementById(formName).elements[i].checked)
			to_delete += document.getElementById(formName).elements[i].value+",";
		}
		if(to_delete.length == 0){
			jAlert('Você deve selecionar ao menos um registro a ser excluído', 'Atenção');
		}
		else{

			jConfirm('Confirma a exclusão dos registros selecionados?', 'Confirmação', function(r) {
				if(r) document.location.href='index1.php?snippet='+snippet+'&SITCodigo='+_SITCodigo+'&action=delete&to_delete='+to_delete;
			});
		}
}
