//*****************************************************************
// Funciones Comunes en Paginas
// By BAZJFR 
//*****************************************************************


var nav4 = window.Event ? true : false;

//*****************************************************************
// JS para que un input acepte numeros
//*****************************************************************
function acceptNum(evt){
	// NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57	
	var key = nav4 ? evt.which : evt.keyCode;
	return (key <= 13 || (key >= 48 && key <= 57));
}

//*****************************************************************
// JS para que un input acepte numeros con decimales
//*****************************************************************
function acceptNumDecimal(evt){
	// NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57	
	var key = nav4 ? evt.which : evt.keyCode;
	return (key <= 13 || (key >= 48 && key <= 57) || key == 44);
}

//*****************************************************************
// Soluciona Problema de Scroll del Fullscreen cuando es R.Desktop
//*****************************************************************
function FixFullScreenScrolls() {
		var ie4_t=document.all&&navigator.userAgent.indexOf("Opera")==-1;
		var ns6_t=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1;
		var ns4_t=document.layers;	
		var height_Chck=document.body.clientHeight==screen.height;
		// Si no es full screen
		if (!height_Chck)  {            
            document.body.scroll="yes";
            cssHorScrolls('scroll');
		}
}
//************************************************************************
// Setea el overflow
//************************************************************************

function cssHorScrolls(val){
	document.body.style.overflowX = val;
}
//************************************************************************
// Restaura el intercambio de las imagenes - Implementado en TechintHR
//************************************************************************
function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//************************************************************************
// Restaura el intercambio de las imagenes - Implementado en TechintHR
//************************************************************************
function MM_swapImgRestore() {
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
//************************************************************************
// Busca un objeto - Implementado en TechintHR
//************************************************************************
function MM_findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//************************************************************************
// Intercambia Imagenes - Implementado en TechintHR
//************************************************************************
function MM_swapImage() { 
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//************************************************************************
// Carga el HTMLAREA
//************************************************************************
_editor_url = "css_js/";// URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
	document.write('<scr' + 'ipt src="' + _editor_url + 'editor.js"');
	document.write(' language="Javascript1.2"></scr' + 'ipt>');  
} else {
	document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>');
}

var config = new Object();    // create new config object

config.width = "90%";
config.height = "200px";
config.bodyStyle = 'background-color: white; font-family: "Verdana"; font-size: x-small;';
config.debug = 0;
						
// NOTE:  You can remove any of these blocks and use the default config!
						
config.toolbar = [
['fontname'],
['fontsize'],
['fontstyle'],
['linebreak'],
['bold','italic','underline','separator'],
//['strikethrough','subscript','superscript','separator'],
['justifyleft','justifycenter','justifyright','separator'],
['OrderedList','UnOrderedList','Outdent','Indent','separator'],
['forecolor','backcolor','separator'],
['HorizontalRule','Createlink','htmlmode','separator'],
//['popupeditor'],
];
						
config.fontnames = {
"Arial":           "arial, helvetica, sans-serif",
"Courier New":     "courier new, courier, mono",
"Georgia":         "Georgia, Times New Roman, Times, Serif",
"Tahoma":          "Tahoma, Arial, Helvetica, sans-serif",
"Times New Roman": "times new roman, times, serif",
"Verdana":         "Verdana, Arial, Helvetica, sans-serif",
"impact":          "impact",
"WingDings":       "WingDings"
};

config.fontsizes = {
"1 (8 pt)":  "1",
"2 (10 pt)": "2",
"3 (12 pt)": "3",
"4 (14 pt)": "4",
"5 (18 pt)": "5",
"6 (24 pt)": "6",
"7 (36 pt)": "7"
};
						
//config.stylesheet = "http://www.domain.com/sample.css";
							
config.fontstyles = [   // make sure classNames are defined in the page the content is being display as well in or they won't work!
{ name: "headline",     className: "headline",  classStyle: "font-family: arial black, arial; font-size: 28px; letter-spacing: -2px;" },
{ name: "arial red",    className: "headline2", classStyle: "font-family: arial black, arial; font-size: 12px; letter-spacing: -2px; color:red" },
{ name: "verdana blue", className: "headline4", classStyle: "font-family: verdana; font-size: 18px; letter-spacing: -2px; color:blue" }

// leave classStyle blank if it's defined in config.stylesheet (above), like this:
//  { name: "verdana blue", className: "headline4", classStyle: "" }  
];
//************************************************************************

