var window_size = 0;
var myWidth = 0;
var myHeight = 0;


function pageSize() {
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	 } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	 } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	 }
	 window_size = myHeight + "px";
}



function showLoader() {
		
		showme = function() {
			
			var overloader = document.getElementsByTagName("div")[0];
			var loader = document.getElementsByTagName("div")[1];
			
			if ( loader ) {
				
				pageSize();
				loader.style.display = "block";
				overloader.style.display = "block";
				overloader.style.height = window_size;
				clearInterval( shower );
			
			}
			
}

var shower = setInterval( showme, 100 );
		
};

showLoader();
 
window.onload = function () { 

new Effect.Fade('loader', { duration: 0.3 });
new Effect.Fade('overloader', { duration: 0.3 });

}

function coverme () {	

	if (!document.getElementsByTagName) {
		
		return;
		
	}
	
	var gen_count = 0;
	var det_count = 0;


	
}

function printpage() {
	window.print();  
}

function IsNumeric(strString)
   //  check for valid numeric strings	
{
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
}

function highlight_message()
{
	var id="flashMessage";
	if (document.getElementById(id)) {
		var elemento=document.getElementById(id);
		if (elemento.innerHTML.length>0)
			{
				new Effect.Highlight(id, {startcolor:'#FF0033', duration: 0.5} );
				new Insertion.Bottom(id, '<p>Kapatmak için tıklayınız</p>');
			}
	}
	Event.stopObserving(window, 'load', highlight_message);
}

function close_highlight_message()
{
	var id="flashMessage";
	if (document.getElementById(id)) {
		var elemento=document.getElementById(id);
		//alert('close_hiligt');
		if (elemento.innerHTML.length>0)
			{
				//alert('length is bigger man');
				new Effect.Fade(id);
			}
	}
	Event.stopObserving(window, 'load', close_highlight_message);
}

Event.observe(window, 'load', highlight_message, false);
Event.observe(document, 'click', close_highlight_message, false);
