var colSeparator = "\t";
var out = "";

function fillContent(id, divHeight){
   
    var content = "";
	

	//get data
	if(navigator.appName=="Microsoft Internet Explorer"){
		var objHTTP = new ActiveXObject("Microsoft.XMLHTTP");
		if (objHTTP.readyState == 4 || objHTTP.readyState == 0){
			objHTTP.Open('GET','php/_portfolio.php?id='+id,false);
			objHTTP.Send();
			content=objHTTP.responseText;
		}
	}
	else{
		objHTTP = new XMLHttpRequest();
		if (objHTTP.readyState == 4 || objHTTP.readyState == 0){
			objHTTP.open('GET','php/_portfolio.php?id='+id,false);
			objHTTP.send(null);
			content = objHTTP.responseText;
		}
	}
	
	rows = content.split(colSeparator);

	out = '<div class="portofolio-placeholder">';
	
	//scoate comenturile pentru a adauga link la elementele din portofoliu (in detrimentul SEO)
	/*if (rows[3]){
		out += '<a href="' + rows[3] + '" title="' + rows[1] + '" target="_new">';
		out += '<img src=" pix/portofolio/' + rows[0] + '.png" alt="' + rows[1] + '"/>';
		out += '</a></div>';
	}
	else{*/
		out += '<img src=" pix/portofolio/' + rows[0] + '.png" alt="' + rows[1] + '" height="92" width="168" /></div>';
	//}
	
	/*if (rows[3])
		out += '<h1><a href="' + rows[3] + '" title="' + rows[1] + '" target="_new">' + rows[1] + '</a></h1>';*/
	//else
		out += '<h1>' + rows[1] + '</h1>';
		
	out += rows[2];
	
	//smooth scroll
	new SmoothScroll({duration:400}).scrollTo(0,300);

	//add content
	setTimeout("replaceContent('"+ divHeight +"')",500);
}

function replaceContent(divHeight){
 	if(!parseInt(divHeight) || parseInt(divHeight) < 1)
		return;
	
	containerDiv = document.getElementById('content-portofolio');
	containerDiv.innerHTML = out;

	//div size
	containerDiv.style.height = divHeight + 'px';

}