function ventanaPopUp (pagina,ancho,alto,scroll_b){
	var opciones=("toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars="+scroll_b+", resizable=no, width="+ancho+", height="+alto+"");
	var w=window.open(pagina,"ventana",opciones);
}
var cuenta=0;
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=380,height=300');");
}


function validar(){
	if(document.buscador.buscar.value.length==0){
		alert("Por favor completa todos los campos del formulario.");
		return false;
	}else{
		document.buscador.submit();
	}

}
function validar2(){
	if(document.buscador.nombre.value.length==0){
		alert("Por favor completa todos los campos del formulario.");
		return false;
	}else{
		document.buscador.submit();
	}

}
function ingresar_correo(){
	if(document.implogin.imapuser.value.length == 0 || document.implogin.pass.value.length == 0)
		alert("Todos los campos son obligatorios.");
	else{
		if(document.implogin.imapuser.value.indexOf("@")==-1)
			document.implogin.imapuser.value = document.implogin.imapuser.value + "@" + "netsaluti.com";
			document.implogin.submit();
	}					
	
}
function tamano(){
this.document.getElementById("cambiable").setAttribute("size","4");
this.document.getElementById("cambiable").setAttribute("color","#57628f");
this.document.getElementById("cambiable").setAttribute("font-family","Trebuchet ms");
//puedes poner cualquier tamaño, o pasarlo por parametro a la funcion, etc...
}
function tamano2(){
this.document.getElementById("cambiable").setAttribute("size","2");
//puedes poner cualquier tamaño, o pasarlo por parametro a la funcion, etc...
}


/*Script para aumentar en tamaño del texto en tres escalas*/
var contador=0;
function sizear(){
if((arguments[arguments.length-1])=='menos'){
if(contador<-0)return;
contador--;
for(ii=0;ii<arguments.length-1;ii++){
if(isNaN(parseInt(document.getElementById(arguments[ii]).style.fontSize)))continue;
document.getElementById(arguments[ii]).style.fontSize=(parseInt(document.getElementById(arguments[ii]).style.fontSize)-2)+'px';
}
}else{
if(contador>1)return;
contador++;
for(ii=0;ii<arguments.length-1;ii++){
if(isNaN(parseInt(document.getElementById(arguments[ii]).style.fontSize)))continue;
document.getElementById(arguments[ii]).style.fontSize=(parseInt(document.getElementById(arguments[ii]).style.fontSize)+2)+'px';
}
}
}

            $(function() {
                $('#container-1 > ul').tabs();
                $('#container-2 > ul').tabs(2);
                $('#container-3 > ul').tabs({ fxSlide: true });
                $('#container-4 > ul').tabs({ fxFade: true, fxSpeed: 'fast' });
                $('#container-5 > ul').tabs({ fxSlide: true, fxFade: true, fxSpeed: 'normal' });
                $('#container-6 > ul').tabs({
                    fxFade: true,
                    fxSpeed: 'fast',
                    click: function() {
                        alert('click callback');
                    },
                    hide: function() {
                        alert('hide callback');
                    },
                    show: function() {
                        alert('show callback');
                    }
                });
                $('#container-7 > ul').tabs({ fxShow: { height: 'show', opacity: 'show' }, fxSpeed: 'normal' });
                $('#container-8 > ul').tabs({ cache: false });
                $('#container-9 > ul').tabs({ disabled: [3] });
                $('<p><a href="#">Remove tab<\/a><\/p>').prependTo('#fragment-22').find('a').click(function() {
                    $('#container-9 > ul').tabsRemove(4);
                    return false;
                });
                $('<p><a href="#">Add tab<\/a><\/p>').prependTo('#fragment-22').find('a').click(function() {
                    $('#container-9 > ul').tabsAdd('#new-tab', 'New Tab', 4);
                    return false;
                });
                $('<p><a href="#">Disable third tab<\/a><\/p>').prependTo('#fragment-22').find('a').click(function() {
                    $('#container-9 > ul').tabsDisable(3);
                    return false;
                });
                $('<p><a href="#">Enable third tab<\/a><\/p>').prependTo('#fragment-22').find('a').click(function() {
                    $('#container-9 > ul').tabsEnable(3);
                    return false;
                });
                $('<p><a href="#">Click third tab<\/a><\/p>').prependTo('#fragment-22').find('a').click(function() {
                    $('#container-9 > ul').tabsClick(3);
                    return false;
                });
                $('<p><a href="#">Get selected tab<\/a><\/p>').prependTo('#fragment-22').find('a').click(function() {
                    alert( $('#container-9 > ul').tabsSelected() );
                    return false;
                });
                $('#container-10 > ul').tabs({ unselected: true });
                $('#container-11 > ul').tabs({ event: 'mouseover' }).find('a').click(function() {
                    return false;
                });
            });
function Browser() {
var ua, s, i;
this.isIE = false;
this.isNS = false;
this.version = null;
ua = navigator.userAgent;
s = "MSIE";
if ((i = ua.indexOf(s)) >= 0) {
this.isIE = true;
this.version = parseFloat(ua.substr(i + s.length));
return;
}
s = "Netscape6/";
if ((i = ua.indexOf(s)) >= 0) {
this.isNS = true;
this.version = parseFloat(ua.substr(i + s.length));
return;
}
// Treat any other "Gecko" browser as NS 6.1.
s = "Gecko";
if ((i = ua.indexOf(s)) >= 0) {
this.isNS = true;
this.version = 6.1;
return;
}
}
var browser = new Browser();
//----------------------------------------------------------------------------
// Code for handling the menu bar and active button.
//----------------------------------------------------------------------------
var activeButton = null;
// Capture mouse clicks on the page so any active button can be
// deactivated.
if (browser.isIE)
document.onmousedown = pageMousedown;
else
document.addEventListener("mousedown", pageMousedown, true);


/*Esta funcion no sé que realiza*/
/*function pageMousedown(event) {
var el;
if (activeButton == null)
return;
if (browser.isIE)
el = window.event.srcElement;
else
el = (event.target.tagName ? event.target : event.target.parentNode);
if (el == activeButton)
return;
if (getContainerWith(el, "DIV", "menu") == null) {
resetButton(activeButton);
activeButton = null;
}
}
*/

function buttonClick(event, menuId) {
var button;
if (browser.isIE)
button = window.event.srcElement;
else
button = event.currentTarget;
button.blur();
if (button.menu == null) {
button.menu = document.getElementById(menuId);
menuInit(button.menu);
}
if (activeButton != null)
resetButton(activeButton);
if (button != activeButton) {
depressButton(button);
activeButton = button;
}
else
activeButton = null;
return false;
}
function buttonMouseover(event, menuId) {
var button;
if (browser.isIE)
button = window.event.srcElement;
else
button = event.currentTarget;
if (activeButton != null && activeButton != button)
buttonClick(event, menuId);
}
function depressButton(button) {
var x, y;
button.className += " menuButtonActive";
x = getPageOffsetLeft(button);
y = getPageOffsetTop(button) + button.offsetHeight;
if (browser.isIE) {
x += button.offsetParent.clientLeft;
y += button.offsetParent.clientTop;
}
button.menu.style.left = x + "px";
button.menu.style.top = y + "px";
button.menu.style.visibility = "visible";
}


function menuMouseover(event) {
var menu;
if (browser.isIE)
menu = getContainerWith(window.event.srcElement, "DIV", "menu");
else
menu = event.currentTarget;
if (menu.activeItem != null)
closeSubMenu(menu);
}
function menuItemMouseover(event, menuId) {
var item, menu, x, y;
if (browser.isIE)
item = getContainerWith(window.event.srcElement, "A", "menuItem");
else
item = event.currentTarget;
menu = getContainerWith(item, "DIV", "menu");
if (menu.activeItem != null)
closeSubMenu(menu);
menu.activeItem = item;
item.className += " menuItemHighlight";
if (item.subMenu == null) {
item.subMenu = document.getElementById(menuId);
menuInit(item.subMenu);
}
x = getPageOffsetLeft(item) + item.offsetWidth;
y = getPageOffsetTop(item);
var maxX, maxY;
if (browser.isNS) {
maxX = window.scrollX + window.innerWidth;
maxY = window.scrollY + window.innerHeight;
}
if (browser.isIE && browser.version < 6) {
maxX = document.body.scrollLeft + document.body.clientWidth;
maxY = document.body.scrollTop + document.body.clientHeight;
}
if (browser.isIE && browser.version >= 6) {
maxX = document.documentElement.scrollLeft + document.documentElement.clientWidth;
maxY = document.documentElement.scrollTop + document.documentElement.clientHeight;
}
maxX -= item.subMenu.offsetWidth;
maxY -= item.subMenu.offsetHeight;
if (x > maxX)
x = Math.max(0, x - item.offsetWidth - item.subMenu.offsetWidth
+ (menu.offsetWidth - item.offsetWidth));
y = Math.max(0, Math.min(y, maxY));
item.subMenu.style.left = x + "px";
item.subMenu.style.top = y + "px";
item.subMenu.style.visibility = "visible";
if (browser.isIE)
window.event.cancelBubble = true;
else
event.stopPropagation();
}
function closeSubMenu(menu) {
if (menu == null || menu.activeItem == null)
return;
if (menu.activeItem.subMenu != null) {
closeSubMenu(menu.activeItem.subMenu);
menu.activeItem.subMenu.style.visibility = "hidden";
menu.activeItem.subMenu = null;
}
removeClassName(menu.activeItem, "menuItemHighlight");
menu.activeItem = null;
}
function menuInit(menu) {
var itemList, spanList
var textEl, arrowEl;
var itemWidth;
var w, dw;
var i, j;
if (browser.isIE) {

spanList = menu.getElementsByTagName("SPAN");
for (i = 0; i < spanList.length; i++)
if (hasClassName(spanList[i], "menuItemArrow")) {
spanList[i].style.fontFamily = "Webdings";
spanList[i].firstChild.nodeValue = "4";
}
}
itemList = menu.getElementsByTagName("A");
if (itemList.length > 0)
itemWidth = itemList[0].offsetWidth;
else
return;
for (i = 0; i < itemList.length; i++) {
spanList = itemList[i].getElementsByTagName("SPAN")
textEl = null
arrowEl = null;
for (j = 0; j < spanList.length; j++) {
if (hasClassName(spanList[j], "menuItemText"))
textEl = spanList[j];
if (hasClassName(spanList[j], "menuItemArrow"))
arrowEl = spanList[j];
}
if (textEl != null && arrowEl != null)
textEl.style.paddingRight = (itemWidth
- (textEl.offsetWidth + arrowEl.offsetWidth)) + "px";
}
if (browser.isIE) {
w = itemList[0].offsetWidth;
itemList[0].style.width = w + "px";
dw = itemList[0].offsetWidth - w;
w -= dw;
itemList[0].style.width = w + "px";
}
}




function getContainerWith(node, tagName, className) {
while (node != null) {
if (node.tagName != null && node.tagName == tagName &&
hasClassName(node, className))
return node;
node = node.parentNode;
}
return node;
}
function hasClassName(el, name) {
var i, list;
list = el.className.split(" ");
for (i = 0; i < list.length; i++)
if (list[i] == name)
return true;
return false;
}
function removeClassName(el, name) {
var i, curList, newList;
if (el.className == null)
return;
newList = new Array();
curList = el.className.split(" ");
for (i = 0; i < curList.length; i++)
if (curList[i] != name)
newList.push(curList[i]);
el.className = newList.join(" ");
}
function getPageOffsetLeft(el) {
var x;
x = el.offsetLeft;
if (el.offsetParent != null)
x += getPageOffsetLeft(el.offsetParent);
return x;
}
function getPageOffsetTop(el) {
var y;
y = el.offsetTop;
if (el.offsetParent != null)
y += getPageOffsetTop(el.offsetParent);
return y;
}


