function add(value)
{
	document.getElementById('textedit').value += '' + value + ' ';
    document.getElementById('textedit').focus();
}

	function preview(value)
{
	value = value.replace(/\[b\]/g,"<b>");
	value = value.replace(/\[\/b\]/g,"</b>");

	value = value.replace(/\[h1\]/g,"<h1>");
	value = value.replace(/\[\/h1\]/g,"</h1>");
	
	value = value.replace(/\[h2\]/g,"<h2>");
	value = value.replace(/\[\/h2\]/g,"</h2>");
	
	value = value.replace(/\[h3\]/g,"<h3>");
	value = value.replace(/\[\/h3\]/g,"</h3>");
	
	value = value.replace(/\[h4\]/g,"<h4>");
	value = value.replace(/\[\/h4\]/g,"</h4>");
	
	value = value.replace(/\[h5\]/g,"<h5>");
	value = value.replace(/\[\/h5\]/g,"</h5>");
	
	value = value.replace(/\[h6\]/g,"<h6>");
	value = value.replace(/\[\/h6\]/g,"</h6>");

	value = value.replace(/\[midden\]/g,"<div align=\"center\">");
	value = value.replace(/\[\/midden\]/g,"</div>");
	
	value = value.replace(/\[links\]/g,"<div align=\"left\">");
	value = value.replace(/\[\/links\]/g,"</div>");	

	value = value.replace(/\[rechts\]/g,"<div align=\"right\">");
	value = value.replace(/\[\/rechts\]/g,"</div>");	
	
	value = value.replace(/\[s\]/g,"<s>");
	value = value.replace(/\[\/s\]/g,"</s>");
	
	value = value.replace(/\[i\]/g,"<i>");
	value = value.replace(/\[\/i\]/g,"</i>");
	
	value = value.replace(/\[u\]/g,"<u>");
	value = value.replace(/\[\/u\]/g,"</u>");		
	
	value = value.replace(/\[large\]/g,"<p class=\"large\">");
	value = value.replace(/\[\/large\]/g,"</p>");
	
	value = value.replace(/\[li\]/g,"<li>");
	value = value.replace(/\[\/li\]/g,"</li>");	
	
			
	
	value = value.replace(/:D/g,"<img src=\"style/smilies/7.png\"  />");
	value = value.replace(/:d/g,"<img src=\"style/smilies/7.png\"  />");
	value = value.replace(/:p/g,"<img src=\"style/smilies/2.png\" />");
	value = value.replace(/:P/g,"<img src=\"style/smilies/2.png\" />");
	value = value.replace(/:\)/g,"<img src=\"style/smilies/cocktail.png\" />");	
	value = value.replace(/:\(/g,"<img src=\"style/smilies/1.png\" />");
	value = value.replace(/:\?/g,"<img src=\"style/smilies/8.png\" />");	
	value = value.replace(/8\)/g,"<img src=\"style/smilies/googles2.png\" />");
	value = value.replace(/:@/g,"<img src=\"style/smilies/12.png\" />");
	value = value.replace(/:\|/g,"<img src=\"style/smilies/14.png\" />");
	value = value.replace(/:k/g,"<img src=\"style/smilies/13.png\" />");	
		
	value = value.replace(/:L\@/g,"<img src=\"style/smilies/11.png\">");	
	value = value.replace(/:g/g,"<img src=\"style/smilies/girl2.png\">");		
	value = value.replace(/:G/g,"<img src=\"style/smilies/girl2.png\">");	
	value = value.replace(/:B/g,"<img src=\"style/smilies/15.png\">");
	value = value.replace(/:b/g,"<img src=\"style/smilies/15.png\">");
	value = value.replace(/:o/g,"<img src=\"style/smilies/4.png\">");	
	value = value.replace(/:O/g,"<img src=\"style/smilies/4.png\">");	
	value = value.replace(/:\$/g,"<img src=\"style/smilies/3.png\">");
	value = value.replace(/:h/g,"<img src=\"style/smilies/16.png\">");		
	value = value.replace(/:H/g,"<img src=\"style/smilies/16.png\">");	
		
	value = value.replace(/:zonnig:/g,"<img src=\"style/icons/weather_sun.png\">");	
	value = value.replace(/:regen:/g,"<img src=\"style/icons/weather_rain.png\">");	
	value = value.replace(/:bewolkt:/g,"<img src=\"style/icons/weather_cloudy.png\">");	
	value = value.replace(/:wolken:/g,"<img src=\"style/icons/weather_clouds.png\">");		
	value = value.replace(/:bliksem:/g,"<img src=\"style/icons/weather_lightning.png\">");	
	value = value.replace(/\(y\)/g,"<img src=\"style/editor/thumb_up.png\">");		
	value = value.replace(/\(n\)/g,"<img src=\"style/editor/thumb_down.png\">");	
	
	value = value.replace(/:qr1:/g,"<img src=\"style/icons/1.png\">");		
	value = value.replace(/:qr2:/g,"<img src=\"style/icons/2.png\">");		
	value = value.replace(/:qr3:/g,"<img src=\"style/icons/3.png\">");		
	value = value.replace(/:qr4:/g,"<img src=\"style/icons/4.png\">");		
	value = value.replace(/:qr5:/g,"<img src=\"style/icons/5.png\">");		
	value = value.replace(/:qr6:/g,"<img src=\"style/icons/6.png\">");		
	value = value.replace(/:qr7:/g,"<img src=\"style/icons/7.png\">");		
	value = value.replace(/:qr8:/g,"<img src=\"style/icons/8.png\">");		
	value = value.replace(/:qr9:/g,"<img src=\"style/icons/9.png\">");		
	value = value.replace(/:qr10:/g,"<img src=\"style/icons/10.png\">");		
	value = value.replace(/:qr11:/g,"<img src=\"style/icons/11.png\">");		
	value = value.replace(/:qr12:/g,"<img src=\"style/icons/12.png\">");			

	value = value.replace(/:wr1:/g,"<img src=\"style/icons/animated/1.png\">");		
 	value = value.replace(/:wr2:/g,"<img src=\"style/icons/animated/2.png\">");		
	value = value.replace(/:wr3:/g,"<img src=\"style/icons/animated/3.png\">");		
	value = value.replace(/:wr4:/g,"<img src=\"style/icons/animated/4.png\">");		
	value = value.replace(/:wr5:/g,"<img src=\"style/icons/animated/5.png\">");		
	value = value.replace(/:wr6:/g,"<img src=\"style/icons/animated/6.png\">");		
	value = value.replace(/:wr7:/g,"<img src=\"style/icons/animated/7.png\">");		
	value = value.replace(/:wr8:/g,"<img src=\"style/icons/animated/8.png\">");		
	value = value.replace(/:wr9:/g,"<img src=\"style/icons/animated/9.png\">");		
	value = value.replace(/:wr10:/g,"<img src=\"style/icons/animated/10.png\">");		
	value = value.replace(/:wr11:/g,"<img src=\"style/icons/animated/11.png\">");		
	value = value.replace(/:wr12:/g,"<img src=\"style/icons/animated/12.png\">");		
	value = value.replace(/:wr13:/g,"<img src=\"style/icons/animated/13.png\">");		
	value = value.replace(/:wr14:/g,"<img src=\"style/icons/animated/14.png\">");		
	value = value.replace(/:wr15:/g,"<img src=\"style/icons/animated/15.png\">");		
	value = value.replace(/:wr16:/g,"<img src=\"style/icons/animated/16.png\">");		
	value = value.replace(/:wr17:/g,"<img src=\"style/icons/animated/17.png\">");		
	value = value.replace(/:wr18:/g,"<img src=\"style/icons/animated/18.png\">");		
	value = value.replace(/:wr19:/g,"<img src=\"style/icons/animated/19.png\">");		
	value = value.replace(/:wr20:/g,"<img src=\"style/icons/animated/20.png\">");		
       
	



	value = value.replace(/\n/g,"<p class=\"margin\"></p>");	

	
	document.getElementById("preview").innerHTML =  value;
}




function loadFile(url) {
      req = false;

if(window.XMLHttpRequest) {
      try {
                  req = new XMLHttpRequest();
} catch(e) {
                  req = false;
}

} else if(window.ActiveXObject) {
      try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
      } catch(e) {
      try {
            req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch(e) {
            req = false;
      }
            }
}
      if(req) {
            req.onreadystatechange = processReqChange;
            req.open("GET", url, true);
            req.send(null);
      }
}

function processReqChange() {

if (req.readyState == 4) {

if (req.status == 200) {
document.getElementById('extra_smilies').innerHTML = req.responseText;
} else {
alert("Probleem met verkrijgen van data:\n" +
req.statusText);
}
}
}

function load(value)
{
	document.getElementById('load').innerHTML = '<img src="style/images/loading.gif" class="content"> Loading...';
}



function preview_news_name(value)
{
	document.getElementById('nieuws_name').innerHTML = value;
}

function show(value1,value2,value3,value4,value5,value6,value7,value8,value9)
{

	name = '<p><b>Naam:</b> '+ value1 +'</p>';
	size = '<p class="margin"><b>Groote:</b> '+ value2 +'</p>';
	width = '<p class="margin"><b>Origineel:</b> '+ value3 +'</p>';
	
	link = '<p><b>Forum Link:</b></p> <p class="margin">';
	link2 = '<input type="text" class="button" value="[img]'+ value4 +'[/img]"></p>';	

	ratingbg = '<div id="rating2"></div>';
	
	if(value8 > 1)
	{
	countr = parseFloat(value5);
	countr2 = eval(countr * 10 * 2);
	countr3 = countr2;
	}
	else
	{
	countr3 = value5;
	value5 = value5 / 20;
		
	}



	text_r = '<p style="margin-top: 2px;">Rating: ('+ value5 +' / 5)</p>';
	text_r2 = '<p class="margin">'+ value8 +' stemmen</p>';			

	url = 'index.php?page=album&id='+ value7 +'&view='+ value6 +'&rate=';
	rating1 = '<div class="ratingblock">';
	rating2 = '<div id="unit_long1a">'; 
	rating3 = '<ul id="unit_ul1a" class="unit-rating" style="width:100px;">';     
	rating4 = '<li class="current-rating" style="width:'+ countr3 +'px;"></li>';
	rating5 = '<li><a href="'+ url +'1" title="1 / 5" class="r1-unit rater" rel="nofollow">1</a></li>';
	rating6 = '<li><a href="'+ url +'2" title="2 / 5" class="r2-unit rater" rel="nofollow">2</a></li>';
	rating7 = '<li><a href="'+ url +'3" title="3 / 5" class="r3-unit rater" rel="nofollow">3</a></li>';
	rating8 = '<li><a href="'+ url +'4" title="4 / 5" class="r4-unit rater" rel="nofollow">4</a></li>';
	rating9 = '<li><a href="'+ url +'5" title="5 / 5" class="r5-unit rater" rel="nofollow">5</a></li></ul>';
	rating10 = '</div></div>';
	
	views = '<p>'+ value9 +' keer bekeken.</p>';
	

	
	document.getElementById('show').innerHTML = name + size + width + link + link2  + rating3 + rating4 + rating5 + rating6 + rating7 + rating8 + rating9 + rating10 + text_r + text_r2 + views;
		
}

function unshow()
{



	document.getElementById('show').innerHTML = '';
		
}

function upload()
{



	document.getElementById('loading').innerHTML = '<img src="style/images/loading.gif" class="no-border">';
		
}
function contact()
{
	document.getElementById('contact_form').style.height='220px';
	document.getElementById('contact_form').style.visibility='visible';
}