function cargar_flash_central(){ 
  
	// <![CDATA[
			var so = new SWFObject("_swf/menu_presupuestos.swf", "TypeWorks", "780", "360", "8", "#000000", true);
				so.write("contenidoItems");
	// ]]>
	return
} 
function abrir_carga(){

	document.getElementById("carga").style.display = "inline";
	return
}
function abrir_carga_desede_iframe(){

	parent.document.getElementById("carga").style.display = "inline";
	return
}


function cerrar_carga(){

	document.getElementById("carga").style.display = "none";
	return
}
function cerrar_carga_desede_iframe(){

	parent.document.getElementById("carga").style.display = "none";
	return
}


function ver_div_enviando(){
	document.getElementById("bgEnabled").style.display = "inline";
	return
}
function ocultar_div_enviando(){
	document.getElementById("bgEnabled").style.display = "none";
	return
}

function enviar_form_presupuesto(cual){
		
		document.form1.action = "iframe.enviarPresupuestos.php?tipo_de_presupuesto=" + cual;
		document.form1.target = "FrameForm";
		document.form1.submit();
		return
		
}

function enviar_form_usuario(){ 
		
		document.form1.action = "iframe.envioUsuarioNuevo.php";
		document.form1.target = "FrameForm";
		document.form1.submit();
		return
		
}

////QUEDO EN VEREMOS
function cambiar_caja(cual){
	var formu  =  document.form1;		
	/*alert(formu.txt_hora_retiro_ini.value.length)*/
	
	if(document.getElementById(cual).value.length == 2){
		if(cual=="txt_hora_retiro_ini"){
			document.getElementById('txt_min_retiro_ini').focus();
		}
		if(cual=="txt_hora_entregar_ini"){
			document.getElementById('txt_hora_entregar_ini').focus();
		}
	}
}

function pasar_envio2(){

	
	if(document.formMetodo.metodo_de_envio[0].checked){
		var		metodo="web"
	}
	
	if(document.formMetodo.metodo_de_envio[1].checked){
		var	metodo="cliente"
	}
	
	peticion("envio_p2.php", "contenidoItems", "POST", "metodo_de_envio=" + metodo);	
	
	return
}

function pasar_envio3(){
		
		document.form1.action = "iframe.envio_p3.php";
		document.form1.target = "FrameForm";
		document.form1.submit();
		return
		
}


function verDatos(elDiv){
	//
	//
	document.getElementById('div_ctp').style.display='none';
	document.getElementById('div_ctf').style.display='none';
	document.getElementById('div_escaner').style.display='none';
	document.getElementById('div_prueba_color').style.display='none';
	document.getElementById('div_otros').style.display='none';
	
	document.getElementById(elDiv).style.display='block';
	
 	peticion("bandeja_de_entrada/arma_tabla_ajax.php", elDiv, "POST", "cual_muestro=" + elDiv);	
	
}
function altaOT(cualID, cualTab){

//window.location.href = "http://192.168.1.100/TypeWorks/pasarOrden/para_typeworks.php?id="+ cualID +"&tabla=" + cualTab;
window.open("http://192.168.1.101/TypeWorks/pasarOrden/para_typeworks.php?id="+ cualID +"&tabla=" + cualTab );
document.location.href="bandeja_de_entrada.php";
}

function despintar(cual){
	document.getElementById(cual).style.background = "#ffffff"
}

function pintar(cual){
	document.getElementById(cual).style.background = "#ffffcc"
}
function OcultarAvanzada(ctQue){
	document.getElementById('TablaAvanzadas').style.display='none';	
	document.getElementById('DivAvanzadas').innerHTML ="<a href='#' onclick='return VerAvanzada(\""+ctQue+"\");'>Avanzadas >> </a>";
	return false;
}
function VerAvanzada(ctQue){
	document.getElementById('TablaAvanzadas').style.display='block';
	document.getElementById('DivAvanzadas').innerHTML ="<a href='#' onclick='return OcultarAvanzada(\""+ctQue+"\");'>Avanzadas << </a>";
	
	document.form1.txt_linea.value = '';
	document.form1.txt_sobreimpresion.value = '';
	document.form1.txt_trapping.value = '';		
	document.form1.chk_armado_de_pliego.checked = false;
	document.getElementById('divArmado').style.display='none';
	
	if(ctQue=="ctp"){
		document.form1.chk_horneado.checked = false;
		document.getElementById('div_tiraje').style.display='none';
		document.form1.txt_tiraje.value = '';
	}
	if(ctQue=="ctf"){
		document.form1.chk_negativo.checked = false;
		document.form1.chk_emulsion.checked = false;
	}
	return false;
}

function VerOcultarDiv(cual){
	if(document.getElementById(cual).style.display=='none'){
		document.getElementById(cual).style.display='block';		
	}else{
		document.getElementById(cual).style.display='none';
	}
}

function validarFormato(valor){
	if(valor=='Otro'){
		document.getElementById('FormatoOtros').style.display='block';
	}else{
		document.form1.txt_formato_ancho.value = '';
		document.form1.txt_formato_alto.value = '';
		document.form1.txt_calibre.value = '';
		document.getElementById('FormatoOtros').style.display='none';		
	}
}