function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

var perde = {

	showPerde:function() {
		var WH = getPageSize();
		//document.getElementById('perde').style.height = WH[1];
		document.getElementById('perde').style.display = 'block';
		
		var attributes = {
			height: { to: WH[1] }
		};
			  
		var anim = new YAHOO.util.Anim('perde', attributes, 0.5);
		anim.animate();
		//YAHOO.util.Event.addListener('perde', "click", perde.hideWin); 
		//YAHOO.util.Event.addListener('closeButton', "click", perde.hideWin); 
	},
	
	hideWin:function() { 
		document.getElementById('winn').style.width=0;
		document.getElementById('winn').style.height=0;
		document.getElementById('winn').style.display = 'none'; 
	//	document.getElementById('perde').style.width=0;
		document.getElementById('perde').style.height=0;
		document.getElementById('perde').style.display = 'none'; 
		document.getElementById('winC').innerHTML='';
	},
	
	
	showWin:function(w,h) { 
		perde.showPerde();

		document.getElementById('winn').style.display = 'block';
		var WH = getPageSize();
		var left = (WH[0]/2)-(w/2);
		var top = document.body.scrollTop + (WH[3]/2)-(h/2);
		
		   var attributes = {
			  width: { to: w }, 
			  height: { to: h+20 }
		   };
			  
		   var anim = new YAHOO.util.Anim('winn', attributes, 0.5, YAHOO.util.Easing.backOut);
		   anim.animate();
		document.getElementById('winn').style.left = left;
		document.getElementById('winn').style.top = top;
		//document.getElementById('winn').style.width = w;
		//document.getElementById('winn').style.height = h;
		
	}

};


		

function melodiDinle(code,description,demo_file) {
	var callback = { 
		success:function(o) { document.getElementById('winC').innerHTML=o.responseText; }, 
		failure:function() { return false; }, 
		timeout:5000 
	}; 
	YAHOO.util.Connect.asyncRequest('POST', 'melodiDinle.php', callback, "code=http://cms.ringofon.com/content_demo/b61cadfdbd60bcba6ed845574d2d426a.mp3&description=aaaaa&demo_file=http://cms.ringofon.com/content_demo/b61cadfdbd60bcba6ed845574d2d426a.mp3");
	perde.showWin(400,250);
}




function aboneKontrol() {
	if ( document.getElementById('operator') && document.getElementById('msisdn') && document.getElementById('pin') ) {
		document.getElementById('chk').disabled=true;
		var callback = { 
			success:function(o) {
				document.getElementById('chk').disabled=false;
					if (o.responseText) {
						document.getElementById('mhResult').innerHTML=o.responseText; 
					} else alert('Telefon numaranýz yada þifreniz hatalý!');
				},
			failure:function() { return false; }
		}; 
		YAHOO.util.Connect.asyncRequest('POST', 'musteriHizmetleri.php', callback, "JX=1&O="+document.getElementById('operator').value+"&M="+document.getElementById('msisdn').value+"&P="+document.getElementById('pin').value);
	} else alert('Eksik yada geçersiz bilgi girdiniz.\nLütfen kontrol edip tekrar deneyiniz.');
	return false;
}

function doIptal() {
	if ( document.getElementById('operator') && document.getElementById('msisdn') && document.getElementById('pin') ) {
		var callback = { 
			success:function(o) {
					if (o.responseText) {
						document.getElementById('mhResult').innerHTML=o.responseText; 
					} else alert('Telefon numaranýz yada þifreniz hatalý!');
				},
			failure:function() { return false; }
		}; 
		YAHOO.util.Connect.asyncRequest('POST', 'musteriHizmetleri.php', callback, "JX=1&PTL=1&O="+document.getElementById('operator').value+"&M="+document.getElementById('msisdn').value+"&P="+document.getElementById('pin').value);
	} else alert('Eksik yada geçersiz bilgi girdiniz.\nLütfen kontrol edip tekrar deneyiniz.');
	return false;
}

function open_statusMenu(){

	if(document.getElementById("statusMenu").style.display == "none"){
		document.getElementById("statusMenu").style.display = "block";
	}else{
		document.getElementById("statusMenu").style.display = "none";
	}
	
}
