function setLinks(){
	var links = document.getElementsByTagName('a');
	for (var i=0;i<links.length;i++){
	 	if(links[i].className == 'external'){
		links[i].onclick = function(){window.open(this.href,'','');return false}
		}else if(links[i].className == 'contact'){
	    links[i].onmouseover = function(){setContact(this.id);return false} 
		links[i].onfocus = function(){setContact(this.id);return false}
		}else if(links[i].className == 'archived_years'){
		links[i].onclick = function(){block(this.title);return false}
		}
	}
} 
function setContact(adr) {
var obj = document.getElementById(adr);
	if (obj) {
		adr = (adr == 'w') ? 'webmaster' : 'info';
		var dmn = 'sevencolors.org';
		obj.href = 'mailto:' + adr + '@' + dmn;
	}
	return true;
}
function close_arch(){
var d = document.getElementsByTagName("dl");
for(var i=0;i<d.length;i++){
if(d[i].className == 'years_list')
d[i].style.display = 'none'; 
 }
}
var supported = (document.all || (document.getElementById && !window.opera));

function block(i){
	if(!supported)return;	//added by A.Bianchini
	var x = document.getElementById(i);
	with(x.style)
	{
	display == 'none' ? display = 'block' : display = 'none';
	}
	}
function go_home(){
var h = document.getElementById('header');
if(!h || window.location == "http://sevencolors.org/" || window.location == "http://sevencolors.org/index.php" || window.location == "http://sevencolors.org/index.htm" || window.location == "http://www.sevencolors.org/" || window.location == "http://www.sevencolors.org/index.php" || window.location == "http://www.sevencolors.org/index.htm") return;
h.setAttribute('title','web design - opinions - art - life');
h.onmouseover = function(){this.style.cursor = "pointer";return false};
h.onclick = function(){window.location = "http://sevencolors.org";return false};
}
function go_studies(){
var s = document.getElementById('studies_page_header');
if(!s) return;
s.onmouseover = function(){this.style.cursor = "pointer";return false};
s.onclick = function(){window.location = "http://sevencolors.org/index.htm#studies_div";return false};
}
function jsonFlickrApi(rsp){
	if (rsp.stat != 'ok') return;
	    var div = document.createElement('div');
		div.setAttribute('id','photos_wrapper');
		var div2 = document.createElement('div');
		div2.setAttribute('id','photos');
	for (var i=0; i<rsp.photos.photo.length; i++){
		var p = rsp.photos.photo[i];
		var a = document.createElement('a');
		a.setAttribute('href','http://www.flickr.com/photos/13067897@N00/'+p.id+'/');
		a.setAttribute('title',p.title);
		var img = document.createElement('img');
		img.setAttribute('src','http://farm'+p.farm+'.static.flickr.com/'+p.server+'/'+p.id+'_'+p.secret+'_t.jpg');
		img.setAttribute('alt',p.title);
		a.appendChild(img);											
		div2.appendChild(a);
	}
	var target = document.getElementById('badge');
	if(!target) return;
	div.appendChild(div2);
	target.appendChild(div);
}
 function call_flickr(){
    var newScript = document.createElement('script');
	newScript.setAttribute('src','http://api.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&api_key=af7c02f8faf56ab8f8614b194a71f46b&user_id=13067897%40N00&per_page=8&page=1&format=json&callback=jsonFlickrApi');
	var obj = document.getElementById('write');
	if(!obj) return;
	obj.appendChild(newScript);
}
window.onload = function(){setLinks();close_arch();go_home();go_studies();call_flickr()};