// JavaScript Document

function piterShowFlash(flashSource)
{
    docSource = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="726" height="144">';
    docSource += '<param name="movie" value="' + flashSource +'" />';
    docSource += '<param name="quality" value="high" />';
    docSource += '<param name="wmode" value="transparent" />';
    docSource += '<embed src="' + flashSource + '" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="726" height="144"></embed></object>';
    document.write(docSource);
}

function piterShowMap(flashSource)
{
    docSource = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="183" height="143" style="float: right;">';
    docSource += '<param name="movie" value="' + flashSource +'" />';
    docSource += '<param name="quality" value="high" />';
    docSource += '<param name="wmode" value="transparent" />';
    docSource += '<embed src="' + flashSource + '" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="183" height="143" style="float: right;"></embed></object>';
    document.write(docSource);
}

function piterPrintDate()
{
	daysArray = new Array();
	monthsArray = new Array();
	
	daysArray = ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"];
	monthsArray = ["stycznia", "lutego", "marca", "kwietnia", "maja", "czerwca", "lipca", "sierpnia", "września", "października", "listopada", "grudnia"];
	
	currentDate = new Date();
	if(currentDate.getDate() < 10) thisDay = "0" + currentDate.getDate();
	else thisDay = currentDate.getDate();
	if(currentDate.getMonth() + 1 < 10) thisMonth = "0" + (currentDate.getMonth() + 1);
    else thisMonth = currentDate.getMonth() + 1;
	
	dateString = daysArray[currentDate.getDay()] + " " + thisDay + "." + thisMonth + "." + currentDate.getFullYear();
	
	document.write(dateString);
}

function xchange(element_id) {
    var wys = document.getElementById(element_id).style.display;
    if (wys == "none") document.getElementById(element_id).style.display = "block"
    else document.getElementById(element_id).style.display = "none";
}

function piterValidateForm(formName, errorTagName)
{
	var defaultColor = "#ffffff";
	var errorColor = "#ffd8d8";
	var defaultBorderColor = "#cfcfcf";
	var errorBorderColor = "#ee0000";
	var validForm = true;
	
	var errorTag = document.getElementById(errorTagName);
	var piterForm = document.getElementById(formName);
	
	for(i = 0; i < piterForm.length - 1; i++)
	{
		if(piterForm.elements[i].value == "") 
		{
			validForm = false;
		}
		else
		{
			piterForm.elements[i].style.backgroundColor = defaultColor;
			piterForm.elements[i].style.borderColor = defaultBorderColor;
		}
	} 
	
	if(!validForm) {
		errorTag.style.display = "block";
		return false;
	}
	else {
		piterForm.submit();
		return true;
	}
}

/***********************************************
* Bookmark site script- C Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
function piterBookmarkSite()
{
	title = "Prima 2000";
	url = "http://www.prima2000.pl";
	if (document.all)
		window.external.AddFavorite(url, title);
	else if (window.sidebar)
		window.sidebar.addPanel(title, url, "")
}

/* suckerfish dropdown script */
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("supmenu");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;

