/************************************************************************************************************************************/ 
 function Resizer(ancho,alto)
 {
	window.resizeTo(ancho, alto);
 }
  

 function GetStatus(STATUS)
 {
	for (var i=0; i<3; i++){
	 if(STATUS == "True" )
	 {
		return src = "Images/ok.gif";
	 }
	 else
	 {
		return src = Images/disabled.gif;
		document.reload();
	 }
	 }
 }

/****************************************************************************************************************************************/ 
 /* 
 Confirma la baja del item y como parametro espera el id y la descripcion para mostrar 
 Necesita tener en la pagina un 
 hidden con name ID_BORRAR
 y un boton para el postback  llamado BtnBorrar
  */
/****************************************************************************************************************************************/ 

 function ConfirmBorrar(ID,DESCRIP)
  {
    oRta = confirm("Esta seguro que desea borrar \"" + DESCRIP + "\" ?");
    if(oRta)
    {
       Form1.ID_BORRAR.value = ID;
      __doPostBack('BtnBorrar','');
    }    
      
  }

/****************************************************************************************************************************************/ 

function LINKOVER(control)
{
  control.style.color = "red";
}

function LINKOUT(control)
{
  control.style.color = "white";
}

var win= null;
function AbrirPop(URL,ALTO,ANCHO)
{
 var winl = (screen.width-ANCHO)/2;
 var wint = (screen.height-ALTO)/2; 
 // document.location = URL;
 //window.open(URL,'','toolbar=no,heigth=200,width=200');
 window.open(URL,'',"height=" + ALTO + ",width=" + ANCHO + ",status=yes,toolbar=no,menubar=no,location=no,status=no,left=" +winl+ ",top=" +wint+ "");
// showModalDialog(URL,"","toolbar=no");
}

function ADDError()
{
	document.location = "Edit_Error.aspx";
	// window.open(URL,'','toolbar=no,heigth=500,width=400');
 }
 
 
/****************************************************************************************************************************************/ 
 /* Esta funcio cierra la ventana     */
/****************************************************************************************************************************************/ 
 function cerrar(URL)
		{
				window.close(); 
		}



/****************************************************************************************************************************************/		
 function ondeleteclick()
   {
        return confirm("Are you sure you want to delete this?")
   }
 
   for(i=0;i<document.all.length;i++)
   {
       var x = document.all.item(i)
       if(x!=null && x.name !=null &&  x.name.indexOf("TestGrid")==0)
       {
           if(x.value=="Delete")
                x.onclick = ondeleteclick
           continue;
      }
 }
 /**********************************************************************************/
function RotarImagen(ObjetoImagen, id_Object , Posicion , TipoPermiso)
{
		var strAux = ObjetoImagen.src;
		var strTipoPermisoNuevo = "";
		
		if (strAux.indexOf("disabled.gif") > 0 )
		{
		 ObjetoImagen.src = "images/ok.gif";
		 strTipoPermisoNuevo = "images/ok.gif";
		}
		else
		{
			if (strAux.indexOf("ok.gif") > 0)
				{
					 ObjetoImagen.src = "images/Warning1.gif";
					 strTipoPermisoNuevo = "images/Warning1.gif";
				} 
			else
				{
					strTipoPermisoNuevo = "images/disabled.gif";
					 ObjetoImagen.src = "images/disabled.gif";
					 
					
				}
		}
		
		
	    var oPermiso = strTipoPermisoNuevo.split("/");
	    var Final =oPermiso[oPermiso.length - 1];
	   
		
		
		if( document.all("ID_UPDATE").value.indexOf(";" + id_Object  + "-" + Posicion) < 0)		
		   document.all("ID_UPDATE").value = document.all("ID_UPDATE").value + ";" + id_Object  + "-" + Posicion + "-" + Final ;
		else  
		{
	
		  var str=  document.all("ID_UPDATE").value;
		  var Medio = str.indexOf(";" + id_Object  + "-" + Posicion);
		  var Fin = str.indexOf(";" , Medio + 1); 		 
		
		   
		   if(Fin == -1)
		   {
		     str = str.substring(0,Medio);
		     
		   }
		   else
		   {
		     var str1 = str.substring(Medio, Fin);
		     str = str.replace(str1 , "");
		     	   
		   }
		   
		   str = str + ";" + id_Object  + "-" + Posicion + "-" + Final ;
		  
		  document.all("ID_UPDATE").value = str;
		  
		 
		}

	}
/**********************************************************************************/
function Blok() 
{ 
		//debugger; 
			document.all("Button1").disabled = true; 
			document.all("Button2").disabled = true; 
			document.all("DdlAplicaciones").disabled = true; 
}

/****************************************************************************************/
/**** A Espaņol *****/

function CambiarURLDetalleApartamentoEsp(url){

url = document.location.href ;                          
partes = url.split('/');                                                   
var strUrl=window.location.href;
var UrlNueva = "http://www.rossanoargentina.com.ar/"+ partes[partes.length-1];
window.location=UrlNueva;

}


///////////////////////////////////////////////////////////////////
////  a Ingles ************************************************/


                          
function CambiarURLDetalleApartamentoIng(url){
url = document.location.href ;                          
partes = url.split('/');                                                   
var strUrl=window.location.href;
var UrlNueva = "http://www.rossanoargentina.com.ar/IN/"+ partes[partes.length-1];
window.location=UrlNueva;

}
