var domloaded;

function initPencere() {
	var win = new Window({className: "alphacube", title: "Hizmet Sözleşmesi", width:500, height:450, url: "/pages/sozlesme", showEffectOptions: {duration:1.5}}) 
	win.showCenter(); 	
  }                 
  
function initWarn() {
	var win = new Window({className: "alphacube", title: "Eski Üyelerimiz", width:650, height:450, url: "/pages/sozlesme", showEffectOptions: {duration:1.5}}) 
	win.showCenter(); 	
	
  }                 

function showhide(id){
	if (document.getElementById){
	obj = document.getElementById(id);
	
	if (obj.style.display == "none"){
		obj.style.display = "";
		
		} else {
		$('fee_description').visualEffect('fade');	
		//obj.style.display = "none";
		}
	}
}

function showHidePayment(id){
	if (document.getElementById){
	obj = document.getElementById(id);
	
	if (obj.style.display == "none"){
		obj.style.display = "";
		} 
	}
}


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


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);
}


//Kunthar check DOM loading times 
// dom:loaded event fires before the window load event.
Element.observe(document, 'dom:loaded', function(){
	//domloaded = new Date().getTime();
	//alert('Geldim Cavit, DOM yuklendi naapıyoruz??');
	var id="PageLoad";
	if (document.getElementById(id)) 
	{
		new Effect.Appear(id);
		//new Effect.Appear(id, { duration: 0.9 });
	}
	
});

// Observing the plain old window load event.
Element.observe(window, 'load', function(){
	//var load = new Date().getTime();
	//alert(load - domloaded); // +-35 (ms)
	var id="PageLoad";
	if (document.getElementById(id)) 
	{
		//new Effect.Fade(id);	
		new Effect.Fade(id, { duration: 0.5 });	
	}	
});


//Event.observe(window, 'load', page_load, false);
Event.observe(window, 'load', highlight_message, false);
Event.observe(document, 'click', close_highlight_message, false);
//Event.observe(element, name, observer, [useCapture]);