﻿// funkcje standardowe

function win(string)
{
	var par3 = "top=100, left=100, resizable = 1, directories = 0, location = 0, status = 0, toolbar = 0, width=500, height=560"
	var w = window.open("", "", par3);
	w.document.write(builder(string));
	w.focus();
}

function builder(string)
{
	var code = "<html><head><meta http-equiv='content-type' content='text/html; charset=utf-8'> <title>FOTO</title><link rel='Stylesheet' type='text/css' href='uklad.css' /></head><body><center><img src = '" + string + "' onClick = 'self.close()' height = 500 alt ='' /><p>Kliknij zdjęcie, aby zamknąć</p></center></body></html>";
	return code
}

function mov(string)
{
	var par3 = "top=100, left=100, resizable = 1, directories = 0, location = 0, status = 0, toolbar = 0, width=500, height=460"
	var w = window.open("", "", par3);
	w.document.write(mov_builder(string));
	w.focus();
}

function mov_builder(string)
{
	var yt = "<object width='425' height='373'><param name='movie' value='http://www.youtube.com/" + string + "'></param><param name='wmode' value='transparent'></param><embed src='http://www.youtube.com/" + string + "' type='application/x-shockwave-flash' wmode='transparent' width='425' height='373'></embed></object>";
	var style = "<style type= 'text/css'> a:link, a:visited { text-decoration : underline; font-family : Arial; color : #FFFFFF; font-size : 12pt; } a:hover { text-decoration : none; }	</style>";
	var code = "<html><head><meta http-equiv='content-type' content='text/html; charset=utf-8'> <title>FILM</title><link rel='Stylesheet' type='text/css' href='uklad.css' />" + style + "</head><body><center>" + yt + "<p><a href = '' onClick='self.close()'>Zamknij okno</a></p></center></body></html>";
	return code
}

// funkcje parametryzowane

function win2(string, h, w)
{
	var par3 = "top=100, left=100, resizable = 1, directories = 0, location = 0, status = 0, toolbar = 0, width=" + w + ", height=" + h;
	var w = window.open("", "", par3);
	w.document.write(builder2(string, h));
	w.focus();
}

function builder2(string, h)
{
	var hh = (parseInt(h)-60).toString();
	var code = "<html><head><meta http-equiv='content-type' content='text/html; charset=utf-8'> <title>FOTO</title><link rel='Stylesheet' type='text/css' href='uklad.css' /></head><body><center><img src = '" + string + "' onClick = 'self.close()' height = " + hh + " alt ='' /><p>Kliknij zdjęcie, aby zamknąć</p></center></body></html>";
	return code
}
