function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function setStatusBar(msgStr){
self.status = msgStr; 
}
function favorites(){
if (document.all){
window.external.AddFavorite("http://www.beatfactor.net/", "Deejayz Area")
}
}
function jumpCountry(formopt) {
	if(formopt!='0')
		document.location = '?country=' + formopt;
}
function otvor(adresa, xova, yova)
{
//xova=xova+20
//yova=yova+20
okno=window.open(adresa,"","toolbar=no,scrollbars=yes,location=no,status=no,screenX=20,screenY=20,width="+xova+",height="+yova+",resizable=0")
} 
<!--
// bbCode control by
// subBlue design
// www.subBlue.com

// Startup variables
var imageTag = false;
var theSelection = false;

// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); // Get browser version

var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1));
var is_nav  = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
                && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
                && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));

var is_win   = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
var is_mac    = (clientPC.indexOf("mac")!=-1);


// Helpline mtxts
b_help = "Bold text: [b]text[/b] (alt+b)";
i_help = "Italic text: [i]text[/i] (alt+i)";
u_help = "Underline text: [u]text[/u] (alt+u)";
q_help = "Quote text: [quote]text[/quote] (alt+q)";
c_help = "Code display: [code]code[/code]  (alt+c)";
l_help = "List: [list]text[/list] (alt+l)";
o_help = "Ordered list: [list=]text[/olist] (alt+o)";
p_help = "Insert image: [img]http://image_url[/img] (alt+p)";
w_help = "Insert URL: [url]http://url[/url] or [url=http://url]URL text[/url] (alt+w)";
a_help = "Close all open bbCode tags";
s_help = "Font color: [color=red]text[/color]  Tip: you can also use color=#FF0000";
f_help = "Font size: [size=x-small]small text[/size]";

// Define the bbCode tags
bbcode = new Array();
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[list]','[/list]','[img]','[/img]','[url]','[/url]','[list=]','[/olist]');
imageTag = false;

// Shows the help mtxts in the helpline window
function helpline(help) {
	document.post.helpbox.value = eval(help + "_help");
}


// Replacement for arrayname.length property
function getarraysize(thearray) {
	for (i = 0; i < thearray.length; i++) {
		if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null))
			return i;
		}
	return thearray.length;
}

// Replacement for arrayname.push(value) not implemented in IE until version 5.5
// Appends element to the array
function arraypush(thearray,value) {
	thearray[ getarraysize(thearray) ] = value;
}

// Replacement for arrayname.pop() not implemented in IE until version 5.5
// Removes and returns the last element of an array
function arraypop(thearray) {
	thearraysize = getarraysize(thearray);
	retval = thearray[thearraysize - 1];
	delete thearray[thearraysize - 1];
	return retval;
}


function checkForm() {

	formErrors = false;

	if (document.post.mtxt.value.length < 2) {
		formErrors = "You must enter a message when posting";
	}

	if (formErrors) {
		alert(formErrors);
		return false;
	} else {
		bbstyle(-1);
		//formObj.preview.disabled = true;
		//formObj.submit.disabled = true;
		return true;
	}
}

function emoticon(text) {
	text = ' ' + text + ' ';
	if (document.post.mtxt.createTextRange && document.post.mtxt.caretPos) {
		var caretPos = document.post.mtxt.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
		document.post.mtxt.focus();
	} else {
	document.post.mtxt.value  += text;
	document.post.mtxt.focus();
	}
}

function bbfontstyle(bbopen, bbclose) {
	if ((clientVer >= 4) && is_ie && is_win) {
		theSelection = document.selection.createRange().text;
		if (!theSelection) {
			document.post.mtxt.value += bbopen + bbclose;
			document.post.mtxt.focus();
			return;
		}
		document.selection.createRange().text = bbopen + theSelection + bbclose;
		document.post.mtxt.focus();
		return;
	} else {
		document.post.mtxt.value += bbopen + bbclose;
		document.post.mtxt.focus();
		return;
	}
	storeCaret(document.post.mtxt);
}


function bbstyle(bbnumber) {

	donotinsert = false;
	theSelection = false;
	bblast = 0;

	if (bbnumber == -1) { // Close all open tags & default button names
		while (bbcode[0]) {
			butnumber = arraypop(bbcode) - 1;
			document.post.mtxt.value += bbtags[butnumber + 1];
			buttext = eval('document.post.addbbcode' + butnumber + '.value');
			eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
		}
		imageTag = false; // All tags are closed including image tags :D
		document.post.mtxt.focus();
		return;
	}

	if ((clientVer >= 4) && is_ie && is_win)
		theSelection = document.selection.createRange().text; // Get text selection

	if (theSelection) {
		// Add tags around selection
		document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
		document.post.mtxt.focus();
		theSelection = '';
		return;
	}

	// Find last occurance of an open tag the same as the one just clicked
	for (i = 0; i < bbcode.length; i++) {
		if (bbcode[i] == bbnumber+1) {
			bblast = i;
			donotinsert = true;
		}
	}

	if (donotinsert) {		// Close all open tags up to the one just clicked & default button names
		while (bbcode[bblast]) {
				butnumber = arraypop(bbcode) - 1;
				document.post.mtxt.value += bbtags[butnumber + 1];
				buttext = eval('document.post.addbbcode' + butnumber + '.value');
				eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
				imageTag = false;
			}
			document.post.mtxt.focus();
			return;
	} else { // Open tags

		if (imageTag && (bbnumber != 14)) {		// Close image tag before adding another
			document.post.mtxt.value += bbtags[15];
			lastValue = arraypop(bbcode) - 1;	// Remove the close image tag from the list
			document.post.addbbcode14.value = "Img";	// Return button back to normal state
			imageTag = false;
		}

		// Open tag
		document.post.mtxt.value += bbtags[bbnumber];
		if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag
		arraypush(bbcode,bbnumber+1);
		eval('document.post.addbbcode'+bbnumber+'.value += "*"');
		document.post.mtxt.focus();
		return;
	}
	storeCaret(document.post.mtxt);
}

// Insert at Claret position. Code from
// http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
function storeCaret(textEl) {
	if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}
function fwLoadMenus() {
 if (window.fw_menu_0) return;
 window.fw_menu_0 = new Menu("root",150,18,"Verdana, Arial, Helvetica, sans-serif",10,"#EBFFFF","#D7F4F4","#506D7C","#6289A0");
 fw_menu_0.addMenuItem("<b>›</b> Vinyls","location='music/vinyls/'");
 fw_menu_0.addMenuItem("<b>›</b> Albums","location='music/albums/'");
 fw_menu_0.addMenuItem("<b>›</b> Compilations","location='muzica.php?type=3'");
 fw_menu_0.addMenuItem("<b>›</b> Topuri","location='topuri.php'");
 fw_menu_0.addMenuItem("<b>›</b> DJ / Artisti","location='djs.php'");
 fw_menu_0.addMenuItem("<b>›</b> Labeluri","location='labels.php'");
 fw_menu_0.addMenuItem("<b>›</b> <b>BF Audio</b>","location='audio.php'");
 fw_menu_0.hideOnMouseOut=true;
 
 window.fw_menu_2 = new Menu("root",150,17,"Verdana, Arial, Helvetica, sans-serif",10,"#EBFFFF","#EBFFFF","#506D7C","#6289A0");
 fw_menu_2.addMenuItem("<b>›</b> Reportaje Eveniment","location='http://localhost/beatfactor/ro/v3/articole/reportaje/'");
 fw_menu_2.addMenuItem("<b>›</b> Editoriale","location='articole.php?show=editorial'");
 fw_menu_2.addMenuItem("<b>›</b> Features","location='articole.php?show=feature'");
 fw_menu_2.hideOnMouseOut=true;
 
window.fw_menu_3 = new Menu("root",115,17,"Verdana, Arial, Helvetica, sans-serif",10,"#EBFFFF","#EBFFFF","#506D7C","#6289A0"); 
 fw_menu_3.addMenuItem("<b>›</b> Local","location='foto.php?show=local'");
 fw_menu_3.addMenuItem("<b>›</b> International","location='foto.php?show=international'");
 fw_menu_3.hideOnMouseOut=true;
 fw_menu_3.writeMenus();
}  // fwLoadMenus()

//-->
