	if (navigator.appName.indexOf("Netscape")!=-1)
	{
		var _emptyTags = {
		   "IMG":   true,
		   "BR":    true,
		   "INPUT": true,
		   "META":  true,
		   "LINK":  true,
		   "PARAM": true,
		   "HR":    true
		};
	
		HTMLElement.prototype.__defineGetter__("outerHTML", function () {
		   var attrs = this.attributes;
		   var str = "<" + this.tagName;
		   for (var i = 0; i < attrs.length; i++)
			  str += " " + attrs[i].name + "=\"" + attrs[i].value + "\"";
	
		   if (_emptyTags[this.tagName])
			  return str + ">";
		   return str + ">" + this.innerHTML + "</" + this.tagName + ">";
		});
		HTMLElement.prototype.__defineSetter__("outerHTML", function (sHTML) {
		   var r = this.ownerDocument.createRange();
		   r.setStartBefore(this);
		   var df = r.createContextualFragment(sHTML);
		   this.parentNode.replaceChild(df, this);
		});
	}
	
		var is_being_rated = new Array();
		var rate_fadein_opacity = 0;
		var rate_fadeout_opacity = 100;
		var post_id = 0;
		var post_rating = 0;
		var ratings_max = 0;
		var cur_id = '';
		var tags_text = new Array();
		var t_count = 0;
	
	function RunPlayer(soundUrl, playMode)
	{
		var width="193";
		var height="27";
		if (playMode=="autoplay"){
			width="1";
			height="1";
		}
	
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width=\"'+width+'\" height=\"'+height+'\" id="player" align="middle">\n');
		document.write('<param name="movie" value="/images/design/player/player.swf" />\n');
		document.write('<param name="flashvars" value="soundUrl='+soundUrl+'&playMode='+playMode+'" />\n');
		document.write('<param name="wmode" value="opaque" /> \n');
		document.write('<embed src="/images/design/player/player.swf" wmode="opaque" quality="high" bgcolor="#ffffff" width=\"'+width+'\" height=\"'+height+'\" name="player" align="middle" FlashVars="soundUrl='+soundUrl+'&playMode='+playMode+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
	
		document.write('</object>\n');
	}
	
	//// MILLIONER
	function MilBegin() {
		document.getElementById('millioner_begin_btn').submit();
	}
	
	function MilA() {
		document.getElementById('question_1').submit();
	}
	
	function MilAnswer(id, answ_id) {
		document.getElementById('answer').value=id;
		var answ = document.getElementById(answ_id);
		answ.className = 'oorange';
		setTimeout('MilA()', 2000);
	}
	
	var ajaxumil = new sack();
	function MilAjaxAction(user,action) {
		ajaxumil.setVar("user",user);
		if (document.getElementById('value_a'))
		ajaxumil.setVar("a_id",document.getElementById('value_a').value);
		if (document.getElementById('value_b'))
		ajaxumil.setVar("b_id",document.getElementById('value_b').value);
		if (document.getElementById('value_c'))
		ajaxumil.setVar("c_id",document.getElementById('value_c').value);
		if (document.getElementById('value_d'))
		ajaxumil.setVar("d_id",document.getElementById('value_d').value);
		ajaxumil.setVar("action",action);
		ajaxumil.requestFile = "/mil_action.php";
		ajaxumil.onCompletion = doMilAjaxAction;
		ajaxumil.runAJAX();
	}
	
	
	function doMilAjaxAction() {
		eval(ajaxumil.response);
		 //location.href="Publicites.html";
	}
	//// END MILLIONER
	
	///// BEGIN FCL
	function showVopros() {
			var tArea = document.getElementById('tavopros');
			var tBlock = document.getElementById('txtvopros');
			if (tArea.value != '') {
			tArea.style.display = 'none';
			tBlock.innerHTML = tArea.value;
			doAjaxFCL('login',tArea.value);
			tBlock.style.display = 'block';
			var pQ = document.getElementById('poserq');
			pQ.style.display = 'none';
			}
	}
	
	function refreshGamers() {
		//refresh
		doAjaxFCL('refreshGamers');
		setTimeout('refreshGamers()', 5000);
	}
	
	
	function countDown() {
	  	sec--;
	  if (sec == -01) {
	    sec = 59;
	    mins = mins - 1;
	  }
		else {
	  	mins = mins;
		}
		if (sec<=9) {
		 sec = "0" + sec;
		}
		time = (mins<=9 ? "0" + mins : mins) + " : " + sec;
		if (document.getElementById('tm')) {
		 document.getElementById('tm').innerHTML = time;
		}
		SD=window.setTimeout("countDown();", 1000);
		if (mins == '00' && sec == '00') {
			sec = "00";
			window.clearTimeout(SD);
		doAjaxFCL('go_step'+next_step,'');
		}
	}
	
	function addLoadEvent(func) {
	  var oldonload = window.onload;
		if (typeof window.onload != 'function') {
	   window.onload = func;
		}
		else {
	   window.onload = function() {
	      if (oldonload) {
	       oldonload();
	      }
	   func();
		}
	  }
	}
	
	var ajaxufcl = new sack();
	function doAjaxFCL(action,input) {
		if (input=='res') {
			ajaxufcl.setVar("resp1",document.getElementById('resp1').value);
			ajaxufcl.setVar("id1",document.getElementById('id1').value);
			ajaxufcl.setVar("resp2",document.getElementById('resp2').value);
			ajaxufcl.setVar("id2",document.getElementById('id2').value);
			ajaxufcl.setVar("resp3",document.getElementById('resp3').value);
			ajaxufcl.setVar("id3",document.getElementById('id3').value);
		}
		ajaxufcl.setVar("input",input);
		ajaxufcl.setVar("action",action);
		ajaxufcl.requestFile = "/addon/fcl/mainAjax.php";
		ajaxufcl.onCompletion = doAjaxFCLFinish;
		ajaxufcl.runAJAX();
	}
	
	function doAjaxFCLFinish() {
		eval(ajaxufcl.response);
		ajaxufcl.reset();
		 //location.href="Publicites.html";
	}
	///// END FCL
	function checkKingBid() {
		var bid=document.getElementById('bid').value;
		if (bid=='') {
			alert('Erreur');
			return false;
		} else return true;
	}
	
	function getStyle(elem, prop)
	{
	  if (typeof elem!="object") elem = document.getElementById(elem);
	
	  if (document.defaultView && document.defaultView.getComputedStyle)
	  {
	    if (prop.match(/[A-Z]/)) prop = prop.replace(/([A-Z])/g, "-$1").toLowerCase();
	    return document.defaultView.getComputedStyle(elem, "").getPropertyValue(prop);
	  }
	
	  if (elem.currentStyle)
	  {
	    var i;
	    while ((i=prop.indexOf("-"))!=-1) prop = prop.substr(0, i) + prop.substr(i+1,1).toUpperCase() + prop.substr(i+2);
	    return elem.currentStyle[prop];
	  }
	
	  return "";
	}
	
	function View_rate_list(id)
	{
		obj = document.getElementById(id);
		div = obj.getElementsByTagName('DIV')[0];
		if (getStyle(div, "display")!='block')
			obj.style.backgroundImage = 'url(/images/design/bsoo_stars1.gif)';
		cur_id = id;
		setTimeout("vrl_next(obj)", 350);
	}
	
	function vrl_next(obj)
	{
		obj.className += " act";
		obj.style.backgroundImage = 'url(/images/design/rate_stars_blank.gif)';
		obj.getElementsByTagName('DIV')[0].style.display = 'block';
		cur_id = cur_id - 0;
		if (is_being_rated[cur_id]!= 1)
		{
			is_being_rated[cur_id] = 0;
		}
	}
	
	function current_rating(id, rating)
	{
		if(is_being_rated[id]!=='1') {
			post_id = id;
			post_rating = rating;
			for(i = 1; i <= rating; i++) {
				document.images['rating_' + post_id + '_' + i].src = '/images/design/rs_full.gif';
				ratings_max = i;
			}
		}
	}
	
	function view_rated_item(id, rating){
	/*	if(is_being_rated[post_id]!=='1') {
			is_being_rated[post_id] = '1';
		}
	//	alert(rating);
		rating_max = rating;
		post_rating = 1;
		View_rate_list(id);
		current_rating(id, rating);
	*/
	
	
	
	}
	
	function ratings_off(rating_score, insert_half) {
		if(is_being_rated[post_id] !== '1') {
			for(i = 1; i <= ratings_max; i++) {
				if(i <= rating_score) {
					document.images['rating_' + post_id + '_' + i].src = '/images/design/rs_full.gif';
				} else {
					document.images['rating_' + post_id + '_' + i].src = '/images/design/rs_blank.gif';
				}
			}
		}
	}
	
	var ajax_rate = new sack();
	
	
	function rate_post2(id){
		obj = document.getElementById(id);
		div = obj.getElementsByTagName('DIV')[0];
		if (getStyle(div, "display")!='block')
			obj.style.backgroundImage = 'url(/images/design/bsoo_stars1.gif)';
		cur_id = id;
		setTimeout("vrl_next(obj)", 350);
	
	
		if(is_being_rated[post_id]!=='1') {
			is_being_rated[post_id] = '1';
		}
	}
	
	function setUPids(aid,pid,php) {
		document.getElementById('aid').value=aid;
		document.getElementById('pid').value=pid;
		document.getElementById('upload_script').value=php;
	}
	
	function uploadMp3() {
		//<script language="JavaScript" type="text/javascript">RunPlayer("onestop.mid", "full");</script>
	    var req = new JsHttpRequest();
	    var value = document.getElementById('uphoto_style');
	    req.onreadystatechange = function() {
	        if (req.readyState == 4) {
	            eval(req.responseJS.res);
	            if (req.responseText) alert(req.responseText);
	        }
	    }
	    req.open(null, '/upload_mp3.php', true);
	    req.send( { file:value } );
	}
	
	function ChangeMusic(soundUrl)
	{
		if (soundUrl != '0') {
		var playMode = 'full';
		var width="193";
		var height="27";
		player = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="player" align="middle">\n';
		player = player + '<param name="movie" value="/images/design/player/player.swf" />\n<param name="flashvars" value="soundUrl='+soundUrl+'&playMode='+playMode+'" />\n';
		player = player + '<param name="wmode" value="opaque" /> \n';
		player = player + '<embed src="/images/design/player/player.swf" quality="high" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="player" align="middle" FlashVars="soundUrl='+soundUrl+'&playMode='+playMode+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n';
		player = player + '</object>\n';
		document.getElementById('PlayerTD').innerHTML = player;
		} else { document.getElementById('PlayerTD').innerHTML = ''; }
	}
	
	function uploadStyle(value) {
		var php = '/upload_style.php';
	    var req = new JsHttpRequest();
	    req.onreadystatechange = function() {
	        if (req.readyState == 4) {
	            eval(req.responseJS.res);
	            if (req.responseText) alert(req.responseText);
	        }
	    }
	    req.open(null, php, true);
	    req.send( { file:value } );
	}
	
	function SaveStyle(value) {
	
	    var req = new JsHttpRequest();
	    var sURL = unescape(window.location.pathname);
	    var php = sURL;
		document.getElementById('savestatus').innerHTML='<b>Les paramÃ¨tres ont Ã©tÃ© sauvegardÃ©s</b>';
	    req.onreadystatechange = function() {
	        if (req.readyState == 4) {
	            if (req.responseText) alert(req.responseText);
	        }
	    }
	    req.open(null, php, true);
	    req.send( { file:value } );
	}
	
	function clearUPform() {
		document.getElementById('aid').value='';
		document.getElementById('pid').value='';
		document.getElementById('uid').value='';
		document.getElementById('fileurl').value='';
		document.getElementById('iphoto').value='';
	}
	
	function uploadPhoto(value) {
		var php = document.getElementById('upload_script').value;
	    var req = new JsHttpRequest();
	    req.onreadystatechange = function() {
	        if (req.readyState == 4) {
	            eval(req.responseJS.upl);
				try
				{
					disableButton('upButton', 'Confirmer', 'Veuillez patienter...');
					hideBlock('add_photo');
				}
				catch (e) {}
	
	            clearUPform();
	            if (req.responseText) alert(req.responseText);
	        }
	    }
	    req.open(null, php, true);
	    req.send( { upl: value } );
	
	}
	
	
	var ajaxuann = new sack();
	
	function updateAnn(id,uid) {
		ajaxuann.setVar("id",id);
		ajaxuann.setVar("phone",document.getElementById('ephone'+id).value);
		ajaxuann.setVar("name",document.getElementById('ename'+id).value);
		ajaxuann.setVar("icq",document.getElementById('eicq'+id).value);
		ajaxuann.setVar("email",document.getElementById('eemail'+id).value);
		ajaxuann.setVar("autor",document.getElementById('eautor'+id).value);
		ajaxuann.setVar("content",document.getElementById('econtent'+id).value);
		ajaxuann.setVar("aaction",'edit');
		ajaxuann.requestFile = "Publicites.html";
		ajaxuann.onCompletion = doupdateAnn;
		ajaxuann.runAJAX();
	}
	
	function doupdateAnn() {
		eval(ajaxuann.response);
		 //location.href="Publicites.html";
	}
	
	function SetNewRate(){
		eval(ajax_rate.response);	// Executing the response from Ajax as Javascript code
		if (rating_reset)
		ajax_rate.reset();
	}
	
	function checkEmail(email)
	{
		if (!email) return false;
		var pattern = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (!email.match(pattern)) return false;
	
		return true;
	}
	
	var ajaxInvite = new sack();
	
	function sendInvite(emailFieldId, id, userId, type, sss)
	{
		email = document.getElementById(emailFieldId).value;
		if (!checkEmail(email))
		{
			alert('Wrong email!');
			return false;
		}
		ajaxInvite.setVar("email", email);
		ajaxInvite.setVar("id", id);
		ajaxInvite.setVar("type", type);
		ajaxInvite.setVar("from", userId);
		ajaxInvite.setVar("sss", sss);
		ajaxInvite.requestFile = "/send_invite.php";
		ajaxInvite.onCompletion = function (){alert("Your invitation has been successfuly sent.");}
		ajaxInvite.runAJAX();
		return false;
	}
	
	var checkMailbox = new sack();
	function checkMyMailbox(id)
	{
			checkMailbox.setVar('id', id);
			checkMailbox.requestFile = "/check_mailbox.php";
			checkMailbox.onCompletion = showNewMail;
			checkMailbox.runAJAX();
			setTimeout('checkMyMailbox('+id+')', 30000);
			return true;
	}
	
	function showNewMail(){
		if (checkMailbox)
		eval(checkMailbox.response);
	}
	
	var updc = new sack();
	function updcom(id, type)
	{
			updc.reset();
			updc.setVar('id', id);
			if (type != 3)
			{
				com = document.getElementById('comm_edit'+id).value;
				updc.setVar('com', com);
			}
			else
			{
				updc.setVar('auth', 1);
			}
			if (type == 1)
			{
				updc.requestFile = "/update_comment_ignore.php";
			}
			else if (type == 2)
			{
				updc.requestFile = "/update_comment_friend.php";
			}
			else
			{
				updc.requestFile = "/update_comment.php";
			}
			updc.onCompletion = showNewComment;
			updc.runAJAX();
			return false;
	}
	
	
	function showNewComment(){
		if (updc)
		eval(updc.response);
	}
	
	function getEffect(id)
	{
		obj = document.getElementById(id);
		obj2 = obj.getElementsByTagName('div')[0];
		cla = getStyle(obj2, 'background-image');
		if (cla.lastIndexOf('plus_right.gif') == -1)
			obj2.style.backgroundImage = 'url(/images/design/plus_right.gif)';
		else obj2.style.backgroundImage = 'url(/images/design/plus_left.gif)';
	
	}
	function getEffect2(id)
	{
		obj = document.getElementById(id);
		src = obj.getElementsByTagName('div')[0];
		cla = getStyle(src, 'background-image');
		if (cla.lastIndexOf('com_b.gif') == -1)
			src.style.backgroundImage = 'url(/images/images/com_b.gif)';
		else src.style.backgroundImage = 'url(/images/images/com_t.gif)';
	
	}
	function View_all_ri(obj1, id1, id2 )
	{
		if (obj1.className == 'more')
		{
			obj1.className +=' less';
			obj1.getElementsByTagName('span')[0].innerHTML = 'Less';
			document.getElementById(id2).style.display = 'none';
			document.getElementById(id1).style.display = 'block';
		}
		else
		{
			obj1.className = 'more';
			obj1.getElementsByTagName('span')[0].innerHTML = 'More';
			document.getElementById(id2).style.display = 'block';
			document.getElementById(id1).style.display = 'none';
		}
	}
	
	function getClientWidth()
	{
	  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
	}
	
	function getElementPosition(elemId)
	{
	    var elem = document.getElementById(elemId);
	
	    var w = elem.offsetWidth;
	    var h = elem.offsetHeight;
	
	    var l = 0;
	    var t = 0;
	
	    while (elem)
	    {
	        l += elem.offsetLeft;
	        t += elem.offsetTop;
	        elem = elem.offsetParent;
	    }
	
	    return {"left":l, "top":t, "width": w, "height":h};
	}
	
	function getPopup(obj_id, pop_id)
	{
		popup = document.getElementById(pop_id);
		obj = document.getElementById(obj_id);
	
		pos = getElementPosition(obj_id);
		popup.style.display = 'block';
		if ((getClientWidth()-pos.left)<325)
		{
			popup.style.right = 0+'px';
			popup.style.left = 'auto';
		}
		else popup.style.left = pos.left+'px';
		popup.style.top = (pos.top+20)+'px';
	}
	
	function popWinPhoto(ul) {
		var theURL = ul;
		newWin = window.open(theURL,'photo','toolbar=No,menubar=No,left=200,top=200,resizable=No,scrollbars=No,status=No,location=No,width=400,height=340');
	}
	
	function popWinPrivateMessage(ul) {
		var theURL = ul;
		newWin = window.open(theURL,'mes','toolbar=No,menubar=No,left=200,top=200,resizable=No,scrollbars=No,status=No,location=No,width=700,height=460');
	}
	
	function popWin(url,width,height) {
		var theURL = url;
		//width = width;
		//height = height;
		popupWin = window.open(url,'one_shot','toolbar=No,menubar=No,left=200,top=200,resizable=No,scrollbars=No,status=No,location=No,width='+width+',height='+height);
		//popupWin.focus();
	}
	
	
	
	function popWinLink(ul, field, form) {
		var theURL = ul;
		newWin = window.open(theURL + ".field-" + field + ".form-" + form,'link','toolbar=No,menubar=No,left=200,top=200,resizable=No,scrollbars=No,status=No,location=No,width=400,height=270');
	}
	
	function popWinSuggest(ul) {
		var theURL = ul;
		newWin = window.open(theURL ,'suggesttopic','toolbar=No,menubar=No,left=200,top=200,resizable=No,scrollbars=No,status=No,location=No,width=400,height=420');
	}
	
	
	function addText( input, insText ) {
	 input.focus();
	 if( input.createTextRange ) {
	  document.selection.createRange().text += insText;
	 } else if( input.setSelectionRange ) {
	  var len = input.selectionEnd;
	  input.value = input.value.substr( 0, len )
	   + insText + input.value.substr( len );
	  input.setSelectionRange(len+insText.length,len+insText.length);
	 } else { input.value += insText; }
	}
	var usr_id = 0;
	function getMessage(id, block_id, msg_id, user_id)
	{
		usr_id = user_id;
		checkMyUnreadMailbox(msg_id);
		sp = document.getElementById(block_id).getElementsByTagName('span');
		i=0;
		while (sp[i])
		{
			if (sp[i].className=='gray_msg')
			{
				dp = getStyle(sp[i], 'display');
				if (dp == 'block') sp[i].style.display = 'none';
				else sp[i].style.display = 'block';
			}
			i++;
		}
		obj = document.getElementById(id);
		disp = getStyle(obj, 'display');
		if (disp == 'none') obj.style.display = 'block';
		else obj.style.display = 'none';
	}
	
	var checkUnreadMailbox = new sack();
	function checkMyUnreadMailbox(msg_id)
	{
			checkUnreadMailbox.setVar('msg_id', msg_id);
			checkUnreadMailbox.requestFile = "/check_unread_mailbox.php";
			checkUnreadMailbox.onCompletion = showUnreadMail;
			checkUnreadMailbox.runAJAX();
			return true;
	}
	
	function showUnreadMail(){
		if (checkUnreadMailbox)
		{
			eval(checkUnreadMailbox.response);
			if (usr_id) checkMyMailbox(usr_id);
		}
	}
	
	function check_review(el){
		review_control = document.getElementById(el);
		if (review_control && (review_control.value))
		{
			return true;
		}
		alert('Entrez des critique');
		return false;
	}
	
	/***** EDIT-TAG FUNCTIONS *****/
	function getEditInput(obj_id, but_id)
	{
		obj = document.getElementById(obj_id);
		pos = getElementPosition(obj_id);
		obj_width = pos.width;
		if (obj_width<100) obj_width = 100;
		text = obj.getElementsByTagName('div')[0].innerHTML;
		obj.innerHTML = '<input style=\"width: '+obj_width+'px\" type=\"text\" value=\"'+text+'\" \/>';
		but = document.getElementById(but_id);
		but.style.display = 'block';
		but.getElementsByTagName('div')[0].onclick = function() {
			text = obj.getElementsByTagName('input')[0].value;
			obj.innerHTML = '<div onclick=\"getEditInput(\''+obj_id+'\', \''+but_id+'\')">'+text+'</div>';
			but.style.display = 'none';
			id = but_id.substr(5);
			id = 1*id;
			tags_text[id] = text;
		}
	}
	
	function addNewTag(id)
	{
		obj = document.getElementById(id);
		obj.outerHTML = '<div class=\"edit_tag\" id=\"tag_'+t_count+'\"><div class=\"et_left\"><div class=\"etl_img\" title=\"Delete tag\" onclick=\"delTag(\'tag_'+t_count+'\', \''+t_count+'\');\" onmouseover=\"this.className+=\' hov\'\" onmouseout=\"this.className=\'etl_img\'\">&nbsp;<\/div><\/div><div class=\"ed_tag_cont\" id=\"tag_cont_'+t_count+'\"><div onclick=\"getEditInput(\'tag_cont_'+t_count+'\', \'edit_'+t_count+'\')\"><\/div><\/div><div class=\"et_right\" id=\"edit_'+t_count+'\"><div class=\"etr_img\" title=\"Edit tag\">&nbsp;<\/div><\/div><\/div><div id=\"add_tag_'+t_count+'\" style=\"float:left; width: auto;\"><a href=\"javascript: void(0);\" class=\"add_tag\" title=\"Add tag\" onclick=\"addNewTag(\'add_tag_'+t_count+'\');\">Add tag<\/a><\/div>';
		getEditInput('tag_cont_'+t_count, 'edit_'+t_count);
		t_count++;
	}
	
	function addTag(id, text)
	{
		document.write('<div class=\"edit_tag\" id=\"'+'tag_'+id+'\"><div class=\"et_left\"><div class=\"etl_img\" title=\"Delete tag\" onclick=\"delTag(\'tag_'+t_count+'\', \''+t_count+'\');\" onmouseover=\"this.className+=\' hov\'" onmouseout=\"this.className=\'etl_img\'\">&nbsp;</div></div><div class=\"ed_tag_cont\" id=\"tag_cont_'+id+'\"><div onclick=\"getEditInput(\'tag_cont_'+id+'\', \'edit_'+id+'\')\">'+text+'</div></div><div class=\"et_right\" id=\"edit_'+id+'\"><div class=\"etr_img\" title=\"Edit tag\">&nbsp;</div></div></div>');
		tags_text[t_count] = text;
		t_count++;
	}
	
	function delTag(id, num)
	{
		document.getElementById(id).style.display = 'none';
		tags_text[num] = '';
	}
	
	function pack_tags(id)
	{
		field = document.getElementById(id);
		if (!field) return;
		field.value = '';
		for (i = 0; i < tags_text.length; i++)
		{
			if (tags_text[i])
			{
				field.value = field.value + tags_text[i];
				if (i < tags_text.length - 1)
					 field.value = field.value + ' ';
			}
		}
	}
	
	/***** END EDIT-TAG FUNCTIONS *****/
	function setStyleValues(type,value)
	{
		document.getElementById('selected_type').value=type;
		document.getElementById('selected_value').value=value;
		//document.forms.set_style.selected_type.value = type;
		//document.forms.set_style.selected_value.value = value;
	
	}
	
	//TOP
	function SetTopC(c) {
		var ajaxtopc = new sack();
		ajaxtopc.setVar("c",c);
		ajaxtopc.requestFile = "/addon/set_topc.php";
		ajaxtopc.onCompletion = function() { eval(ajaxtopc.response); };
		ajaxtopc.runAJAX();
	}

	function showBlock(showname)
	{
		var sblock = document.getElementById(showname);
		sblock.style.display = 'block';
	}
	
	
	function hideBlock(hidename)
	{
			var hblock = document.getElementById(hidename);
			hblock.style.display = 'none';
	}

	function chkseoform()
	{
		age_from = document.form1.age_from.value;
		age_to   = document.form1.age_to.value;
		if (age_from > age_to && age_from > 0 && age_to > 0)
		{
			alert('Ages invalides.!');
			return false;
		}

		return true;
	}
	
	function showOther()
	{
	 var sell = document.getElementById('sell_region');
	 for ( var i = 0; i<sell.length; ++i)
	 {
	 if (sell.options[i].selected)
	 	{
			if (sell.options[i].value == 'other')
			{
			getPopupx('sell_region', 'block_region', -30, 318);
			}
	  	}
	  }
	}
	
	function getPopupx(obj_id, pop_id, tpoz, lpoz)
	{
		popup = document.getElementById(pop_id);
		obj = document.getElementById(obj_id);
					
		pos = getElementPositionx(obj_id);
		
		if ((getClientWidthx()-pos.left)<325)
		{
			popup.style.right = 0+'px';
			popup.style.left = 'auto';
			popup.style.display = 'block';
		}
		else popup.style.left = (pos.left-lpoz)+'px';
		popup.style.top = (pos.top-tpoz)+'px';
		popup.style.display = 'block';
	}

	function getClientWidthx()
	{
	  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
	}
	
	function getElementPositionx(elemId)
	{
	    var elem = document.getElementById(elemId);
	
	    var w = elem.offsetWidth;
	    var h = elem.offsetHeight;
	
	    var l = 0;
	    var t = 0;
	
	    while (elem)
	    {
	        l += elem.offsetLeft;
	        t += elem.offsetTop;
	        elem = elem.offsetParent;
	    }
	
	    return {"left":l, "top":t, "width": w, "height":h};
	}

function showBlock(showname)
{
	var sblock = document.getElementById(showname);
	sblock.style.display = 'block';
}

function hideBlock(hidename)
{
	var hblock = document.getElementById(hidename);
	hblock.style.display = 'none';
}

function chkseoform()
{
	age_from = document.form1.age_from.value;
	age_to   = document.form1.age_to.value;
	if (age_from > age_to && age_from > 0 && age_to > 0)
	{
		alert('Age invalide.');
		return false;
	}
	return true;
}

function showOther()
{
	var sell = document.getElementById('sell_region');
	for ( var i = 0; i<sell.length; ++i)
 	{
 		if (sell.options[i].selected)
 		{
			if (sell.options[i].value == 'other')
			{
				getPopupx('sell_region', 'block_region', -30, 318);
			}
  		}
  	}
}

function getPopupx(obj_id, pop_id, tpoz, lpoz)
{
	popup = document.getElementById(pop_id);
	obj = document.getElementById(obj_id);
	pos = getElementPositionx(obj_id);
	if ((getClientWidthx()-pos.left)<325)
	{
		popup.style.right = 0+'px';
		popup.style.left = 'auto';
		popup.style.display = 'block';
	}
	else popup.style.left = (pos.left-lpoz)+'px';
	popup.style.top = (pos.top-tpoz)+'px';
	popup.style.display = 'block';
}

function getClientWidthx()
{
  	return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function getElementPositionx(elemId)
{
    var elem = document.getElementById(elemId);
    var w = elem.offsetWidth;
    var h = elem.offsetHeight;
    var l = 0;
    var t = 0;
    while (elem)
    {
        l += elem.offsetLeft;
        t += elem.offsetTop;
        elem = elem.offsetParent;
    }
    return {"left":l, "top":t, "width": w, "height":h};
}

function addOtherRegion()
{
	var sellRegion = document.getElementById('regionObj');
	var sellOther = document.getElementById('cityObj');
	var sellCountry = document.getElementById('countryObj');
	var sellSearch = document.getElementById('sell_region');
	var sellNum = new Array;
	var newValue;
	if (sellCountry.selectedIndex>=0)
	{
		newValue = sellCountry.options[sellCountry.options.selectedIndex].value;
	}
	else
	{
		alert('Sélectionnez un pays');
		return false;
	}

	if (sellRegion.selectedIndex>=1)
	{
		newValue += '-'+sellRegion.options[sellRegion.options.selectedIndex].value;
	}

	if (sellOther.selectedIndex>=1)
	{
		newValue += '-'+sellOther.options[sellOther.options.selectedIndex].value;
	}
	var tvalue;
	for (j=0; j<sellSearch.length; ++j)
	{
		if (sellSearch.options[j].value == newValue)
		{
			tvalue = true;
			break;
		}
		else
		{
			tvalue = false;
		}
	}
	if (tvalue == true)
	{
		sellSearch.options[j].selected = true;
		hideBlock('block_region');
	}
	else
	{
		var newOpt = document.createElement("option");
		if (sellOther.selectedIndex>=1)
			newOpt.text = sellOther.options[sellOther.options.selectedIndex].text + ', ' + sellCountry.options[sellCountry.options.selectedIndex].text;
		else if (sellRegion.selectedIndex>=1)
		{
			newOpt.text = sellRegion.options[sellRegion.options.selectedIndex].text + ', ' + sellCountry.options[sellCountry.options.selectedIndex].text;
		}
		else if (sellCountry.selectedIndex>=0)
		{
			newOpt.text = sellCountry.options[sellCountry.options.selectedIndex].text;
		}
		var browser_name = navigator.appName;
		if (browser_name == "Microsoft Internet Explorer")
		{
			sellSearch.add(newOpt, sellSearch.length-1);
		}
		else
		{
			sellSearch.add(newOpt, sellSearch.options[sellSearch.length-1]);
		}
		sellSearch.options[sellSearch.length-2].selected = true;
		sellSearch.options[sellSearch.length-2].value = newValue;
		hideBlock('block_region');
	}
}

function shloginTXT (sh_id,hd_id)
{
var ss = document.getElementById(sh_id);
ss.style.display = 'block';
var hh = document.getElementById(hd_id);
hh.style.display = 'none';
var bb = document.getElementById('vblocked');
bb.style.display = 'none';
}

