/************************************************ IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com) */
//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe","myframe2","myframe3","myframe4"]
//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
	var dyniframe=new Array()
	for (i=0; i<iframeids.length; i++){
		if (document.getElementById)
			resizeIframe(iframeids[i])
		//reveal iframe for lower end browsers? (see var above):
		if ((document.all || document.getElementById) && iframehide=="no"){
			var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
			tempobj.style.display="block"
		}
	}
}
function resizeIframe(frameid){
	var currentfr=document.getElementById(frameid)
	if (currentfr && !window.opera){
		currentfr.style.display="block"
		if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
			currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
		else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
			currentfr.height = currentfr.Document.body.scrollHeight;
		if (currentfr.addEventListener)
			currentfr.addEventListener("load", readjustIframe, false)
		else if (currentfr.attachEvent){
			currentfr.detachEvent("onload", readjustIframe) // Bug fix line
			currentfr.attachEvent("onload", readjustIframe)
		}
	}
}
function readjustIframe(loadevt) {
	var crossevt=(window.event)? event : loadevt
	var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
	if (iframeroot)
	resizeIframe(iframeroot.id);
}
function loadintoIframe(iframeid, url){
	if (document.getElementById)
		document.getElementById(iframeid).src=url
}
if (window.addEventListener)
	window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
	window.attachEvent("onload", resizeCaller)
else
	window.onload=resizeCaller
//END

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//END

//<!-- Begin
// Set up the image files to be used.
var theImages = new Array() // do not change this
var theTexts = new Array() // do not change this
// To add more image files, continue with the pattern below, adding to the array.
theImages[0] = '<iframe name="myframe" id="myframe" src="infoizq_1.htm" scrolling="no" height"420" marginwidth="0" marginheight="0" vspace="0" hspace="0" frameborder="0" style="overflow:visible; width:100%; display:none; top:auto; margin-top:0; padding:0 ; vertical-align:top">tu navegador no soporta iframes</iframe>'
theImages[1] = '<iframe name="myframe" id="myframe" src="infoizq_2.htm" scrolling="no" height"420" marginwidth="0" marginheight="0" vspace="0" hspace="0" frameborder="0" style="overflow:visible; width:100%; display:none; top:auto; margin-top:0; padding:0 ; vertical-align:top">tu navegador no soporta iframes</iframe>'
theImages[2] = '<iframe name="myframe" id="myframe" src="infoizq_3.htm" scrolling="no" height"420" marginwidth="0" marginheight="0" vspace="0" hspace="0" frameborder="0" style="overflow:visible; width:100%; display:none; top:auto; margin-top:0; padding:0 ; vertical-align:top">tu navegador no soporta iframes</iframe>'
theImages[3] = '<iframe name="myframe" id="myframe" src="infoizq_4.htm" scrolling="no" height"420" marginwidth="0" marginheight="0" vspace="0" hspace="0" frameborder="0" style="overflow:visible; width:100%; display:none; top:auto; margin-top:0; padding:0 ; vertical-align:top">tu navegador no soporta iframes</iframe>'

theTexts[0] = '<img src="images/textcontent_down0.jpg" alt="" name="textcontent_down" width="534" height="35" border="0">'
theTexts[1] = '<img src="images/textcontent_down1.jpg" alt="" name="textcontent_down" width="534" height="35" border="0">'
theTexts[2] = '<img src="images/textcontent_down2.jpg" alt="" name="textcontent_down" width="534" height="35" border="0">'
theTexts[3] = '<img src="images/textcontent_down3.jpg" alt="" name="textcontent_down" width="534" height="35" border="0">'
theTexts[4] = '<img src="images/textcontent_down4.jpg" alt="" name="textcontent_down" width="534" height="35" border="0">'
theTexts[5] = '<img src="images/textcontent_down5.jpg" alt="" name="textcontent_down" width="534" height="35" border="0">'

// do not edit anything below this line
var j = 0;
var j2 = 0;

var p = theImages.length;
var p2 = theTexts.length;

var preBuffer = new Array()	// random for IMAGES
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var preBuffer2 = new Array()	// random for TEXTS
for (i2 = 0; i2 < p2; i2++){
   preBuffer2[i2] = new Image()
   preBuffer2[i2].src = theTexts[i2]
}


var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
	document.write(theImages[whichImage]);
}
var whichImage2 = Math.round(Math.random()*(p2-1));
function showText(){
	document.write(theTexts[whichImage2]);
}

// ---------------------------------------------------------------------------------------------------
// --------------check data from FORM CREDITO --------------------------------------------------------
// ---------------------------------------------------------------------------------------------------
//	Para mostrar Acentos y caracteres en los ALERTS
//    * \u00e1 -> á
//    * \u00e9 -> é
//    * \u00ed -> í
//    * \u00f3 -> ó
//    * \u00fa -> ú
//    * \u00f1 -> ñ
function checkdataCredito(theForm) {
	if (theForm.nombre.value == "") {
	  alert("Por favor escriba su nombre o raz\u00f3n social");
	  theForm.nombre.focus();
	  return (false);
	}	if (theForm.nombre.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Nombre o Raz\u00f3n Social\" .");
	  theForm.nombre.focus();
	  return (false);
	}
	if (theForm.direccion.value == "") {
	  alert("Por favor escriba su direcci\u00f3n fiscal");
	  theForm.direccion.focus();
	  return (false);
	}	if (theForm.direccion.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Direcci\u00f3n Fiscal\" .");
	  theForm.direccion.focus();
	  return (false);
	}
	if (theForm.ciudad.value == "") {
	  alert("Por favor escriba la ciudad");
	  theForm.ciudad.focus();
	  return (false);
	}	if (theForm.ciudad.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Ciudad\" .");
	  theForm.ciudad.focus();
	  return (false);
	}
	if (theForm.estado.value == "") {
	  alert("Por favor escriba el Estado");
	  theForm.estado.focus();
	  return (false);
	}	if (theForm.estado.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Estado\" .");
	  theForm.estado.focus();
	  return (false);
	}
	if (theForm.rfc.value == "") {
	  alert("Por favor escriba su RFC");
	  theForm.rfc.focus();
	  return (false);
	}	if (theForm.rfc.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"RFC\" .");
	  theForm.rfc.focus();
	  return (false);
	}
	if (theForm.telefono.value == "")  {
	  alert("Por favor escriba un tel\u00e9fono donde podamos contactarlo.");
	  theForm.telefono.focus();
	  return (false);
	}	if (theForm.telefono.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo  \"tel\u00e9fono\" .");
	  theForm.telefono.focus();
	  return (false);
	}
	if (theForm.giro.value == "") {
	  alert("Por favor escriba el giro de su empresa");
	  theForm.giro.focus();
	  return (false);
	}	if (theForm.giro.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Giro\" .");
	  theForm.giro.focus();
	  return (false);
	}
	//expresion regular
    var validamail=/^[^@\s]+@[^@\.\s]+(\.[^@\.\s]+)+$/
	if (!validamail.test(theForm.correo.value))  {  //si correo no es igual a validamail
	  alert("Por favor escriba un correo electr\u00f3nico v\u00e1lido.");
	  theForm.correo.focus();
	  return (false);
	}
	// terminamos de comprobar el primer bloque de información del cliente--------------------------
	//--------------------- Principales Accionistas, 1 campo
	if (theForm.accionista1.value == "") {
	  alert("Por favor escriba el Principal accionista de su empresa");
	  theForm.accionista1.focus();
	  return (false);
	}	if (theForm.accionista1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Principales accionistas\" .");
	  theForm.accionista1.focus();
	  return (false);
	}
	if (theForm.sino1.value == "0") {
	  alert("Por favor seleccione una opci\u00f3n en el campo \"Poder para firmar\" .");
	  theForm.sino1.focus();
	  return (false);
	}
	if (theForm.firma1.value == "") {
	  alert("Por favor escriba la firma del Principal accionista de su empresa");
	  theForm.firma1.focus();
	  return (false);
	}	if (theForm.firma1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Firma\" .");
	  theForm.firma1.focus();
	  return (false);
	}
	if (theForm.puesto1.value == "") {
	  alert("Por favor escriba que Puesto en la Empresa tiene el principal accionista de su empresa");
	  theForm.puesto1.focus();
	  return (false);
	}	if (theForm.puesto1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Puesto en la Empresa\" .");
	  theForm.puesto1.focus();
	  return (false);
	}
	//--------------------- Instituciones Financieras, 2 campos
	if (theForm.institucion1.value == "") {
	  alert("Por favor escriba la institucion financiera");
	  theForm.institucion1.focus();
	  return (false);
	}	if (theForm.institucion1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Instituciones financieras\" .");
	  theForm.institucion1.focus();
	  return (false);
	}
	if (theForm.sucursal1.value == "") {
	  alert("Por favor escriba la Sucursal");
	  theForm.sucursal1.focus();
	  return (false);
	}	if (theForm.sucursal1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Sucursal\" .");
	  theForm.sucursal1.focus();
	  return (false);
	}
	if (theForm.cuenta1.value == "") {
	  alert("Por favor escriba el No. de Cuenta");
	  theForm.cuenta1.focus();
	  return (false);
	}	if (theForm.cuenta1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"No. de Cuenta\" .");
	  theForm.cuenta1.focus();
	  return (false);
	}
	if (theForm.lineacredito1.value == "") {
	  alert("Por favor escriba el Monto de l\u00ednea de cr\u00e9dito");
	  theForm.lineacredito1.focus();
	  return (false);
	}	if (theForm.lineacredito1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Monto de l\u00ednea de cr\u00e9dito \" .");
	  theForm.lineacredito1.focus();
	  return (false);
	}
	//--------------------- 
	if (theForm.institucion2.value == "") {
	  alert("Por favor escriba la instituci\u00f3n financiera");
	  theForm.institucion2.focus();
	  return (false);
	}	if (theForm.institucion2.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Instituciones financieras\" .");
	  theForm.institucion2.focus();
	  return (false);
	}
	if (theForm.sucursal2.value == "") {
	  alert("Por favor escriba la Sucursal");
	  theForm.sucursal2.focus();
	  return (false);
	}	if (theForm.sucursal2.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Sucursal\" .");
	  theForm.sucursal2.focus();
	  return (false);
	}
	if (theForm.cuenta2.value == "") {
	  alert("Por favor escriba el No. de Cuenta");
	  theForm.cuenta2.focus();
	  return (false);
	}	if (theForm.cuenta2.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"No. de Cuenta\" .");
	  theForm.cuenta2.focus();
	  return (false);
	}
	if (theForm.lineacredito2.value == "") {
	  alert("Por favor escriba el Monto de l\u00ednea de cr\u00e9dito");
	  theForm.lineacredito2.focus();
	  return (false);
	}	if (theForm.lineacredito2.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Monto de l\u00ednea de cr\u00e9dito \" .");
	  theForm.lineacredito2.focus();
	  return (false);
	}

	//---------------------  Proveedor de acero , 2 campos
	if (theForm.proveedor1.value == "") {
	  alert("Por favor escriba el nombre del proveedor de acero");
	  theForm.proveedor1.focus();
	  return (false);
	}	if (theForm.proveedor1.value.length < 4)  {
	  alert("Por favor escriba al menos 4 caracteres en el campo \"Proveedor de acero\" .");
	  theForm.proveedor1.focus();
	  return (false);
	}
	if (theForm.provtel1.value == "") {
	  alert("Por favor escriba el Tel\u00e9fono");
	  theForm.provtel1.focus();
	  return (false);
	}	if (theForm.provtel1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Tel\u00e9fono\" .");
	  theForm.provtel1.focus();
	  return (false);
	}
	if (theForm.provlimcredito1.value == "") {
	  alert("Por favor escriba el L\u00edmite de Cr\u00e9dito");
	  theForm.provlimcredito1.focus();
	  return (false);
	}	if (theForm.provlimcredito1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"L\u00edmite de Cr\u00e9dito\" .");
	  theForm.provlimcredito1.focus();
	  return (false);
	}
	if (theForm.provantiguedad1.value == "") {
	  alert("Por favor escriba la Antig\u00FCedad del Cr\u00e9dito");
	  theForm.provantiguedad1.focus();
	  return (false);
	}	
	if (theForm.provtipogarantia1.value == "0") {
	  alert("Por favor seleccione una opcion del Tipo de Garant\u00Eda");
	  theForm.provtipogarantia1.focus();
	  return (false);
	}

	if (theForm.proveedor2.value == "") {
	  alert("Por favor escriba el nombre del proveedor de acero");
	  theForm.proveedor2.focus();
	  return (false);
	}	if (theForm.proveedor2.value.length < 4)  {
	  alert("Por favor escriba al menos 4 caracteres en el campo \"Proveedor de acero\" .");
	  theForm.proveedor2.focus();
	  return (false);
	}
	if (theForm.provtel2.value == "") {
	  alert("Por favor escriba el Tel\u00e9fono");
	  theForm.provtel2.focus();
	  return (false);
	}	if (theForm.provtel2.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Tel\u00e9fono\" .");
	  theForm.provtel2.focus();
	  return (false);
	}
	if (theForm.provlimcredito2.value == "") {
	  alert("Por favor escriba el L\u00edmite de Cr\u00e9dito");
	  theForm.provlimcredito2.focus();
	  return (false);
	}	if (theForm.provlimcredito2.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"L\u00edmite de Cr\u00e9dito\" .");
	  theForm.provlimcredito2.focus();
	  return (false);
	}
	if (theForm.provantiguedad2.value == "") {
	  alert("Por favor escriba la Antig\u00FCedad del Cr\u00e9dito");
	  theForm.provantiguedad2.focus();
	  return (false);
	}	
	if (theForm.provtipogarantia2.value == "0") {
	  alert("Por favor seleccione una opcion del Tipo de Garant\u00Eda");
	  theForm.provtipogarantia2.focus();
	  return (false);
	}

	//---------------------  OTRO Proveedor de acero , 1 linea
	if (theForm.otroproveedor1.value == "") {
	  alert("Por favor escriba el nombre de otro proveedor");
	  theForm.otroproveedor1.focus();
	  return (false);
	}	if (theForm.otroproveedor1.value.length < 4)  {
	  alert("Por favor escriba al menos 4 caracteres en el campo \"Otro proveedor\" .");
	  theForm.otroproveedor1.focus();
	  return (false);
	}
	if (theForm.otroprovtel1.value == "") {
	  alert("Por favor escriba el Tel\u00e9fono");
	  theForm.otroprovtel1.focus();
	  return (false);
	}	if (theForm.otroprovtel1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Tel\u00e9fono\" .");
	  theForm.otroprovtel1.focus();
	  return (false);
	}
	if (theForm.otroprovlimcredito1.value == "") {
	  alert("Por favor escriba el L\u00edmite de Cr\u00e9dito");
	  theForm.otroprovlimcredito1.focus();
	  return (false);
	}	if (theForm.otroprovlimcredito1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"L\u00edmite de Cr\u00e9dito\" .");
	  theForm.otroprovlimcredito1.focus();
	  return (false);
	}
	if (theForm.otroprovantiguedad1.value == "") {
	  alert("Por favor escriba la Antig\u00FCedad del Cr\u00e9dito");
	  theForm.otroprovantiguedad1.focus();
	  return (false);
	}	
	if (theForm.otroprovtipogarantia1.value == "0") {
	  alert("Por favor seleccione una opcion del Tipo de Garant\u00EDa");
	  theForm.otroprovtipogarantia1.focus();
	  return (false);
	}

	//--------------------- Clientes Principales. 1
	if (theForm.clientes1.value == "") {
	  alert("Por favor escriba el nombre de sus principales clientes");
	  theForm.clientes1.focus();
	  return (false);
	}	if (theForm.clientes1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Clientes Principales\" .");
	  theForm.clientes1.focus();
	  return (false);
	}
	if (theForm.condventa1.value == "") {
	  alert("Por favor escriba las condiciones de venta ");
	  theForm.condventa1.focus();
	  return (false);
	}	if (theForm.condventa1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Condiciones de venta \" .");
	  theForm.condventa1.focus();
	  return (false);
	}


	//--------------------- Bienes muebles e inmuebles, 2 lineas
	if (theForm.bienes1.value == "") {
	  alert("Por favor escriba los bienes muebles e inmuebles de la empresa");
	  theForm.bienes1.focus();
	  return (false);
	}	if (theForm.bienes1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Bienes muebles e inmuebles de la empresa\" .");
	  theForm.bienes1.focus();
	  return (false);
	}
	if (theForm.bienesgarantia1.value == "") {
	  alert("Por favor escriba a quien ha sido dado en garantia");
	  theForm.bienesgarantia1.focus();
	  return (false);
	}	if (theForm.bienesgarantia1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Principales accionistas\" .");
	  theForm.bienesgarantia1.focus();
	  return (false);
	}

	if (theForm.bienes2.value == "") {
	  alert("Por favor escriba los bienes muebles e inmuebles de la empresa");
	  theForm.bienes2.focus();
	  return (false);
	}	if (theForm.bienes2.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Bienes muebles e inmuebles de la empresa\" .");
	  theForm.bienes2.focus();
	  return (false);
	}
	if (theForm.bienesgarantia2.value == "") {
	  alert("Por favor escriba a quien ha sido dado en garantia");
	  theForm.bienesgarantia2.focus();
	  return (false);
	}	if (theForm.bienesgarantia2.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Principales accionistas\" .");
	  theForm.bienesgarantia2.focus();
	  return (false);
	}

	//--------------------- AVAL o deudores, 1 linea
	if (theForm.avalnombre1.value == "") {
	  alert("Por favor escriba el nombre del aval");
	  theForm.avalnombre1.focus();
	  return (false);
	}	if (theForm.avalnombre1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Nombre\" .");
	  theForm.avalnombre1.focus();
	  return (false);
	}
	if (theForm.avaldir1.value == "") {
	  alert("Por favor escriba la direcci\u00F0n particular");
	  theForm.avaldir1.focus();
	  return (false);
	}	if (theForm.avaldir1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Direcci\u00F0n particular\" .");
	  theForm.avaldir1.focus();
	  return (false);
	}
	if (theForm.avaltel1.value == "") {
	  alert("Por favor escriba tel\u00e9fono");
	  theForm.avaltel1.focus();
	  return (false);
	}	if (theForm.avaltel1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Tel\u00e9fono\" .");
	  theForm.avaltel1.focus();
	  return (false);
	}
	if (theForm.avalrefbanc1.value == "") {
	  alert("Por favor escriba las referencias bancarias del aval");
	  theForm.avalrefbanc1.focus();
	  return (false);
	}	if (theForm.avalrefbanc1.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo \"Referencias bancarias\" .");
	  theForm.avalrefbanc1.focus();
	  return (false);
	}

}
//  End -->

