$(document).ready(function(){
	
for(var i = 1; i<catalog.length; i++){
	//document.getElementById("right_scroll").innerHTML = catalog[1][3];
	//<img src="'+catalog[i][3]+'">
	if (catalog[i][3] == "/"){
		//alert(catalog[i][3]);
		$('#right_scroll').append('<div onclick="getFullPortfolio('+i+');" style="height: 90px; font-family: arial; font-size: 12px; color: #555; cursor: pointer; margin-bottom: 10px; margin-top: 5px;" align="center">'+catalog[i][7]+'<br><img width="26" src="'+catalog[i][4]+'"></div>');
	}
	if (catalog[i][4] == "/"){
		$('#right_scroll').append('<div onclick="getFullPortfolio('+i+');" style="height: 90px; font-family: arial; font-size: 12px; color: #555; cursor: pointer; margin-bottom: 10px; margin-top: 5px;" align="center">'+catalog[i][7]+'<br><img width="26" src="'+catalog[i][3]+'"></div>');
	}
	if (catalog[i][4] != "/"){
		if (catalog[i][3] != "/"){
		$('#right_scroll').append('<div onclick="getFullPortfolio('+i+');" style="height: 90px; border: 0px solid; ;font-family: arial; font-size: 12px; color: #555; cursor: pointer; margin-bottom: 5px; margin-top: 5px;" align="center">'+catalog[i][7]+'<br><img width="26" src="'+catalog[i][3]+'"> <img width="26" src="'+catalog[i][4]+'"></div>');
	}
	}
}

  });
  function getFullPortfolio(i){
  	document.getElementById("b_1").src = catalog[i][5];
	document.getElementById("b_2").src = catalog[i][6];
	document.getElementById("b_1").style.display = "";
	document.getElementById("b_2").style.display = "";
	document.getElementById("cat_title").innerHTML = catalog[i][7];
	document.getElementById("text1").innerHTML = document.getElementById("text_"+i).innerHTML;
	document.getElementById("text2").innerHTML = document.getElementById("text2_"+i).innerHTML;
	document.getElementById("text3").innerHTML = document.getElementById("text3_"+i).innerHTML;
	//alert(document.getElementById("text_"+i).value);
	document.getElementById("count").value = i;
	if(catalog[i][5] == "/"){
		document.getElementById("b_1").style.display = "none";
		document.getElementById("b_2").style.display = "";
	}
	if(catalog[i][6] == "/"){
		document.getElementById("b_2").style.display = "none";
		document.getElementById("b_1").style.display = "";
	}
	//$("#listp").fadeOut(0);
	document.getElementById("listp").style.display = "none";
	$("#full").fadeIn(200);
	
	document.getElementById("spec1").style.display = "none";
	document.getElementById("spec2").style.display = "";
	document.getElementById("spec2title").innerHTML = catalog[i][7];
  }
  	count = 1;
function aaa(dur){
	i = (catalog.length - 1) / 3;
	
	if (dur == "down") {
		if (i > count) {
			marg = -285 * count;
			goo(marg);
			count++;
		}
	}
	if (dur == "up") {
		if (2 <= count) {
			marg = marg + 285;
			goo(marg);
			count--;
			//alert(count)
		}
	}
}

function goo(marg){
	$("#right_scroll").animate({
				marginTop: marg
			}, 900);
}
	function go_right() {
		a = parseInt(document.getElementById("count").value)+1;
		if (document.getElementById("count").value < (catalog.length-1)){
			getFullPortfolio(a);
		}
	}
	function go_left() {
		a = parseInt(document.getElementById("count").value)-1;
		if (document.getElementById("count").value > 1){
			getFullPortfolio(a);
		}
	}
