// JavaScript Document
function TotalSelected(f,textbox_name,row_checkbox_alias,tot_item)
{
	var count = f.elements.length;
	var pageitem = tot_item;
	All = textbox_name;
	CheckAll = document.getElementById(All);

	if(CheckAll.checked == true)
	{
		for(var i=0;i<pageitem;i++)
		{
			nameId = row_checkbox_alias+i;
			temp = document.getElementById(nameId);
			if(temp.disabled != true)
			{
				temp.checked = true;
			}
		}
	}
	else if(CheckAll.checked == false)
	{
		for(var i=0;i<pageitem;i++)
		{
			nameId = row_checkbox_alias+i;
			temp = document.getElementById(nameId);
			if(temp.disabled != true)
			{
				temp.checked = false;
			}
		}
	}
}

/**********************************************************************************************/

function popUpWindow1(URLStr, left, top, width, height,IsResizable)
{ 
	/*x = document.getElementById(extraParam);
		myString = x.src;
		splitString = myString.split("/");
		imagename=splitString[6];
		newsplitString = imagename.split(".");
		
		myRegExp = newsplitString[0] ;
		newmyRegExp = newsplitString[0]+"_big" ;
		newString = myString.replace(myRegExp,newmyRegExp);
		URLStr=URLStr+"&image_big_path="+newString;
		
	  	if(popUpWin)
	  	{
	    	if(!popUpWin.closed) popUpWin.close();
	  	}
	  
	 		popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');*/
		
		 /*if(popUpWin)
		 {
		    if(!popUpWin.closed) popUpWin.close();
		 }*/

			day = new Date();
			id = day.getTime();
			
			if (!width) width = 700;
			if (!height) height = 500;
	
			if (isNaN(parseInt(width))) width = 700;
			if (isNaN(parseInt(height))) height = 500;	
		
			width	 = parseInt(width);
			height = parseInt(height);
			
		
			LeftTemp = screen.width - width;
			left = (screen.width - width) / 2;
			TopTemp = screen.height - height;	
			top = (screen.height - height) / 2;
			
popUpWin =  open(URLStr, id, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable='+IsResizable+',copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'')
}

function ConfirmAction(Message)
{
	if (confirm(Message))	
	{
		return true;
	}
	else
	{
		return false;	
	}		
}

var win=null;
function mostrarimagen(url_imagen,ancho,alto,alto_ventana,titulo){
 	var img = new Image();
 	img.src = url_imagen;
	win=window.open('','','width='+ancho+',height='+alto_ventana+',scrollbars=no,resizable=1,toolbar=0');
	win.document.write ('<html>\n');
	win.document.write (' <head>\n');
	win.document.write ('  <title>'+titulo+'</title>\n');
	win.document.write (' </head>\n');
	win.document.write (' <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">\n');
	win.document.write ('  <img src="' + url_imagen + '" height='+alto+' width='+ancho+'>\n');
	win.document.write (' </body>\n');
	win.document.write ('</html>\n');	
}

