with (navigator) if (appName.indexOf('Microsoft')!=-1 && appVersion.indexOf('Mac')==-1)
{
	document.write('<scr'+'ipt language="VBScript">\nMM_flash = NOT IsNull(CreateObject("ShockwaveFlash.ShockwaveFlash"))\n</scr'+'ipt>');
}

function MM_checkPlugin(plgIn)
{
  	var result = false;

 	if (navigator.appName.indexOf('Microsoft')==-1 || (navigator.plugins && navigator.plugins.length))
  	{
  		result = navigator.plugins[plgIn] != null ? true : false;
  	}
  	else
  	{
  		if (navigator.appName.indexOf('Microsoft')!=-1 && navigator.appVersion.indexOf('Mac')==-1)
		{
			result = MM_flash;
		}
	}
	result = result == true ? true : false;
	return result;  		
}

var flashExists = MM_checkPlugin("Shockwave Flash");

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 mask(string,textbox,location,delim){
var loc = location.split(',');

for (var i = 0; i <= location.length; i++){
	for (var k = 0; k <= string.length; k++){
	 if (k == location[i]){
	  if (string.substring(k, k+1) != delim){
	    string = string.substring(0,k) + delim + string.substring(k,string.length)
	  }
	 }
	}
 }
textbox.value = string
}

var prevLink = null;

function showRecordLink(name) {
 if (prevLink!= null) {
  closeRecordLink(prevLink);
 }
 var oImg = document.getElementById(name+'_img');
 var oDiv = document.getElementById(name);
 oDiv.style.left = oImg.offsetLeft+16;
 oDiv.style.top = oImg.offsetTop - 5;
 oDiv.style.visibility = "visible";
 prevLink = name;
}
function closeRecordLink(name) {
 var oDiv = document.getElementById(name);
 oDiv.style.visibility = "hidden";
 prevLink = null;
}
function resizeMe(){
	var left = Utilities.getElement('left');
	var content = Utilities.getElement('content');
	if(content.offsetHeight<left.offsetHeight){
		content.style.height = left.offsetHeight+'px';
	}	
}
function resizeSlajd(){
	var kurs = Utilities.getElement('slajd');
	var left = Utilities.getElement('left');
	var book_separator = Utilities.getElement('book_separator');
	var kurs_content= Utilities.getElement('kurs_content');

	if(kurs_content.offsetHeight<450){
		kurs_content.style.height = '450px';
	}

	if(kurs.offsetHeight<kurs_content.offsetHeight){
		kurs.style.height = kurs_content.offsetHeight+50+'px';		
	}	
	book_separator.style.height = kurs.offsetHeight+12+'px';				
}
