function loadPic(id,text) {
    var hoverable = $("#bigPic_hover");
    var bigPic = $("#bigPic");
    hoverable.hide();
    var src = $("#"+id).attr("src");
    bigPic.html('<img src="'+src+'" width="150">');
    var bigPicWidth = bigPic.width();
    var bigPicOffset =  bigPic.offset();

    hoverable.html(text);
    hoverable.css({
       "left" : (bigPicOffset.left) + "px",
       "top"  : (bigPicOffset.top) + "px",
       "width" : bigPicWidth + "px"
    });
    if (text) {
        hoverable.show('slow');
    }
}

function getText(fromid,toid){
	var docid = document.getElementById(fromid);
	var textid = document.getElementById(toid);
	
	if (docid.innerHTML != "") {

		textid.innerHTML = docid.innerHTML;
		textid.innerHTML = textid.innerHTML.replace('<pre>','');
		textid.innerHTML = textid.innerHTML.replace('</pre>','');
	}
	
}


// Textarea form�z�
function format(txtarea,type){
	
	txtarea = document.getElementById(txtarea);
	if (txtarea.setSelectionRange) {

		  startPos = txtarea.selectionStart;
		  endPos = txtarea.selectionEnd;
		  before = txtarea.value.substr(0, startPos);
		  selected = txtarea.value.substr(txtarea.selectionStart, (txtarea.selectionEnd - txtarea.selectionStart));
		  if (selected != "" && unaccepted(selected)) {
			  after = txtarea.value.substr(txtarea.selectionEnd, (txtarea.value.length - txtarea.selectionEnd));
			  txtarea.value = before + "["+type+"]" + selected + "[/"+type+"]" + after;
		  }
	} else {
		if (selectedText != "") {
			var selectedText = document.selection.createRange().text;
			if (unaccepted(selectedText)) {
				var newText = "["+type+"]"+ selectedText +"[/"+type+"]";
				document.selection.createRange().text = newText;
			}
		} 
	}
} 

function unaccepted(selection) {
	tags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]');
	for(i=0;i<tags.length;i++) {
		if (selection == tags[i]) {
			return false;
		}
	}
	return true;
}



$('#achivement').hide();
$('#achivement').css('width','0px');
$('#achivement').css('height','0px');
function fireAchivement(title,description,img) {
	$('#achivement').html('<img src="t_contents/owp/'+img+'" alt="'+title+'" title="'+title+'"');
	
	width = screen.width;
	height = screen.height;
	imgwidth = 370;
	imgheight = 170;
	posx = (width - imgwidth) - 100;
	posy = (height - imgheight) - 180;

	$('#achivement').css('position','fixed');
	$('#achivement').css('top',posy);
	$('#achivement').css('left',posx);
	$('#achivement').css('width','370px');
	$('#achivement').css('height','170px');	
	$('#achivement img').slideDown("slow");
	setTimeout('hideAchivement()',5000);
}

function hideAchivement(){
	$('#achivement img').fadeOut('slow');
	$('#achivement').css('width','0px');
	$('#achivement').css('height','0px');
	$('#achivement').html('');
}


function download(surl) {
	window.open('http://otherworld.hu/t_components/ajax/standalone/Download.php?f='+surl,'dload','width=300,height=300');

}

var changeContent = "";




