// JavaScript Document

function fEnviarEmailMW(vAsunto) { 
	var vParam00 = '@yahoo.es?subject=' + vAsunto;
	vParam00 = 'mailto:magicwood2006' + vParam00;
  var winCorreoCR = window.open(vParam00,'wCorreoCR','width=700,height=400,resizable=1,left=50,top=50,location=0');
};//fEnviarEmailMW

function fAbrirSitioWebKC() { 
  winKC = window.open('https://www.kingandcountry.com','winKC', 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800');
	setTimeout("winKC.focus()", 2000);
};// fAbrirSitioWebKC

function fAbrirPagWebAL(vIniOpMenu) {
	if (vIniOpMenu) { winAL = window.open('PagHTML/AvisoLegal.html','winAL', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=700,height=470,left=50,top=50');
	}
	else { winAL = window.open('../PagHTML/AvisoLegal.html','winAL', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=700,height=470,left=50,top=50');
	}
	setTimeout("winAL.focus()", 2000);
};// fAbrirSitioWebKC

function fAbrirSitioWebExterno(vURLExterna) { 
  winExterna = window.open(vURLExterna,'winExterna', 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800');
	setTimeout("winExterna.focus()", 2000);

};// fAbrirSitioWebExterno(vURLExterna)


/************************************************************************************ Ctrl Window.ONRESIZE */
var vTamWin = [0, 0];
var vCtrlTam = 1;				// Controla que iEplored no ejecute 2 veces la función del Evento ONRESIZE

function fTamVentana() {
  if (typeof window.innerWidth != 'undefined')
  {
    vTam = [window.innerWidth,window.innerHeight];
		vCtrlTam = 1;
  } //fin_T_If
  else
    if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
			if (vCtrlTam == 1) {
				vTam = [
					document.documentElement.clientWidth,
					document.documentElement.clientHeight
				];
			}
			else {
				vCtrlTam = 1;
				vTam = [0,0];
			}
    } //fin_T_If
    else   {
				vTam = [
  	      document.getElementsByTagName('body')[0].clientWidth,
    	    document.getElementsByTagName('body')[0].clientHeight
      	];
				vCtrlTam = 1;
    } //fin_elseIf
  return vTam;
}; //ffTamVentana

function fCtrlTamWin(vTamMarcoCentral) {
  vTamWin = fTamVentana();
	if ((vCtrlTam == 1) && (vTamWin[0] > 0)){
		var vPosTxt = "";
		var vPos = vTamWin[1] - document.getElementById('lG_MarcoSup').offsetHeight - document.getElementById('lG_MarcoInf').offsetHeight - document.getElementById('lG_MarcoCentral').offsetHeight;
		if (vPos > 0) {
			vPosTxt = document.getElementById('lG_MarcoSup').offsetHeight + parseInt(vPos / 2) + "px";
		}
		else{
			vPosTxt = document.getElementById('lG_MarcoSup').offsetHeight + 20 + "px";
		}
		document.getElementById("lG_MarcoCentral").style.top=vPosTxt;
		vCtrlTam = 0;
		} //fin_If

/*	alert(vPos + ' ---- ' + vPosTxt);
	alert('offsetTop  '+ vObj.offsetTop);
  alert('La ventana mide: [' + vTamWin[0] + ', ' + vTamWin[1] + ']');
*/
	window.onresize = function() { 	fCtrlTamWin(); };
}; //fCtrlTamWin

