function Compter(Target, max, nomchamp)
{
	StrLen = Target.value.length
	if (StrLen > max )
	{
	  Target.value = Target.value.substring(0,max);
	  CharsLeft = max;
	} else {
	  CharsLeft = StrLen;
	}
	nomchamp.value = max - CharsLeft;
}

function frmsubmit(func) {
	frm = document.getElementById("caddieform");
	frm.func.value = func;
	frm.submit();
}

function switch_product_images(new_main, new_main_zoom, vignette_id){
	var current_main = document.getElementById('mainProductImage').src;
	var current_main_zoom = document.getElementById('zoom1').href;
	document.getElementById(vignette_id).innerHTML = '<a href="javascript:switch_product_images(\''+current_main+'\', \''+current_main_zoom+'\', \''+vignette_id+'\')"><img src="'+current_main+'" name="'+vignette_id+'" width="50" border="0" /></a>';
	document.getElementById('mainProductImage').src = new_main;
	document.getElementById('zoom1').href = new_main_zoom;
}
function switch_product_tab(tab_to_highlight_id,title_to_highlight_id){
	var current_tab=document.getElementById('current_tab_id').value;
	var current_tab_title=document.getElementById('current_tab_title').value;


	document.getElementById(current_tab).style.display='none';
	document.getElementById(current_tab_title).className='tab';

	document.getElementById(tab_to_highlight_id).style.display='block';
	document.getElementById(title_to_highlight_id).className='current_tab';

	document.getElementById('current_tab_id').value=tab_to_highlight_id;
	document.getElementById('current_tab_title').value=title_to_highlight_id;
}

function popupSmileys (src) {
	window.open(src,'', 'top=20, left=20, width=220, height=360, resizable=yes, toolbar=no, scrollbars=yes, status=yes');
}

function PopupImage(img)
{
titre="BIGOUDI Shop le professionnel de la coiffure&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
w=document.images[0].width*4;
h=document.images[0].height*4;
pop_up_width = 550;
pop_up_height = 503;
LeftPosition = (screen.width-pop_up_width)/2;
TopPosition = (screen.height-pop_up_height)/2;

	win=open('','image','width=100,height=100,top='+TopPosition+',left='+LeftPosition+',toolbar=no,scrollbars=no,resizable=no');

	win.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE><style> body,a { color: #2E6354; font-family: Arial; font-size: 11px; font-weight: bold ; text-decoration:none}</style></HEAD>");
	win.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+50,document.images[0].height+100); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	win.document.write("<BODY bgcolor=#C1DFD6 onload='checksize()' leftMargin=10 topMargin=10 marginwidth=10 marginheight=10><IMG src='"+img+"'>");
	win.document.write("<br><center><a href=javascript:window.close()>Fermer la fenetre</a>");
	win.document.write("</BODY></HTML>");
	win.document.close();
}
