<!-- 
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function setFieldValue(fieldRef, str) {
	obj = eval(fieldRef);
	if (obj.value == str) {
		obj.value = "";
	}
	else if (obj.value == "") {
		obj.value = str;
	}
}

function create_roll_overs(){

    var images = document.getElementsByTagName('IMG');
	var preloads = new Object();

	for (var i = 0; i < images.length; i++){
		
		var ImageOffSrc = images[i].src + "";
		var ImageOnSrc = ImageOffSrc.replace(/_zoff/g, "_zon");
		
		preloads['ImageOff_' + i] = new Image();
		preloads['ImageOff_' + i].src = ImageOffSrc;
		preloads['ImageOn_' + i] = new Image();
		preloads['ImageOn_' + i].src = ImageOnSrc;
		
		images[i].onmouseover = function(){this.src = this.src.replace(/_zoff/g, "_zon");}
		images[i].onmouseout = function(){this.src = this.src.replace(/_zon/g, "_zoff");}
		
	} 

}

// fetch a random image from a fiven list and display it

function display_random_image() {
	
	var dir="/images/general/featured_clients_top/"; //this is the folder where the images are to be found
	
	var images_list=new Array("top_client_1.jpg", "top_client_3.jpg", "top_client_4.jpg", "top_client_5.jpg", "top_client_6.jpg");
	var images_text=new Array("Forza Tesori", "DPMG", "Saptamana Romanilor", "Saptamana Romanilor", "Fondswerte Magazin");
	
	var images_count=images_list.length;

	random_choice= Math.round(Math.random()*(images_count-1));
	if (count>0) {
		var old_choice=random_choice;
		while (random_choice==old_choice) random_choice= Math.round(Math.random()*(images_count-1));
	}
	

	
	//now display the stuff in browser 
	
	
	var img_tag="<img src=\"" + dir + images_list[random_choice] + "\" alt=\"" + images_text[random_choice] +	"\" width=\"594\" height=\"75\" />"
	
	document.write(img_tag);;   
	count++;
							  
}

count=0;
random_choice=0;
curPicToDisplay="";

function moveover(txt) {
   window.status = txt;
   setTimeout("erase()",10);
}
function erase() {
   window.status="";
}


preloads = new Object(); //for preloading project images
prj_images_names=new Array(); //hold all images names
current_proj_image_index=0;

//function to show/link to all images corresponding to a project
function showProjectImages() {
	
	
	
	var imageExtension=MainImage.substring(MainImage.lastIndexOf(".")+1); //pictures' extension
	var imageRoot=MainImage.substring(0,MainImage.lastIndexOf(".")-1); //root name of the images
	
	for (i=2; i<=noImages; i++) { //preload the other images 
		preloads[i] = new Image();
		preloads[i].src = imageRoot+i.toString()+"."+imageExtension;
	}
	
	//show the perv, next.. images with links
	document.write('<div id="photosNavBar"><a href="javascript:changePic2(-1);" id="link_previous"><img id="img_prev" src="/images/en/buttons/previous_zoff.gif" width="60" height="15" border="0" /></a><a href="javascript:changePic2(1);"  id="link_next"><img src="/images/en/buttons/next_zoff.gif" id="NavBarNext"  border="0" /></a><a href="javascript:displayLargerImage();"><img src="/images/en/buttons/zoom_in.gif" width="16" height="15" id="NavBarZoom" border="0" /></a></div>');
	
	var image=document.getElementById('projImagePlaceHolder');
	image.onclick=function(){displayLargerImage();}
	if (noImages>=2) {
		current_proj_image_index=1;
		for (i=1; i<=noImages; i++) { //iterate the collection 
			
			var curPic;  //current pic to "process"
			if (i==1) var curPic=imageRoot+"n"+"."+imageExtension; else var curPic=imageRoot+i.toString()+"."+imageExtension;
			if (image.src.indexOf(curPic)!=0) {
			
			curPicToDisplay=curPic;
			
			prj_images_names[i]=curPic;
			}
		
		}
	
	var img_prev=document.getElementById('img_prev');
	img_prev.src='/images/en/buttons/previous_disabled.gif';
	var link_previous=document.getElementById('link_previous'); 
	
	
	link_previous.href='#';
	
	}
	
}



function displayLargerImage()	{ //display a popup with large version of the image
	
     var image=document.getElementById('projImagePlaceHolder');
	 var imageRoot=image.src.substring(0,image.src.lastIndexOf(".")); 
	 var imageExtension=image.src.substring(image.src.lastIndexOf(".")+1); //pictures' extension
	 
	 var popupImage=imageRoot+'_big.'+imageExtension;
	 
	 
	 var imgPreload=new Image(); imgPreload.src=popupImage; var width=imgPreload.width;  var height=imgPreload.height;
	 
	 Popup = window.open('','','toolbar=no,scrollbars=no,resizable=yes,width=300, height=400');
	 Popup.document.write('<html><BODY topmargin="0" marginheight="0" leftmargin="0" marginwidth="0">');
	if (width!=0)
		Popup.document.write('<img src="'+popupImage+'" width="'+width+'" height="'+height+'" border=0 />');
	else Popup.document.write('<img src="'+popupImage+'" width="'+400+'" height="'+300+'" border=0 />');
	 Popup.document.write('</BODY></html>');
	 
	 var NS = (navigator.appName=="Netscape")?true:false; 

	 iW = (NS)?Popup.innerWidth:Popup.document.body.clientWidth; 
     iH = (NS)?Popup.innerHeight:Popup.document.body.clientHeight; 
	 
	  width=Popup.document.images[0].width;
	  height=Popup.document.images[0].height;
	   
	 Popup.resizeBy(width-iW,height-iH);

	
}

function changePic(pic) { //change a picture
	var image=document.getElementById('projImagePlaceHolder');
	var id=pic.charAt(pic.lastIndexOf(".")-1);
	 var mybody=document.body;

	var strId;
	strId="h"+id;
	
	
	link=document.getElementById(strId); 
	link.style.color="gray";
	for (i=1; i<=noImages; i++) if ( i!=parseInt(id)) document.getElementById("h"+i.toString()).style.color=""; 
	
	image.src=pic;
	
}

function changePic2(direction) { //change a picture
	var image=document.getElementById('projImagePlaceHolder');
	
	 var mybody=document.body;

	
	var link_next=document.getElementById('link_next'); 
	var link_previous=document.getElementById('link_previous'); 
	
	var NavBarNext=document.getElementById('NavBarNext'); 
	var img_prev=document.getElementById('img_prev');
	
	
	
	if (current_proj_image_index==noImages-1) {
					NavBarNext.src='/images/en/buttons/next_disabled.gif';
					link_next.href='#';
					img_prev.src='/images/en/buttons/previous_zon.gif';
				}
				
	if (current_proj_image_index==2) {
		img_prev.src='/images/en/buttons/previous_disabled.gif';
		link_previous.href='#';
		NavBarNext.src='/images/en/buttons/next_zon.gif';
	}
	
	if (direction==1) {
			if (current_proj_image_index<=noImages-1) {
				//advance..
					
					link_previous.href='javascript:changePic2(-1);';
					img_prev.src='/images/en/buttons/previous_zoff.gif';
					current_proj_image_index++;
					image.src=prj_images_names[current_proj_image_index];	
				
				
			}
		}
		else
		{
			if (current_proj_image_index>1) {
				//go back..
				
					link_next.href='javascript:changePic2(1);';
					NavBarNext.src='/images/en/buttons/next_zoff.gif';
					
					current_proj_image_index--;
					image.src=prj_images_names[current_proj_image_index];	
				
				
			}
		} //end big if
	
	
	
}


function changeMailLinks(subject) { //make active any email address found in the current document

	
	var matches=subject.match(/([a-zA-Z0-9_\.]+)@(\w+)\.([a-zA-Z]+)/ig);
	var replacements=new Array();
	var result=''+subject;
	for (i in matches) {
			if ( i<=matches.length) {
				link="<a href='mailto:"+matches[i]+"'>"+matches[i]+"</a>";
				replacements[i]=link;
				
				var objRegex = new RegExp(matches[i],"i");
				//var s=
				result=result.replace(objRegex, replacements[i]);
			}
		
	}
	return result;
}
 

// -->