function audiofile(file) 
{
var html = file;
var win = new Window({className: "dialog",  width:490, height:100, zIndex: 100, resizable: false, title: "Прослушать аудио файл", draggable:true, wiredDrag: true})
win.getContent().innerHTML= '<div style="padding:10px"><object type="application/x-shockwave-flash" data="http://ross.ross-studio.com/templates/default/js/ump3player_500x70.swf" height="70" width="470"><param name="wmode" VALUE="transparent" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="movie" value="http://ross.ross-studio.com/templates/default/js/ump3player_500x70.swf" /><param name="FlashVars" value="way=http://ross.ross-studio.com' + html + '&amp;swf=http://ross.ross-studio.com/templates/default/js/ump3player_500x70.swf&amp;w=470&amp;h=70&amp;time_seconds=0&amp;autoplay=0&amp;q=&amp;skin=black&amp;volume=70&amp;comment=" /></object></div>'
//win.setStatusBar("Status bar info");
win.showCenter();  
}
	  
function videofile(file) {
var html = file;
var win = new Window({className: "dialog",  width:420, height:320, zIndex: 100, resizable: false, title: "Посмотреть видео файл", draggable:true, wiredDrag: true})
win.getContent().innerHTML= '<div style="padding:10px"><object type="application/x-shockwave-flash" data="http://ross.ross-studio.com/templates/cp/js/uflvplayer.swf" height="300" width="400"><param name="bgcolor" value="#999999" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="movie" value="http://ross.ross-studio.com/templates/cp/js/uflvplayer.swf" /><param name="FlashVars" value="way=http://ross.ross-studio.com' + html + '&amp;swf=http://ross.ross-studio.com/templates/cp/js/uflvplayer.swf&amp;w=400&amp;h=300&amp;pic=http://&amp;autoplay=0&amp;tools=1&amp;skin=black&amp;volume=70&amp;q=&amp;comment=" /></object></div>'
//win.setStatusBar("Status bar info");
win.showCenter();  
      }
	  
	  
	  
	  
function popup(datei,name,breite,hoehe,noresize)
{ 
	var posX=(screen.availWidth-breite)/2;
	var posY=(screen.availHeight-hoehe)/2;
	var resizable = (noresize==1) ? 0 : 1;
	window.open(datei,name,"resizable="+resizable+",scrollbars=1,width=" + breite + ",height=" + hoehe + "screenX=" + posX + ",screenY=" + posY + ",left=" + posX + ",top=" + posY + "");
}


function galpop(datei,name,breite,hoehe,noresize)
{ 
	var posX=(screen.availWidth-breite)/2;
	var posY=(screen.availHeight-hoehe)/2;
	var resizable = (noresize==1) ? 0 : 1;
	var scrollbar = (document.all) ? 0 : 1;
	window.open(datei,name,"resizable="+resizable+",scrollbars="+scrollbar+",width=" + breite + ",height=" + hoehe + "screenX=" + posX + ",screenY=" + posY + ",left=" + posX + ",top=" + posY + "");
}


function textCounter(field, countfield, maxlimit)
{ 
	if (field.value.length > maxlimit)
	{ 
		field.value = field.value.substring(0, maxlimit);
	} else { 
		countfield.value = maxlimit - field.value.length;
	}
}


function elemX (element) {
	var x = 0;
	while (element) {
		x += element.offsetLeft;
		element = element.offsetParent;
	}
	return x;
}

function elemY (element) {
	var y = 0;
	while (element) {
		y += element.offsetTop;
		element = element.offsetParent;
	}
	return y;
}

function getWidth (element) {
	return element.offsetWidth;
}

function getHeight (element) {
	return element.offsetHeight;
}

function elemObj(elementId) {
	if (document.all)
		return document.all[elementId];
	else if (document.getElementById)
		return document.getElementById(elementId);
	else
		return null;
}





	  
	  
	  
	  
	  
	  