// okno popup
function openwindow(popupurl){
	window.open(popupurl, 'MCWindow', 'scrollbars,resizable=no,height=220,width=380');
}


// potwierdzenie
function ConfirmAction(NewUrl,Text)
{
	ConfirmAnswer = confirm(Text);

	if(ConfirmAnswer == true)
	{
		window.location.href = NewUrl;
	}
}

function flip( rid ) {
	document.getElementById(rid).style.display = document.getElementById(rid).style.display == 'none' ? 'block' : 'none'
}

function SendMailTo(user, Domain, subject)
{
	var mailto = "mailto:";
	var at = "@";
	var subjectX = "?subject=";
	if ( arguments.length == 3 )
	{
		_target = mailto + user + at + Domain + subjectX + subject;
	} else {
		_target = mailto + user + at + Domain;
	}
	document.location = _target;
}

function LoginPB(mode)
{


	var LoginStatus;
	advAJAX.submit(document.getElementById("LoginForm"), {
		onSuccess : function(obj) {
		 //$ ("LoginStatus").value = obj.responseText;
    	alert(obj.responseText);
    	if(obj.responseText == 0) {
    		alert("Nieprawidlowa nazwa uzytkownika badz haslo!");
    	}
    	
    	if(obj.responseText == 1) {
        advAJAX.get({
        	url: "http://playback.pl/ajax_l.php5?m="+mode,
          onSuccess : function(obj) { document.getElementById("TheAJAXForm") = obj.responseText; },
          onError : function(obj) { alert("Error: " + obj.status); }
        });
    		
    	}
    	
    	if(obj.responseText == 2) {
    		alert("Zostales zbanowany - skontaktuj sie z Administratorem!");
    	}
    	
    	if(obj.responseText == 3) {
    		alert("Mozliwosc logowania sie z Twojego komputera zostala na jakis czas wylaczona!");
    	}
		},
    onError : function(obj) { alert("Error: " + obj.status); }
	});

}
