function objetoAjax(){
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; 
}

function fp_slide(slide_div, slide_content, heightoriginal){
	slide_content1 = document.getElementById(slide_content);
	if(slide_div.style.backgroundPosition == '-20px 50%'){
		slide_div.style.backgroundPosition = "0px";
		//slide_content1.style.display = 'block';
		elheight = heightoriginal;
		$(slide_content1).animate({ "height": elheight }, 1600, "easeOutBounce");
		
	}else{	
		slide_div.style.backgroundPosition = "-20px";
		//slide_content1.style.display = "none";
		$(slide_content1).animate({ "height": 0 }, 1600, "easeOutBounce");
	
	}
}

function show_element_collection(categoriaid, nombre_categoria){
	area_preloader = document.getElementById('fp_area_preloader');
	slide_simbolos = document.getElementById('slide_simbols');
	area_preloader.style.display = 'block';
	//slide_simbolos.style.display = "none";
	
	ajax=objetoAjax(); 
	ajax.open("POST", "show_simbols.php",true); 
	ajax.onreadystatechange=function() { 
		if (ajax.readyState==4) {
			if(ajax.responseText == "err"){

			}else{

				slide_simbolos.innerHTML = ajax.responseText;
				setTimeout("area_preloader.style.display = 'none';", 500);

			}
		} 
	} 
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send("categoriaid="+categoriaid+"&nombre_categoria="+nombre_categoria); 
}

function ShowFondoPre(categoriaid, nombre_categoria){
	$('#fp_titulo').html('FONDOS PREDETERMINADOS - '+nombre_categoria);
	$('#fp_preloader_25').css('display', 'block');
	$('#fp_fondos_content').css('display', 'none');
	ajax=objetoAjax(); 
	ajax.open("POST", "show_fondo_pre.php",true); 
	ajax.onreadystatechange=function() { 
		if (ajax.readyState==4) {
			if(ajax.responseText == "err"){

			}else{

				$('#fp_fondos_content').html(ajax.responseText);
				setTimeout("$('#fp_preloader_25').css('display', 'none');", 500);
				setTimeout("$('#fp_fondos_content').css('display', 'block');", 500);

			}
		} 
	} 
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send("categoriaid="+categoriaid); 
	
}

function resize_mifoto(foto){
	$('#fp_preloader_25').css('display', 'block');
	$('#fp_fondos_content').css('display', 'none');
	ajax=objetoAjax(); 
	ajax.open("POST", "resize_image.php",true); 
	ajax.onreadystatechange=function() { 
		if (ajax.readyState==4) {
			if(ajax.responseText == "err"){

			}else{

				$('#fp_fondos_content').html("");
				//document.getElementById('fp_fondos_content').innerHTML = "";
				//$("#fp_fondos_content").append($(document.createElement("img")).attr({src: "fotos/galeria/foto95.jpg",id:"photo"})).show();	
				$("#fp_fondos_content").append(ajax.responseText).show();	
				setTimeout("$('#fp_preloader_25').css('display', 'none');", 500);
				setTimeout("$('#fp_fondos_content').css('display', 'block');", 1500);
				//jQuery(function(){
				//	jQuery('#photo').Jcrop();
				//});
				jQuery(function(){
					jQuery('#photo').Jcrop({
						minSize: [288, 360],
						maxSize: [288, 360],
						setSelect: [ 156, 40, 444, 400 ],
						onChange: showCoords,
						onSelect: showCoords,
						allowResize: false
					});
					function showCoords(c)
					{
						$('#x').val(c.x);
						$('#y').val(c.y);
						$('#x2').val(c.x2);
						$('#y2').val(c.y2);
						$('#w').val(c.w);
						$('#h').val(c.h);
					};
				});				
				
			}
		} 
	} 
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send("foto="+foto); 
	
}

function add_bckgd_resized(nombre_fondo){
	x = $('#x').val();
	y = $('#y').val();
	x2 = $('#x2').val();
	y2 = $('#y2').val();
	w = $('#w').val();
	h = $('#h').val();
	$('#fp_preloader_25').css('display', 'block');
	ajax=objetoAjax(); 
	ajax.open("POST", "add_bckgd_resized.php",true); 
	ajax.onreadystatechange=function() { 
		if (ajax.readyState==4) {
			
			//myVar = new Image();
			//myVar.src = "add_bckgd_resized.php?x="+x+"&y="+y+"&x2="+x2+"&y2="+y2+"&w="+w+"&h="+h+"&nfoto="+nombre_fondo;
						
			//var elfondo = parent.document.getElementById('fondo');	
		  	//elfondo.style.backgroundImage = myVar;
			
			//myVar.src = "prueba_resize.php";
			//$('#fp_fondos_content').html(myVar);
			cadena = ajax.responseText;
			array_cadena = cadena.split("|");

			$('#btn_elegirfoto', window.parent.document).css('display', 'none');
			$('#area_foto_elegida', window.parent.document).css('display', 'block');
			$('#fondo_elegido_petit', window.parent.document).html(array_cadena[0]);
			var elfondo = parent.document.getElementById('fondo');	
		  	elfondo.style.backgroundImage = "url(imagenes/fondos/temp/"+array_cadena[1]+")";
			setTimeout("$('#fp_preloader_25').css('display', 'none'); parent.$.fn.colorbox.close();", 500);
			
		}
	}
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send("x="+x+"&y="+y+"&x2="+x2+"&y2="+y2+"&w="+w+"&h="+h+"&nfoto="+nombre_fondo); 
	
}


function add_bckgd(nombre_fondo){
	$('#fp_preloader_25').css('display', 'block');
	ajax=objetoAjax(); 
	ajax.open("POST", "add_bckgd.php",true); 
	ajax.onreadystatechange=function() { 
		if (ajax.readyState==4) {
			$('#btn_elegirfoto', window.parent.document).css('display', 'none');
			$('#area_foto_elegida', window.parent.document).css('display', 'block');
			$('#fondo_elegido_petit', window.parent.document).html(ajax.responseText);
			var elfondo = parent.document.getElementById('fondo');	
		  	elfondo.style.backgroundImage = "url(imagenes/fondos/"+nombre_fondo+")";
			setTimeout("$('#fp_preloader_25').css('display', 'none'); parent.$.fn.colorbox.close();", 500);
			
		}
	}
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send("fondo="+nombre_fondo); 
	
}

function ShowFondoMisfotos(){
	$('#fp_titulo').html('MIS FOTOS');
	$('#fp_preloader_25').css('display', 'block');
	ajax=objetoAjax(); 
	ajax.open("POST", "show_fondo_misfotos.php",true); 
	ajax.onreadystatechange=function() { 
		if (ajax.readyState==4) {
				$('#fp_fondos_content').html(ajax.responseText);
				setTimeout("$('#fp_preloader_25').css('display', 'none');", 500);
				setTimeout("$('#fp_fondos_content').css('display', 'block');", 500);
		}
	}
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send(""); 
}


function ShowFondoFotosGrales(){
	$('#fp_titulo').html('FOTOS');
	$('#fp_preloader_25').css('display', 'block');
	ajax=objetoAjax(); 
	ajax.open("POST", "show_fondo_fotos_grales.php",true); 
	ajax.onreadystatechange=function() { 
		if (ajax.readyState==4) {
				$('#fp_fondos_content').html(ajax.responseText);
				setTimeout("$('#fp_preloader_25').css('display', 'none');", 500);
				setTimeout("$('#fp_fondos_content').css('display', 'block');", 500);
		}
	}
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send(""); 
}


function add_simbol(nombre_simbol, ancho, alto){
	$('#fp_area_preloader').css('display', 'block');
	//var elsimbol = document.getElementById('simbol1');	
	var divsimbolo = document.getElementById('divsimbolo');	
  	var elworkspace = document.getElementById('workspace');	

	ajax=objetoAjax(); 
	ajax.open("POST", "add_simbol.php",true); 
	ajax.onreadystatechange=function() { 
		if (ajax.readyState==4) {
			
			  	var newdiv = document.createElement('div');
			  	var divIdName = 'simbolo_'+ajax.responseText;
			  	newdiv.setAttribute('id',divIdName);
				newdiv.style.left = '0px'; 
				newdiv.style.top = '0px';
			  	newdiv.style.width = ancho+'px';
			    newdiv.style.height = alto+'px';
				newdiv.style.position = 'absolute';
				newdiv.style.display = "block";
				newdiv.style.zIndex = parseInt(ajax.responseText);
				newdiv.innerHTML = "<img src='imagenes/simbolos/"+nombre_simbol+"' width='100%' height='100%'>";				
			  	newdiv.className = "drsElement drsMoveHandle";
				elworkspace.appendChild(newdiv);
				setTimeout("show_info();", 100);
				setTimeout("$('#fp_area_preloader').css('display', 'none');", 500);
				//para borrar uno de los div creados
				//elworkspace.removeChild(newdiv);
				
						
		}
	} 
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send("simbolo="+nombre_simbol); 
	
}

function delete_simbol(nombre_simbol){
	$('#fp_area_preloader').css('display', 'block');
  	var elworkspace = document.getElementById('workspace');	
	var aborrar = document.getElementById(nombre_simbol);	
	ajax=objetoAjax(); 
	ajax.open("POST", "delete_simbol.php",true); 
	ajax.onreadystatechange=function() { 
		if (ajax.readyState==4) {
			// para borrar uno de los div creados
			elworkspace.removeChild(aborrar);
			setTimeout("show_info();", 100);	
			setTimeout("$('#fp_area_preloader').css('display', 'none');", 500);
		}
	} 
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send("simbolo="+nombre_simbol); 
	
}

function showhide_simbol(nombre_simbol, valor){
	$('#fp_area_preloader').css('display', 'block');
	var aesconder = document.getElementById(nombre_simbol);	
	var icono = document.getElementById('eye_'+nombre_simbol);	
	
	ajax=objetoAjax(); 
	ajax.open("POST", "showhide.php",true); 
	ajax.onreadystatechange=function() { 
		if (ajax.readyState==4) {
			
			if(aesconder.style.display == "block"){
				aesconder.style.display = "none";
			}else{
				aesconder.style.display = "block";
			}
			
			
			ajax2=objetoAjax(); 
			ajax2.open("POST", "show_info.php",true); 
			ajax2.onreadystatechange=function() { 
				if (ajax2.readyState==4) {
					
						//divsimbolo.innerHTML = ajax.responseText;
						
						$('#info').html(ajax2.responseText);
						setTimeout("$('#fp_area_preloader').css('display', 'none');", 100);	
						// para borrar uno de los div creados
						//elworkspace.removeChild(newdiv);
								
				}
			} 
			ajax2.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
			ajax2.send(""); 
			
			
		}
	}
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send("simbolo="+nombre_simbol+"&valor="+valor); 
	
	
	   
}

function duplicate_simbol(nombre_simbol, simbolo){
	$('#fp_area_preloader').css('display', 'block');
	var elworkspace = document.getElementById('workspace');	
	
	ajax=objetoAjax(); 
	ajax.open("POST", "add_simbol.php",true); 
	ajax.onreadystatechange=function() { 
		if (ajax.readyState==4) {
			
			var newdiv = document.createElement('div');
			var divIdName = 'simbolo_'+ajax.responseText;
			newdiv.setAttribute('id',divIdName);
			newdiv.style.left = '0px'; 
			newdiv.style.top = '0px';
			newdiv.style.width = document.getElementById(simbolo).style.width;
			newdiv.style.height = document.getElementById(simbolo).style.height;
			newdiv.style.position = 'absolute';
			newdiv.style.display = "block";
			newdiv.style.zIndex = parseInt(ajax.responseText);
			newdiv.innerHTML = "<img src='imagenes/simbolos/"+nombre_simbol+"' width='100%' height='100%'>";				
			newdiv.className = "drsElement drsMoveHandle";
			elworkspace.appendChild(newdiv);
			setTimeout("show_info();", 100);
			setTimeout("$('#fp_area_preloader').css('display', 'none');", 500);		
						
		}
	} 
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send("simbolo="+nombre_simbol); 
	
}

function get_design_parameters(){
	var preview = document.getElementById('preview');
	ajax=objetoAjax(); 
	ajax.open("POST", "show_totalsimbols.php",true); 
	ajax.onreadystatechange=function() { 
		if (ajax.readyState==4) {
			var cadena = ajax.responseText;
			var vector = new Array();
			//separamos la cadena segun el caracter \
			vector = cadena.split(",");
			
			var vv = "";
			for(ii = 0; ii < vector.length; ii++){
				if(ii < 1){
					vv += vector[ii]+"|"+document.getElementById(vector[ii]).style.zIndex+"|"+document.getElementById(vector[ii]).style.width+"|"+document.getElementById(vector[ii]).style.height+"|"+document.getElementById(vector[ii]).style.top+"|"+document.getElementById(vector[ii]).style.left;
				}else{
					
					vv += ","+vector[ii]+"|"+document.getElementById(vector[ii]).style.zIndex+"|"+document.getElementById(vector[ii]).style.width+"|"+document.getElementById(vector[ii]).style.height+"|"+document.getElementById(vector[ii]).style.top+"|"+document.getElementById(vector[ii]).style.left;
				
				}
			}

			//myVar = new Image();
			//myVar.src = "prueba_resize1.php?simbolos="+vv;
			//$('#preview').html(myVar)
			return vv;
		} 
		
	} 
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send(""); 

	
}

function make_preview(qsimbolo){
	var elsimbol = document.getElementById('simbol1');	
	var info = document.getElementById('info');	
	var preview = document.getElementById('preview');	
	var width = elsimbol.style.width;
	var height = elsimbol.style.height;
	var left = elsimbol.style.left;
	var top = elsimbol.style.top;
	info.innerHTML = "Info necesaria para armar el preview:<br>Width:"+width+"<br>height:"+height+"<br>top:"+top+"<br>left:"+left+"<br>";
	
	/*ajax=objetoAjax(); 
	ajax.open("POST", "prueba_resize.php",true); 
	ajax.onreadystatechange=function() { 
		if (ajax.readyState==4) {
			if(ajax.responseText != "err"){
				//setTimeout("show_msg('verde', 'Los datos han sido actualizados');", 1000);
				//ajax.setRequestHeader("Content-Type","image/gif"); 
				//preview.innerHTML = "<img src='"+ajax.responseText+"' width='288 height='360'>";
				
				setTimeout("$('#preview').html(ajax.responseText);", 1000);
			}else if(ajax.responseText == "err"){
				//setTimeout("show_msg('rojo', 'Los datos no puedieron ser actualizados');", 1000);
				alert("hubo un error al generar el preview....fuck !!!!");
			}
		} 
	} 
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send("fondo=rubia.jpg&simbolo=mickey1.png&simbolo_width="+width+"&simbolo_height="+height+"&simbolo_top="+top+"&simbolo_left="+left); 
	*/
	
	myVar = new Image();
	myVar.src = "prueba_resize1.php?fondo=rubia.jpg&simbolo="+qsimbolo+"&simbolo_width="+width+"&simbolo_height="+height+"&simbolo_top="+top+"&simbolo_left="+left;
	$('#preview').html(myVar)
	//preview.appendChild(myVar);
	
}

function show_info(){
	ajax=objetoAjax(); 
	ajax.open("POST", "show_info.php",true); 
	ajax.onreadystatechange=function() { 
		if (ajax.readyState==4) {
			
				//divsimbolo.innerHTML = ajax.responseText;
				
			  	$('#info').html(ajax.responseText);
				
				// para borrar uno de los div creados
				//elworkspace.removeChild(newdiv);
						
		}
	} 
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send(""); 
	
}
function show_info_parent(){
	ajax=objetoAjax(); 
	ajax.open("POST", "show_info.php",true); 
	ajax.onreadystatechange=function() { 
		if (ajax.readyState==4) {
			
				//divsimbolo.innerHTML = ajax.responseText;
				
			  	$('#info', window.parent.document).html(ajax.responseText);
				
				// para borrar uno de los div creados
				//elworkspace.removeChild(newdiv);
						
		}
	} 
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send(""); 
	
}

function guardar_disenio(){


	if($('#nombre_disenio').val() == "" || $('#nombre_disenio').val() == "Sin nombre"){
		
		$('#fp_msg').animate({ "height": 25 }, 600, "easeInOutQuad");
		$('#fp_msg').html("Ingrese el nombre del diseņo");
		setTimeout('$("#fp_msg").animate({ "height": 0 }, 600, "easeInOutQuad");', 4000);	
		//$(panel).animate({ "height": 0 }, 700, "easeInOutQuad");
		
	}else{
		
		$('#fp_area_preloader').css('display', 'block');	
		$('#fp_msg').animate({ "height": 25 }, 600, "easeInOutQuad");
		$('#fp_msg').html("Guardando, por favor espere...");
				
		ajax=objetoAjax(); 
		ajax.open("POST", "show_totalsimbols.php",true); 
		ajax.onreadystatechange=function() { 
			if (ajax.readyState==4) {
				var cadena = ajax.responseText;
				var vector = new Array();
				//separamos la cadena segun el caracter \
				vector = cadena.split(",");
				
				var vv = "";
				for(ii = 0; ii < vector.length; ii++){
					if(ii < 1){
						vv += vector[ii]+"|"+document.getElementById(vector[ii]).style.zIndex+"|"+document.getElementById(vector[ii]).style.width+"|"+document.getElementById(vector[ii]).style.height+"|"+document.getElementById(vector[ii]).style.top+"|"+document.getElementById(vector[ii]).style.left;
					}else{
						
						vv += ","+vector[ii]+"|"+document.getElementById(vector[ii]).style.zIndex+"|"+document.getElementById(vector[ii]).style.width+"|"+document.getElementById(vector[ii]).style.height+"|"+document.getElementById(vector[ii]).style.top+"|"+document.getElementById(vector[ii]).style.left;
					
					}
				}
	
				
				nombre_disenio = $('#nombre_disenio').val();
				
				ajax1=objetoAjax(); 
				ajax1.open("POST", "guardo_disenio.php",true); 
				ajax1.onreadystatechange=function() { 
				if (ajax1.readyState==4) {
				
					if(ajax1.responseText == "1"){
				
						//Si todo salio bien			
						setTimeout('$("#fp_msg").animate({ "height": 0 }, 600, "easeInOutQuad"); btn_enviar("show"); $("#fp_area_preloader").css("display", "none");	' , 4000);	
				
					}else if(ajax1.responseText == "2"){
					
						//Si no hay un fondo seleccionado en el disenio
						setTimeout('$("#fp_msg").html("Debe seleccionar un fondo");', 1000);
						setTimeout('$("#fp_area_preloader").css("display", "none");	' , 1000);	
					}else if(ajax1.responseText == "3"){
						
						//Si hubo un error al guardar los datos
						setTimeout('$("#fp_msg").html("No se pudo guardar el disenio");', 1000);
						setTimeout('$("#fp_area_preloader").css("display", "none");	' , 1000);	
					}else if(ajax1.responseText == "4"){
						
						//Si hubo un error al guardar los datos
						setTimeout('$("#fp_msg").html("error al guardar elementos");', 1000);
						setTimeout('$("#fp_area_preloader").css("display", "none");	' , 1000);	
					}
				}
				}
				ajax1.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
				ajax1.send("nombre_disenio="+nombre_disenio+"&simbolos="+vv); 
				
				
			} 
			
		} 
		ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
		ajax.send(""); 
		

		
		
	}

}
function clean(){
	if($("#nombre_disenio").val() == "Sin nombre"){
		$("#nombre_disenio").val("");	
	}
}
function clean2(){
	if($("#nombre_disenio").val() == ""){
		$("#nombre_disenio").val("Sin nombre");	
	}
}

function open_design(designid){



			
  var label=parent.document.getElementById('workspace');	
  while( label.hasChildNodes() ) { label.removeChild( label.lastChild ); }

			

	
	$('#fp_preloader_choosedesign').css('display', 'block');	
	ajax=objetoAjax(); 
	ajax.open("POST", "open_design.php",true); 
	ajax.onreadystatechange=function() { 
		if (ajax.readyState==4) {
			cadena = ajax.responseText;
			var array_cadena = new Array();
			array_cadena = cadena.split("|");
			
			$('#btn_elegirfoto', window.parent.document).css('display', 'none');
			$('#area_foto_elegida', window.parent.document).css('display', 'block');
			$('#fondo_elegido_petit', window.parent.document).html(array_cadena[0]);
			var elfondo = parent.document.getElementById('fondo');	
		  	elfondo.style.backgroundImage = "url("+array_cadena[1]+")";
		  	$('#nombre_disenio', window.parent.document).val(array_cadena[2]);
			
			var divsimbolo = parent.document.getElementById('divsimbolo');	
			var elworkspace = parent.document.getElementById('workspace');
				
			var arre = "";
			var iio = 1;
			for(i5 = 4; i5 < array_cadena.length; i5++){
				var op_simbolo = new Array();
				op_simbolo = array_cadena[i5].split(",");
			
				if(iio < 2){
					arre += op_simbolo[0]+","+op_simbolo[6];
				}else if(iio > 1){
					arre += "|"+op_simbolo[0]+","+op_simbolo[6];	
				}
					
						
			  	var newdiv = parent.document.createElement('div');
			  	var divIdName = 'simbolo_'+(iio);
			  	newdiv.setAttribute('id',divIdName);
				newdiv.style.left = op_simbolo[5]+'px'; 
				newdiv.style.top = op_simbolo[4]+'px';
			  	newdiv.style.width = op_simbolo[2]+'px';
			    newdiv.style.height = op_simbolo[3]+'px';
				newdiv.style.position = 'absolute';
				if(op_simbolo[6] == 1){
					newdiv.style.display = "block";	
				}else{
					newdiv.style.display = "none";
				}
				
				newdiv.innerHTML = "<img src='imagenes/simbolos/"+op_simbolo[0]+"' width='100%' height='100%'>";				
			  	newdiv.className = "drsElement drsMoveHandle";
			  	
				//newdiv.style.zIndex = i5; //op_simbolo[1];
				elworkspace.appendChild(newdiv);
				//newdiv.style.zIndex = parseInt(i5); //op_simbolo[1];
				 
				
				iio++;
			}
			
			var ult = "#simbolo_"+iio;
			$(ult, window.parent.document).maxZIndex({ inc: 5 });
				
			ajax1=objetoAjax(); 
			ajax1.open("POST", "add_simbol_opendesign.php",true); 
			ajax1.onreadystatechange=function() { 
				if (ajax1.readyState==4) {
					
					$('#divnuevowp', window.parent.document).html("<li><a href='wallpapers_pers.php' class='nuevowp' target='_parent'>&nbsp;<span></span></a></li>");
					$('#diveditarwp', window.parent.document).css('display', 'none');
					$('#diveditarwpsel', window.parent.document).css('display', 'block');
					setTimeout("$('#fp_preloader_choosedesign').css('display', 'none'); parent.$.fn.colorbox.close();", 500);	
					setTimeout('show_info_parent(); btn_enviar_parent("show");', 100);
					
					//$('#nombre_disenio', window.parent.document).val(arre);
				}
			} 
			ajax1.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
			ajax1.send("simbolos="+arre); 		
			
				
		}
	} 
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send("designid="+designid); 
	
}

function btn_enviar(accion){
	if(accion == "show"){
		
		$('#btn_enviar_des').css('display', 'none');
		//$("#btn_enviar_hab").html("<a href='popup_wallpapers_pers.php' class='pop_send'><div id='btn_fp_enviar' class='btn_fp_enviar_hab'></div></a>");
		$('#btn_enviar_hab').css('display', 'block');
		
	}else if(accion == "hidde"){
		
		$('#btn_enviar_des').css('display', 'block');
		$("#btn_enviar_hab").css('display', 'none');
		
	}
	
}
function btn_enviar_parent(accion){
	if(accion == "show"){
		
		$('#btn_enviar_des', window.parent.document).css('display', 'none');
		//$("#btn_enviar_hab", window.parent.document).html("<a href='popup_wallpapers_pers.php' class='pop_send'><div id='btn_fp_enviar' class='btn_fp_enviar_hab'></div></a>");
		$('#btn_enviar_hab', window.parent.document).css('display', 'block');
		
	}else if(accion == "hidde"){
		
		$('#btn_enviar_des', window.parent.document).css('display', 'block');
		$("#btn_enviar_hab", window.parent.document).css('display', 'none');
		
	}
	
}


$.maxZIndex = $.fn.maxZIndex = function(opt) {
    /// <summary>
    /// Returns the max zOrder in the document (no parameter)
    /// Sets max zOrder by passing a non-zero number
    /// which gets added to the highest zOrder.
    /// </summary>    
    /// <param name="opt" type="object">
    /// inc: increment value, 
    /// group: selector for zIndex elements to find max for
    /// </param>
    /// <returns type="jQuery" />
    var def = { inc: 10, group: "*" };
    $.extend(def, opt);    
    var zmax = 0;
    $(def.group).each(function() {
        var cur = parseInt($(this).css('z-index'));
        zmax = cur > zmax ? cur : zmax;
    });
    if (!this.jquery)
        return zmax;

    return this.each(function() {
        zmax += def.inc;
        $(this).css("z-index", zmax);
    });
}

/*
function add_simbol(nombre_simbol){
	var elworkspace = document.getElementById('workspace');	
  	var newdiv = document.createElement('div');
  	var divIdName = 'simbol1';
  	newdiv.setAttribute('id',divIdName);
  	newdiv.style.backgroundImage = "url(imagenes/fondos/"+nombre_simbol+")";
  	newdiv.style.width = '203px';
    newdiv.style.height = '213px';
  	elworkspace.appendChild(newdiv);
}
*/
