
function popup (URL,width,height) {
window.open (URL, "previewWindow", "toolbar=yes,scrollbars=yes,width=" + width + ",height=" + height);
}

function openWindow (URL, width, height) {
window.open (URL, "previewWindow", "toolbar=yes,scrollbars=yes,width=" + width + ",height=" + height);
}


function GoToUrl(Arg1, Arg2, Arg3) {
	window.location = Arg1 + Arg2 + Arg3;
}

function GererDiv(_div1, _div2){
	if (_div1 != '')
	{
		var Obj1 = document.getElementById(_div1);
		Obj1.style.display="none";
	}
	if (_div2 != '')
	{
		var Obj2 = document.getElementById(_div2);
		Obj2.style.display="";
	}
}


function Gerer1Div(id_div, id_img, pos, url_fleche_droite, url_fleche_bas, nom_site)
{
	var valeur;
	if (document.getElementById(id_div).style.display == 'inline')
	{
		// Si inline, on passe la div en none, puis on change l'image de la fleche 
		document.getElementById(id_img).src = url_fleche_droite;
		document.getElementById(id_div).style.display = 'none';
		valeur = 0;
	}
	else
	{
		// Sinon on inverse
		document.getElementById(id_img).src = url_fleche_bas;
		document.getElementById(id_div).style.display = 'inline';
		valeur = 1;
	}

	date=new Date;
	date.setDate(date.getDate()+365);
	if (pos == 1)
	{
		EcrireCookie("ONGLETS.POS1", valeur, date, "/", nom_site);
	}
	if (pos == 2)
	{
		EcrireCookie("ONGLETS.POS2", valeur, date, "/", nom_site);
	}
	if (pos == 3)
	{
		EcrireCookie("ONGLETS.POS3", valeur, date, "/", nom_site);
	}
	if (pos == 4)
	{
		EcrireCookie("ONGLETS.POS4", valeur, date, "/", nom_site);
	}
	if (pos == 5)
	{
		EcrireCookie("ONGLETS.POS5", valeur, date, "/", nom_site);
	}
	if (pos == 6)
	{
		EcrireCookie("ONGLETS.POS6", valeur, date, "/", nom_site);
	}
}

function EcrireCookie(nom, valeur)
{
	//alert(nom);
	var argv=EcrireCookie.arguments;
	var argc=EcrireCookie.arguments.length;
	var expires=(argc > 2) ? argv[2] : null;
	var path=(argc > 3) ? argv[3] : null;
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=nom+"="+escape(valeur)+
	((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
	((path==null) ? "" : ("; path="+path))+
	((domain==null) ? "" : ("; domain="+domain))+
	((secure==true) ? "; secure" : "");
}

/*function DeleteCookie (name) {
	var exp=new Date();
	exp.setTime (exp.getTime() - 100000);
	var cval=GetCookie (name);
	document.cookie=name+"="+cval+"; expires="+exp.toGMTString();
}*/

function delete_cookie ( cookie_name )
{
  var cookie_date = new Date ( );  // current date & time
  cookie_date.setTime ( cookie_date.getTime() - 1 );
  document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}



function TJS_ExtractURL(url) {
	var regexp=new RegExp("[?&]");
	var tab=url.split(regexp);
	return tab;
}

function vsubmit(theurl)
{
	var page_url = theurl;
	var tab = TJS_ExtractURL(page_url);

	// Si l'url contient what_adv alors on remplace la valeur, sinon on ajoute le paramètre à l'url
	var bTrouveWhat = 0;
	var bTrouveValue = 0;
	var	bTrouveListIndex = 0;
	var	bTrouvePage = 0;
	for (var i=0;i<tab.length;i++)
	{ 
		if (tab[i].substring(0,tab[i].indexOf("=")) == 'what_adv')
		{
			tab[i] = 'what_adv='+document.form_recherche_affinee.what_adv.value;
			bTrouveWhat = 1;
		}
		if (tab[i].substring(0,tab[i].indexOf("=")) == 'value_adv')
		{
			tab[i] = 'value_adv='+document.form_recherche_affinee.value_adv.value;
			bTrouveValue = 1;
		}
		if (tab[i].substring(0,tab[i].indexOf("=")) == 'list_index')
		{
			bTrouveListIndex = 1;
		}
		if (tab[i].substring(0,tab[i].indexOf("=")) == 'page')
		{
			tab[i] = 'page=1';
			bTrouvePage = 1;
		}
	}
	if (bTrouveWhat == 0)
	{
		tab[tab.length] = 'what_adv='+document.form_recherche_affinee.what_adv.value;
	}
	if (bTrouveValue == 0)
	{
		tab[tab.length] = 'value_adv='+document.form_recherche_affinee.value_adv.value;
	}
	if (bTrouveListIndex == 0)
	{
		tab[tab.length] = 'list_index=0';
	}
	if (bTrouvePage == 0)
	{
		tab[tab.length] = 'page=1';
	}


	var new_url = tab[0] + '?';
	for (var i=1;i<tab.length;i++)
	{	
		new_url += tab[i] + '&';
	}

	//alert(new_url);
	window.location.href = new_url;

}

function Gerer4Div(_divActif, _divInActif1, _divInActif2, _divInActif3){
	if (_divInActif1 != '')
	{
		var Obj1 = document.getElementById(_divInActif1);
		Obj1.style.display="none";
		var Objlink1 = document.getElementById('link_'+_divInActif1);
		Objlink1.className = "form_title";
		Objlink1.style.fontSize = "12px";
		Objlink1.style.padding = "2px";
	}
	if (_divInActif2 != '')
	{
		var Obj2 = document.getElementById(_divInActif2);
		Obj2.style.display="none";
		var Objlink2 = document.getElementById('link_'+_divInActif2);
		Objlink2.className = "form_title";
		Objlink2.style.fontSize = "12px";
		Objlink2.style.padding = "2px";
	}
	if (_divInActif3 != '')
	{
		var Obj3 = document.getElementById(_divInActif3);
		Obj3.style.display="none";
		var Objlink3 = document.getElementById('link_'+_divInActif3);
		Objlink3.className = "form_title";
		Objlink3.style.fontSize = "12px";
		Objlink3.style.padding = "2px";
	}
	if (_divActif != '')
	{
		var Obj4 = document.getElementById(_divActif);
		Obj4.style.display="inline";
		var Objlink4 = document.getElementById('link_'+_divActif);
		Objlink4.className = "lienor";
		Objlink4.style.fontSize = "12px";
		Objlink4.style.padding = "2px";
	}
}

function GererXDiv(_divActif, _divInActif1, _divInActif2, _divInActif3, _divInActif4, _divInActif5, _divInActif6, _divInActif7){
	if (_divInActif1 != '')
	{
		var Obj1 = document.getElementById(_divInActif1);
		if (Obj1)
		{
			Obj1.style.display="none";
			var Objlink1 = document.getElementById('link_'+_divInActif1);
			Objlink1.className = "link_item_artist_conso_title";
			//Objlink1.style.fontSize = "13px";
			//Objlink1.style.padding = "2px";
		}
	}
	if (_divInActif2 != '')
	{
		var Obj2 = document.getElementById(_divInActif2);
		if (Obj2)
		{
			Obj2.style.display="none";
			var Objlink2 = document.getElementById('link_'+_divInActif2);
			Objlink2.className = "link_item_artist_conso_title";
			//Objlink2.style.fontSize = "13px";
			//Objlink2.style.padding = "2px";
		}
	}
	if (_divInActif3 != '')
	{
		var Obj3 = document.getElementById(_divInActif3);
		if (Obj3)
		{
			Obj3.style.display="none";
			var Objlink3 = document.getElementById('link_'+_divInActif3);
			Objlink3.className = "link_item_artist_conso_title";
			//Objlink3.style.fontSize = "13px";
			//Objlink3.style.padding = "2px";
		}
	}
	if (_divInActif4 != '')
	{
		var Obj4 = document.getElementById(_divInActif4);
		if (Obj4)
		{
			Obj4.style.display="none";
			var Objlink4 = document.getElementById('link_'+_divInActif4);
			Objlink4.className = "link_item_artist_conso_title";
			//Objlink4.style.fontSize = "13px";
			//Objlink4.style.padding = "2px";
		}
	}
	if (_divInActif5 != '')
	{
		var Obj5 = document.getElementById(_divInActif5);
		if (Obj5)
		{
			Obj5.style.display="none";
			var Objlink5 = document.getElementById('link_'+_divInActif5);
			Objlink5.className = "link_item_artist_conso_title";
			//Objlink5.style.fontSize = "13px";
			//Objlink5.style.padding = "2px";
		}
	}
	if (_divInActif6 != '')
	{
		var Obj6 = document.getElementById(_divInActif6);
		if (Obj6)
		{
			Obj6.style.display="none";
			var Objlink6 = document.getElementById('link_'+_divInActif6);
			Objlink6.className = "link_item_artist_conso_title";
			//Objlink6.style.fontSize = "13px";
			//Objlink6.style.padding = "2px";
		}
	}
	if (_divInActif7 != '')
	{
		var Obj7 = document.getElementById(_divInActif7);
		if (Obj7)
		{
			Obj7.style.display="none";
			var Objlink7 = document.getElementById('link_'+_divInActif7);
			Objlink7.className = "link_item_artist_conso_title";
			//Objlink7.style.fontSize = "13px";
			//Objlink7.style.padding = "2px";
		}
	}
	if (_divActif != '')
	{
		var ObjA = document.getElementById(_divActif);
		if (ObjA)
		{
			ObjA.style.display="inline";
			var ObjlinkA = document.getElementById('link_'+_divActif);
			ObjlinkA.className = "link_item_artist_conso_title_select";
			//ObjlinkA.style.fontSize = "13px";
			//ObjlinkA.style.padding = "2px";
		}
	}
}

function newSelectUnSelectAll(my_form,field_name)
{
    if(my_form.clickcontrol.checked)
           {
               flag = true;
           }
    else
           {
               flag = false;
           }
   len     =       my_form.elements.length;
   var     index   =       0;
    for( index=0; index < len; index++ )
    {
        if( my_form.elements[index].name == field_name )
        {
            my_form.elements[index].checked=flag;
        }
    }
}


function CheckExactSearch()
{
	if ((document.form_search.exact_search.checked == 1))
	{
		document.form_search.exact_search_hidden.value = 1;
	}
	else
	{
		document.form_search.exact_search_hidden.value = 0;
	}
}


function vCheckLanguage(_url, _lesite, _lng)
{
	//alert('Welcome on '+_lesite+' ('+_url+'|os:'+navigator.systemLanguage+'|nav:'+navigator.language+')');
	//alert(_lng);
	var tab = TJS_ExtractURL(_url);

	/*if (!navigator.systemLanguage)
	{
		if (navigator.language == 'fr')
		{
			window.location.replace(document.URL + '?lng=2');
		}
	}
	if (navigator.systemLanguage == 'fr')
	{
		window.location.replace(document.URL + '?lng=2');
	}*/

	date=new Date;
	date.setDate(date.getDate()+365);

	//alert('checklanguage');
	
	var	bRewriteUrl = 0;
	var lng_detect = 1;
	var monnaie_detect = 5;

	if (tab.length >= 0 || document.URL == "http://bd.cdandlp.com/" || document.URL == "http://www.socomics.com/" || document.URL == "http://local.cdandlp.com/" || document.URL == "http://www.cdandlp.com/" || document.URL == "http://groovecollector.cdandlp.com/" || document.URL == "http://www.groovecollector.com/")
	{
		if (!navigator.systemLanguage)
		{
			//alert(navigator.language);
			if (navigator.language.indexOf('fr') != -1)
			{
				lng_detect = 1;
				EcrireCookie('LNGNAVIG', '1', date, "/", _lesite);
				EcrireCookie('LANGUE', '1', date, "/", _lesite);
				EcrireCookie('MONNAIE', '5', date, "/", _lesite);
			}
			else if (navigator.language.indexOf('en-US') != -1)
			{
				lng_detect = 2;
				EcrireCookie('LNGNAVIG', '2', date, "/", _lesite);
				EcrireCookie('LANGUE', '2', date, "/", _lesite);
				EcrireCookie('MONNAIE', '9', date, "/", _lesite);
			}
			else if (navigator.language.indexOf('en-GB') != -1)
			{
				lng_detect = 2;
				EcrireCookie('LNGNAVIG', '2', date, "/", _lesite);
				EcrireCookie('LANGUE', '2', date, "/", _lesite);
				EcrireCookie('MONNAIE', '7', date, "/", _lesite);
			}
			else if (navigator.language.indexOf('en') != -1)
			{
				lng_detect = 2;
				EcrireCookie('LNGNAVIG', '2', date, "/", _lesite);
				EcrireCookie('LANGUE', '2', date, "/", _lesite);
				EcrireCookie('MONNAIE', '7', date, "/", _lesite);
			}
			else if (navigator.language.indexOf('ja') != -1)
			{
				lng_detect = 3;
				EcrireCookie('LNGNAVIG', '3', date, "/", _lesite);
				EcrireCookie('LANGUE', '3', date, "/", _lesite);
				EcrireCookie('MONNAIE', '10', date, "/", _lesite);
			}
			else
			{
				lng_detect = 2;
				EcrireCookie('LNGNAVIG', '2', date, "/", _lesite);
				EcrireCookie('LANGUE', '2', date, "/", _lesite);
				EcrireCookie('MONNAIE', '5', date, "/", _lesite);
			}
		}
		else
		{
			if (navigator.systemLanguage.indexOf('fr') != -1)
			{
				lng_detect = 1;
				EcrireCookie('LNGNAVIG', '1', date, "/", _lesite);
				EcrireCookie('LANGUE', '1', date, "/", _lesite);
				EcrireCookie('MONNAIE', '5', date, "/", _lesite);
			}
			else if(navigator.systemLanguage.indexOf('en-US') != -1)
			{
				lng_detect = 2;
				EcrireCookie('LNGNAVIG', '2', date, "/", _lesite);
				EcrireCookie('LANGUE', '2', date, "/", _lesite);
				EcrireCookie('MONNAIE', '9', date, "/", _lesite);
			}
			else if(navigator.systemLanguage.indexOf('en-GB') != -1)
			{
				lng_detect = 2;
				EcrireCookie('LNGNAVIG', '2', date, "/", _lesite);
				EcrireCookie('LANGUE', '2', date, "/", _lesite);
				EcrireCookie('MONNAIE', '7', date, "/", _lesite);
			}
			else if(navigator.systemLanguage.indexOf('en') != -1)
			{
				lng_detect = 2;
				EcrireCookie('LNGNAVIG', '2', date, "/", _lesite);
				EcrireCookie('LANGUE', '2', date, "/", _lesite);
				EcrireCookie('MONNAIE', '7', date, "/", _lesite);
			}
			else if(navigator.systemLanguage.indexOf('ja') != -1)
			{
				lng_detect = 3;
				EcrireCookie('LNGNAVIG', '3', date, "/", _lesite);
				EcrireCookie('LANGUE', '3', date, "/", _lesite);
				EcrireCookie('MONNAIE', '10', date, "/", _lesite);
			}
			else
			{
				lng_detect = 2;
				EcrireCookie('LNGNAVIG', '2', date, "/", _lesite);
				EcrireCookie('LANGUE', '2', date, "/", _lesite);
				EcrireCookie('MONNAIE', '5', date, "/", _lesite);
			}
		}
		EcrireCookie('BIDON', '1', date, "/", _lesite);
		if (_lng != lng_detect)
		{
			//alert(_lng);
			if (document.URL == "http://local.cdandlp.com/" || document.URL == "http://www.cdandlp.com/")
			{
				if (lng_detect == 1)
				{
					window.location.reload();
				}
				if (lng_detect == 2)
				{
					window.location.replace(document.URL + 'en/');
				}
				if (lng_detect == 3)
				{
					window.location.replace(document.URL + 'jp/');
				}
				if (lng_detect == 4)
				{
					window.location.replace(document.URL + 'es/');
				}

			}
			else if (document.URL == "http://groovecollector.cdandlp.com/" || document.URL == "http://www.groovecollector.com/")
			{
				if (lng_detect == 1)
				{
					window.location.replace(document.URL + 'fr/');
				}
				if (lng_detect == 2)
				{
					window.location.reload();
				}
				if (lng_detect == 3)
				{
					window.location.replace(document.URL + 'jp/');
				}
				if (lng_detect == 4)
				{
					window.location.replace(document.URL + 'es/');
				}

			}
			else
			{
				window.location.reload();
			}
		}
	}
}

function vRewriteLanguage(_url)
{
	//alert('toto');
	date=new Date;
	date.setDate(date.getDate()+365);

	if (!navigator.systemLanguage)
	{
		if (navigator.language.indexOf('fr') != -1)
		{
			EcrireCookie('LANGUE', '1', date, "/", _lesite);
			EcrireCookie('MONNAIE', '5', date, "/", _lesite);
			if (document.URL == "http://local.cdandlp.com/" || document.URL == "http://www.cdandlp.com/")
			{
				//window.location.replace(document.URL);
			}
			else
			{
				window.location.replace(_url + '/home1');
			}
		}
		else if (navigator.language.indexOf('en') != -1)
		{
			EcrireCookie('LANGUE', '2', date, "/", _lesite);
			EcrireCookie('MONNAIE', '7', date, "/", _lesite);
			if (document.URL == "http://local.cdandlp.com/" || document.URL == "http://www.cdandlp.com/")
			{
				window.location.replace(document.URL + 'en/');
			}
			else
			{
				window.location.replace(_url + '/home2');
			}
		}
		else if (navigator.language.indexOf('ja') != -1)
		{
			EcrireCookie('LANGUE', '3', date, "/", _lesite);
			EcrireCookie('MONNAIE', '10', date, "/", _lesite);
			if (document.URL == "http://local.cdandlp.com/" || document.URL == "http://www.cdandlp.com/")
			{
				window.location.replace(document.URL + 'jp/');
			}
			else
			{
				window.location.replace(_url + '/home3');
			}
		}
		else if (navigator.language.indexOf('es') != -1)
		{
			EcrireCookie('LANGUE', '4', date, "/", _lesite);
			EcrireCookie('MONNAIE', '5', date, "/", _lesite);
			if (document.URL == "http://local.cdandlp.com/" || document.URL == "http://www.cdandlp.com/")
			{
				window.location.replace(document.URL + 'es/');
			}
			else
			{
				window.location.replace(_url + '/home4');
			}
		}
		else
		{
			EcrireCookie('LANGUE', '2', date, "/", _lesite);
			EcrireCookie('MONNAIE', '9', date, "/", _lesite);
			if (document.URL == "http://local.cdandlp.com/" || document.URL == "http://www.cdandlp.com/")
			{
				window.location.replace(document.URL + 'en/');
			}
			else
			{
				window.location.replace(_url + '/home2');
			}
		}
	}
	else
	{
		if (navigator.systemLanguage.indexOf('fr') != -1)
		{
			EcrireCookie('LANGUE', '1', date, "/", _lesite);
			EcrireCookie('MONNAIE', '5', date, "/", _lesite);
			if (document.URL == "http://local.cdandlp.com/" || document.URL == "http://www.cdandlp.com/")
			{
				//window.location.replace(document.URL);
			}
			else
			{
				window.location.replace(_url + '/home1');
			}
		}
		else if(navigator.systemLanguage.indexOf('en') != -1)
		{
			EcrireCookie('LANGUE', '2', date, "/", _lesite);
			EcrireCookie('MONNAIE', '7', date, "/", _lesite);
			if (document.URL == "http://local.cdandlp.com/" || document.URL == "http://www.cdandlp.com/")
			{
				window.location.replace(document.URL + 'en/');
			}
			else
			{
				window.location.replace(_url + '/home2');
			}
		}
		else if(navigator.systemLanguage.indexOf('ja') != -1)
		{
			EcrireCookie('LANGUE', '3', date, "/", _lesite);
			EcrireCookie('MONNAIE', '10', date, "/", _lesite);
			if (document.URL == "http://local.cdandlp.com/" || document.URL == "http://www.cdandlp.com/")
			{
				window.location.replace(document.URL + 'jp/');
			}
			else
			{
				window.location.replace(_url + '/home3');
			}
		}
		else if(navigator.systemLanguage.indexOf('es') != -1)
		{
			EcrireCookie('LANGUE', '4', date, "/", _lesite);
			EcrireCookie('MONNAIE', '5', date, "/", _lesite);
			if (document.URL == "http://local.cdandlp.com/" || document.URL == "http://www.cdandlp.com/")
			{
				window.location.replace(document.URL + 'es/');
			}
			else
			{
				window.location.replace(_url + '/home4');
			}
		}
		else
		{
			EcrireCookie('LANGUE', '2', date, "/", _lesite);
			EcrireCookie('MONNAIE', '9', date, "/", _lesite);
			if (document.URL == "http://local.cdandlp.com/" || document.URL == "http://www.cdandlp.com/")
			{
				window.location.replace(document.URL + 'en/');
			}
			else
			{
				window.location.replace(_url + '/home2');
			}
		}
	}


}


function vMessageAvertissement(_url_redirection, _lesite, _langue)
{
	if (_langue == '1')
	{
		var mess = 'ATTENTION : Cette partie du site est susceptible de contenir des images à caractère érotique ou pornographique. Elle est donc réservée aux adultes majeurs. Si vous certifiez avoir plus de 18 ans, cliquez sur "OK" sinon "Annuler"';
	}
	else
	{
		var mess = 'WARNING: This site may contain erotic or pornographic material. It is reserved to adults only. If you certify to be over 18, click "OK" or "Cancel"';
	}

	if (confirm(mess))
	{ 
		date=new Date;
		date.setDate(date.getDate()+365);
		EcrireCookie('MAJEUR', '18', date, "/", _lesite);
		window.location.reload();
	}
	else
	{ 
		window.location.replace(_url_redirection);
	}
}

var lesitesocomics = '';
var url_redirection = '';
var agreebox = '';

function ageprompt(_lng,_lesite,_url_redirection, url_ip)
{
	var nav = 'xxx'+navigator.appName + ' ' + navigator.appVersion;
	//alert(nav);
	// On affiche du javascript pour ceux qui ne gère pas normalement le DHTML.
	// IE et FireFox -> OK
	if 
		(
			(nav.indexOf('MSIE') != -1)
		|| 
			((nav.indexOf('Netscape') != -1) && (nav.indexOf('Safari') == -1))
		)
	{
		lesitesocomics = _lesite;
		url_redirection = _url_redirection;

		agreebox=dhtmlmodal.open("agreebox", "iframe", url_ip+"/includes/warning/modalfiles/agreement.cfm?", "", "width=450px,height=250px,center=1,resize=0,scrolling=0", "");
	}
	else
	{
		vMessageAvertissement(_url_redirection, _lesite, _lng);
	}

}

//Function to run when buttons within modal window is clicked on. Directly embedded inside hidden DIV, bypassing "onclose" event:
function process_age(whichbutton){
	if (whichbutton == 'yes')
	{ 
		date=new Date;
		date.setDate(date.getDate()+365);
		EcrireCookie('MAJEUR', '18', date, "/", lesitesocomics);
		window.location.reload();
		agreebox.hide();
	}
	else
	{ 
		window.location.replace(url_redirection);
		agreebox.hide();
	}
}


var shopbox = '';
var url_redirection_back = '';

function addshopcard(_lng,_url_redirection,_url_redirection_back, url_ip, _n_ref)
{

	// Le mode DIV fonctionne avec tous les navigateurs (FF, IE, OP, GC, SAF)
	url_redirection = _url_redirection;
	url_redirection_back = _url_redirection_back;
	shopbox=dhtmlmodal.open("shopbox", "div", "shopdiv", "", "width=550px,height=180px,center=1,resize=0,scrolling=0", "");
	
	//	shopbox=dhtmlmodal.open("shopbox", "iframe", url_ip+"/includes/warning/modalfiles/addshop_cdandlp.cfm", "", "width=550px,height=350px,center=1,resize=0,scrolling=0", "");

}

//Function to run when buttons within modal window is clicked on. Directly embedded inside hidden DIV, bypassing "onclose" event:
function process_shop(whichbutton){
	if (whichbutton == 'yes')
	{ 
		window.location.replace(url_redirection_back);
	}
	if (whichbutton == 'yes_surp')
	{ 
		window.location.replace(url_redirection_back+'&back_surp=1');
	}

	if (whichbutton == 'no')
	{ 
		window.location.replace(url_redirection);
	}


	//if (whichbutton != 'yes' && whichbutton != 'no' && whichbutton != '')
	//{
	//	window.location.replace(whichbutton);
	//}
}


function vMessageShop(_url_redirection, _url_redirection_back, _langue)
{
	if (_langue == '1')
	{
		var mess = 'L\'article a été ajouté à votre caddie. Cliquez sur "OK" pour terminer votre commande, ou bien sur "Annuler" pour continuer vos achats.';
	}
	else
	{
		var mess = 'The item has been added in your shopping cart. Click "OK" to submit your order or "Cancel" to continue your shopping.';
	}

	if (confirm(mess))
	{ 
		window.location.replace(_url_redirection);
	}
	else
	{ 
		window.location.replace(_url_redirection_back);
	}
}


function argsMail(_url, _title)
{
	if (_url && _title && _url != '' && _title != '')
	{
		window.location.href="mailto:email?subject="+_title+"&body="+_url ;
	}
	else
	{
		window.location.href="mailto:email?subject="+document.title+"&body="+document.URL ;
	}
}
function argsMyspace(_url, _title)
{
	if (_url && _title && _url != '' && _title != '')
	{
		window.open("http://www.myspace.com/Modules/PostTo/Pages/?u="+_url+"&t="+_title,'_blank','toolbar=1, location=1, directories=1, status=1, scrollbars=1, resizable=1, copyhistory=1, menuBar=1');
	}
	else
	{
		window.open("http://www.myspace.com/Modules/PostTo/Pages/?u="+document.URL+"&t="+document.title,'_blank','toolbar=1, location=1, directories=1, status=1, scrollbars=1, resizable=1, copyhistory=1, menuBar=1');
	}
}
function argsFacebook(_url)
{
	if (_url && _url != '')
	{
		window.open("http://www.facebook.com/share.php?u="+_url,'_blank','toolbar=1, location=1, directories=1, status=1, scrollbars=1, resizable=1, copyhistory=1, menuBar=1');
	}
	else
	{
		window.open("http://www.facebook.com/share.php?u="+document.URL,'_blank','toolbar=1, location=1, directories=1, status=1, scrollbars=1, resizable=1, copyhistory=1, menuBar=1');
	}
}
function argsTwitter(_url, _title)
{
	if (_url && _title && _url != '' && _title != '')
	{
		window.open("http://twitter.com/share?url="+_url+"&text="+_title,'_blank','toolbar=1, location=1, directories=1, status=1, scrollbars=1, resizable=1, copyhistory=1, menuBar=1');
	}
	else
	{
		window.open("http://twitter.com/share?url="+document.URL+"&text="+document.title,'_blank','toolbar=1, location=1, directories=1, status=1, scrollbars=1, resizable=1, copyhistory=1, menuBar=1');
	}
}
function argsMixi(_url)
{
	if (_url && _url != '')
	{
		window.open("http://mixi.jp/share.pl?u="+_url+"&k=ae81de6430e5f38e9fb4fb9551e61f951a3da1fa",'_blank','toolbar=1, location=1, directories=1, status=1, scrollbars=1, resizable=1, copyhistory=1, menuBar=1');
	}
	else
	{
		window.open("http://mixi.jp/share.pl?u="+document.URL+"&k=ae81de6430e5f38e9fb4fb9551e61f951a3da1fa",'_blank','toolbar=1, location=1, directories=1, status=1, scrollbars=1, resizable=1, copyhistory=1, menuBar=1');
	}
}

/*
	différentes valeur de code :
		- code null ou code = 1 : détection et remplacement de JP en caractère latin
		- code = 2				: pour la traduction en JP (conso artiste)
*/
function Translate(obj_saisie, obj_traduit,obj_info_lng_saisie, obj_lng_voulue, obj_message, code )
{
	if(obj_traduit == '')
	{
			var tmp = obj_saisie.value;
	}
	else
	{
			var tmp = obj_saisie.innerHTML;
	}
	google.language.detect(tmp, 
		function(result) 
		{  
			if (!result.error) 
			{    
				var language = 'unknown';    
				for (l in google.language.Languages) 
				{    
					if (google.language.Languages[l] == result.language) 
					{        
						language = l;        
						codelanguage = google.language.Languages[l];
						break;      
					}    
				}
				if (code == '' || code == 1)
				{
					
					if (language == 'JAPANESE' || language == 'CHINESE_SIMPLIFIED')
					{
						/*google.language.translate(tmp, 'ja', 'en', function(result) {if (!result.error) {
								if (obj_traduit =='')
								{
									obj_saisie.value = result.translation;
								}
								else
								{
									obj_traduit.innerHTML = result.translation;
								}
						}});*/
						obj_saisie.value = '';
						obj_message.innerHTML = "お客様は詳細を日本語で入力されました。当社はこの詳細を自動翻訳します。もし、自動翻訳が正しくない場合は翻訳をご訂正して頂きますようお願いします。";
						obj_message["className"] = "infobox";
					}
					else
					{
						obj_message.innerHTML = "";
						obj_message["className"] = "";
					}				
				}
				else if (code == 2)
				{
					google.language.translate(tmp, "", 'ja', function(result) {if (!result.error) {obj_saisie.value = result.translation;}});
				}
			}
		}
	);
}

function openClose(obj_tr, obj_lien)
{
	if (obj_tr.style.display == 'none') 
	{
		obj_tr.style.display = '';
		obj_lien.innerHTML = document.getElementById('hidden_cacher').value;
	} 
	else 
	{
		obj_tr.style.display = 'none';
		obj_lien.innerHTML = document.getElementById('hidden_afficher').value;
	}
} 

function IsNumeric(sText)
{
	var ValidChars = "0123456789.";
	var IsNumber=true;
	var Char;

	for (i = 0; i < sText.length && IsNumber == true; i++) 
	{ 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) 
		{
			IsNumber = false;
		}
	}
	
	return IsNumber;

}



