function hideFormElement(name){
	var a1 = document.getElementById(name + '_suport');
	var a2 = document.getElementById(name + '_spacer');
	
	if(a1) hidee(name + '_suport');
	if(a2) hidee(name + '_spacer');
}

function showFormElement(name){
	var a1 = document.getElementById(name + '_suport');
	var a2 = document.getElementById(name + '_spacer');
	
	if(a1) showw(name + '_suport');
	if(a2) showw(name + '_spacer');
}

function hideFormElements(names){
	var a = names.split(',');
	for(var i=0;i<a.length;i++){
		hideFormElement(a[i]);
	}
}

function showFormElements(names){
	var a = names.split(',');
	for(var i=0;i<a.length;i++){
		showFormElement(a[i]);
	}
}

function checkContactForm(){
	var c1 = document.getElementById('rec_name').value;
	var c2 = document.getElementById('rec_mail').value;
	var c3 = document.getElementById('rec_message').value;
	if(c1 == ''){
		alert('Please enter your name.');
		return false;
	}
	if(c2 == ''){
		alert('Please enter your e-mail address.');
		return false;
	}
	if(!c2.match(/^(\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+)?$/)){
		alert('The e-mail address is invalid.');
		return false;
	}
	if(c3 == ''){
		alert('Please enter your message.');
		return false;
	}
	
	return true;
	
	
}

function FitPic() { 
 	var NS = (navigator.appName=="Netscape")?true:false; 	
   iWidth = (NS)?window.innerWidth:document.body.clientWidth; 
   iHeight = (NS)?window.innerHeight:document.body.clientHeight; 
   iWidth = document.images[0].width - iWidth; 
   iHeight = document.images[0].height - iHeight+53; 
   window.resizeBy(iWidth, iHeight); 
   self.focus(); 
} 

function changevar(varname,td){
	var obj = document.getElementById(varname);	
	var val = obj.value;
	if(val==0) td.className='selectorr_on';
	if(val==1) td.className='selectorr_off';
	obj.value=1-val;
}


function getComboValue(controlname){
	return document.getElementById(controlname).options[document.getElementById(controlname).selectedIndex].value;
}

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 getPositionTop(obj){
var el = obj;var pT = 0;
while(el){pT+=el.offsetTop;el=el.offsetParent;}
return pT
}
function getPositionLeft(obj){
var el = obj;var pL = 0;
while(el){pL+=el.offsetLeft;el=el.offsetParent;}
return pL
}
