function pishitepisma(whe, who) {window.open('mailto:'+who+'@'+whe, '_top')}

function hide(){
		
		var p = document.getElementsByTagName ("DIV");
			for (i=0; i<p.length; ++i)
				if (p[i].className == "popup")
					p[i].style.display="none";
	}

function popup(id){
		
		if(document.getElementById(id).style.display=='block'){
			hide();
		}else{
			hide();
			document.getElementById(id).style.display='block';
		}
	
	}
	
function processStateChange(){
  if (request.readyState == 4){
	contentDiv = document.getElementById(dest);
	if (request.status == 200){
		response = request.responseText;
		contentDiv.innerHTML = response;				
	} else {
		contentDiv.innerHTML = "Error: "+request.status;
	}
  }
}		
var request;
var dest;
function loadHTML(URL, destination){
	dest = destination;
	if(window.XMLHttpRequest){
		request = new XMLHttpRequest();
		request.onreadystatechange = processStateChange;
		request.open("GET", URL, true);
		request.send(null);
	}
	else{
		if (window.ActiveXObject) {
			request = new ActiveXObject("Microsoft.XMLHTTP");
			if (!request) request = new ActiveXObject("MSxml2.XMLHTTP");
			if (request) {
				request.onreadystatechange = processStateChange;
				request.open("GET", URL, true);
				request.send();
			}
		}
	}
}
function show(name,id) {
	var x,y;
	var test1 = document.body.scrollHeight;
	var test2 = document.body.offsetHeight;
	if (test1 > test2) {
		x = document.body.scrollWidth;
		y = document.body.scrollHeight;
	}
	else {
		x = document.body.offsetWidth;
		y = document.body.offsetHeight;
	}
	if(navigator.appName != "Microsoft Internet Explorer"){
		document.getElementById(name+id).style.height=y-document.body.scrollTop;
		document.getElementById(name+id).style.padding=document.body.scrollTop+"px 0px 0px 0px";
		document.getElementById(name+id).style.width='100%';
	}
	else{
		document.getElementById(name+id).style.height=y;
		document.getElementById(name+id).style.padding=document.body.scrollTop+20+"px 0px 0px 0px";
		document.getElementById(name+id).style.width=x;
	}
	loadHTML('http://tula-upak.ru/photo.php?photo='+id+'&name='+name,name+id);
	document.getElementById(name+id).style.display='block';		
}	
function zagar(id){
	document.getElementById(id).src ="img/"+id+".jpg";
}
function tushit(){
	for(i=1;i<7;i++){
		document.getElementById("z"+i).src ="img/pixel.png";
	}

}
var preload = new Array(7);
for(i=1;i<7;i++){
	preload[i] = new Image;
	preload[i].src ="img/z"+i+".jpg";
}
