/* Required variables on parent page:
mCopyLink_1 
mCopyLink_2 
mCopyLink_HTML 
*/

function ViewFoto(vPK, vFK, vSmall){
	window.open("Foto.aspx?pk=" + vPK + "&small=" + vSmall + "&");
}

function FotoBrowser(vPK, vFK, vLngUser, vNewWindow){
	if (vNewWindow == 1){
		window.open("FotoBrowser.aspx?pk=" + vPK + "&fk=" + vFK + "&lng_user=" + vLngUser);
	}else{
		location.href = "FotoBrowser.aspx?pk=" + vPK + "&fk=" + vFK + "&lng_user=" + vLngUser;
	}
}

function EditSpecies(vPK, vLngUser){
	window.open("EditSpecies.aspx?pk=" + vPK + "&lng_user=" + vLngUser);
}

function EditFoto(vPK, vFK, vLngUser){
	window.open("EditFoto.aspx?pk=" + vPK + "&fk=" + vFK + "&lng_user=" + vLngUser);
}

function DeleteItem(vId) {
	if (confirm(m_deleted_alert)) {
		document.Form.hid_selected.value = vId;
		document.Form.hid_action.value = "delete";
		document.body.style.cursor="wait";
		document.Form.submit();
	}
}

function CopyLink(vType, vID,vTitle){
	document.Form.hid_clipboard.value = "#" + vType + "#" + vID + "#" + vTitle + "#";
	try {
		var Copied = document.Form.hid_clipboard.createTextRange();
		Copied.execCommand("Copy");
		//alert("Odkaz \n" + document.Form.hid_clipboard.value + "\n byl zkopirovan do schranky.")
		alert(ReplaceString(mCopyLink_1, "#", document.Form.hid_clipboard.value));
	}catch(exception){
		//alert("Chyba - odkaz \n" + document.Form.hid_clipboard.value + "\n se nepodařilo zkopírovat do schránky.")
		alert(ReplaceString(mCopyLink_2, "#", document.Form.hid_clipboard.value));
   	}
	document.Form.hid_clipboard.value = ""
}

function CopyLink_HTML(){
	var sTitle = new String;
	var sID = new String;
	
	//sTitle = window.prompt("Zadejte prosim URL adresu, kterou chcete vlozit:","");
	sTitle = window.prompt(mCopyLink_HTML,"");
	if (sTitle.length > 0) {
		if (sTitle.indexOf("http://") == -1){
			sID = "http://" + sTitle;
		}else{
			sID = sTitle;
		}
		CopyLink("A", sID, sTitle);
	}
}

function EditCurrentUser(vLngUser){
	var address="";
	var params="";
	params="directories=no,copyhistory=no,titlebar=yes,menubar=no,toolbar=no,location=no,status=yes,scrollbars=yes,resizable=yes,center=yes,width=605,height=480";

	address = "EditCurrentUser.aspx?lng_user=" + vLngUser + "&";
	window.open(address,"EditCurrentUser", params);
}

