
// LOCALFILE.JS
// --------------
// acciones necesarias para la ejecución del la pagina por medio del protocolo file:///
// este archivo trata de eliminar el uso de pcWindows.js



// NEW-SITE WINDOW OPEN FUNCTIONS
// ------------------------------
// ims-rc

// ##########################################
//  MACROMEDIA
// ##########################################

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_openBrWindowCentered(cenURL,cenName,cenFeatures,cenWidth,cenHeight){  //v1.0 Creado por IMS-RC, para facil edición manual
	theLeft = (screen.availWidth/2)-(cenWidth/2);
	theTop = (screen.availHeight/2)-(cenHeight/2);
	MM_openBrWindow(cenURL,cenName,cenFeatures+',height='+cenHeight+',width='+cenWidth+',top='+theTop+',left='+theLeft);
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// ##########################################
// NUEVAS FUNCIONES - USAR ESTAS 2003/08/04 IMS-RC
// ##########################################
// begin: Open Browser Window Functions
// 2 Funciones para abrir ventanas nuevas con Javascript.
// Versiones Normal y Centreada.


function openBrWindow(theURL,winName,features) { //v2.0
// openBrWindow: Función que utiliza window.open
// 3 Parametros:
//			theURL = URL de la página
//			winName = nombre de la ventana
//			features = propiedades de la ventana, si no se incluyen default es NO:
/*						toolbar=	yes|no
						location=	yes|no
						status=		yes|no
						menubar=	yes|no
						scrollbars=	yes|no
						resizable=	yes|no
						width=		dimensiones en pixeles
						height=		dimensiones en pixeles
*/
//  Autor: IMS-RC

  newWindow = window.open(theURL,winName,features);
  newWindow.focus();
}

function openBrWindowCentered(cenURL,cenName,cenFeatures,cenWidth,cenHeight){  //v1.1
// openBrWindowCentered: función para centrear ventana nueva. Utiliza
// la función MM_openBrWindow.
// 5 Parametros:
//			cenURL = URL de la página
//			cenName = nombre de la ventana
//			cenFeatures = propiedades de la ventana (ver arriba)
//			cenWidth = ancho de la ventana
//			cenHeight = alto de la ventana
//  Autor: IMS-RC

	theLeft = (screen.availWidth/2)-(cenWidth/2);
	theTop = (screen.availHeight/2)-(cenHeight/2);
	openBrWindow( cenURL, cenName, cenFeatures+', height='+cenHeight+', width='+cenWidth+', top='+theTop+', left='+theLeft);
}


function openBrWindowFull(theURL, winName, features) {
	if (window.screen){
		var padding = 30
		var hori = screen.availWidth-padding;
		var verti = screen.availHeight-(100+padding);
		window.open(theURL, winName, 'width='+hori+', height='+verti+', left=10, top=10, '+ features);
	}
}

// end: Open Browser Window Functions -->




/* 







// Get the query string with javascript
// just like a cgi script would
// so send it my_page.html?food=eggs&drink=beer
// and you will have the variable query_food == eggs
// and the variable query_drink == beer
// everywhere in the document
// the whole variable _query_string == food=eggs&drink=beer
// is also available to you
// * from http://www.summerholiday.org/freecode/

// BEGIN GET QUERY STRING CODE
queryVar = this.location.href;
var inq = queryVar.indexOf('?');
queryVar = queryVar.substring(inq + 1);
if (inq > 0)
{
    _query_string = queryVar; // full query is also available to body
}
var text1 = "&";
var strLength = queryVar.length, txtLength = text1.length;

var i = queryVar.indexOf(text1);

while (i+txtLength < strLength)
{
    if (i > 0)
    {
        qrysplit(queryVar.substring(0,i),"=");
    }
    else
    {
        qrysplit(queryVar,"=");
    }
    queryVar = queryVar.substring(i+txtLength,strLength);
    var i = queryVar.indexOf(text1);
    if (i < 1)
    {
        i = strLength + 1; // end while
    }
}
qrysplit(queryVar,"="); // last one

function qrysplit(string,text)
{
    name = string.substring(0,string.indexOf(text));
    value = string.substring(string.indexOf(text) + 1);
    eval("query_" + name + " = value;");
    // comment the previous line and uncomment this next line if you want to
    // use UNESCAPE, that is, turn %20 into a space, %22 into double quotes, etc.
    // eval("query_" + name + " = unescape(value);");
}


// var _query_string; // call before reference in case undefined
// document.write("the query string is &quot;" + _query_string + "&quot;. ");

var query_i; // call before reference in case undefined
// this goes in the BODY
// document.write("the i is &quot;" + query_i + "&quot;. ");

var query_h; // call before reference in case undefined
// this goes in the BODY
// document.write("the h is &quot;" + query_h + "&quot;. ");

var query_w; // call before reference in case undefined
// this goes in the BODY
// document.write("the w is &quot;" + query_w + "&quot;. ");

// this goes in the BODY
// image.height.width
// document.write("<img src=\"faq-images/faq-photos/" + query_i + "\" height=" + query_h + " width=" + query_w + ">");

// END GET QUERY STRING CODE







rediseño 2005
Separation of CSS and Javascript
================================
http://www.onlinetools.org/articles/unobtrusivejavascript/cssjsseparation.html
---------------------------*/
/*
 * cssjs
 * written by Christian Heilmann (http://icant.co.uk)
 * eases the dynamic application of CSS classes via DOM
 * parameters: action a, object o and class names c1 and c2 (c2 optional)
 * actions: swap exchanges c1 and c2 in object o
 *			add adds class c1 to object o
 *			remove removes class c1 from object o
 *			check tests if class c1 is applied to object o
 * example:	cssjs('swap',document.getElementById('foo'),'bar','baz');
 */

function cssjs(a,o,c1,c2)
{
	//alert("cssjs running...");
	switch (a){
		
		case 'swap':
			o.className=!cssjs('check',o,c1)?o.className.replace(c2,c1):o.className.replace(c1,c2);
		break;
		case 'add':
			if(!cssjs('check',o,c1)){o.className+=o.className?' '+c1:c1;}
		break;
		case 'remove':
			var rep=o.className.match(' '+c1)?' '+c1:c1;
			o.className=o.className.replace(rep,'');
		break;
		case 'check':
			return new RegExp('\\b'+c1+'\\b').test(o.className)
		break;
		case 'set': 
			o.className='';
			if(!cssjs('check',o,c1)){o.className+=o.className?' '+c1:c1;}
		break;

	}
}


