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_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_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 expand( name )

{

	document.getElementById( name ).style.display = '';

}



function collapse( name )

{

	document.getElementById( name ).style.display = 'none';

}



function collexp( name )

{

	if ( document.getElementById( name ).style.display == 'none' )

		document.getElementById( name ).style.display = '';

	else

	if ( document.getElementById( name ).style.display == '' )

		document.getElementById( name ).style.display = 'none';

}











function expandf( name, fid, file )

{

	document.getElementById( name ).style.display= '';	

	document.getElementById( fid ).src = file;

}



function collapsef( name, fid, file )

{

	document.getElementById( name ).style.display = 'none';

	document.getElementById( fid ).src = "";

}



function collexpf( name, fid, file )

{

	if ( document.getElementById( name ).style.display == '' )

	{

		document.getElementById( name ).style.display = 'none';

		document.getElementById( fid ).src = "";

	}

	else

	if ( document.getElementById( name ).style.display == 'none' )

	{

		document.getElementById( name ).style.display = '';	

		document.getElementById( fid ).src = file;

	}

}











function cbcheck( vhow, fname )

{

	fob = document.getElementById( fname );

	check = "invert";

	switch( vhow )

	{

		case "all":

			check = true;

			break;

		case "none":

			check = false;

			break;

			

		default:

			check = "invert";

			break;

	}

	

	

	for( i = 0; i <= fob.elements.length; i++ )

	{

		if ( ( fob.elements[ i ].type == "checkbox" ) && ( ! fob.elements[ i ].disabled ) )

		{

			if ( check == "invert" )

			{

				fob.elements[ i ].checked = ! fob.elements[ i ].checked;

			}

			else

			{

				fob.elements[ i ].checked = check;

			}

		}

	}

	

}



function listselect( field, value )

{

var ob = document.getElementById( field );

for ( i=0; i<= ob.options.length; i++ )

	if ( ob.options[i].value == value )

	{

		ob.selectedIndex = i;

		break;

	}

}



function confirmMsg( msg )

{

	if ( confirm( msg ) )

		return true;

	else

		return false;

}



function handleOptions()

{

	selval = document.formsearch.action.value; 

	document.form1.doaction.value = selval;

	c = true;

	if ( selval == "DEL" )

		c = confirmMsg('');

	if ( c )

		document.form1.submit();

}



function checkotype()

{

	var mytext;

	selval = document.form1.otype.value; 

	if ( selval == "3" )

	{

		//mytext = document.form1.source.value;

		collapse( 'cms' );

		expand( 'code' );

		//document.form1.source1.value = mytext;

	}

	else

	{

		//mytext = document.form1.source1.value;

		collapse( 'code' );

		expand( 'cms' );

		//document.form1.source.value = mytext;

	}

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 doSubmit()

{

	var ob = document.getElementById( "cbagree" );

	if ( ! ob.checked )

		alert("Ca sa va puteti inregistra trebuie sa fiti de acord cu termenii si conditiile specificate!\r\nVa multumim pentru intelegere!");

	else

		document.testdrive.submit();

}



function dateDisplay() {

	var days = [ "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata", "Duminica"];

	var months = [ "Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"];

	var now = new Date();

	var day = now.getDay();

	var today = days[now.getDay()-1]+" "+now.getDate()+" "+months[now.getMonth()]+" "+now.getFullYear();

	document.write(today);

}



function hourDisplay() {

	var now = new Date();

	var hourObject = document.getElementById("hourZone");

	if (now.getMinutes() < 10) hourObject.value = now.getHours()+":0"+now.getMinutes();

		else hourObject.value = now.getHours()+":"+now.getMinutes();

	var time = setTimeout("hourDisplay()",6000);

}



//var x = 360;

//var y = 177;

function setVisible(obj, x, y)

{

	obj = document.getElementById(obj);

	if (document.documentElement)

	{

		theLeft = document.documentElement.scrollLeft;

		theTop = document.documentElement.scrollTop;

	}

	else if (document.body)

	{

		theLeft = document.body.scrollLeft;

		theTop = document.body.scrollTop;

	}

	theLeft = x;

	theTop = y;

	obj.style.left = theLeft + 'px' ;

	obj.style.top = theTop + 'px' ;

	obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';

}

function placeIt(obj, x, y)

{

	obj = document.getElementById(obj);

	if (document.documentElement)

	{

		theLeft = document.documentElement.scrollLeft;

		theTop = document.documentElement.scrollTop;

	}

	else if (document.body)

	{

		theLeft = document.body.scrollLeft;

		theTop = document.body.scrollTop;

	}

	theLeft += x;

	theTop += y;

	obj.style.left = theLeft + 'px' ;

	obj.style.top = theTop + 'px' ;

	//setTimeout("placeIt('"+obj+"', "+x+" , "+y+")",500);

}


