/*2*/
function MM_swapImgRestore() { 
  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() {
  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) { 
  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() {
  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];}
}
/*3*/
/* browser detect */
 var agt=navigator.userAgent.toLowerCase();

    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    // Note: Opera and WebTV spoof Navigator.  We do strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    var is_nav6 = (is_nav && (is_major == 5));
    var is_nav6up = (is_nav && (is_major >= 5));
    var is_gecko = (agt.indexOf('gecko') != -1);


    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie3    = (is_ie && (is_major < 4));
    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
    var is_ie4up  = (is_ie && (is_major >= 4));
    var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
    var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
    var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
    var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);

    // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
    // or if this is the first browser window opened.  Thus the
    // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.
    var is_aol   = (agt.indexOf("aol") != -1);
    var is_aol3  = (is_aol && is_ie3);
    var is_aol4  = (is_aol && is_ie4);
    var is_aol5  = (agt.indexOf("aol 5") != -1);
    var is_aol6  = (agt.indexOf("aol 6") != -1);

    var is_opera = (agt.indexOf("opera") != -1);
    var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
    var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
    var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
    var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
    var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);

    var is_webtv = (agt.indexOf("webtv") != -1); 

    var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
    var is_AOLTV = is_TVNavigator;

    var is_hotjava = (agt.indexOf("hotjava") != -1);
    var is_hotjava3 = (is_hotjava && (is_major == 3));
    var is_hotjava3up = (is_hotjava && (is_major >= 3));

    // *** JAVASCRIPT VERSION CHECK ***
    var is_js;
    if (is_nav2 || is_ie3) is_js = 1.0;
    else if (is_nav3) is_js = 1.1;
    else if (is_opera5up) is_js = 1.3;
    else if (is_opera) is_js = 1.1;
    else if ((is_nav4 && (is_minor <= 4.05)) || is_ie4) is_js = 1.2;
    else if ((is_nav4 && (is_minor > 4.05)) || is_ie5) is_js = 1.3;
    else if (is_hotjava3up) is_js = 1.4;
    else if (is_nav6 || is_gecko) is_js = 1.5;
    // NOTE: In the future, update this code when newer versions of JS
    // are released. For now, we try to provide some upward compatibility
    // so that future versions of Nav and IE will show they are at
    // *least* JS 1.x capable. Always check for JS version compatibility
    // with > or >=.
    else if (is_nav6up) is_js = 1.5;
    // NOTE: ie5up on mac is 1.4
    else if (is_ie5up) is_js = 1.3

    // HACK: no idea for other browsers; always check for JS version with > or >=
    else is_js = 0.0;

    // *** PLATFORM ***
    var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
    // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
    //        Win32, so you can't distinguish between Win95 and WinNT.
    var is_win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));

    // is this a 16 bit compiled version?
    var is_win16 = ((agt.indexOf("win16")!=-1) || 
               (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) || 
               (agt.indexOf("windows 16-bit")!=-1) );  

    var is_win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
                    (agt.indexOf("windows 16-bit")!=-1));

    var is_winme = ((agt.indexOf("win 9x 4.90")!=-1));
    var is_win2k = ((agt.indexOf("windows nt 5.0")!=-1));

    // NOTE: Reliable detection of Win98 may not be possible. It appears that:
    //       - On Nav 4.x and before you'll get plain "Windows" in userAgent.
    //       - On Mercury client, the 32-bit version will return "Win98", but
    //         the 16-bit version running on Win98 will still return "Win95".
    var is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
    var is_winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
    var is_win32 = (is_win95 || is_winnt || is_win98 || 
                    ((is_major >= 4) && (navigator.platform == "Win32")) ||
                    (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));

    var is_os2   = ((agt.indexOf("os/2")!=-1) || 
                    (navigator.appVersion.indexOf("OS/2")!=-1) ||   
                    (agt.indexOf("ibm-webexplorer")!=-1));

    var is_mac    = (agt.indexOf("mac")!=-1);
    // hack ie5 js version for mac
    if (is_mac && is_ie5up) is_js = 1.4;
    var is_mac68k = (is_mac && ((agt.indexOf("68k")!=-1) || 
                               (agt.indexOf("68000")!=-1)));
    var is_macppc = (is_mac && ((agt.indexOf("ppc")!=-1) || 
                                (agt.indexOf("powerpc")!=-1)));

    var is_sun   = (agt.indexOf("sunos")!=-1);
    var is_sun4  = (agt.indexOf("sunos 4")!=-1);
    var is_sun5  = (agt.indexOf("sunos 5")!=-1);
    var is_suni86= (is_sun && (agt.indexOf("i86")!=-1));
    var is_irix  = (agt.indexOf("irix") !=-1);    // SGI
    var is_irix5 = (agt.indexOf("irix 5") !=-1);
    var is_irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
    var is_hpux  = (agt.indexOf("hp-ux")!=-1);
    var is_hpux9 = (is_hpux && (agt.indexOf("09.")!=-1));
    var is_hpux10= (is_hpux && (agt.indexOf("10.")!=-1));
    var is_aix   = (agt.indexOf("aix") !=-1);      // IBM
    var is_aix1  = (agt.indexOf("aix 1") !=-1);    
    var is_aix2  = (agt.indexOf("aix 2") !=-1);    
    var is_aix3  = (agt.indexOf("aix 3") !=-1);    
    var is_aix4  = (agt.indexOf("aix 4") !=-1);    
    var is_linux = (agt.indexOf("inux")!=-1);
    var is_sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
    var is_unixware = (agt.indexOf("unix_system_v")!=-1); 
    var is_mpras    = (agt.indexOf("ncr")!=-1); 
    var is_reliant  = (agt.indexOf("reliantunix")!=-1);
    var is_dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) || 
           (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) || 
           (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1)); 
    var is_sinix = (agt.indexOf("sinix")!=-1);
    var is_freebsd = (agt.indexOf("freebsd")!=-1);
    var is_bsd = (agt.indexOf("bsd")!=-1);
    var is_unix  = ((agt.indexOf("x11")!=-1) || is_sun || is_irix || is_hpux || 
                 is_sco ||is_unixware || is_mpras || is_reliant || 
                 is_dec || is_sinix || is_aix || is_linux || is_bsd || is_freebsd);

    var is_vms   = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));


/* meniu */
		//                                                      left  top   w    h
		if (is_ie5_5up) {
			var myMenu1 = new ypSlideOutMenu("menu1", "right", -1000, 177, 225, 150);		
			var myMenu2 = new ypSlideOutMenu("menu2", "right", -1000, 195, 190, 150);
			var myMenu3 = new ypSlideOutMenu("menu3", "right", -1000, 213, 190, 150);
			var myMenu4 = new ypSlideOutMenu("menu4", "right", -1000, 230, 141, 54);
			var myMenu5 = new ypSlideOutMenu("menu5", "right", -1000, 200, 111, 94);
			var myMenu6 = new ypSlideOutMenu("menu6", "right", -1000, 320, 225, 150);
			var myMenu7 = new ypSlideOutMenu("menu7", "right", -1000, 339, 170, 150);
			var int_left_pos = -185;
		} else {
			var myMenu1 = new ypSlideOutMenu("menu1", "right", -1000, 179, 225, 150);
			var myMenu2 = new ypSlideOutMenu("menu2", "right", -1000, 195, 190, 150);
			var myMenu3 = new ypSlideOutMenu("menu3", "right", -1000, 215, 190, 150);
			var myMenu4 = new ypSlideOutMenu("menu4", "right", -1000, 232, 141, 54);
			var myMenu5 = new ypSlideOutMenu("menu5", "right", -1000, 250, 111, 94);
			var myMenu6 = new ypSlideOutMenu("menu6", "right", -1000, 319, 225, 150);
			var myMenu7 = new ypSlideOutMenu("menu7", "right", -1000, 340, 170, 150);
			var int_left_pos = -194;
		}
		
     
    // for each menu, we set up hte onactivate event to call repositionMenu with the amount offset from center, in pixels
		myMenu1.onactivate = function() { repositionMenu(myMenu1, int_left_pos); }
		myMenu2.onactivate = function() { repositionMenu(myMenu2, int_left_pos); }
		myMenu3.onactivate = function() { repositionMenu(myMenu3, int_left_pos); }
		myMenu4.onactivate = function() { repositionMenu(myMenu4, int_left_pos); }
		myMenu5.onactivate = function() { repositionMenu(myMenu5, int_left_pos); }
		myMenu6.onactivate = function() { repositionMenu(myMenu6, int_left_pos); }
		myMenu7.onactivate = function() { repositionMenu(myMenu7, int_left_pos); }
		
    // this function repositions a menu to the speicified offset from center
		function repositionMenu(menu, offset)
		{
      // the new left position should be the center of the window + the offset
			var newLeft = getWindowWidth() / 2 + offset;
			if(is_gecko && document.body.offsetHeight >800 ) {
				var newLeft = getWindowWidth() / 2 + offset +10;
			}

      // setting the left position in netscape is a little different than IE
			menu.container.style ? menu.container.style.left = newLeft + "px" : menu.container.left = newLeft;
		}
		 
    // this function calculates the window's width - different for IE and netscape
		function getWindowWidth()
		{
			return window.innerWidth ? window.innerWidth : document.body.offsetWidth;			
		}
/* verificare formular contact */
function trim(obj) { 
	var cont=obj.replace(/\s+$|^\s+/g,"");	
	if(cont=='')
		{
			return 0;			
		}
	else
		{
			return 1;	
		}
} 

function verifMail(mail){
	if ( !mail ) {
		var name = document.contact.email.value;
	} else {
		var name = mail;
	}
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	if (filter.test(name))
	{
		return true;
	}
	else
	{
		return false;
	}
}

function verifica_contact(limba) {
	if (document.contact.nume.value == "" || trim(document.contact.nume.value)==0)
	 {
	  var mesaj = (limba=='ro') ? 'Nu ati completat campul nume!' : 'What is your last name?' ;
	  alert(mesaj);
	  document.contact.nume.value="";
	  document.contact.nume.focus();
	  var verifica = 0;
	  return false;
	 }
	 if (document.contact.prenume.value == "" || trim(document.contact.prenume.value)==0)
	 {
	 var mesaj = (limba=='ro') ? 'Nu ati completat campul prenume!' : 'What is your first name?!' ;
	  alert(mesaj);
	  document.contact.prenume.value="";
	  document.contact.prenume.focus();
	  var verifica = 0;
	  return false;
	 }
	 /*
	 if (document.contact.email.value == "" || trim(document.contact.email.value)==0 || !verifMail())
	 {
	  var mesaj = (limba=='ro') ? 'Adresa de e-mail invalida!' : 'Invalid e-mail address!' ;
	  alert(mesaj);
	  document.contact.email.value="";
	  document.contact.email.focus();
	  var verifica = 0;
	  return false;
	 }
	 */
	 if (document.contact.oras.value == "" || trim(document.contact.oras.value)==0)
	 {
	  var mesaj = (limba=='ro') ? 'Nu ati completat campul oras!' : 'The field `City` is empty!' ;
	  alert(mesaj);
	  document.contact.oras.value="";
	  document.contact.oras.focus();
	  var verifica = 0;
	  return false;
	 }
	 if (document.contact.mesaj.value == "" || trim(document.contact.mesaj.value)==0)
	 {
	  var mesaj = (limba=='ro') ? 'Nu ati completat campul mesaj!' : 'The field `Message is empty`!' ;
	  alert(mesaj);
	  document.contact.mesaj.value="";
	  document.contact.mesaj.focus();
	  var verifica = 0;
	  return false;
	 } 

	 if ( verifica!=0 ) {
		document.contact.submited.value=1;
		document.contact.submit();
	 } else {
		return false;
	 }
}

function verifica_form_sesiune(limba) {
	if (document.inscriere.nume.value == "" || trim(document.inscriere.nume.value)==0)
	 {
	  var mesaj = (limba=='ro') ? 'Nu ati completat campul nume!' : 'What is your last name?' ;
	  alert(mesaj);
	  document.inscriere.nume.value="";
	  document.inscriere.nume.focus();
	  var verifica = 0;
	  return false;
	 }
	 if (document.inscriere.prenume.value == "" || trim(document.inscriere.prenume.value)==0)
	 {
	 var mesaj = (limba=='ro') ? 'Nu ati completat campul prenume!' : 'What is your first name?!' ;
	  alert(mesaj);
	  document.inscriere.prenume.value="";
	  document.inscriere.prenume.focus();
	  var verifica = 0;
	  return false;
	 }
	 if (document.inscriere.grad.value == "" || trim(document.inscriere.grad.value)==0)
	 {
	  var mesaj = (limba=='ro') ? 'Nu ati completat campul grad!' : 'The field `Degree` is empty!' ;
	  alert(mesaj);
	  document.inscriere.grad.value="";
	  document.inscriere.grad.focus();
	  var verifica = 0;
	  return false;
	 }
	 if (document.inscriere.mesaj.value == "" || trim(document.inscriere.mesaj.value)==0)
	 {
	  var mesaj = (limba=='ro') ? 'Nu ati completat campul mesaj!' : 'The field `Short description` is empty!' ;
	  alert(mesaj);
	  document.inscriere.mesaj.value="";
	  document.inscriere.mesaj.focus();
	  var verifica = 0;
	  return false;
	 } 

	 if ( verifica!=0 ) {
		document.inscriere.submited.value=1;
		document.inscriere.submit();
	 } else {
		return false;
	 }
}


/* $verificare formular */

/* verificare formular recomanda */
function verifica_recomanda(limba) {
	 // prenume
	 if (document.contact.prenume_exp.value == "" || trim(document.contact.prenume_exp.value)==0)
	 {
	  var mesaj = (limba=='ro') ? 'Nu ati completat campul prenume!' : 'What is your first name?' ;
	  alert(mesaj);
	  document.contact.prenume_exp.value="";
	  document.contact.prenume_exp.focus();
	  var verifica = 0;
	  return false;
	 }
	 // prenume prieten
	 if (document.contact.prenume_dest.value == "" || trim(document.contact.prenume_dest.value)==0)
	 {
	  var mesaj = (limba=='ro') ? 'Nu ati completat campul prenume prieten!' : 'What is your friend\'s first name?' ;
	  alert(mesaj);
	  document.contact.prenume_dest.value="";
	  document.contact.prenume_dest.focus();
	  var verifica = 0;
	  return false;
	 }
	 // nume
	 if (document.contact.nume_exp.value == "" || trim(document.contact.nume_exp.value)==0)
	 {
	  var mesaj = (limba=='ro') ? 'Nu ati completat campul nume!' : 'What is your last name?' ;
	  alert(mesaj);
	  document.contact.nume_exp.value="";
	  document.contact.nume_exp.focus();
	  var verifica = 0;
	  return false;
	 }
	 // nume expeditor
	 if (document.contact.nume_dest.value == "" || trim(document.contact.nume_dest.value)==0)
	 {
	  var mesaj = (limba=='ro') ? 'Nu ati completat campul nume prieten!' : 'What is your friend\'s last name?' ;
	  alert(mesaj);
	  document.contact.nume_dest.value="";
	  document.contact.nume_dest.focus();
	  var verifica = 0;
	  return false;
	 }
	 // email
	 if (document.contact.email_exp.value == "" || trim(document.contact.email_exp.value)==0 || !verifMail(document.contact.email_exp.value))
	 {
	  var mesaj = (limba=='ro') ? 'Adresa de e-mail invalida!' : 'Invalid e-mail address!' ;
	  alert(mesaj);
	  document.contact.email_exp.value="";
	  document.contact.email_exp.focus();
	  var verifica = 0;
	  return false;
	 }
	 // email prieten
	  if (document.contact.email_dest.value == "" || trim(document.contact.email_dest.value)==0 || !verifMail(document.contact.email_dest.value))
	 {
	  var mesaj = (limba=='ro') ? 'Adresa de e-mail invalida!' : 'Invalid e-mail address!' ;
	  alert(mesaj);
	  document.contact.email_dest.value="";
	  document.contact.email_dest.focus();
	  var verifica = 0;
	  return false;
	 }
	 // mesaj
	if (document.contact.mesaj.value == "" || trim(document.contact.mesaj.value)==0)
	 {
	  var mesaj = (limba=='ro') ? 'Nu ati completat campul mesaj!' : 'What is your message?' ;
	  alert(mesaj);
	  document.contact.mesaj.value="";
	  document.contact.mesaj.focus();
	  var verifica = 0;
	  return false;
	 }

	 if ( verifica!=0 ) {
		document.contact.submited.value=1;
		document.contact.submit();
	 } else {
		return false;
	 }
}



/* nav */
var dom=(document.getElementById)?true:false;
var realdom=(document.addEventListener)?true:false;
var target=(realdom)?"event.target":"event.srcElement";

function listen(obj,act,func) {
	if (realdom) obj.addEventListener(act,func,0);
	else obj.attachEvent("on"+act,func);
}

function doPop() {
	doPopArgs = doPop.arguments;
	if(doPopArgs.length == 1) window.open(doPopArgs[0].href, doPopArgs[0].target, 'status=no,scrollbars=no,resizable=no,width=520,height=395');
	else if (doPopArgs.length > 1) window.open(doPopArgs[0].href, doPopArgs[0].target, 'status=no,scrollbars=no,resizable=no,width='+doPopArgs[1]+',height='+doPopArgs[2]);
	return false;
}

/* start smoth opening/closing scripting */
var fullH = 0;var opening=false; var doingOpen;
var actObj, exObj; var nextObj = new String();

function closeSmooth() {
	exH = exObj.style.height.substring(0,exObj.style.height.length-2);
	if (exH > 10) {
		exH-=10;
		exObj.style.height = exH+'px';
		setTimeout("closeSmooth()", 30);
	} else {
		exObj.style.height = '0px';
		return false;
	}
}

function openSmooth() {
	openArgs = openSmooth.arguments;
	if(openArgs.length) {
		if (opening) nextObj = openArgs[0];
		else actObj = document.getElementById(openArgs[0]);
	}
	actH = actObj.scrollHeight;
	if (exObj && exObj!=actObj) closeSmooth();
	if (!exObj || exObj!=actObj) {
		if (fullH < actH) {
			if (fullH > 500) return false;
			fullH+=10;
			actObj.style.height = fullH+'px';
			opening = true;
			doingOpen = setTimeout("openSmooth()", 30);
		} else {
			opening=false;
			exObj = actObj;
			fullH = 0;
			if(nextObj.length) {
				newNextObj = nextObj;
				nextObj = '';
				openSmooth(newNextObj);
			}
		}
	}
	return false;
}
/* end smoth opening/closing scripting */
/* //nav */
/* scroll index */


function printeaza(text) {
	/*
	text=document;
	print(text);
	*/
	window.open(text, 'print', 'status=no,scrollbars=yes,resizable=no,width=520,height=395')

}

// Flash Version Detector  v1.2.1
// documentation: http://www.dithered.com/javascript/flash_detect/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)
// with VBScript code from Alastair Hamilton (now somewhat modified)


function isDefined(property) {
  return (typeof property != 'undefined');
}

var flashVersion = 0;

function getFlashVersion() {
	var latestFlashVersion = 8;
   var agent = navigator.userAgent.toLowerCase(); 
   
   // NS3 needs flashVersion to be a local variable
   if (agent.indexOf("mozilla/3") != -1 && agent.indexOf("msie") == -1) {
      flashVersion = 0;
   }
   
	// NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		var flashPlugin = navigator.plugins['Shockwave Flash'];
		if (typeof flashPlugin == 'object') { 
			for (var i = latestFlashVersion; i >= 3; i--) {
            if (flashPlugin.description.indexOf(i + '.') != -1) {
               flashVersion = i;
               break;
            }
         }
		}
	}

	// IE4+ Win32:  attempt to create an ActiveX object using VBScript
	else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
	   var doc = '<scr' + 'ipt language="VBScript"\> \n';
      doc += 'On Error Resume Next \n';
      doc += 'Dim obFlash \n';
      doc += 'For i = ' + latestFlashVersion + ' To 3 Step -1 \n';
      doc += '   Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';
      doc += '   If IsObject(obFlash) Then \n';
      doc += '      flashVersion = i \n';
      doc += '      Exit For \n';
      doc += '   End If \n';
      doc += 'Next \n';
      doc += '</scr' + 'ipt\> \n';
      document.write(doc);
   }
		
	// WebTV 2.5 supports flash 3
	else if (agent.indexOf("webtv/2.5") != -1) flashVersion = 3;

	// older WebTV supports flash 2
	else if (agent.indexOf("webtv") != -1) flashVersion = 2;

	// Can't detect in all other cases
	else {
		flashVersion = flashVersion_DONTKNOW;
	}

	return flashVersion;
}

flashVersion_DONTKNOW = -1;

/* swf */
function arata_flash(swf_url,img_path,tip,alt_width) {
	if (is_opera) {
		var poza = (tip == 0)?'opera_mare.jpg':'opera_mica.jpg';
	} else {
		var poza = (tip == 0)?'noflash.jpg':'noflashsmall.jpg';
	}
	var alt_width = ( alt_width ) ? 294 : 390;
	var width = ( tip == 0 )? 361 : alt_width ;
	var height = ( tip == 0 )? 160 : 134 ;
	var area_coords = ( tip ==0 ) ? '255,128,353,152' : '261,104,353,126';
	var area = '<map name="Map"><area shape="rect" coords="' + area_coords + '" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank" alt="Flash Player Install"></map>';
	var imagine = '<img src="' + img_path + poza + '" width="'+ width +'" height="'+ height +'" border="0"';
	imagine	   += ( !is_opera ) ? ' usemap="#Map" ' : '';
	imagine    += ' /> ' + area;
	
	var alt_swfload = ( alt_width == 294 ) ? 'second_294.swf' : 'second.swf';
	var swfload = (tip==0)?'main.swf':alt_swfload;
	
	frameuri = [1, 42, 83, 123, 163, 203, 242];
	var p = frameuri.length;
	var randFrame = Math.round(Math.random()*(p-1));
	
	var swf = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+width+'" height="'+height+'"><param name="movie" value="' + swf_url + swfload+'?frame='+ frameuri[randFrame] +'&urlu='+ swf_url +'" /><param name="wmode" value="opaque" />';
	swf    += '<embed src="' + swf_url + swfload + '?frame=' + frameuri[randFrame] + '&urlu=' + swf_url + '" quality=high pluginspage="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" wmode="opaque" width="'+width+'" height="'+height+'">';
	swf    += '</embed>';
	swf    += '</object>';
	var versiune = getFlashVersion();
	
//	if ( !versiune || versiune < 6 || is_opera ) 
//	{
//		document.write(imagine);
//	} 
//	else 
//	{
		document.write(swf);
//	}
}

// by Visan C
function show_hide(id, care)
{
	var id;
	var care;
	div_news = document.getElementById("sh"+ care +"_"+id);
	

	if(div_news.style.display=='none'){
		div_news.style.display='block';
		div_news.focus();
		
	}
	else
	{
		div_news.style.display='block';
		div_news.style.display="none";
		div_news.blur();
	}
}
