function setContent(id,text){
	document.getElementById(id,text).innerHTML = text;
}

function expandToggle(id){
		var object = document.getElementById(id);
		if (object.style.display == '') object.style.display = 'none';
		 else  object.style.display = '';	
	}
	
function getOfertaclient(){	
	var args = new Array();		
	setLoading('content');
	sajax_do_call('contact','display',args,'content');
}



function getContact(){	
	var args = new Array();		
	setLoading('content');
	sajax_do_call('contact','display',args,'content');
}

function getContactm(){	
	var args = new Array();		
	setLoading('content');
	sajax_do_call('contactm','display',args,'content');
}

function getInfo(){	
	var args = new Array('info');		
	setLoading('content');	
	sajax_do_call('main','getText',args,'content');
}

function getFaq(){	
	var args = new Array('faq');
	setLoading('content');
	sajax_do_call('main','getText',args,'content');
}

 function getVideo(id){
	args = new Array();
	//args.push('');
	setLoading('content');
	sajax_do_call('video','display',args,'content');		
}

function openWindow(path,name,w,h){
	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  winW = parent.window.innerWidth;
	  winH = parent.window.innerHeight;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  winW = parent.document.body.offsetWidth;
	  winH = parent.document.body.offsetHeight;
	 }
	}	
	
	x=winW/2-w/2;
	y=winH/2-h/2;	
	window.open(path,name,'width='+w+', height='+h+', toolbar=0, resizable = 0, menubar=0, status=0, titlebar=0, left='+x+', top='+y);
}

function $(id){
	return document.getElementById(id);
}

function setLoading(id){
	$(id).innerHTML = '<img src="img/loading.gif" align="absmiddle">';
}

function checkForm(form,lang){
	var errorMsg = new Array();
	errorMsg['ro'] = 'Trebuiesc completate toate campurile obligatorii';
	errorMsg['en'] = 'You have to fill in the required fields';
	var error;
	if (!$('contact.nume').value || !$('contact.detalii').value){
		error = errorMsg[lang];
		$('error').innerHTML = error;
		return false;
	}
	else return true;
	
}