function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';

  cookie_str = document.cookie;
  cookie_str.toString();

  pos_start  = cookie_str.indexOf(name);
  pos_end    = cookie_str.indexOf('=', pos_start);

  cookie_name = cookie_str.substring(pos_start, pos_end);

  pos_start  = cookie_str.indexOf(name);
  pos_start  = cookie_str.indexOf('=', pos_start);
  pos_end    = cookie_str.indexOf(';', pos_start);
  
  if (pos_end <= 0) pos_end = cookie_str.length;
  cookie_val = cookie_str.substring(pos_start + 1, pos_end);
  if (cookie_name == name && cookie_val  == "done")
    return;

  w=window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
  w.focus();
}

/*

Utilisation :
<a href="javascript:open_window('win', 'maison_natale.html', 300, 100, 400, 550, 0, 0, 0, 0, 0)" target="_self" 
 title="Maison natale de Nikolaļ Kouzmine">maison natale</a>

*/


function link_to_location(linkId, htmlLinkA, htmlLinkNoA, locationId, htmlLocation) 
{
  this.linkId = linkId;
  this.htmlLinkA = htmlLinkA;
  this.htmlLinkNoA = htmlLinkNoA;
  this.locationId = locationId;
  this.htmlLocation = htmlLocation;
}



var imgAttributes = ["src","width","height","alt","title","border","vspace","hspace"] //"border","vspace","hspace","style"]; 

function displayImageToLocation(objectName,locationName) {
	copyAttributesToLocation(objectName,locationName,imgAttributes);
}

function copyAttributesToLocation(objectName,locationName,attributes) {
	var location = eval("document['"+locationName+"']");
	for (var i=0; i<attributes.length ; i++)
	{
		attribute = attributes[i];
		eval("location."+attribute+" = "+objectName+"."+attribute);
	}
}

function getImageFromLocation(locationName,objectName) {
	copyAttributesFromLocation(locationName,objectName,imgAttributes);
}


function copyAttributesFromLocation(locationName,objectName,attributes) {
	var location = eval("document['"+locationName+"']");
	for (var i=0; i<attributes.length ; i++)
	{
		attribute = attributes[i];
		eval(objectName+"."+attribute+" = "+"location."+attribute);
	}
}

function copyImgAttributes(origin,destination) {
	copyAttributes(origin,destination,imgAttributes);
}


function copyAttributes(origin,destination,attributes) {
	for (var i=0; i<attributes.length ; i++)
	{
		attribute = attributes[i];
		eval(destination+"."+attribute+" = "+origin+"."+attribute);
	}
}




/*

function open_popup(file,window,left,top,width,height) 
{
     ff=window.open(fichier,window,"width="+width+",height="+height+",left="+left+",top="+top+",scrollbars=no,resizable=no,menubar=no,status=no,toolbar=no,location=no") 
     ff.focus();
}


<a href="maison_natale.html" target="popup" 
onClick="scripts.open_popup(this.href,this.target,0,0,110,550);return false" title="Maison natale de Nikolaļ Kouzmine">maison natale</a>
*/
