//<![CDATA[

function showHeader ()
	{
	var id = parseInt(document.getElementById('iSequence').value);

	if (typeof(id) == 'undefined' || id == 0 || id > 4) {
		id = 1;
	}
		
	if (id < 4) {
		document.getElementById('iSequence').value = id + 1;
	}
	else {
		document.getElementById('iSequence').value = 1;
	}
	//alert(document.getElementById('iSequence').value);

	httpHeader = getXmlHttpObject();
	httpHeader.open("POST", "portfolio/list-header.php",true);
	httpHeader.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

	httpHeader.onreadystatechange=function() {
		if (httpHeader.readyState==4) {
			document.getElementById('brandbox').innerHTML = httpHeader.responseText;
			setTimeout("showHeader()", 5000);
			}
		}
	httpHeader.send('id='+id);
	}

function showPortfolo(cat, row)
	{
	var num = document.getElementById('iNum_' + cat).value;
	if (num > 1)
		{
		for (i = 1; i <= num; i++)
			{
			if (i == row)
				document.getElementById('num_' +cat+ '_' + i).style.color = '#000';
			else
				document.getElementById('num_' +cat+ '_' + i).style.color = '#8ac2e6';
			}
		}
		if (document.getElementById('sImg_' +cat+ '_' + row).value != '')
			{
			document.getElementById('sImg_' +cat).style.backgroundImage = 'url(portfolio/images/'+document.getElementById('sImg_' +cat+ '_' + row).value+')';
			}

		if (document.getElementById('sComment_' +cat+ '_' + row).value != '')
			{
			document.getElementById('sComment_' +cat).innerHTML = document.getElementById('sComment_' +cat+ '_' + row).value;
			}
	}

function init (idPage)
	{
	http = getXmlHttpObject();
	http.open("POST", "portfolio/list.php",true);
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

	http.onreadystatechange=function() {
		if (http.readyState==4) {
			document.getElementById('portfolio-list').innerHTML = http.responseText;
			}
		}
	http.send('idPage='+idPage);
	}

function getXmlHttpObject()
	{
	var xmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	 try {
	  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	 } catch (e) {
	  try {
	   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (E) {
	   xmlhttp = false;
	  }
	 }
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined')
		{
		xmlhttp = new XMLHttpRequest();
		}
	return xmlhttp;
	}
// ]]>
