function OnOver(TheId) {
	document.getElementById(TheId).style.background='#F4F4F4';
}

function OnOut(TheId) {
	document.getElementById(TheId).style.background='#FFFFFF';
}

function getAbsoluteLeft(objectId) {
	// Get an object left position from the upper left viewport corner
	// Tested with relative and nested objects
	o = document.getElementById(objectId);
	oLeft = o.offsetLeft ;           // Get left position from the parent object
	while(o.offsetParent!=null) {   // Parse the parent hierarchy up to the document element
		oParent = o.offsetParent ;   // Get parent object reference
		oLeft += oParent.offsetLeft; // Add parent left position
		o = oParent;
	}
	// Return left postion
	return oLeft;
}

function getAbsoluteTop(objectId) {
	// Get an object top position from the upper left viewport corner
	// Tested with relative and nested objects
	o = document.getElementById(objectId);
	oTop = o.offsetTop       ;     // Get top position from the parent object
	while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element
		oParent = o.offsetParent ; // Get parent object reference
		oTop += oParent.offsetTop; // Add parent top position
		o = oParent;
	}
	// Return top position
	return oTop;
}

function show_domain_help(id,short_text)
{
	
		var w = screen.width
		var left = getAbsoluteLeft(id);


		var top = getAbsoluteTop(id);
		var resp = document.getElementById('domain_helper');
		resp.style.top = top+0+'px';
		resp.style.left = left+17+'px';
		

		resp.innerHTML=short_text;
		document.getElementById('domain_helper').style.display='';
}

function hide_domain_help() {
	document.getElementById('domain_helper').style.display='none';
}


function close_domain_window(){
	//document.getElementById('domain_rezerv').style.display='none';
	
	//var ajax;
	
	new Effect.Shrink('domain_rezerv');
}

function select_domain(id,extension,name){
	
	
	//document.domain_form.button1.disabled=true;

	var ajax;

	//new Effect.Grow('domain_sel')

	document.getElementById('domain_sel').innerHTML = '<img src="/media/img/layout/loader.gif" style="margin-right:5px;"> va rugam asteptati ...';

	
	ajax =  new Ajax.Updater(
         'domain_sel',
         '/phpBIN/inc.sel-domain.php?type='+id+'&extension='+extension+'&name='+name,
         { method:'get'});


}

function sel_host(hosting){
	//alert(hosting.value);
}

function check_domain(){
	
	
	document.domain_form.button1.disabled=true;

	var ajax;

	new Effect.Grow('domain_rezerv')

	val = document.domain_form.domain_name.value;
	document.getElementById('domain_rezerv').innerHTML = '<img src="/media/img/layout/loader.gif" style="margin-right:5px;"> va rugam asteptati ...';

	var c_value = "";
	
	for (var i=0; i < document.domain_form.domain.length; i++)
	{
		if (document.domain_form.domain[i].checked){
		  c_value = c_value + document.domain_form.domain[i].value + "+";
		}
	}	
	
	ajax =  new Ajax.Updater(
         'domain_rezerv',
         '/phpBIN/inc.check-domain.php?type='+val+'&ext='+c_value,
         { method:'get'});


}

function disabled_off()
{
	document.domain_form.button1.disabled=false;
}


function domainPriceOver(TheId) {
	document.getElementById(TheId).style.border='1px solid #e40429';
	//document.getElementById(TheId).style.color='#FFFFFF';
}

function domainPriceOut(TheId) {
	document.getElementById(TheId).style.border='1px solid #EEEEEE';
	//document.getElementById(TheId).style.color='#e40429';
}

function check_order()
{
	if (document.order.name.value=="" || document.order.name.value=="-") {
		alert("Va rugam adaugati numele dvs pentru a continua.");
		document.order.name.focus();
		return false;
	}
	if (document.order.email.value=="" || document.order.email.value=="-") {
		alert("Va rugam adaugati e-mail dvs pentru a continua.");
		document.order.email.focus();
		return false;
	}

	if (document.order.phone.value=="" || document.order.phone.value=="-") {
		alert("Va rugam adaugati telefonul dvs pentru a continua.");
		document.order.phone.focus();
		return false;
	}	

	if (document.order.city.value=="" || document.order.city.value=="-") {
		alert("Va rugam adaugati orasul dvs pentru a continua.");
		document.order.city.focus();
		return false;
	}

	if (document.order.addr.value=="" || document.order.addr.value=="-") {
		alert("Va rugam adaugati adresa dvs pentru a continua.");
		document.order.addr.focus();
		return false;
	}

	if (document.order.code.value=="" || document.order.code.value=="-") {
		alert("Va rugam adaugati codul postal dvs pentru a continua.");
		document.order.code.focus();
		return false;
	}

	if (document.order.cf.value=="" || document.order.cf.value=="-") {
		alert("Va rugam adaugati codul fiscal sau CNP pentru persoane fizice pentru a continua.");
		document.order.cf.focus();
		return false;
	}	
	
}




