function print_it (id, width_i)
{
	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='+width_i+',height=800');
		printWin.document.open ();
		printWin.document.write ('<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.way2web.ro/css/domenii.css\" /></head><body style=\"background-color:#fff;\">');

// 		printWin.document.write ('<div style="width:1000px; margin:0px auto;">');
		printWin.document.write (content);
// 		printWin.document.write ("</div>");
		printWin.document.write ('</body></html>');
		printWin.document.close ();
		printWin.focus ();
		printWin.print ();

		setTimeout ("", 1000);

		printWin.close();
	}
	return false;
}

	

function pass_show()
{
	$('#password').show();
	$('#div_login').hide();
}

function login_show()
{
	$('#password').hide();
	$('#div_login').show();
}


function div_show()
{
			$('#div_scoli').show();
}

function div_hide()
{
			$('#div_scoli').hide();
}


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 validate_required(field,alerttxt)
{
with (field)
{
if (value==NULL||value=='Nume' && value=='')
  {alert(alerttxt);return false}
else {return true}
}
}



function popup(url, img)
			{
				
				if (typeof window.innerWidth != 'undefined')
 				{
     				viewportwidth = window.innerWidth;
     				viewportheight = window.innerHeight;
					offwidth = document.getElementsByTagName('html')[0].offsetWidth;
			        offheight = document.getElementsByTagName('html')[0].offsetHeight;
				}

				// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

				else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0)
				{
			       viewportwidth = document.documentElement.clientWidth;
			       viewportheight = document.documentElement.clientHeight;
			       offwidth = document.getElementsByTagName('html')[0].offsetWidth;
			       offheight = document.getElementsByTagName('html')[0].offsetHeight;
				}

				// older versions of IE

				else
				{
			       viewportwidth = document.getElementsByTagName('html')[0].clientWidth;
			       viewportheight = document.getElementsByTagName('html')[0].clientHeight;
				   offwidth = document.getElementsByTagName('html')[0].offsetWidth;
			       offheight = document.getElementsByTagName('html')[0].offsetHeight;
				}
				if(url!=null)
				{
				$('<div id="overall_page" onclick="cancel_mail()" class="overall_page" style="width:'+offwidth+'px; height:'+offheight+'px" ></div>').appendTo("body");
				}
				else
				{
					$('<div id="overall_page" class="overall_page" style="width:'+offwidth+'px; height:'+offheight+'px" ></div>').appendTo("body");
				}
				$('#overall_page').fadeTo("slow", 0.65 ,function(){
					$('#overall_page').after('<div class="main_panel" id="main_panel"></div>');

			if(url!=null){
					$('#main_panel').load( url , null, function(){
						p_width = document.getElementById('main_panel').offsetWidth;
						p_height = document.getElementById('main_panel').offsetHeight;

						new_width  = viewportwidth/2-p_width/2;
						new_height = viewportheight/2-p_height/2;
						document.getElementById('main_panel').style.top = new_height+'px';
						document.getElementById('main_panel').style.left = new_width+'px';
					});}
			else if(img!=null)
			{
				
						$('#main_panel').html('<div class="loading"> <img src="'+img+'" alt="Loading..."/> </div>');
						p_width = document.getElementById('main_panel').offsetWidth;
						p_height = document.getElementById('main_panel').offsetHeight;

						new_width  = viewportwidth/2-p_width/2;
						new_height = viewportheight/2-p_height/2;
						document.getElementById('main_panel').style.top = new_height+'px';
						document.getElementById('main_panel').style.left = new_width+'px';
				

			}


				});



			}

			function cancel_mail()
			{
				$('#overall_page').remove();
				//$('select').css({visibility: 'visible'});
				$('#main_panel').empty();
				$('#main_panel').remove();

			}

			function submit_mail()
			{
				$('#em_form').ajaxSubmit({ target:        '#main_panel'});
			}


			function hoverOn(message)
			{
				$('.help').empty();
				$('.help').html($('#'+message).html());
			//
			}

			function hoverOff()
			{
				$('.help').empty();

			}


function show_pic(top_0)
{
		if(document.getElementById(top_0).style.display == 'block')
		{
			document.getElementById(top_0).style.display = 'none';
		}
		else if(document.getElementById(top_0).style.display == 'none')
		{
			document.getElementById(top_0).style.display = 'block';
		}
}

	

function pass_show()
{
	$('#password').show();
	$('#div_login').hide();
}

function login_show()
{
	$('#password').hide();
	$('#div_login').show();
}

	
	
	
