/*function accordeon_style(id)
{
  status=document.getElementById(id).className;

  if(status == "")
  {
    document.getElementById(id).className="active";
  }
  else
  {
    document.getElementById(id).className="";
  }
}

jQuery().ready(function(){
		// simple accordion
		jQuery('#list1a').accordion();
		jQuery('#list1b').accordion({
			autoheight: false
		});

		// second simple accordion with special markup
		jQuery('#menu').accordion({
			active: ":first",
			header: '.head',
			selectedClass: 'active',
			navigation: false,
			event: 'mouseover',
			fillSpace: false,
			animated: 'easeslide'
		});

		// highly customized accordion
		jQuery('#list2').accordion({
			event: 'mouseover',
			active: '.selected',
			selectedClass: 'active',
			animated: "bounceslide",
			header: "dt"
		}).bind("change.ui-accordion", function(event, ui) {
			jQuery('<div>' + ui.oldHeader.text() + ' hidden, ' + ui.newHeader.text() + ' shown</div>').appendTo('#log');
		});

		// first simple accordion with special markup
		jQuery('#list3').accordion({
			header: 'div.title',
			active: false,
			alwaysOpen: false,
			animated: false,
			autoheight: false
		});

		var wizard = $("#wizard").accordion({
			header: '.title',
			event: false
		});

		var wizardButtons = $([]);
		$("div.title", wizard).each(function(index) {
			wizardButtons = wizardButtons.add($(this)
			.next()
			.children(":button")
			.filter(".next, .previous")
			.click(function() {
				wizard.accordion("activate", index + ($(this).is(".next") ? 1 : -1))
			}));
		});

		// bind to change event of select to control first and seconds accordion
		// similar to tab's plugin triggerTab(), without an extra method
		var accordions = jQuery('#list1a, #list1b, #list2, #list3, #menu, #wizard');

		jQuery('#switch select').change(function() {
			accordions.accordion("activate", this.selectedIndex-1 );
		});
		jQuery('#close').click(function() {
			accordions.accordion("activate", -1);
		});
		jQuery('#switch2').change(function() {
			accordions.accordion("activate", this.value);
		});
		jQuery('#enable').click(function() {
			accordions.accordion("enable");
		});
		jQuery('#disable').click(function() {
			accordions.accordion("disable");
		});
		jQuery('#remove').click(function() {
			accordions.accordion("destroy");
			wizardButtons.unbind("click");
		});
	});*/
	var r_ajax;

// JavaScript Document
function nuevoAjax(){
	var xmlhttp=false;
	try{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}catch(E){
			xmlhttp = false;
		}
	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	
	return xmlhttp;
}


	var error='';

function check_input(id, value, type)
{
		values='?id='+id+'&value='+value;
		if(type)
			values+='&type='+type;
		tipo=id.lastIndexOf(2);
		if (tipo!=-1){
			id1=id.split('2');
			value1 = document.getElementById(id1[0]).value;
			values= values+'&value1='+value1;
		}
        ajax=nuevoAjax();
        ajax.open("GET", "include/check_input.php"+values, true);
        ajax.onreadystatechange=function() 
        { 
        if (ajax.readyState==1)
            { 
               // document.getElementById("result").innerHTML="<img src='images/loading.gif' alt='loading' />";
            }
            if (ajax.readyState==4)
            { 
               // document.getElementById("result").innerHTML="";
                //document.getElementById("result").innerHTML=ajax.responseText;	
				eval(ajax.responseText);
				
            } 
        }
        ajax.send(null);
		
		
		
}
function validar_form()
{
	error='';
	/*
	setTimeout("input='email';value=document.getElementById(input).value;error+=check_input(input, value, 'all');",1);
	
	
	setTimeout("input='email2';value=document.getElementById(input).value;error+=check_input(input, value, 'all');",200);
	
	
	setTimeout("input='pass';value=document.getElementById(input).value;error+=check_input(input, value, 'all');",400);
	
	
	setTimeout("input='pass2';value=document.getElementById(input).value;error+=check_input(input, value, 'all');",800);
	
	
	setTimeout("input='zip';value=document.getElementById(input).value;error+=check_input(input, value, 'all');",1000);*/
	//if(error==""){return true;}
	for (i=0; ele=document.forms[0].elements[i]; i++) {
		valor = ele.value;
		//alert (ele.tagName);
		if (ele.id!='input' && (ele.tagName=='INPUT' || ele.tagName=='SELECT')){
			setTimeout("input='"+ele.id+"';value=document.getElementById(input).value;check_input(input, value, 'all');",i*2000);
		}
	}
	setTimeout("alert (error);",i*2000);
	
}

function f_widgets(values)
{

        ajax=nuevoAjax();
        ajax.open("GET", "include/functions_widgets.php?"+values+'&tabla=user', true);
        ajax.onreadystatechange=function() 
        { 
        if (ajax.readyState==1)
            { 
              	document.getElementById("loading").innerHTML="<img src='img/loading.gif' alt='' />";
            }
            if (ajax.readyState==4)
            { 
                setTimeout('document.getElementById("loading").innerHTML=""',800);
                //document.getElementById("loading").innerHTML=ajax.responseText;	
				eval(ajax.responseText);



				
            } 
        }
        ajax.send(null);	
}
function remove_widget(values)
{
	if(confirm('Delete this favorite?'))
	{
		f_widgets(values);
	}
}
function f_widgets_masseuses(values)
{
//alert ("include/functions_widgets.php?"+values+'&tabla=masseuse');
        ajax=nuevoAjax();
        ajax.open("GET", "include/functions_widgets.php?"+values+'&tabla=masseuse', true);
        ajax.onreadystatechange=function() 
        { 
        if (ajax.readyState==1)
            { 
              	document.getElementById("loading").innerHTML="<img src='img/loading.gif' alt='' />";
            }
            if (ajax.readyState==4)
            { 
                document.getElementById("loading").innerHTML="";
                //document.getElementById("loading").innerHTML=ajax.responseText;	
				eval(ajax.responseText);



				
            } 
        }
        ajax.send(null);	
}
function remove_widget_masseuse(values)
{
	
	if(confirm('Delete this photo?'))
	{
		f_widgets_masseuses(values);
		serializes();
		
	}
}
function banner_count(href,id)
{
        ajax=nuevoAjax();
        ajax.open("GET", "include/banners_count.php?id="+id, true);
        ajax.onreadystatechange=function() 
        { 
        if (ajax.readyState==1)
            { 
              	//document.getElementById("loading").innerHTML="<img src='img/loading.gif' alt='' />";
            }
            if (ajax.readyState==4)
            { 
                //document.getElementById("loading").innerHTML="";
                //document.getElementById("loading").innerHTML=ajax.responseText;	
				//eval(ajax.responseText);	
            } 
        }
        ajax.send(null);
		href=$(href).attr('href');
		if (href=='#'){
			return false;
		}else{
			return true;
		}
}
function product_count(href,id)
{
        ajax=nuevoAjax();
        ajax.open("GET", "include/products_count.php?id="+id, true);
        ajax.onreadystatechange=function() 
        { 
        if (ajax.readyState==1)
            { 
              	//document.getElementById("loading").innerHTML="<img src='img/loading.gif' alt='' />";
            }
            if (ajax.readyState==4)
            { 
                //document.getElementById("loading").innerHTML="";
                //document.getElementById("loading").innerHTML=ajax.responseText;	
				//eval(ajax.responseText);	
            } 
        }
        ajax.send(null);
		href=$(href).attr('href');
		if (href=='#'){
			return false;
		}else{
			return true;
		}
}
function show_hide(ele){
	if($(ele).css("display")=='none'){
		$(ele).fadeIn('slow');
	}else{
		$(ele).fadeOut('slow');
	}
}
function menu_right(ele)
{
	if($('#'+ele).css("display")=='none'){
		$('#'+ele).show('slow');
		$('li.'+ele+' a ').removeClass('gBox');
		$('li.'+ele+' a ').addClass('rBox');
	}else{
		$('#'+ele).hide('slow');
	}
	if(ele=='atGlance'){
		chow_('techniques');
		chow_('infoAndRates');
		//$('#techniques').hide('slow');
	}
	if(ele=='techniques'){
		chow_('atGlance');
		chow_('infoAndRates');
		//$('#techniques').hide('slow');
	}
	if(ele=='infoAndRates'){
		chow_('atGlance');
		chow_('techniques');
		//$('#techniques').hide('slow');
	}
	
}
function chow_(ele){
	if($(ele).css("display")!='none'){
		setTimeout("$('#"+ele+"').hide('slow')",300);
		$('li.'+ele+' a ').removeClass('rBox');
		$('li.'+ele+' a ').addClass('gBox');
	}
}
function change_photo(id_photo, title)
{
	$('#img_big').hide();
	$('#cargando').fadeIn('slow'); 
$("._photo").attr('class','_photo');
$('#'+id_photo).attr('class', 'current_photo _photo');
xsrc=$('#'+id_photo).attr('src');
xsrc=xsrc.replace('thumbs/gallery/','');
document.getElementById('img_big').src=xsrc;
//setTimeout("show_hide('#cargando'); show_hide('#img_big');",1000);
//document.getElementById('titulo').innerHTML=title;
//alert (xsrc);
}


function update_in_box(table,id)
{
		mails=$("#n_mails"+table).html();
        ajax=nuevoAjax();
        ajax.open("GET", "include/update_mail_span.php?update_email_js=ok&id="+id+"&table="+table+"&mails="+mails, true);
        ajax.onreadystatechange=function() 
        { 
        if (ajax.readyState==1)
            { 
              	document.getElementById("loading").innerHTML="<img src='img/loading.gif' alt='' />";
            }
            if (ajax.readyState==4)
            { 
                document.getElementById("loading").innerHTML="";
                //document.getElementById("loading").innerHTML=ajax.responseText;	
				eval(ajax.responseText);	
            } 
        }
        ajax.send(null);
		setTimeout("update_in_box('"+table+"','"+id+"')",(Math.floor(Math.random()*11)*5000));
}

function send_paginador(page,formulario){
	$('#page').attr('value',page);
	document.getElementById('search').submit();
}

function submit_superform(value){
	$('#oneinsuperform').attr('value'," and bodywork like '%"+value+"%'");
	document.getElementById('superform').submit();
}
function xajax(strings)
{
		//alert(strings);
        ajax=nuevoAjax();
        ajax.open("GET", strings, true);
        ajax.onreadystatechange=function() 
        { 
        if (ajax.readyState==1)
            { 
              	//document.getElementById("loading").innerHTML="<img src='img/loading.gif' alt='' />";
            }
            if (ajax.readyState==4)
            { 
               // document.getElementById("loading").innerHTML="";
                //document.getElementById("loading").innerHTML=ajax.responseText;	
				eval(ajax.responseText);	
            } 
        }
        ajax.send(null);
		
}
function openmodalforgot(){
	open_modal('include/modals/forgot_pass_masseuse.php');
}
function openmodalforgot2(){
	open_modal('include/modals/forgot_pass.php');
}











//////////////////////////functions menu left//////////////////////////////////////
//////////////////////////end functions menu left/////////////////////////////////
