// function_project.js



	/**
	 * @comment  : Sayfa yuklendikten sonra yapilan sayfa ayaridir. Sayfa yuksekligine ve Form kutularina sekil verir.
	 * @function : onForm
	 * @param    : -
	 * @return   : void
	 */	 	
	function onForm2(){
		// Sayfanin yuksekligini ayarla
		var tbH = document.documentElement.clientHeight;
		document.getElementById('tableGeneral').style.height = (tbH-230)+'px';
		
		// Formdaki text alanlarinin style'lerini belirt.
		var input_tag = document.getElementsByTagName('input');
		var textarea_tag = document.getElementsByTagName('textarea');
		
		var input_length = input_tag.length;
		var textarea_length = textarea_tag.length;
		
		
		for ( i = 0 ; i < input_length ; i++ ){
			if ( input_tag[i].type == 'text' || input_tag[i].type == 'password' || input_tag[i].type == 'file' ){
				input_tag[i].className = 'input';

				if ( !input_tag[i].onfocus ){
					input_tag[i].onfocus = function(){
						this.className += ' input_focus';
					}
					input_tag[i].onblur = function(){
						this.className = 'input';
					}
				}
			} 
		}
		
		for ( i = 0 ; i < textarea_length ; i++ ){
			if ( !textarea_tag[i].onfocus ){
				textarea_tag[i].onfocus = function(){
					this.className += ' input_focus';
				}
			}
			
			textarea_tag[i].onblur = function(){
				this.className = '';
			}
		}
		
	}
	//function(onForm):END





	/**
	 * @comment  : Farenin, istenen ikon uzerine gelmesi durumunda acilacak yardim kutusunun konumunu belirler.
	 * @function : infoIcon
	 * @param    : e, str (Event(Olay), Mesajin kendisi)
	 * @return   : void
	 */	 	
	function infoIcon(e,str){
	
		if (!e) e = window.event;

		if (e){
		  if (e.pageX || e.pageY){
		  	screen_x = window.innerWidth - 16;
		  	screen_y = window.innerHeight - 16;
		    mousex = e.pageX + 15;
		    mousey = e.pageY;
		  }
		  else if (e.clientX || e.clientY){
		  	screen_x = document.body.offsetWidth - 20;
		  	screen_y = document.body.offsetHeight - 20;
		    mousex = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft + 15;
		    mousey = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
		  }
		}

		var div_info_icon = document.getElementById('div_info_icon');
		div_info_icon.style.display 	= 'block';
		div_info_icon.style.textAlign	= 'center';
		div_info_icon.innerHTML	= str;

		var div_width = div_info_icon.style.width;
		var div_height = div_info_icon.offsetHeight;
		div_width = 180;

		//alert(screen_y+' - '+mousey+' - '+div_height);
		if ( screen_x - mousex  < div_width ){			
			mousex = (mousex - div_width - 25);
			mousey = mousey + 15;
		}
		if ( screen_y - mousey  < div_height ){
			mousey = (mousey - div_height - 15);
		}

		div_info_icon.style.left 		= mousex+'px';
		div_info_icon.style.top 		= mousey+'px';
		return false;

	}
	//function(infoIcon):END


	
	
	/**
	 * @comment  : Farenin, istenen ikon uzerine gelmesi durumunda istenen yere ilgili yazinin yazdirilmasi.
	 * @function : infoIconText
	 * @param    : str (Mesajin kendisi)
	 * @return   : void
	 */	 	
	function infoIconText(id, str){
		var div_info_icon = document.getElementById('div_info_icon_'+id);
		
		if ( Trim(str) > '' )
		div_info_icon.innerHTML = str;else
		div_info_icon.innerHTML = '&nbsp;';
	}
	//function(infoIconText):END



	/**
	 * @comment  : Acilan yardim ikonlarini farenin ikon uzerinden kalkmasi sonucu kapatir.
	 * @function : infoIcon
	 * @param    : -
	 * @return   : void
	 */	 
	function infoIconClose(){
		var div_info_icon 					= document.getElementById('div_info_icon');		
		div_info_icon.innerHTML			= '&nbsp;';
		div_info_icon.style.display = 'none';
		return false;
	}
	//function(infoIconClose):END
	
	
	
	
	/**
	 * @comment  : Acilan yardim ikonlarini farenin ikon uzerinden kalkmasi sonucu kapatir.
	 * @function : infoIcon
	 * @param    : -
	 * @return   : void
	 */	 
	function popupChangeLanguage(e, id){
		var popup_lng = window.open('popup.lng.php?id='+id,'popup_lng','scrollbars=yes,left=150,top=150,width=600,height=700');popup_lng.focus();
	}
	