function dodaj() {

    var tytul = 'Silesia Parkiet';
    var adres = 'http://www.silesiaparkiet.agencjawmc.pl';

    //FireFox
    if (window.sidebar) { 

        window.sidebar.addPanel(tytul, adres, ""); 

    //IE
    } else if (window.external) {

        window.external.AddFavorite(adres, tytul); 

    //Opera
    } else if (window.opera && window.print) {

        var a = document.createElement('a');
        a.setAttribute('href', adres);
        a.setAttribute('title', tytul);
        a.setAttribute('rel','sidebar');
        a.click();
    }
}



var popUpWin=0;

function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=1,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function popUpWindowNS(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=1,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}


function checkEmail()	{

	var emailRegExp = /^[A-Za-z0-9._\-]+@(([A-Za-z]\.)|([A-Za-z0-9][A-Za-z0-9\-]+\.))+[A-Za-z]+$/;

	if ((!emailRegExp.test(document.formEmail.EmailAddress.value)) || (document.formEmail.EmailAddress.value == 'tutaj wpisz swój email'))	{

		document.formEmail.EmailAddress.focus();
		alert('Wpisz poprawny adres email!');
		return false;
	}

	return true;
}

function RecommendFormCheck1()	{

	var emailRegExp = /^[A-Za-z0-9._\-]+@(([A-Za-z]\.)|([A-Za-z0-9][A-Za-z0-9\-]+\.))+[A-Za-z]+$/;

	if(!emailRegExp.test(document.RecommendForm.RecommendFromEmail.value))	{

		document.RecommendForm.RecommendFromEmail.focus();
		alert('Wpisz poprawny adres email nadawcy!');
		return false;
	}

	if(!emailRegExp.test(document.RecommendForm.RecommendToEmail.value))	{

		document.RecommendForm.RecommendToEmail.focus();
		alert('Wpisz poprawny adres email odbiorcy!');
		return false;
	}

	return true;
}


function FormCheckEmail(email)	{
	var emailRegExp = /^[A-Za-z0-9._\-]+@(([A-Za-z]\.)|([A-Za-z0-9][A-Za-z0-9\-]+\.))+[A-Za-z]+$/;
	if (!emailRegExp.test(email)){
		return false;
	}
	return true;
}

function FormCheckValue(temp){
	if (temp == 0)	{
		return false;
	}
	return true;
}

function FormCheckFormatFile(file) {
	var tab = new Array();
	tab = file.split(".");
	var i = tab.length;
	var ext = tab[i-1];
	if(ext != 'doc' && ext!= 'pdf') {
		return false;
	}
	return true;
}

function FormCheckConfirm(inp) {
	if(inp.checked == false)
		return false;
	return true;
}

function ContactFormCheck1()	{

	var emailRegExp = /^[A-Za-z0-9._\-]+@(([A-Za-z]\.)|([A-Za-z0-9][A-Za-z0-9\-]+\.))+[A-Za-z]+$/;
	if (!emailRegExp.test(document.cf.cfEmail.value))	{

		document.cf.cfEmail.focus();
		alert('Wpisz poprawny adres email!');
		return false;
	}
	if (document.cf.cfSubject.value == 0)	{

		document.cf.cfSubject.focus();
		alert('Podaj temat wiadomości!');
		return false;
	}
	if (document.cf.cfContent.value == 0)	{

		document.cf.cfContent.focus();
		alert('Podaj treść wiadomoci!');
		return false;
	}
	return true;
}
