// JScript source code
	function ponURLScore3 (numScore,isLogged,urlReturn,preg,cat,subitem) {	
		var radioBtn;
		var newUrl;
		if (isLogged==1) {		
			radioBtn='Score'+numScore+'_'+subitem; 
			newUrl = 'index_comments_dovote.aspx?preg='+preg+'&cat='+cat+'&Photo=999999'+subitem+'&curPage=&newScore='+numScore+'&cmdVotar=1&url_return='+urlReturn+'&ancla=anchScore'+subitem;
			document.getElementById(radioBtn).href= newUrl
		}
	
	}


	function PaintCurRate(curRate) {		
		/*pinta las bolitas con base en el rating actual*/
		var i;
		var idControl;
		var j;
		
		for (i=1;i<=curRate;i++) {
			idControl = "IMGSCR"+i;
			document.getElementById(idControl).src="images/bolita_rellena.gif";
			//alert(idControl);
		}
		//alert(i);
		if (i<=5) {
			for (j=i;j<=5;j++) {
				idControl = "IMGSCR"+j;
				document.getElementById(idControl).src="images/bolita.gif";
			}
		}
		return(curRate);		
	}


	function PaintCurRate2(curRate,subitem) {
		/*pinta las bolitas con base en el rating actual*/
		var i;
		var idControl;
		var j;
		
		for (i=1;i<=curRate;i++) {
			idControl = "IMGSCR"+i+"_"+subitem;
			document.getElementById(idControl).src="images/bolita_rellena.gif";
		}
		if (i<=5) {
			for (j=i;j<=5;j++) {
				idControl = "IMGSCR"+j+"_"+subitem;
				document.getElementById(idControl).src="images/bolita.gif";
			}
		}
		return(curRate);		
	}


	function swapImageScore(curScore) {
		/*pinta las bolitas con base en el score seleccionado*/
		var i;
		var idControl;
		var j;
		var rateTitle = new Array(5) 
		rateTitle[0]="Pobre"; 
		rateTitle[1]="Nada especial"; 
		rateTitle[2]="Vale la pena verlo"; 
		rateTitle[3]="Bastante bueno"; 
		rateTitle[4]="Impresionante"; 
		
		for (i=1;i<=curScore;i++) {
			idControl = "IMGSCR"+i;
			document.getElementById(idControl).src="images/bolita_rellena.gif";
		}
		if (i<=5) {
			for (j=i;j<=5;j++) {
				idControl = "IMGSCR"+j;
				document.getElementById(idControl).src="images/bolita.gif";
			}
		}
   }
   
   function swapImageScore2(curScore,subitem) {
		/*pinta las bolitas con base en el score seleccionado*/
		var i;
		var idControl;
		var j;
		var rateTitle = new Array(5) 
		rateTitle[0]="Pobre"; 
		rateTitle[1]="Nada especial"; 
		rateTitle[2]="Vale la pena verlo"; 
		rateTitle[3]="Bastante bueno"; 
		rateTitle[4]="Impresionante"; 
		
		for (i=1;i<=curScore;i++) {
			idControl = "IMGSCR"+i+"_"+subitem;
			document.getElementById(idControl).src="images/bolita_rellena.gif";
		}
		if (i<=5) {
			for (j=i;j<=5;j++) {
				idControl = "IMGSCR"+j+"_"+subitem;
				document.getElementById(idControl).src="images/bolita.gif";
			}
		}
   }

		
	function ponURLScore () {
	var numScore= arguments[0];
	var photoID= arguments[1];
	var curPage= arguments[2];
	var newScore= arguments[3];
	var photoRate= arguments[4];
	var isLogged= arguments[5];
	var yBoxPosition= arguments[6];
	var ptgXBoxPosition= arguments[7];
	var goTo= arguments[8];
	var urlReturn= arguments[9];
	
	if(arguments.length == 11){
		var callObj = arguments[10];
	}
	
		var radioBtn;
		var newUrl;

		//alert(isLogged);		
		//alert(goTo);
		//alert(urlReturn);
		if (isLogged==1) {
		
			if (goTo==1) {
				radioBtn='Score'+numScore; 
				newUrl = 'index_comments_dovote.aspx?Photo='+photoID+'&curPage='+curPage+'&newScore='+newScore+'&photoRate='+photoRate+'&cmdVotar=1&url_return='+urlReturn+'&ancla=anchScore';
				//alert(newUrl);
				document.getElementById(radioBtn).href= newUrl
			} else {
			
				 if (goTo==2) {
					//alert("depsliega comentario...");
					//alert(document.getElementById("txtComment").style.width);
					document.getElementById("boxComment").style.display='inline';
					document.getElementById("txtComment").style.width='230px';
					document.getElementById("txtComment").style.height='88px';
					document.getElementById("txtComment").value='';
					window.location.hash="anchComment";
					//document.getElementById("txtComment").focus();
				} else {
					if (goTo==3) {
						radioBtn='Coment3'; 
						newUrl = 'index_comments_postone.aspx?Photo='+photoID+'&curPage='+curPage+'&newScore='+newScore+'&photoRate='+photoRate+'&cmdVotar=1&url_return='+urlReturn;
						document.getElementById(radioBtn).href= newUrl
					} else {
						if (goTo==4) {
							radioBtn='Coment4'; 
							newUrl = 'index_recommend_postone.aspx?Photo='+photoID+'&curPage='+curPage+'&newScore='+newScore+'&photoRate='+photoRate+'&cmdVotar=1&url_return='+urlReturn;
							document.getElementById(radioBtn).href= newUrl
						} else {
							if (goTo==5) {
							radioBtn='Coment5'; 
							newUrl = 'index_ninosnido_subefoto.aspx';
							document.getElementById(radioBtn).href= newUrl;
							} else {
								if (goTo==6) {
									document.getElementById("boxComment2").style.display='inline';
									document.getElementById("txtComment2").style.width='230px';
									document.getElementById("txtComment2").style.height='88px';
									document.getElementById("txtComment2").value='';
									window.location.hash="anchComment2";
								} else {
									if (goTo==7) {
										document.getElementById("boxComment3").style.display='inline';
										document.getElementById("txtComment3").style.width='230px';
										document.getElementById("txtComment3").style.height='88px';
										document.getElementById("txtComment3").value='';
										window.location.hash="anchComment3";
									} else {
										if (goTo==8) {
											document.getElementById("boxComment4").style.display='inline';
											document.getElementById("txtComment4").style.width='230px';
											document.getElementById("txtComment4").style.height='88px';
											document.getElementById("txtComment4").value='';
											window.location.hash="anchComment4";
										} else {
											if (goTo==9) {
												document.getElementById("boxComment5").style.display='inline';
												document.getElementById("txtComment5").style.width='230px';
												document.getElementById("txtComment5").style.height='88px';
												document.getElementById("txtComment5").value='';
												window.location.hash="anchComment5";
											} else {
												if (goTo==10) {
													document.getElementById("boxComment6").style.display='inline';
													document.getElementById("txtComment6").style.width='230px';
													document.getElementById("txtComment6").style.height='88px';
													document.getElementById("txtComment6").value='';
													window.location.hash="anchComment6";
												} else {
													if (goTo==11) {
														document.getElementById("boxComment7").style.display='inline';
														document.getElementById("txtComment7").style.width='230px';
														document.getElementById("txtComment7").style.height='88px';
														document.getElementById("txtComment7").value='';
														window.location.hash="anchComment7";
													} else {
														if (goTo==12) {
															document.getElementById("boxComment8").style.display='inline';
															document.getElementById("txtComment8").style.width='230px';
															document.getElementById("txtComment8").style.height='88px';
															document.getElementById("txtComment8").value='';
															window.location.hash="anchComment8";
														} else {
														if (goTo==13) {
															document.getElementById("boxComment9").style.display='inline';
															document.getElementById("txtComment9").style.width='230px';
															document.getElementById("txtComment9").style.height='88px';
															document.getElementById("txtComment9").value='';
															window.location.hash="anchComment9";
														}	
														}
													}
												}	
											}	
										}
									}
								}
							}
						}	
					}
				}
			}
		//alert(newUrl);
		//alert('url');
		}
		else {
		
			var yPosition = yBoxPosition
			var xResol;
			var xPosition;
			var ptgXpos;
			  
			/*ptgXpos = ptgXBoxPosition
			xResol = getWindowBSFXSize();
			if (xResol>=1200) xPosition = parseInt(xResol*ptgXpos);
			else if (xResol>=1000) xPosition = parseInt(xResol*ptgXpos);
			else if (xResol>900) xPosition = parseInt(xResol*ptgXpos);
			else xPosition = parseInt(xResol*ptgXpos);
			
			document.getElementById("divErroresLogin").innerHTML="";	
				
			if(callObj){
				xPosition = posX(arguments[10]);
				yPosition = posY(arguments[10]);
				if(arguments[10].width){
					xPosition += arguments[10].width - (arguments[10].width / 4);
				}
				if(arguments[10].height){
					yPosition += arguments[10].height - (arguments[10].height / 4);
				}				
			}
						
			document.getElementById("boxNotSoFast").style.left = xPosition + 'px';
			document.getElementById("boxNotSoFast").style.top = yPosition + 'px';
			document.getElementById("boxNotSoFast").style.visibility = "visible";
*/



			if (goTo==3) {
				//document.forms["frmLogin"].elements["url_referer"].value='index_comments_postone.aspx';	
				urlReturn='index_comments_postone.aspx';	
			} else { 
				if (goTo==4) {
					//document.forms["frmLogin"].elements["url_referer"].value='index_recommend_postone.aspx';	
				urlReturn=	'index_recommend_postone.aspx';	
					}
				else 
					if (goTo==4) {
					//document.forms["frmLogin"].elements["url_referer"].value='index_recommend_postone.aspx';	
					urlReturn="index_recommend_postone.aspx";
					} else {
						if (goTo==5) {
							//document.forms["frmLogin"].elements["url_referer"].value='index_ninosnido_subefoto.aspx';	
							urlReturn='index_ninosnido_subefoto.aspx';	
							} 
							else {
								if (goTo==6) {
									//document.forms["frmLogin"].elements["url_referer"].value='index_divertiguia_test10.aspx';		
							urlReturn=	'index_divertiguia_test10.aspx';		
									} 
								else {
									if (goTo==7) {
										//document.forms["frmLogin"].elements["url_referer"].value='index_privilegios_cupon.aspx?promocode=promobolicheamf$';		
										//document.forms["frmLogin"].target='_blank';
										urlReturn='index_privilegios_cupon.aspx?promocode=promobolicheamf$';		
										document.forms["frmLogin"].elements["target_ventana"].value='_blank';
										}
									else {
										if (goTo==8) {
											//document.forms["frmLogin"].elements["url_referer"].value='index_privilegios_cupon.aspx?promocode=promomagictrek$';		
											urlReturn='index_privilegios_cupon.aspx?promocode=promomagictrek$';
											//document.forms["frmLogin"].target='_blank';
											document.forms["frmLogin"].elements["target_ventana"].value='_blank';
											}
										else {
											switch(goTo){
												case 9:
												urlReturn='index_privilegios_CURVES.aspx';
													//document.forms["frmLogin"].elements["url_referer"].value='index_privilegios_CURVES.aspx';
												break;
												case 10:
												urlReturn='index_privilegios_BIOPARQUE.aspx';
													//document.forms["frmLogin"].elements["url_referer"].value='index_privilegios_BIOPARQUE.aspx';
												break;
												case 11:
												urlReturn='index_privilegios_GYMBOREE.aspx';
													//document.forms["frmLogin"].elements["url_referer"].value='index_privilegios_GYMBOREE.aspx';													
												break;
												case 12:
												urlReturn='index_privilegios_GRENITAS.aspx';
													//document.forms["frmLogin"].elements["url_referer"].value='index_privilegios_GRENITAS.aspx';													
												break;												
												default:
												urlReturn=urlReturn;
													//document.forms["frmLogin"].elements["url_referer"].value=urlReturn;	
												}												
											}
										}
									}
							}
						}
						
				}
				
				//alert(<em>document</em>.<em>body</em>.<em>scrollTop</em>);
				
				
				//alert(document.body.offsetHeight);
				//alert("yyy");
				//MostrarVentana(urlReturn,document.body.offsetHeight, String(400 + document.body.offsetHeight) + "px");
				//MostrarVentana(urlReturn,document.body.offsetHeight, String(tempY-150) + "px");
				
				//MostrarVentana(urlReturn,document.body.offsetHeight, String(500) + "px");
				
				// -----------------------------
				 
				 				 
				MostrarVentana(urlReturn,document.body.offsetHeight, "450px"); // Ventana de login...
				scrollTo(300,100);
				
			//alert(document.forms["frmLogin"].elements["url_referer"].value);
			//document.forms["frmLogin"].elements["photo"].value=photoID;	
			//alert(document.forms["frmLogin"].elements["photo"].value);
			//document.forms["frmLogin"].elements["url_recommend"].value=urlReturn;
			//alert(document.forms["frmLogin"].elements["url_recommend"].value);	
			//document.getElementById("boxLogin").name="boxLogin";
			//alert(document.getElementById("boxLogin").name);
			
		}
		//alert(goTo)
		//alert(document.forms["frmLogin"].elements["url_referer"].value);	
	}
	
	function ponURLScore2 (numScore,photoID,curPage,newScore,photoRate,isLogged,yBoxPosition,ptgXBoxPosition,goTo,urlReturn,subitem) {	
		var radioBtn;
		var newUrl;
		if (isLogged==1) {		
			if (goTo==1) {
				radioBtn='Score'+numScore+'_'+subitem; 
				newUrl = 'index_comments_dovote.aspx?Photo='+photoID+'&curPage='+curPage+'&newScore='+newScore+'&photoRate='+photoRate+'&cmdVotar=1&url_return='+urlReturn+'&ancla=anchScore'+subitem;
				document.getElementById(radioBtn).href= newUrl
			} 
		}
	
	}
	
	
	function validaPostComment(forma) {
		var comment = '';
		var errores = '';
		comment = forma.txtComment.value.replace(/^\s*|\s*$/g,"");
		if (comment=='') { 
			forma.txtComment.value='';
			errores += '+ Ingresa un comentario';
		}
		if (errores=='') {forma.submit();}
		else {alert(errores);}
	}

	function validaPostComment2(forma,subitem) {
	
		var comment = '';
		var errores = '';
		comment = document.getElementById("txtComment"+subitem).value.replace(/^\s*|\s*$/g,"");
		if (comment=='') { 
			document.getElementById("txtComment"+subitem).value='';
			errores += '+ Ingresa un comentario';
		}
		
		if (errores=='') {
				//document.getElementById("frmComment").submit();
				forma.submit();
			}
		else { 
			alert(errores);
		}		
	}