function printContents()
{
	iWidth = window.screen.width;
	iHeight = window.screen.height;
    wt = 630;
    ht = 460;
    lt = (iWidth - wt) / 2;
    tp = (iHeight - ht) / 2;
    window.open("print.php", '', 'height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=no,resizable=no,scrollbars=yes'); 
}

function preview(file, desc, width, height)
{
 if (desc == null) {
   desc = '';
 }
 var left = (screen.width - width) / 2;
 var top = (screen.height - height + 20) / 2;
 window.open("preview.php?file="+file+"&desc="+desc, "_preview_", "width="+width+",height="+height+",top="+top+",left="+left);
}

function recommend()
{
	iWidth = window.screen.width;
	iHeight = window.screen.height;
    wt = 375;
    ht = 275;
    lt = (iWidth - wt) / 2;
    tp = (iHeight - ht) / 2;
    var URL = location.search;
    window.open("send.php"+URL, '', 'height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=no,resizable=no,scrollbars=yes'); 
}

function checkMail(form) {
	var err = '';
	if (form.email.value.length == 0) {
		err = err + "Brak adresu e-mail";
	} else {
		sem = form.email.value;
		if ((sem == "") || (sem.indexOf ('@', 0) == -1) || (sem.indexOf ('.', 0) == -1) || (sem.length < 6|| sem.indexOf ('.',0) == -1)) {
			err = err + "Niepoprawny format adresu e-mail\n";
		}
	}
	if (err != '') {
		alert(err);
		return false;
	}
	return true;
}

function checkLogin(form) {
	var err = '';
	if (form.login.value.length == 0) {
		err = err + "Proszę podać login\n";
	}
	if (form.login.value.length == 0) {
		err = err + "Proszę podać hasło\n";
	}
	if (err != '') {
		alert(err);
		return false;
	}
	return true;
}

function rollover(img) {
    document.getElementById(img).style.backgroundColor = "#ff71c5";
}
function rollout(img) {
    document.getElementById(img).style.backgroundColor = "#68b5e1";
}
function ie_rollover(obj, img) {
	obj.src = 'images/' + img + '_on.gif';
    document.getElementById(img).style.backgroundColor = "#ff71c5";
}
function ie_rollout(obj, img) {
	obj.src = 'images/' + img + '.gif';
    document.getElementById(img).style.backgroundColor = "#68b5e1";
}
function ie_rollover2(obj, img) {
    document.getElementById(obj).src = 'images/' + img + '_on.gif';
    document.getElementById(img).style.backgroundColor = "#ff71c5";
}
function ie_rollout2(obj, img) {
    document.getElementById(obj).src = 'images/' + img + '.gif';
    document.getElementById(img).style.backgroundColor = "#68b5e1";
}
function highlight(id) {
    document.getElementById('pos_'+id).style.backgroundColor = "#be187a";
}
function dehighlight(id, color) {
    document.getElementById('pos_'+id).style.backgroundColor = color;
}



function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}


function playTVClip() {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="280" height="210" id="FLVPlayer">'+
					'<param name="movie" value="tv/FLVPlayer_Progressive.swf" />'+
					'<param name="salign" value="lt" />'+
					'<param name="quality" value="high" />'+
					'<param name="scale" value="noscale" />'+
					'<param name="FlashVars" value="&MM_ComponentVersion=1&skinName=tv/Clear_Skin_3&streamName=Pupy_30s_10_02_2010&autoPlay=false&autoRewind=true" />'+
					'<embed src="tv/FLVPlayer_Progressive.swf" flashvars="&MM_ComponentVersion=1&skinName=tv/Clear_Skin_3&streamName=Pupy_30s_10_02_2010&autoPlay=false&autoRewind=true" quality="high" scale="noscale" width="280" height="210" name="FLVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
					'</object>');
}

function showClipHP() {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="230" height="90" id="FLVPlayer">'+
					'<param name="movie" value="tv/tv_screen_20100210.swf" />'+
					'<param name="salign" value="lt" />'+
					'<param name="wmode" value="transparent" />'+
					'<param name="quality" value="high" />'+
					'<param name="scale" value="noscale" />'+
					'<embed src="tv/tv_screen_20100210.swf" wmode="transparent" quality="high" scale="noscale" width="230" height="90" name="FLVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
					'</object>');
}
