var base_url = 'http://www.cinematograph.ro/';


function manage (id, cls1, cls2)
{
	if (document.getElementById)
	{
		var el = document.getElementById (id);
		if (el.className == cls1)
			el.className = cls2;
		else
			el.className = cls1;
		for (var i = 3; i<arguments.length; i++)
		{
			if (arguments[i] != '')
			{
				var el = document.getElementById (arguments[i]);
				el.className = cls1;
			}
		}
	}
	//document.location.href="http://google.com";
	return false;
}


function verify(id)
{
		var form = document.getElementById (id);
		/*alert(form.frm_nume.value);*/
		if(form.frm_nume.value == 0 || form.frm_nume.value == 'Prenume, Nume')
		{
			alert('Trebuie sa completati numele dumneavoastra !');
			form.frm_nume.focus();
			return false;
		}
		if((form.frm_email.value.indexOf("@") == -1) || (form.frm_email.value.indexOf(".") == -1) || form.frm_email.value == 'Email')
		{
			alert('Introduceti un e-mail valid!');
			form.frm_email.focus();
			return false;
		}
		if(form.frm_subiect.value == 0 || form.frm_subiect.value == 'Subiect')
		{
			alert('Trebuie sa completati subiectul comentariului dumneavoastra !');
			form.frm_subiect.focus();
			return false;
		}
		if(form.frm_comentariu.value == 0 || form.frm_comentariu.value == 'Comentariu')
		{
			alert('Trebuie sa introduceti un comentariu !');
			form.frm_comentariu.focus();
			return false;
		}
		if(form.code.value == 0 || form.code.value == 'Cod imagine dreapta')
		{
			alert('Trebuie sa introduceti codul din imagine !');
			form.code.focus();
			return false;
		}
		form.submit();
}

function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}

function print_it (id)
{
	if (document.getElementById)
	{
		var content = document.getElementById (id).innerHTML;
		/*content = content.substring (0, content.indexOf ('<script')) + content.substring (content.indexOf ('</script>')+9);*/

		var printWin = window.open ('','', 'width=800,height=800');
		printWin.document.open ();
		printWin.document.write ('<html><head><link rel=\"stylesheet\" TYPE=\"text/css\" href=\"'+base_url+'css/style.css\" /></head><body style=\"background-color:#fff;\">');

		printWin.document.write ("<table><tr><td><img src=\"'+base_url+'css/bck.jpg\" align=\"left\" /></td></tr></table>");
		printWin.document.write (content);
		printWin.document.write ("<img src=\"'+base_url+'css/footer.jpg\" align=\"left\" /> &nbsp;");
		printWin.document.write ('</body></html>');
		printWin.document.close ();
		printWin.focus ();
		printWin.print ();

		setTimeout ("", 1000);

		printWin.close();
	}
}
function get_value(id)
{
	form = document.getelementbyid("select");
	alert(id);
}

function validare_news(id)
{
		var form = document.getElementById (id);
		if(form.nume.value == 0)
		{
			alert('Trebuie sa completati numele dumneavoastra !');
			form.nume.focus();
			return false;
		}
		if((form.email.value.indexOf("@") == -1) || (form.email.value.indexOf(".") == -1) || form.email.value == 0)
		{
			alert('Introduceti un e-mail valid!');
			form.email.focus();
			return false;
		}
		form.submit();
}


function show(id)
{
	copii = id.split("_");
	for(i=1;i<copii.length;i++)
	{

		if(document.getElementById(copii[0]+'_'+copii[i]).style.display == 'none')
		{
				document.getElementById(copii[0]+'_'+copii[i]).style.display ='block';
				//alert(copii[0]+'_'+copii[i]);
		}
		else
				document.getElementById(copii[0]+'_'+copii[i]).style.display = 'none';
	}
}



function wopen(url, name, w, h)
{
// Fudge factors for window decoration space.
 // In my tests these work well on all platforms & browsers.
w += 32;
h += 96;
 var win = window.open(url,
 name,
 'width=' + w + ', height=' + h + ', ' +
 'location=no, menubar=no, ' +
 'status=no, toolbar=no, scrollbars=yes, resizable=no');
 win.resizeTo(w, h);
 win.focus();
}


function lista(id,id_a)
{
	if(document.getElementById(id).style.display == 'block'){
		document.getElementById(id).style.display = 'none';
		document.getElementById(id_a).style.backgroundImage = 'url('+base_url+'css/menu_arrow.jpg)';
	}
	else if(document.getElementById(id).style.display == 'none'){
		document.getElementById(id).style.display = 'block';
		document.getElementById(id_a).style.backgroundImage = 'url('+base_url+'css/menu_arrow_set.jpg)';
	}
	return false;
}

