/*
Copyright (c) 2001-2007 Enforce Internet Corporativa. All rights reserved.
Created 01.03.2007 by Vagner Franklin (http://www.enforce.com.br)
Last modified: 01.03.2007
*/

function calcular(form) {
	if (form) {
		form.action = '?';
		form.submit();
	} else {
		return false;
	}
}
function finalizar(form) {
	if (form) {
		if (confirm('Deseja realmente enviar o pedido?')) {
			form.action = 'pedido_enviar.php';
			form.submit();
		} else { 
			return false;
		}
	} else {
		return false;
	}
}
/*
Copyright (c) 2001-2007 Enforce Internet Corporativa. All rights reserved.
Created 01.03.2007 by Vagner Franklin (http://www.enforce.com.br)
Last modified: 01.03.2007
*/

/* Adicionar aos Favoritos */

function addFavoritos(){
    var url        = "http://www.telecarinhos.com.br";
    var title    = "Tele Carinhos";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title);}
}


/* Show e Hide layers (Snippets) */

function getById( cronosID ) { return document.getElementById( cronosID ); }
function cronosID( cronosID ) { return getById( cronosID ); }
function isVisivel( cronosID ) { return getById( cronosID ).style.display == 'block'; }
function show( cronosID ) { getById( cronosID ).style.display = 'block'; }
function hide( cronosID ) { getById( cronosID ).style.display = 'none'; }

function showhide( cronosID ) { 
	if ( isVisivel(cronosID) )
			hide( cronosID );
		else
			show( cronosID );
}
function hideArray( cronosIDs ) {
	for ( i=0 ; i < cronosIDs.length ; i++ )
		hide( cronosIDs[i] );
}

function showArray( cronosIDs ) {
	for ( i=0 ; i < cronosIDs.length ; i++ )
		show( cronosIDs[i] );
}

function hideObject( cronosID ) {
	cronosID.style.display = 'none';
}

function showObject( cronosID ) {
	cronosID.style.display = 'block';
}




/** Elemento visivel. */
var elementoVisivel;
/** Esconde o elemento visivel atualmente, exibe outro elemento e atualiza a variavel 'elementoVisivel'.
 */
function hideVisibleShow( elemento ) {
	hide( elementoVisivel );
	show( elemento );
	elementoVisivel = elemento;
}