function addcom(f){
message=document.addcom.content.value.replace(/\n/g,'<br />');
ajax();xhr.open('GET','../script.php?id='+f+'&message='+message,false);xhr.send(null);
if(xhr.readyState==4) document.getElementById('messages').innerHTML=xhr.responseText+document.getElementById('messages').innerHTML;
document.addcom.content.value='';button();}

function addcom2(f,i){
comment=escape(document.getElementById('shoutcom1_'+i).com.value);
if(comment!=''){
ajax();xhr.open('GET','../script.php?addcom='+f+'&comment='+comment,false);xhr.send(null);
if(xhr.readyState==4){document.getElementById('com0_'+i).innerHTML+=xhr.responseText;
document.getElementById('shoutcom1_'+i).com.value='';
options('shoutcom1_'+i);options('shoutcom0_'+i);}}}

function addctic(t){
message=document.addcom.content.value.replace(/\n/g,'<br />');
ajax();xhr.open('GET','../script.php?addctic='+t+'&message='+message,false);xhr.send(null);
if(xhr.readyState==4) document.getElementById('messages').innerHTML=xhr.responseText+document.getElementById('messages').innerHTML;
document.addcom.content.value='';button();}

function addctic2(t,i){
comment=escape(document.getElementById('shoutcom1_'+i).com.value);
if(comment!=''){
ajax();xhr.open('GET','../script.php?addctic2='+t+'&comment='+comment,false);xhr.send(null);
if(xhr.readyState==4){document.getElementById('com0_'+i).innerHTML+=xhr.responseText;
document.getElementById('shoutcom1_'+i).com.value='';
options('shoutcom1_'+i);options('shoutcom0_'+i);}}}

function delcom(i){
ajax();xhr.open('GET','../script.php?del='+i,false);xhr.send(null);
if(xhr.readyState==4) options('com_'+i);}

function delctic(i){
ajax();xhr.open('GET','../script.php?delctic='+i,false);xhr.send(null);
if(xhr.readyState==4) options('com_'+i);}

function rating(i){
if(i==0){document.getElementById('star1').src='/images/star0.png';document.getElementById('star2').src='/images/star0.png';document.getElementById('star3').src='/images/star0.png';document.getElementById('star4').src='/images/star0.png';document.getElementById('star5').src='/images/star0.png';}
if(i==1){document.getElementById('star1').src='/images/star.png';document.getElementById('star2').src='/images/star0.png';document.getElementById('star3').src='/images/star0.png';document.getElementById('star4').src='/images/star0.png';document.getElementById('star5').src='/images/star0.png';}
if(i==2){document.getElementById('star1').src='/images/star.png';document.getElementById('star2').src='/images/star.png';document.getElementById('star3').src='/images/star0.png';document.getElementById('star4').src='/images/star0.png';document.getElementById('star5').src='/images/star0.png';}
if(i==3){document.getElementById('star1').src='/images/star.png';document.getElementById('star2').src='/images/star.png';document.getElementById('star3').src='/images/star.png';document.getElementById('star4').src='/images/star0.png';document.getElementById('star5').src='/images/star0.png';}
if(i==4){document.getElementById('star1').src='/images/star.png';document.getElementById('star2').src='/images/star.png';document.getElementById('star3').src='/images/star.png';document.getElementById('star4').src='/images/star.png';document.getElementById('star5').src='/images/star0.png';}
if(i==5){document.getElementById('star1').src='/images/star.png';document.getElementById('star2').src='/images/star.png';document.getElementById('star3').src='/images/star.png';document.getElementById('star4').src='/images/star.png';document.getElementById('star5').src='/images/star.png';}}

function vote(id,n){
ajax();xhr.open('GET','../script.php?id='+id+'&vote='+n,false);xhr.send(null);
if(xhr.readyState==4){document.getElementById('rating').innerHTML=xhr.responseText;
if(document.getElementById('rating1')) document.getElementById('rating1').innerHTML=xhr.responseText;}}

function nnews(l,p){
ajax();xhr.open('GET','../news.php?m='+l+'&p='+p,false);xhr.send(null);
if(xhr.readyState==4) document.getElementById('nnews'+p).innerHTML=xhr.responseText;}

function photo(i,t){
ajax();xhr.open('GET','../script.php?photo='+i+'&t='+t,false);xhr.send(null);
if(xhr.readyState==4) document.getElementById('photo').innerHTML='<br />'+xhr.responseText;}

function player(n,i){
if(n=='imagerotator') document.getElementById('player').innerHTML='<embed src="/pass/mediaplayer/imagerotator.swf" width="604" height="453" allowfullscreen="true" allowscriptaccess="always" flashvars="repeat=list&shuffle=false&file=photo'+i+'.xml" />';
if(n=='mediaplayer') document.getElementById('player').innerHTML='<embed src="/pass/mediaplayer/player.swf" width="604" height="473" allowscriptaccess="always" allowfullscreen="true" flashvars="config='+i+'.conf.xml" />';}

function play(i){
ajax();xhr.open('GET','../play.php?id='+i,false);xhr.send(null);
if(xhr.readyState==4) document.getElementById('player').innerHTML=xhr.responseText;}

function shoutbox(m){
message=escape(document.shoutbox.message.value);
message=message.replace(/&/g,';amp;');
message=message.replace(/\+/g,';plu;');
if(document.shoutbox.s[1].checked) s=1; else s=0;
ajax();xhr.open('POST','../shoutbox.php',false);
xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xhr.send('space='+m+'&message='+message+'&s='+s);
if(xhr.readyState==4){document.getElementById('shoutbox').innerHTML=xhr.responseText+document.getElementById('shoutbox').innerHTML;
document.shoutbox.message.value='';}}

function shoutbox_c(m,i){
comment=escape(document.getElementById('shoutcom1_'+i).com.value);
if(comment!=''){
ajax();xhr.open('GET','../shoutbox.php?space='+m+'&n='+i+'&comment='+comment,false);xhr.send(null);
if(xhr.readyState==4){document.getElementById('com_'+i).innerHTML+=xhr.responseText;
document.getElementById('shoutcom1_'+i).com.value='';
options('shoutcom1_'+i);options('shoutcom0_'+i);}}}

function new_del(i){
ajax();xhr.open('GET','../shoutbox.php?del='+i,false);xhr.send(null);
if(xhr.readyState==4) options('new_'+i);}

function shoutbox_delc(i){
ajax();xhr.open('GET','../shoutbox.php?delc='+i,false);xhr.send(null);
if(xhr.readyState==4) options('shoutcom_'+i);}