/*
	copyright HotPrint 2009
*/
function pishitepisma(whe, who) {window.open('mailto:'+who+'@'+whe, '_top')}

function show(imgsrc){
	change_img(imgsrc);		
}

function change_img(id_img){
	left_position();
	target = new Image();
	target.src = "img/usr/medium_gphoto"+id_img;
	document.getElementById('img1').src=target.src;
	makeRequest('calendars.xml', id_img);
	document.getElementById("fly_div").style.visibility="visible";
	fadeOpacity.back("fly_div");
	scroll_it(); //вдруг страница была проскролена - надо фотку спозиционировать		
}

function hide(){
	//document.getElementById("fly_div").style.visibility="hidden";
	fadeOpacity("fly_div", 'oR2');
	setTimeout('document.getElementById("fly_div").style.visibility="hidden"',500);
	//fadeOpacity("fly_div", 'oR2');	
	//document.getElementById("fly_div").style.visibility="hidden";
}




	var http_request = false;

	function makeRequest(url, req_id) {
		http_request = false;
		if (window.XMLHttpRequest) { // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType) {
				http_request.overrideMimeType('text/xml');
			}
		} else if (window.ActiveXObject) { // IE
			try {
				http_request = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					http_request = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {}
			}
		}

		if (!http_request) {
			alert('Giving up :( Cannot create an XMLHTTP instance');
			return false;
		}
		http_request.onreadystatechange = function() { alertContents(req_id); };
		
		http_request.open('GET', url, true);
		http_request.send(null);
	}

	function alertContents(item_id) {
		if (http_request.readyState == 4) {
			if (http_request.status == 200) {
				var xmldoc = http_request.responseXML;
				var root_node = xmldoc.getElementsByTagName('item').item(item_id);
				document.getElementById("huy").innerHTML=root_node.firstChild.data;
			} else {
				alert('There was a problem with the request.');
			}
		}
	}

// Определение высоты видимой части страницы
function windowHeight() {
	  var de = document.documentElement;


	  return self.innerHeight || ( de && de.clientHeight ) || document.body.clientHeight;
}


function toggle_show(id) {
    document.getElementById(id).style.display = document.getElementById(id).style.display == 'block' ? 'none' : 'block';
}
function terminate(id, inside_text) {
    document.getElementById(id).style.visibility = document.getElementById(id).style.visibility == 'visible' ? 'hidden' : 'visible';
	document.getElementById("span_alert").innerHTML = inside_text;
}


