/****************************************************************************/
/* This method gives the focus to the given component based on id attribute */
/****************************************************************************/
function assignFocus(id) {
	object = getObject(id);
	if(object){
		object.focus();
	}
} 
/***************************************************************/
/* This method hides the given component based on id attribute */
/***************************************************************/
function hide(id) {
	object = getObject(id);
	if(object){
		object.style.visibility = 'hidden';
	}
} 
/*****************************************************************/
/* This method returns a javascript object using its id attribute*/
/*****************************************************************/
function getObject(id){
	return document.getElementById(id);	
}
/**********************************************************************/
/* This method returns a javascript form object using its id attribute*/
/**********************************************************************/
function getFormObject(form, id) {
	elements = form.elements;
	for (cpt = 0; cpt < elements.length; cpt++){
		if (elements[cpt].id == id)
			return elements[cpt];
	}
	return "";
}
/*************************************************/
/* This method sets the website background image */
/*************************************************/
function setBackground(){
		if (screen.width==1600){
			if (screen.height==1200){
				image = ("../image/argan.png");
			}if (screen.height==1024){
				image = ("../image/argan.png");
			}else {
				image = ("../image/argan.png");
			}
		}else if (screen.width==1280){
			if (screen.height==1024){
				image = ("../image/argan.png");
			}if (screen.height==960){
				image = ("../image/argan.png");
			}else {
				image = ("../image/argan.png");
			}
		}else if (screen.width==1152){
			image = ("../image/argan.png");			
		}else if (screen.width==1024){
			image = ("../image/argan.png");			
		}else if (screen.width==800){
			image = ("../image/argan.png");			
		}else{ //DFAULT
			image = ("../image/argan.png");			
		}	
		document.body.background = image;
}
/**************************************************/
/* This method write the screen height in the page*/
/**************************************************/
function writeHeight(){
	document.write(screen.height);	
}
/**************************************************/
/* This method write the screen width in the page */
/**************************************************/
function writeWidth(){
	document.write(screen.width);	
}