function openn(targetId) {
target = document.getElementById(targetId);
if (target.style.display == "none"){
target.style.display="";
} else {
target.style.display="none";
}
}

var ns6=document.getElementById&&!document.all
function restrictinput(maxlength,e,placeholder){
if (window.event&&event.srcElement.value.length>=maxlength)
return false
else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
if (pressedkey.test(String.fromCharCode(e.which)))
e.stopPropagation()
}
}
function countlimit(maxlength,e,placeholder){
var theform=eval(placeholder)
var lengthleft=maxlength-theform.value.length
var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
if (window.event||e.target&&e.target==eval(placeholder)){
if (lengthleft<0)
theform.value=theform.value.substring(0,maxlength)
placeholderobj.innerHTML=lengthleft
}
}
function displaylimit(thename, theid, thelimit){
var theform=theid!=""? document.getElementById(theid) : thename
var limit_text='<span class="limit" id="'+theform.toString()+'">'+thelimit+'</span>'
if (document.all||ns6)
document.write(limit_text)
if (document.all){
eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
}
else if (ns6){
document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); 
document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true); 
}
}

var imageURL0 = "img/edit_down_arrow_icon.png";
if (document.images) {
var downper = new Image();
downper.src = "img/edit_down_arrow_icon.png";
var upper = new Image();
upper.src = "img/edit_up_arrow_icon.png";
}
function perim() {
if (document.images) {
if (imageURL0 == "img/edit_up_arrow_icon.png") imageURL0 = "img/edit_down_arrow_icon.png";
else imageURL0 = "img/edit_up_arrow_icon.png";
document.per.src = imageURL0;
}
}

var imageURL1 = "img/edit_down_arrow_icon.png";
if (document.images) {
var downpers = new Image();
downpers.src = "img/edit_down_arrow_icon.png";
var uppers = new Image();
uppers.src = "img/edit_up_arrow_icon.png";
}
function perims() {
if (document.images) {
if (imageURL1 == "img/edit_up_arrow_icon.png") imageURL1 = "img/edit_down_arrow_icon.png";
else imageURL1 = "img/edit_up_arrow_icon.png";
document.pers.src = imageURL1;
}
}

var imageURL2 = "img/edit_down_arrow_icon.png";
if (document.images) {
var downgen = new Image();
downgen.src = "img/edit_down_arrow_icon.png";
var upgen = new Image();
upgen.src = "img/edit_up_arrow_icon.png";
}
function genim() {
if (document.images) {
if (imageURL2 == "img/edit_up_arrow_icon.png") imageURL2 = "img/edit_down_arrow_icon.png";
else imageURL2 = "img/edit_up_arrow_icon.png";
document.gen.src = imageURL2;
}
}

var imageURL3 = "img/edit_down_arrow_icon.png";
if (document.images) {
var downcon = new Image();
downcon.src = "img/edit_down_arrow_icon.png";
var upcon = new Image();
upcon.src = "img/edit_up_arrow_icon.png";
}
function conim() {
if (document.images) {
if (imageURL3 == "img/edit_up_arrow_icon.png") imageURL3 = "img/edit_down_arrow_icon.png";
else imageURL3 = "img/edit_up_arrow_icon.png";
document.con.src = imageURL3;
}
}

var imageURL4 = "img/edit_down_arrow_icon.png";
if (document.images) {
var downcons = new Image();
downcons.src = "img/edit_down_arrow_icon.png";
var upcons = new Image();
upcons.src = "img/edit_up_arrow_icon.png";
}
function conims() {
if (document.images) {
if (imageURL4 == "img/edit_up_arrow_icon.png") imageURL4 = "img/edit_down_arrow_icon.png";
else imageURL4 = "img/edit_up_arrow_icon.png";
document.cons.src = imageURL4;
}
}

var imageURL5 = "img/edit_down_arrow_icon.png";
if (document.images) {
var downconss = new Image();
downconss.src = "img/edit_down_arrow_icon.png";
var upconss = new Image();
upconss.src = "img/edit_up_arrow_icon.png";
}
function conimss() {
if (document.images) {
if (imageURL5 == "img/edit_up_arrow_icon.png") imageURL5 = "img/edit_down_arrow_icon.png";
else imageURL5 = "img/edit_up_arrow_icon.png";
document.conss.src = imageURL5;
}
}

var imageURL6 = "img/menu_down_arrow_icon.png";
if (document.images) {
var downmenu = new Image();
downmenu.src = "img/menu_down_arrow_icon.png";
var upmenu = new Image();
upmenu.src = "img/menu_up_arrow_icon.png";
}
function menuop() {
if (document.images) {
if (imageURL6 == "img/menu_up_arrow_icon.png") imageURL6 = "img/menu_down_arrow_icon.png";
else imageURL6 = "img/menu_up_arrow_icon.png";
document.menuarrow.src = imageURL6;
}
}

var imageURL7 = "img/sh_down_arrow_icon.png";
if (document.images) {
var downsh0 = new Image();
downsh0.src = "img/sh_down_arrow_icon.png";
var upsh0 = new Image();
upsh0.src = "img/sh_close_arrow_icon.png";
}
function shop0() {
if (document.images) {
if (imageURL7 == "img/sh_close_arrow_icon.png") imageURL7 = "img/sh_down_arrow_icon.png";
else imageURL7 = "img/sh_close_arrow_icon.png";
document.sharrow0.src = imageURL7;
}
}

var imageURL8 = "img/sh_down_arrow_icon.png";
if (document.images) {
var downsh1 = new Image();
downsh1.src = "img/sh_down_arrow_icon.png";
var upsh1 = new Image();
upsh1.src = "img/sh_close_arrow_icon.png";
}
function shop1() {
if (document.images) {
if (imageURL8 == "img/sh_close_arrow_icon.png") imageURL8 = "img/sh_down_arrow_icon.png";
else imageURL8 = "img/sh_close_arrow_icon.png";
document.sharrow1.src = imageURL8;
}
}

var imageURL9 = "img/sh_down_arrow_icon.png";
if (document.images) {
var downsh2 = new Image();
downsh2.src = "img/sh_down_arrow_icon.png";
var upsh2 = new Image();
upsh2.src = "img/sh_close_arrow_icon.png";
}
function shop2() {
if (document.images) {
if (imageURL9 == "img/sh_close_arrow_icon.png") imageURL9 = "img/sh_down_arrow_icon.png";
else imageURL9 = "img/sh_close_arrow_icon.png";
document.sharrow2.src = imageURL9;
}
}

var imageURL10 = "img/sh_down_arrow_icon.png";
if (document.images) {
var downsh3 = new Image();
downsh3.src = "img/sh_down_arrow_icon.png";
var upsh3 = new Image();
upsh3.src = "img/sh_close_arrow_icon.png";
}
function shop3() {
if (document.images) {
if (imageURL10 == "img/sh_close_arrow_icon.png") imageURL10 = "img/sh_down_arrow_icon.png";
else imageURL10 = "img/sh_close_arrow_icon.png";
document.sharrow3.src = imageURL10;
}
}

var imageURL11 = "img/hu_quick_help_plus_icon.png";
if (document.images) {
var downsh4 = new Image();
downsh4.src = "img/hu_quick_help_plus_icon.png";
var upsh4 = new Image();
upsh4.src = "img/hu_quick_help_minus_icon.png";
}
function shop4() {
if (document.images) {
if (imageURL11 == "img/hu_quick_help_minus_icon.png") imageURL11 = "img/hu_quick_help_plus_icon.png";
else imageURL11 = "img/hu_quick_help_minus_icon.png";
document.sharrow4.src = imageURL11;
}
}

var imageURL12 = "img/en_quick_help_plus_icon.png";
if (document.images) {
var downsh5 = new Image();
downsh5.src = "img/en_quick_help_plus_icon.png";
var upsh5 = new Image();
upsh5.src = "img/en_quick_help_minus_icon.png";
}
function shop5() {
if (document.images) {
if (imageURL12 == "img/en_quick_help_minus_icon.png") imageURL12 = "img/en_quick_help_plus_icon.png";
else imageURL12 = "img/en_quick_help_minus_icon.png";
document.sharrow5.src = imageURL12;
}
}

var imageURL13 = "img/ja_quick_help_plus_icon.png";
if (document.images) {
var downsh6 = new Image();
downsh6.src = "img/ja_quick_help_plus_icon.png";
var upsh6 = new Image();
upsh6.src = "img/ja_quick_help_minus_icon.png";
}
function shop6() {
if (document.images) {
if (imageURL13 == "img/ja_quick_help_minus_icon.png") imageURL13 = "img/ja_quick_help_plus_icon.png";
else imageURL13 = "img/ja_quick_help_minus_icon.png";
document.sharrow6.src = imageURL13;
}
}

var imageURL14 = "img/de_quick_help_plus_icon.png";
if (document.images) {
var downsh7 = new Image();
downsh7.src = "img/de_quick_help_plus_icon.png";
var upsh7 = new Image();
upsh7.src = "img/de_quick_help_minus_icon.png";
}
function shop7() {
if (document.images) {
if (imageURL14 == "img/de_quick_help_minus_icon.png") imageURL14 = "img/de_quick_help_plus_icon.png";
else imageURL14 = "img/de_quick_help_minus_icon.png";
document.sharrow7.src = imageURL14;
}
}

var inputs;
var imgFalse = 'img/checkbox_off.png';
var imgTrue = 'img/checkbox_on.png';
function init() {
replaceChecks();
}
function replaceChecks() {
inputs = document.getElementsByTagName('input');
for(var i=0; i < inputs.length; i++) {
if(inputs[i].getAttribute('type') == 'checkbox') {
var img = document.createElement('img');
if(inputs[i].checked) {
img.src = imgTrue;
} else {
img.src = imgFalse;
}
img.id = 'checkImage'+i;
img.onclick = new Function('checkChange('+i+')');
inputs[i].parentNode.insertBefore(img, inputs[i]);
inputs[i].style.display='none';
}
}
}
function checkChange(i) {
if(inputs[i].checked) {
inputs[i].checked = '';
document.getElementById('checkImage'+i).src=imgFalse;
} else {
inputs[i].checked = 'checked';
document.getElementById('checkImage'+i).src=imgTrue;
}
}
window.onload = init;

function passpower(pass)
{
var score   = 0;
if (pass.length > 6) score++;	
if ( ( pass.match(/[a-z]/) ) && ( pass.match(/[A-Z]/) ) ) score++;
if (pass.match(/\d+/)) score++;
if ( pass.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/) )	score++;
if (pass.length > 12) score++;
document.getElementById("passdesc").innerHTML = desc[score];
document.getElementById("passpower").className = "des" + score;
}

function sel2(id,priv)
{
var url = 'genderpriv.php';
var pars = 'id=' + id + '&priv=' + priv;	
var myAjax = new Ajax.Request( 
url,
{ method: 'get', parameters: pars, onComplete: showResponse }); 
}
function reportError(request)
{
alert('Error!');
}
function showResponse(originalRequest)
{
$('genderlock').innerHTML = originalRequest.responseText;
}
function sel_age(id,priv)
{
var url = 'agepriv.php';
var pars = 'id=' + id + '&priv=' + priv;	
var myAjax = new Ajax.Request( 
url,
{ method: 'get', parameters: pars, onComplete: showResponse_age }); 
}
function reportError(request)
{
alert('Error!');
}
function showResponse_age(originalRequest)
{
$('agelock').innerHTML = originalRequest.responseText;
}
function sel_country(id,priv)
{
var url = 'countrypriv.php';
var pars = 'id=' + id + '&priv=' + priv;	
var myAjax = new Ajax.Request( 
url,
{ method: 'get', parameters: pars, onComplete: showResponse_country }); 
}
function reportError(request)
{
alert('Error!');
}
function showResponse_country(originalRequest)
{
$('countrylock').innerHTML = originalRequest.responseText;
}
function sel_school(id,priv)
{
var url = 'schoolpriv.php';
var pars = 'id=' + id + '&priv=' + priv;
var myAjax = new Ajax.Request( 
url,
{ method: 'get', parameters: pars, onComplete: showResponse_school }); 
}
function reportError(request)
{
alert('Error!');
}
function showResponse_school(originalRequest)
{
$('schoollock').innerHTML = originalRequest.responseText;
}
function sel_work(id,priv)
{
var url = 'workpriv.php';
var pars = 'id=' + id + '&priv=' + priv;
var myAjax = new Ajax.Request( 
url,
{ method: 'get', parameters: pars, onComplete: showResponse_work }); 
}
function reportError(request)
{
alert('Error!');
}
function showResponse_work(originalRequest)
{
$('worklock').innerHTML = originalRequest.responseText;
}
function sel_pet(id,priv)
{
var url = 'petpriv.php';
var pars = 'id=' + id + '&priv=' + priv;
var myAjax = new Ajax.Request( 
url,
{ method: 'get', parameters: pars, onComplete: showResponse_pet }); 
}
function reportError(request)
{
alert('Error!');
}
function showResponse_pet(originalRequest)
{
$('petlock').innerHTML = originalRequest.responseText;
}
function sel_hobby(id,priv)
{
var url = 'hobbypriv.php';
var pars = 'id=' + id + '&priv=' + priv;
var myAjax = new Ajax.Request( 
url,
{ method: 'get', parameters: pars, onComplete: showResponse_hobby }); 
}
function reportError(request)
{
alert('Error!');
}
function showResponse_hobby(originalRequest)
{
$('hobbylock').innerHTML = originalRequest.responseText;
}
function sel_my(id,priv)
{
var url = 'mypriv.php';
var pars = 'id=' + id + '&priv=' + priv;
var myAjax = new Ajax.Request( 
url,
{ method: 'get', parameters: pars, onComplete: showResponse_my }); 
}
function reportError(request)
{
alert('Error!');
}
function showResponse_my(originalRequest)
{
$('mylock').innerHTML = originalRequest.responseText;
}
function sel_mail(id,priv)
{
var url = 'mailpriv.php';
var pars = 'id=' + id + '&priv=' + priv;
var myAjax = new Ajax.Request( 
url,
{ method: 'get', parameters: pars, onComplete: showResponse_mail }); 
}
function reportError(request)
{
alert('Error!');
}
function showResponse_mail(originalRequest)
{
$('maillock').innerHTML = originalRequest.responseText;
}
function sel_web(id,priv)
{
var url = 'webpriv.php';
var pars = 'id=' + id + '&priv=' + priv;		
var myAjax = new Ajax.Request( 
url,
{ method: 'get', parameters: pars, onComplete: showResponse_web }); 
}
function reportError(request)
{
alert('Error!');
}
function showResponse_web(originalRequest)
{
$('weblock').innerHTML = originalRequest.responseText;
}
function sel_yout(id,priv)
{
var url = 'youtubepriv.php';
var pars = 'id=' + id + '&priv=' + priv;
var myAjax = new Ajax.Request( 
url,
{ method: 'get', parameters: pars, onComplete: showResponse_yout }); 
}
function reportError(request)
{
alert('Error!');
}
function showResponse_yout(originalRequest)
{
$('youtlock').innerHTML = originalRequest.responseText;
}
function sel_twit(id,priv)
{
var url = 'twitterpriv.php';
var pars = 'id=' + id + '&priv=' + priv;		
var myAjax = new Ajax.Request( 
url,
{ method: 'get', parameters: pars, onComplete: showResponse_twit }); 
}
function reportError(request)
{
alert('Error!');
}
function showResponse_twit(originalRequest)
{
$('twitlock').innerHTML = originalRequest.responseText;
}

//jobbraforgat

function rotateright(id)
	{
    
		var url = 'rotateright.php';
		var pars = 'id=' + id;
		
var myAjax = new Ajax.Request( 
 url,
 { method: 'get', parameters: pars, onComplete: showResponse_jobb }); 
	}



	function reportError(request)
	{
		alert('Error!');
	}

function showResponse_jobb(originalRequest)
	{
		//put returned XML in the textarea
		$('embed').innerHTML = originalRequest.responseText;
	}
	
//balforgat

function rotateleft(id)
	{
    
		var url = 'rotateleft.php';
		var pars = 'id=' + id;;
		
var myAjax = new Ajax.Request( 
 url,
 { method: 'get', parameters: pars, onComplete: showResponse_bal }); 
	}



	function reportError(request)
	{
		alert('Error!');
	}

function showResponse_bal(originalRequest)
	{
		//put returned XML in the textarea
		$('embed').innerHTML = originalRequest.responseText;
	}
	
//albumpriv

function sel_albpriv(id,user,priv,di)

{
// gpek

		var http = false;

				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "albumpriv.php?id=" + id + "&user="+ user + "&priv=" + priv + "&di=" + di, true);
				  http.onreadystatechange=function() {


					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById(di).innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);

// gpek vége
}


//videopriv

function sel_vidpriv(id,user,priv,di)

{
// gpek

		var http = false;

				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "vidpriv.php?id=" + id + "&user="+ user + "&priv=" + priv + "&di=" + di, true);
				  http.onreadystatechange=function() {


					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById(di).innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);

// gpek vége
}

//sound

function sel_sdpriv(id,user,priv,di)

{
// gpek

		var http = false;

				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "sdpriv.php?id=" + id + "&user="+ user + "&priv=" + priv + "&di=" + di, true);
				  http.onreadystatechange=function() {
          
          /*if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById(di).innerHTML = '<img src="img/loader.gif" alt="Loader" title="Loader">';
						  }*/

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById(di).innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);

// gpek vége
}

function sel_rspriv(id,user,priv,di)

{
// gpek

		var http = false;

				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "rspriv.php?id=" + id + "&user="+ user + "&priv=" + priv + "&di=" + di, true);
				  http.onreadystatechange=function() {
          
          /*if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById(di).innerHTML = '<img src="img/loader.gif" alt="Loader" title="Loader">';
						  }*/

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById(di).innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);

// gpek vége
}

function subs(id)

{
// gpek

		var http = false;

				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "wantfriend.php?id=" + id, true);
				  http.onreadystatechange=function() {
          
          if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("pok").innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("pok").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);

// gpek vége
}

function subs_back(id)

{
// gpek

		var http = false;

				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "friendback.php?id=" + id, true);
				  http.onreadystatechange=function() {
          
          if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("pok").innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("pok").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);

// gpek vége
}

function subs_ok(id)

{
// gpek

		var http = false;

				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "wefriends.php?id=" + id, true);
				  http.onreadystatechange=function() {
          
          if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("pok").innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("pok").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);

// gpek vége
}

function subs2(id,di)

{
// gpek

		var http = false;

				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "wantfriend2.php?id=" + id + "&di=" + di, true);
				  http.onreadystatechange=function() {
          
          if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById(di).innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById(di).innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);

// gpek vége
}

function subs_back2(id,di)

{
// gpek

		var http = false;

				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "friendback2.php?id=" + id + "&di=" + di, true);
				  http.onreadystatechange=function() {
          
          if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById(di).innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById(di).innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);

// gpek vége
}

function subs_ok2(id,di)

{
// gpek

		var http = false;

				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "wefriends2.php?id=" + id + "&di=" + di, true);
				  http.onreadystatechange=function() {
          
          if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById(di).innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById(di).innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);

// gpek vége
}

//chat
function chatting() {
		var http = false;
    var chats = document.getElementById ("cht");
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "chatting.php?uz=" + chats.value, true);
				  http.onreadystatechange=function() {

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("chats").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        chats.value = '';
        //document.getElementById("add_talk").style.display = "none";
// gpek vége
}

//üzenőfal
function talking() {
		var http = false;
    var uzenet = document.getElementById ("tlk");
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "talking.php?uz=" + uzenet.value, true);
				  http.onreadystatechange=function() {
          
          if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("talks").innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("talks").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        uzenet.value = '';
        //document.getElementById("add_talk").style.display = "none";
// gpek vége
}

//üzenőfal
function talking2() {
		var http = false;
    var uzenet = document.getElementById ("uzi");
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "talking2.php?uz=" + uzenet.value, true);
				  http.onreadystatechange=function() {
          
          if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("alltk").innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("alltk").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        uzenet.value = '';
        //document.getElementById("add_talk").style.display = "none";
// gpek vége
}

function deltalk(id) {
		var http = false;
    
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "deltalk.php?id=" + id, true);
				  http.onreadystatechange=function() {
          
          if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("alltk").innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("alltk").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        //uzenet.value = '';
        //document.getElementById("add_talk").style.display = "none";
// gpek vége
}

function ajaxlap() {
		var http = false;
    
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "ajaxlapoz.php", true);
				  http.onreadystatechange=function() {
          
          if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("lpz").innerHTML = '';
						  }

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("lpz").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        
// gpek vége
}

function seltodo() {
		var http = false;
    
    var ch = 0;
    
    var ch1 = document.getElementById ("ch1");
    var ch2 = document.getElementById ("ch2");
    var ch3 = document.getElementById ("ch3");
    var ch4 = document.getElementById ("ch4");
    
    if ( ch1.checked == true ) {
     ch = ch1.value;
    }
    
    if ( ch2.checked == true ) {
     ch = ch2.value;
    }
    
    if ( ch3.checked == true ) {
     ch = ch3.value;
    }
    
    if ( ch4.checked == true ) {
     ch = ch4.value;
    }
    
    var tenn = document.getElementById("tenn");
    
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "addtodo.php?t=" + tenn.value + "&c=" + ch, true);
				  http.onreadystatechange=function() {
          
          /*if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("tds").innerHTML = '';
						  }*/

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("tds").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        //document.getElementById("add_todo").style.display = "none";
        tenn.value = "";
// gpek vége
}

function seltodo2() {
		var http = false;
    
    var ch = 0;
    
    var cfh1 = document.getElementById ("cfh1");
    var cfh2 = document.getElementById ("cfh2");
    var cfh3 = document.getElementById ("cfh3");
    var cfh4 = document.getElementById ("cfh4");
    
    if ( cfh1.checked == true ) {
     ch = cfh1.value;
    }
    
    if ( cfh2.checked == true ) {
     ch = cfh2.value;
    }
    
    if ( cfh3.checked == true ) {
     ch = cfh3.value;
    }
    
    if ( cfh4.checked == true ) {
     ch = cfh4.value;
    }
    
    var tenn = document.getElementById("tennix");
    
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "addtodof.php?t=" + tenn.value + "&c=" + ch, true);
				  http.onreadystatechange=function() {
          
          /*if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("tds").innerHTML = '';
						  }*/

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("alltk").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        //document.getElementById("alltk").style.display = "none";
        tenn.value = "";
// gpek vége
}

function ajaxlap2() {
		var http = false;
    
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "ajaxlapoz2.php", true);
				  http.onreadystatechange=function() {
          
          if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("lpz").innerHTML = '';
						  }

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("lpz").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        
// gpek vége
}

function deltodo(id) {
		var http = false;
    
    
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "deltodo.php?id=" + id, true);
				  http.onreadystatechange=function() {
          
          /*if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("tds").innerHTML = '';
						  }*/

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("alltk").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        //document.getElementById("alltk").style.display = "none";
        //tenn.value = "";
// gpek vége
}

function kesztodo(id) {
		var http = false;
    
    
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "kesztodo.php?id=" + id, true);
				  http.onreadystatechange=function() {
          
          /*if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("tds").innerHTML = '';
						  }*/

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("alltk").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        //document.getElementById("alltk").style.display = "none";
        //tenn.value = "";
// gpek vége
}

function rmail(id) {
		var http = false;
    
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "rmail.php?prv=" + id, true);
				  http.onreadystatechange=function() {
          
          /*if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("rmail").innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }*/

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("rmail").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        
// gpek vége
}

function rpm(id) {
		var http = false;
    
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "rpm.php?prv=" + id, true);
				  http.onreadystatechange=function() {
          
          /*if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("rmail").innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }*/

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("rpm").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        
// gpek vége
}

function rhir(id) {
		var http = false;
    
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "rhir.php?prv=" + id, true);
				  http.onreadystatechange=function() {
          
          /*if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("rmail").innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }*/

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("rhir").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        
// gpek vége
}

function rmpri(id) {
		var http = false;
    
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "rmpri.php?prv=" + id, true);
				  http.onreadystatechange=function() {
          
          /*if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("rmail").innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }*/

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("rmpri").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        
// gpek vége
}

function ujmail() {
		var http = false;
    var ujm = document.getElementById ("ml").value;
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}


				http.abort();
				  http.open("GET", "newmail.php?ml=" + ujm, true);
				  http.onreadystatechange=function() {
          
          /*if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("rmail").innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }*/

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("fad").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        
// gpek vége
}

function ujpass() {
		var http = false;
    var old = document.getElementById ("old").value;
    var new1 = document.getElementById ("new1").value;
    var new2 = document.getElementById ("new2").value;
    
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}

        if ( new1 == new2 ) {
				http.abort();
				  http.open("GET", "newpass.php?pas=" + old + "&new=" + new1, true);
				  http.onreadystatechange=function() {
          
          /*if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("rmail").innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }*/

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("fad").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        } else {
				  document.getElementById("fad").innerHTML = "<div class=global-alert-full>'.$GLOBALS ['_old_pass_new_pass'].'</div><br />";
				  http.send(null);
        }
// gpek vége
}

function spage(id,s,dv,url) {
		var http = false;
    
    
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}

        
				http.abort();
				  http.open("GET", url+"?id=" + id + "&s=" + s, true);
				  http.onreadystatechange=function() {
          
          if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById(dv).innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById(dv).innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        
// gpek vége
}

function wrongProf(id) {
		var http = false;
    
    
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}

        
				http.abort();
				  http.open("GET", "wrongask.php?id=" + id, true);
				  http.onreadystatechange=function() {
          
          if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("wr").innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("wr").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        
// gpek vége
}

function sendProf(id,wh) {
		var http = false;
    
    
				if(navigator.appName == "Microsoft Internet Explorer") {
				  http = new ActiveXObject("Microsoft.XMLHTTP");
				} else {
				  http = new XMLHttpRequest();
				}

        
				http.abort();
				  http.open("GET", "wrong.php?id=" + id + "&wh=" + wh, true);
				  http.onreadystatechange=function() {
          
          if(http.readyState == 1)
				    		 {
						
				   	   document.getElementById("wr").innerHTML = '<img src="img/ploader.gif" alt="Loader" title="Loader">';
						  }

					if(http.readyState == 4)
				    		 {
						
				   	   document.getElementById("wr").innerHTML = http.responseText;
						  }

				  }
 				  
				  http.send(null);
        
// gpek vége
}

function initArray() {
 this.length = initArray.arguments.length
 for (var i = 0; i < this.length; i++)
  this[i+1] = initArray.arguments[i]
}

function havinev(ev,ho,nap) {
 if (ho==1) {
  var napok = new initArray("ÚJÉV, Fruzsina","Ábel","Genovéva, Benjámin","Titusz, Leona",
   "Simon","Boldizsár","Attila, Ramóna","Gyöngyvér","Marcell",
   "Melánia","Ágota","Ernő","Veronika","Bódog","Lóránt, Loránd",
   "Gusztáv","Antal, Antónia","Piroska","Sára, Márió","Fábián, Sebestyén",
   "Ágnes","Vince, Artúr","Zelma, Rajmund","Timót","Pál","Vanda, Paula",
   "Angelika","Károly, Karola","Adél","Martina, Gerda","Marcella","")
 }
 
 if (ho==2)
  if ((ev!=2000) && (ev!=2004) && ev!=1996) {
   var napok=new initArray("Ignác","Karolina, Aida","Balázs","Ráhel, Csenge","Ágota, Ingrid",
    "Dorottya, Dóra","Tódor, Rómeó","Aranka","Abigél, Alex","Elvira",
    "Bertold, Marietta","Lívia, Lídia","Ella, Linda","Bálint, Valentin",
    "Kolos, Georgina","Julianna, Lilla","Donát","Bernadett","Zsuzsanna",
    "Aladár, Álmos","Eleonóra","Gerzson","Alfréd",
    "Mátyás","Géza","Edina","Ákos, Bátor","Elemér","","") 
  } else {
   var napok=new initArray("Ignác","Karolina, Aida","Balázs","Ráhel, Csenge","Ágota, Ingrid",
    "Dorottya, Dóra","Tódor, Rómeó","Aranka","Abigél, Alex","Elvira",
    "Bertold, Marietta","Lívia, Lídia","Ella, Linda","Bálint, Valentin",
    "Kolos, Georgina","Julianna, Lilla","Donát","Bernadett","Zsuzsanna",
    "Aladár, Álmos","Eleonóra","Gerzson","Alfréd",
    "Szőkőnap","Mátyás","Géza","Edina","Ákos, Bátor","Elemér","","")
  }
 
 if (ho==3) {
  var napok=new initArray("Albin","Lujza","Kornélia","Kázmér","Adorján, Adrián","Leonóra, Inez",
   "Tamás","NŐNAP, Zoltán","Franciska, Fanni","Ildikó","Szilárd",
   "Gergely","Krisztián, Ajtony","Matild","NEMZETI ÜNNEP, Kristóf",
   "Henrietta","Gertrúd, Patrik","Sándor, Ede","József, Bánk","Klaudia",
   "Benedek","Beáta, Izolda","Emőke","Gábor, Karina","Irén, Irisz",
   "Emánuel","Hajnalka","Gedeon, Johanna","Auguszta","Zalán","Árpád","" )
 }
 
 if (ho==4) {
  var napok=new initArray("Hugó","Áron","Buda, Richárd","Izidor","Vince","Vilmos, Bíborka",
   "Herman","Dénes","Erhard","Zsolt","Leó, Szaniszló","Gyula","Ida",
   "Tibor","Anasztázia, Tas","Csongor","Rudolf","Andrea, Ilma","Emma",
   "Tivadar","Konrád","Csilla, Noémi","Béla","György","Márk","Ervin",
   "Zita","Valéria","Péter","Katalin, Kitti","" )
 }
 
 if (ho==5) {
  var napok=new initArray("MUNKA ÜNN.,Fülöp, Jakab","Zsigmond","Tímea, Irma","Mónika, Flórián",
   "Györgyi","Ivett, Frida","Gizella","Mihály","Gergely","Ármin, Pálma",
   "Ferenc","Pongrác","Szervác, Imola","Bonifác","Zsófia, Szonja",
   "Mózes, Botond","Paszkál","Erik, Alexandra","Ivó, Milán",
   "Bernát, Felícia","Konstantin","Júlia, Rita","Dezső","Eszter, Eliza",
   "Orbán","Fülöp, Evelin","Hella","Emil, Csanád","Magdolna",
   "Janka, Zsanett","Angéla, Petronella","" )}
 
 if (ho==6) {
  var napok=new initArray("Tünde","Kármen, Anita","Klotild","Bulcsú","Fatime","Norbert, Cintia",
   "Róbert","Medárd","Félix","Margit, Gréta","Barnabás","Villő",
   "Antal, Anett","Vazul","Jolán, Vid","Jusztin","Laura, Alida",
   "Arnold, Levente","Gyárfás","Rafael","Alajos, Leila","Paulina",
   "Zoltán","Iván","Vilmos","János, Pál","László","Levente, Irén",
   "Péter, Pál","Pál","" )
 }
 
 if (ho==7) {
  var napok=new initArray("Tihamér, Annamária","Ottó","Kornél, Soma","Ulrik","Emese, Sarolta",
   "Csaba","Appolónia","Ellák","Lukrécia","Amália","Nóra, Lili",
   "Izabella, Dalma","Jenő","Őrs, Stella","Henrik, Roland","Valter",
   "Endre, Elek","Frigyes","Emília","Illés","Dániel, Daniella",
   "Magdolna","Lenke","Kinga, Kincső","Kristóf, Jakab","Anna, Anikó",
   "Olga, Liliána","Szabolcs","Márta, Flóra","Judit, Xénia","Oszkár","" )
 }
 
 if (ho==8) {
  var napok=new initArray("Boglárka","Lehel","Hermina","Domonkos, Dominika","Krisztina",
   "Berta, Bettina","Ibolya","László","Emőd","Lőrinc",
   "Zsuzsanna, Tiborc","Klára","Ipoly","Marcell","Mária","Ábrahám",
   "Jácint","Ilona","Huba","ALKOTMÁNY ÜNN., István","Sámuel, Hajna",
   "Menyhért, Mirjam","Bence","Bertalan","Lajos, Patrícia","Izsó",
   "Gáspár","Ágoston","Beatrix, Erna","Rózsa","Erika, Bella")
 }
 
 if (ho==9) {
  var napok= new initArray("Egyed, Egon","Rebeka, Dorina","Hilda","Rozália","Viktor, Lőrinc",
   "Zakariás","Regina","Mária, Adrienn","Ádám","Nikolett, Hunor",
   "Teodóra","Mária","Kornél","Szeréna, Roxána","Enikő, Melitta","Edit",
   "Zsófia","Diána","Vilhelmina","Friderika","Máté, Mirella","Móric",
   "Tekla","Gellért, Mercédesz","Eufrozina, Kende","Jusztina","Adalbert",
   "Vencel","Mihály","Jeromos","" )
 }
 
 if (ho==10) {
  var napok= new initArray("Malvin","Petra","Helga","Ferenc","Aurél","Brúnó, Renáta","Amália",
   "Koppány","Dénes","Gedeon","Brigitta","Miksa","Kálmán, Ede","Helén",
   "Teréz","Gál","Hedvig","Lukács","Nándor","Vendel","Orsolya","Előd",
   "KÖZT.KIKIÁLT., Gyöngyi","Salamon","Blanka, Bianka","Dömötör",
   "Szabina","Simon, Szimonetta","Nárcisz","Alfonz","Farkas","" )
 }
 
 if (ho==11) {
  var napok=new initArray("Marianna","Achilles","Győző","Károly","Imre","Lénárd","Rezső",
   "Zsombor","Tivadar","Réka","Márton","Jónás, Renátó","Szilvia",
   "Aliz","Albert, Lipót","Ödön","Hortenzia, Gergő","Jenő","Erzsébet",
   "Jolán","Olivér","Cecília","Kelemen, Klementina","Emma","Katalin",
   "Virág","Virgil","Stefánia","Taksony","András, Andor","" )
 }
 
 if (ho==12) {
  var napok=new initArray("Elza","Melinda, Vivien","Ferenc, Olívia","Borbála, Barbara","Vilma",
   "Miklós","Ambrus","Mária","Natália","Judit","Árpád","Gabriella",
   "Luca, Otília","Szilárda","Valér","Etelka, Aletta","Lázár, Olimpia",
   "Auguszta","Viola","Teofil","Tamás","Zénó","Viktória","Ádám, Éva",
   "KARÁCSONY, Eugénia","KARÁCSONY, István","János","Kamilla",
   "Tamás, Tamara","Dávid","Szilveszter","")
 }
 
 return napok[nap]
}

function honev(ho) {
 var month = new initArray("január","február","március","április",
 "május","június","július","augusztus","szeptember","október",
 "november","december");
 return month[ho]
}

function napnev(szam) {
 var napok = new initArray("vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat","vasárnap")
 return napok[szam]
}

function kiir () {
 var ido = new Date();
 var ev = ido.getYear();
 var ho = ido.getMonth()+1;
 var nap = ido.getDate();
 if ((navigator.appName.indexOf('Netscape') != -1) || (navigator.appName.indexOf('Opera') != -1)) ev+=((ev<97) ? 2000 : 1900);
 document.writeln(""+ ev + ". " + honev(ho) + " " + nap + ". " + napnev(ido.getDay()+1)+". Ma <a href=\'http://tofriends.net/ecard\' class=\'small\'><b>" + havinev(ev,ho,nap)+"</b></a> névnap van.");
}

function tabview_aux(TabViewId, id)
{
  var TabView = document.getElementById(TabViewId);

  var Tabs = TabView.firstChild;
  while (Tabs.className != "Tabs" ) Tabs = Tabs.nextSibling;

  var Tab = Tabs.firstChild;
  var i   = 0;

  do
  {
    if (Tab.tagName == "A")
    {
      i++;
      Tab.href      = "javascript:tabview_home('"+TabViewId+"', "+i+");";
      Tab.className = (i == id) ? "Active" : "";
      Tab.blur();
    }
  }
  while (Tab = Tab.nextSibling);

  var Pages = TabView.firstChild;
  while (Pages.className != 'Pages') Pages = Pages.nextSibling;

  var Page = Pages.firstChild;
  var i    = 0;

  do
  {
    if (Page.className == 'Page')
    {
      i++;
      if (Pages.offsetHeight) Page.style.height = (Pages.offsetHeight-2)+"px";
      Page.style.overflow = "auto";
      Page.style.display  = (i == id) ? 'block' : 'none';
    }
  }
  while (Page = Page.nextSibling);
}

function tabview_home(TabViewId, id) { tabview_aux(TabViewId, id); }

function tabview_initialize(TabViewId) { tabview_aux(TabViewId,  1); }