function next_page(page_type,page_site,iframe_id)
{
	if(page_type=="iframe")
		window.document.getElementById(iframe_id).src=page_site;
	else
		document.location=page_site;
}

function change(id,color1,color2)
{
	document.getElementById(id).style.backgroundColor=color1;
	id=id+"_2";
	document.getElementById(id).style.color=color2;
}

function change_back(id,color1,color2)
{
	document.getElementById(id).style.backgroundColor=color1;
	id=id+"_2";
	document.getElementById(id).style.color=color2;
}

function sendStyle()
{
	document.frmStyle.style.value=document.all.styles.value;
	document.frmStyle.submit();
}

function new_window(win,sid)
{
	switch(win)
	{
		case 'color':
			var win;
			var topx=(screen.height/2)-(468/2);
			var leftx=(screen.width/2)-(266/2);
			win=window.open("color.php?PHPSESSID="+sid, "Color", "width=266,height=468,scrollbars=no,top="+topx+",left="+leftx);
			win.creator=self;
			break
		case 'list':
			var win;
			var topx=(screen.height/2)-(290/2);
			var leftx=(screen.width/2)-(427/2);
			
			var txtarea=document.all.txttext;
			var theSelection = document.selection.createRange().text;
			var text="";
			
			if(theSelection)
			{
				text=theSelection;
				theSelection = '';
			}
			
			win=window.open("liste.php?PHPSESSID="+sid+"&text="+text, "Liste", "width=427,height=255,scrollbars=no,top="+topx+",left="+leftx);
			win.creator=self;
			break;
		case 'listing':
			var win;
			var topx=(screen.height/2)-(372/2);
			var leftx=(screen.width/2)-(511/2);
			win=window.open("listing.php?PHPSESSID="+sid, "Listing", "width=511,height=372,scrollbars=no,top="+topx+",left="+leftx);
			win.creator=self;
			break;
		case 'avatar':
			var win;
			var topx=(screen.height/2)-(183/2);
			var leftx=(screen.width/2)-(298/2);
			win=window.open("avatar.php?PHPSESSID="+sid+"&pic="+document.frmSave.hidimg.value, "Avatar", "width=298,height=183,scrollbars=no,top="+topx+",left="+leftx);
			win.creator=self;
			break;
		case 'send_window':
			var win;
			var topx=(screen.height/2)-(183/2);
			var leftx=(screen.width/2)-(298/2);
			win=window.open("send_window.php?PHPSESSID="+sid+"&type="+send_type, "window", "width=298,height=183,scrollbars=no,top="+topx+",left="+leftx);
			win.creator=self;
			break;
		case 'send_user':
			var win;
			var topx=(screen.height/2)-(220/2);
			var leftx=(screen.width/2)-(310/2);
			win=window.open("send_user_search.php?PHPSESSID="+sid, "user_search", "width=310,height=220,scrollbars=no,top="+topx+",left="+leftx);
			win.creator=self;
			break;
	}
}
