
function goto(link){
	window.location.href = 'http://'+ window.location.host + link;
}

function option(id){
	if(document.getElementById(id).style.display == 'none') document.getElementById(id).style.display='block'; 
	else document.getElementById(id).style.display='none';
}

function chowaj(id){
	document.getElementById(id).style.display='none';
}

function pokaz(id){
	document.getElementById(id).style.display='block';
}

function chg2fota(id,typ)
{
	var img = document.getElementById('big');
	img.src = '/img/ajax-loading.gif';
	var url = "/inc/ajax_chg2fota.php";
	var params = "id=" + id + "&typ=" + typ;
	startPOSTRequest(url, params, chg2fota_onComplete, chg2fota_onEnd);     
}

function chg2fota_onComplete(responseText, responseXML){
	var tab = responseText.split(';:xxx:;');
	var img = document.getElementById('big');
	var imgsmall = document.getElementById('idp_'+tab[2]);
	var previmgsmall = "idp_" + document.getElementById('idpp').value;
	
	img.src = tab[1];
	if(document.getElementById(previmgsmall)) document.getElementById(previmgsmall).style.border = 'solid 1px #0295e0';
	imgsmall.style.border = 'solid 1px #000';
	
	document.getElementById('idpp').value = tab[2];

}

function chg2fota_onEnd(){
}

function externalLinks()
{
	if (!document.getElementsByTagName) return;

	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) 
	{
		var anchor = anchors[i];
		var relvalue = anchor.getAttribute("rel");

		if (anchor.getAttribute("href")) 
		{
			var external = /external/;
			var relvalue = anchor.getAttribute("rel");
			if (external.test(relvalue)) { anchor.target = "_blank"; }
		}
	}
}
window.onload = externalLinks;

