function setFlashWidth(divid, newW){
	document.getElementById(divid).style.width = newW+"px";
}
function setFlashHeight(divid, newH){
	document.getElementById(divid).style.height = newH+"px";
}
function setFlashX(divid, newW){
	if(newW.toString().indexOf("%") >= 0)
	{
		document.getElementById(divid).style.left = newW;
	}
	else
	{
		document.getElementById(divid).style.left = newW+"px";
	}
}
function setFlashY(divid, newH){
	if(newH.toString().indexOf("%") >= 0)
	{
		document.getElementById(divid).style.top = newH;	
	}
	else
	{
		document.getElementById(divid).style.top = newH+"px";	
	}
		
}
function setFlashSize(divid, newW, newH){
	setFlashWidth(divid, newW);
	setFlashHeight(divid, newH);
}
function setFlashPosition(divid, newX, newY){
	setFlashX(divid, newX);
	setFlashY(divid, newY);
}
function setFlashAll(divid, newX, newY, newW, newH){
	setFlashX(divid, newX);
	setFlashY(divid, newY);
	setFlashWidth(divid, newW);
	setFlashHeight(divid, newH);
}
function setLMargin(divid, m){
	document.getElementById(divid).style.marginLeft = m+"px";
}
function canResizeFlash(){
	var ua = navigator.userAgent.toLowerCase();
	var opera = ua.indexOf("opera");
	if( document.getElementById ){
		if(opera == -1) return true;
		else if(parseInt(ua.substr(opera+6, 1)) >= 7) return true;
	}
	return false;
}
function flash_com(var1)
{
	if(document.getElementById('flash_content'))
	{
		document.getElementById('flash_content').innerHTML += "<BR>"+str_replace("=&gt;<BR>","=&gt;",str_replace(">","&gt;<BR>",str_replace("<","&lt;",var1)));
	}
	else
	{
		alert(var1);
	}
}
function getWindowW()
{
	return document.body.clientWidth;
}
function getWindowH()
{
	return document.body.clientHeight;
}
function getObjX(obj)
{
	var d = document.getElementById(obj).style.left;
	var f = document.getElementById(obj).style.marginLeft;
	if(d.indexOf("%") > 0)
	{
		var e = document.body.clientWidth*parseInt(d.replace("%",""))/100;
		if(f)
		{
			e += parseInt(f.replace("px",""))
		}
		return e;
	}
	else
	{
		return d.replace("px","");
	}
}
function getObjY(obj)
{
	var d = document.getElementById(obj).style.top
	var f = document.getElementById(obj).style.marginTop;
	if(d.indexOf("%") > 0)
	{
		var e = document.body.clientHeight*parseInt(d.replace("%",""))/100;
		if(f)
		{
			e += parseInt(f.replace("px",""))
		}
		return e;
	}
	else
	{
		return d.replace("px","");
	}
}
function setDivPosition(obj,p)
{
	document.getElementById(obj).style.position = p;
	//alert(document.getElementById(obj).style.position);
}
function hideObj(obj)
{
	document.getElementById(obj).style.display = 'none';
}
function showFrog(obj, x, y)
{
	if(x)
	{
		document.getElementById(obj).style.marginLeft = x+'px';
	}
	if(y)
	{
		document.getElementById(obj).style.top = y+'px';
	}
	document.getElementById(obj).style.display = 'block';
}
function hideFrog(obj)
{
	document.getElementById(obj).style.display = 'none';
}
function set_cp_target(target)
{
	cp_target = target;
	//alert(target);
}
function exec_color(color)
{
	document.getElementById("cell_"+cp_target).style.background = color;
	document.getElementById(cp_target).value = color;
	//alert(cp_target);
}
function exec_color_table(color)
{
	fontEdit(cp_target,'ForeColor',color);
	//alert(cp_target);
}
function createCookie(name,value,days,path) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	if(!path || path == "null")
	{
		path = "";
	}
	//alert(name+"="+value+expires+"; path=/"+path);
	document.cookie = name+"="+value+expires+"; path=/"+path;
}
// standart string replace functionality
function str_replace(needle,replacement, haystack) {
    var temp = haystack.split(needle);
    return temp.join(replacement);
}


function toTop(obj)
{
	document.getElementById(obj).style.zIndex="2";
}