
var euro = 0.8547;

var tab_image = new Array();
var tab_liens = new Array();
var tab_prix = new Array();

tab_image.push("14200/14230");
tab_liens.push("voyage/template/27-14230");
tab_prix.push(56);

tab_image.push("6100/6177");
tab_liens.push("affaires/template/2-6177");
tab_prix.push(67);

tab_image.push("17000/17064");
tab_liens.push("beaute/template/1-17064");
tab_prix.push(65);

//tab_image.push("5500/5546");
//tab_liens.push("art_photographie/template/40-5546");
//tab_prix.push(67);

function charger_template() {
	document.getElementById("template_zone").innerHTML = "&nbsp;";
	
	for (var i=0; i < tab_image.length; i++) {
		set_template(tab_image[i], tab_liens[i], Math.round(tab_prix[i]*euro*100)/100);
	}
}

function set_template(adr_image, liens, prix_euro) {
	
	var code = '<div id="template_accueil"><div class="screenshot"><a href="' + liens + '.html" target="_blank" title="kitgraphique image"><img src="http://images.templatemonster.com/screenshots/' + adr_image + '-m.jpg" alt="kitgraphique image" width="135" height="135"></a></div>';
	code += '<div class="details">';
	code += '<div class="formga"><a href="' + liens + '.html" target="_blank" title="kitgraphique prix"><b>' + prix_euro + ' &euro;</b></a></div>';
	code += '<div class="formdr"><a href="' + liens + '.html" target="_blank" title="kitgraphique details">Details</a></div>';
	code += '</div></div>';
		
	document.getElementById("template_zone").innerHTML += code;
}

function shoppingCart(idArticle) {
	var url = 'http://www.templatehelp.com/preset/cart.php?pr_code=xD9tqjt2494pz994zJz1KTOC0reLDy&act=add&templ='+idArticle+'&PHPSESSID=d732f71898bfaa32dd23b4b7bb2712a7';
	var hwnd = window.open(url, "cart", "resizable=yes, location=no, menubar=no, status=no, scrollbars=yes, width=800, height=600");
}

function get_tag(xml, nom) {
	if (xml.getElementsByTagName(nom).length > 0 && xml.getElementsByTagName(nom)[0].firstChild != null)
		return xml.getElementsByTagName(nom)[0].firstChild.nodeValue;
	return "";
}

function get_tag_html(xml, nom) {
	if (xml.getElementsByTagName(nom).length > 0 && xml.getElementsByTagName(nom)[0].firstChild != null)
		return xml.getElementsByTagName(nom)[0].firstChild.nodeValue;
	return "&nbsp;";
}

function get_tag_table(xml, nom) {
	var tab = new Array();
	if (xml.getElementsByTagName(nom).length > 0)
		tab = xml.getElementsByTagName(nom);
	return tab;
}

function getFond(opacity) {
	$("BODY").append('<div id="calqueFond"></div>');
	$("#calqueFond").css({
		position: 'absolute',
		zIndex: 97,
		top: '0px', 
		left: '0px', 
		width: '100%', 
		height: $(document).height(), 
		background: '#000000', 
		opacity: opacity
	});
}

function supFond() {
	$("#calqueFond").remove();
}

