function centerLogin() {
	document.getElementById("center").style.left = (screen.width - 400)/2+"px";
	document.getElementById("center").style.top = (screen.height - 350)/3+"px";
	document.getElementById("username").focus();
}
function mOver(obj) {
	obj.style.background="url(tpl/images/tabo.gif)";
}
function mOut(obj, poza) {
	obj.style.background="url(tpl/images/"+poza+")";
}
function trOver(obj) {
	obj.style.backgroundColor="#AED4DF";
}
function inspiration() {
	w = 550;
	h = 550;
	l = (screen.width - w)/2+"px";
	t = (screen.height - h)/3+"px";
	test = window.open("", "inspiration", "toolbar=no,menubar=no,statusbar=no,resizable=no,border=no,dependent=yes,alwaysRaised=yes,top="+t+",left="+l+",width="+w+",height="+h);
	test.document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='530' height='530'><param name='movie' value='tpl/inspiration/gallery.swf' /><param name='quality' value='high' /><embed src='tpl/inspiration/gallery.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='530' height='530'></embed></object>");
}
function paletar() {
	w = 555;
	h = 465;
	l = (screen.width - w)/2+"px";
	t = (screen.height - h)/3+"px";
	test = window.open("", "paletar", "toolbar=no,menubar=no,statusbar=no,resizable=no,border=no,dependent=yes,alwaysRaised=yes,top="+t+",left="+l+",width="+w+",height="+h);
	test.document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='540' height='450'><param name='movie' value='tpl/colorchanger/homecolor.swf' /><param name='quality' value='high' /><embed src='tpl/colorchanger/homecolor.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='540' height='450'></embed></object>");
}
function curatat() {
	w = 555;
	h = 465;
	l = (screen.width - w)/2+"px";
	t = (screen.height - h)/3+"px";
	test = window.open("", "paletar", "toolbar=no,menubar=no,statusbar=no,resizable=no,border=no,dependent=yes,alwaysRaised=yes,top="+t+",left="+l+",width="+w+",height="+h);
	test.document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='540' height='450'><param name='movie' value='tpl/video/clip1.swf' /><param name='quality' value='high' /><embed src='tpl/video/clip1.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='540' height='450'></embed></object>");
}
function trOut(obj,c) {
	if (c) {
		obj.style.backgroundColor=c;
	}
	else {
		obj.style.backgroundColor='transparent';
	}
}
function previewText(id) {
	text = document.getElementById(id).value;
	//	PARAGRAF
	string = text.replace(/\[p\]/gi, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	//	BOLD
	string = string.replace(/\[b\]/gi, "<span style=\"font-weight:bold\">"); string = string.replace(/\[\/b\]/gi, "</span>");
	//	ITALIC
	string = string.replace(/\[i\]/gi, "<span style=\"font-style:italic\">"); string = string.replace(/\[\/i\]/gi, "</span>");
	//	UNDERLINE
	string = string.replace(/\[u\]/gi, "<span style=\"text-decoration:underline\">"); string = string.replace(/\[\/u\]/gi, "</span>");
	//	SIZE	
	string = string.replace(/\[size=(..)\]/gi, "<span style=\"font-size:$1px\">"); string = string.replace(/\[\/size\]/gi, "</span>");
	//	LINK
	string = string.replace(/\[link=([^ \n,]*)\]/gi, "<a href=http://$1 target=_blank>$1</a>");
	//	ALIGN
	string = string.replace(/\[align=([^ \],]*)\]/gi, "<div align=\"$1\">"); string = string.replace(/\[\/align\]/gi, "</div>");
	//	COLOR
	string = string.replace(/\[color=([^ \],]*)\]/gi, "<span style=\"color:$1\">"); string = string.replace(/\[\/color\]/gi, "</span>");
	//	ENTER
	string = string.replace(/\r\n/gi, "<br>");
	//	DISPLAY
	document.getElementById("preview").innerHTML=string;
	//	DEBUG
	//alert("Return: "+string);
}
function changeLang(loc) {
	window.location=loc;
}
function viewImage(id) {
	w = 400;
	h = 120;
	l = (screen.width - w)/2+"px";
	t = (screen.height - h)/3+"px";
	window.open("images.php?pid="+id, "view", "toolbar=no,menubar=no,statusbar=no,resizable=no,border=no,dependent=yes,alwaysRaised=yes,top="+t+",left="+l+",width="+w+",height="+h);
}