function getBase()
{
	var baseTag = document.getElementsByTagName("base");
	for(var i=0; i<baseTag.length; i++)
		return baseTag[i].href;
}

function RenderEmail(f1, f2)
{
  var lnk = f1 + "@" + f2;
  document.write('<a href="mailto:' + lnk + '">' + lnk + '</a>');  
}

function PopupImage(image)
{
	PopupImage2(image, 650, 600, "imagepopup", false);

}

function Popup(url, width, height, name)
{	
	var win_width = width
	var win_height = height
	var loc_left = (screen.width/2) - (win_width/2)
	var loc_top = (screen.height/2) - (win_height/2)
	var style = "top=" + loc_top + ", left=" + loc_left +
	"toolbar=no,location=no,directories=no," + 
	"status=no,menubar=no,scrollbars=yes," + 
	"resizable=yes,copyhistory=no,width=" + win_width +
	",height=" + win_height
	
	var newwindow = window.open(url,name,style);
	if (window.focus) {newwindow.focus()}
}

function PopupImage2(image, width, height, name, external)
{
    var url = getBase() + "front/templates/imagepopup.aspx?image=" + image + "&external=" + external;
	//var newwindow = window.open(image,"imagepopup","resizable=yes,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,fullscreen=no,dependent=no,width=650,height=600");
	//if (window.focus) {newwindow.focus()}
	
	var win_width = width
	var win_height = height
	var loc_left = (screen.width/2) - (win_width/2)
	var loc_top = (screen.height/2) - (win_height/2)
	var style = "top=" + loc_top + ", left=" + loc_left +
	"toolbar=no,location=no,directories=no," + 
	"status=no,menubar=no,scrollbars=yes," + 
	"resizable=yes,copyhistory=no,width=" + win_width +
	",height=" + win_height
	
	var newwindow = window.open(url,name,style);
	if (window.focus) {newwindow.focus()}
	
}

function PopupImageR(image, name, style)
{
	PopupImage2(image, 650,600, name, true);  
}

function PrinterFriendly() 
{ 
   var sOption="toolbar=no,location=no,directories=no,menubar=no,"; 
         sOption+="scrollbars=yes,width=750,height=600,left=100,top=25"; 
   
   var winprint=window.open("/front/templates/print.aspx","Print",sOption); 
 
   winprint.focus(); 
}

function PrinterFriendlyR() 
{ 
   var sOption="toolbar=no,location=no,directories=no,menubar=no,"; 
         sOption+="scrollbars=yes,width=750,height=600,left=100,top=25"; 
   
   var winprint=window.open("/front/templates/realiteta/print.aspx","Print",sOption); 
 
   winprint.focus(); 
}

/*------------------------------------------------------------
 Document Text Sizer- Copyright 2003 - Taewook Kang.  All rights reserved.
 Coded by: Taewook Kang (txkang.REMOVETHIS@hotmail.com)
 Web Site: http://txkang.com
 Script featured on Dynamic Drive (http://www.dynamicdrive.com)
 
 Please retain this copyright notice in the script.
 License is granted to user to reuse this code on
 their own website if, and only if,
 this entire copyright notice is included.
--------------------------------------------------------------*/
//Specify affected tags. Add or remove from list:
var tgs = new Array( 'div', 'table', 'td','tr', 'font', 'font face', 'p', 'h1', 'h2', 'h3', 'span' );

//Specify spectrum of different font sizes:
var szs = new Array( '9px','10px','12px','14px','16px','18px','20px','22px' );
var startSz = 2;

function ts( trgt,inc ) {
 if (!document.getElementById) return
 var d = document,cEl = null,sz = startSz,i,j,cTags;
 
 sz += inc;
 if ( sz < 0 ) sz = 0;
 if ( sz > 7 ) sz = 7;
 startSz = sz;
  
 if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

 cEl.style.fontSize = szs[ sz ];

 for ( i = 0 ; i < tgs.length ; i++ ) {
  cTags = cEl.getElementsByTagName( tgs[ i ] );
  for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
 }
}

function addBookmark(title,url) {
if (window.sidebar) { 
window.sidebar.addPanel(title, url,""); 
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}

function deleteValue(elem)
{
		elem.value="";
}


function LangDropChange(location)
{
	if((location==-1) || (location==''))
		return;
	window.location=location;
}

function ShowPhotoGallery(el, folder, file, start, end)
{
  var og = document.getElementById(el);
  og.style.display="block";
  //og.style.filter="";
  
  //alert(folder + " " + file);
  var so = document.getElementById("smallimg"); //.innerHTML = folder;
  var imgs = "";
  for (var i=start; i<=end; i++)
  {
     var newfile = i + ".jpg";
     var clickprm = "'" + el + "','" + folder + "','" + newfile + "'," + start + "," + end;
	 imgs += "<a href='javascript:void(0)' onclick=\"javascript:ShowPhotoGallery(" + clickprm + ");\"><img class='img' src='" + folder + "size1/" + i + ".jpg'></a>";
  }
  
  so.innerHTML = "<img class='img' src='" + folder + "size3/" + file + "'>";
  so.innerHTML += "<br>" + imgs;
}
