// JavaScript Document
	function getScrollXY() {
	  var scrOfX = 0, scrOfY = 0;
	  if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	  }
	  return [ scrOfX, scrOfY ];
	}
	
	function dialogBoxShow(w,h)
	{

		hH = parseInt(h / 2);			 
		hW = parseInt(w / 2);
		wPadding = 12;
		
		//yükleniyor bilgisini kapat
		subDialogClose();
		
		 document.getElementById('dialogBoxDis').style.width = w+'px';
		 document.getElementById('dialogBoxDis').style.height = h+'px';
		 document.getElementById('dialogBoxDis').style.left = '50%';
		 document.getElementById('dialogBoxDis').style.top = (1*getScrollXY()[1]+hH+100)+'px';
		 document.getElementById('dialogBoxDis').style.marginLeft = (hW*-1)+'px';
		 document.getElementById('dialogBoxDis').style.marginTop = (hH*-1)+'px';
		 document.getElementById('dialogBoxDis').style.MozOpacity = 0.5;
		 document.getElementById('dialogBoxDis').style.filter = 'Alpha(Opacity=50)';
		 document.getElementById('dialogBoxDis').style.padding = '5px';
		 
		 
		 document.getElementById('dialogBoxIc').style.width = (w-wPadding)+'px';
		 document.getElementById('dialogBoxIc').style.height = (h-wPadding)+'px';
		 document.getElementById('dialogBoxIc').style.left = '50%';
		 document.getElementById('dialogBoxIc').style.top = (1*getScrollXY()[1]+hH+100)+'px';
		 document.getElementById('dialogBoxIc').style.marginLeft = ((hW*-1)+parseInt(wPadding / 2))+'px';
		 document.getElementById('dialogBoxIc').style.marginTop = ((hH*-1)+parseInt(wPadding / 2))+'px';
		 //document.getElementById('dialogBoxIc').style.MozOpacity = 1.0;
		 //document.getElementById('dialogBoxIc').style.filter = 'Alpha(Opacity=100)';
		 document.getElementById('dialogBoxIc').style.padding = '5px';
		 
		 document.getElementById('dialogBoxDis').style.display = '';
		 document.getElementById('dialogBoxIc').style.display = '';
		
	}
	
	function subDialogClose()
	{
		 document.getElementById('subDialogBoxDis').style.display = 'none';
		 document.getElementById('subDialogBoxIc').style.display = 'none';						
	}
	
	function subDialogShow(w,h,str,tip)
	{
		hH = parseInt(h / 2);			 
		hW = parseInt(w / 2);
		wPadding = 12;
		
		 document.getElementById('subDialogBoxDis').style.width = w+'px';
		 document.getElementById('subDialogBoxDis').style.height = h+'px';
		 document.getElementById('subDialogBoxDis').style.left = '50%';
		 document.getElementById('subDialogBoxDis').style.top = (1*getScrollXY()[1]+hH+100)+'px';
		 document.getElementById('subDialogBoxDis').style.marginLeft = (hW*-1)+'px';
		 document.getElementById('subDialogBoxDis').style.marginTop = (hH*-1)+'px';
		 document.getElementById('subDialogBoxDis').style.MozOpacity = 0.5;
		 document.getElementById('subDialogBoxDis').style.filter = 'Alpha(Opacity=50)';
		 document.getElementById('subDialogBoxDis').style.padding = '5px';
		 
		 
		 document.getElementById('subDialogBoxIc').style.width = (w-wPadding)+'px';
		 document.getElementById('subDialogBoxIc').style.height = (h-wPadding)+'px';
		 document.getElementById('subDialogBoxIc').style.left = '50%';
		 document.getElementById('subDialogBoxIc').style.top = (1*getScrollXY()[1]+hH+100)+'px';
		 document.getElementById('subDialogBoxIc').style.marginLeft = ((hW*-1)+parseInt(wPadding / 2))+'px';
		 document.getElementById('subDialogBoxIc').style.marginTop = ((hH*-1)+parseInt(wPadding / 2))+'px';
		 document.getElementById('subDialogBoxIc').style.MozOpacity = 1.0;
		 document.getElementById('subDialogBoxIc').style.filter = 'Alpha(Opacity=100)';
		 document.getElementById('subDialogBoxIc').style.padding = '5px';
		 if (tip == 1)
		 document.getElementById('subDialogIcerik').innerHTML = '<h3 style="margin:0px;" class="text2">'+str+'</h3>';
		 else
		 document.getElementById('subDialogIcerik').innerHTML = '<h3 style="margin:0px;" class="text2">'+str+'</h3><div style="text-align:right"><a href="javascript:;" onClick="subDialogClose()" class="text1 Link1">kapat</a></div> ';
		 
		 document.getElementById('subDialogBoxDis').style.display = '';
		 document.getElementById('subDialogBoxIc').style.display = '';	
						
	}
					
	function dialogBoxClose()
	{
		 document.getElementById('dialogBoxDis').style.display = 'none';
		 document.getElementById('dialogBoxIc').style.display = 'none';		
	}
	
	function dialogYorum()
	{
		subDialogShow(250,50,'Yükleniyor Lütfen Bekleyin...',1);
		document.getElementById('popupFrame').src = '/popup_yorumekle.php';
		
	}
	
	function dialogFotoPuan(objid,objpuan)
	{
		subDialogShow(250,50,'Yükleniyor Lütfen Bekleyin...',1);
		document.getElementById('popupFrame').src = '/popup_fotopuan.php?objid='+objid+'&objpuan='+objpuan;
		
	}
	
	function dialogFotoYorum()
	{
		subDialogShow(250,50,'Yükleniyor Lütfen Bekleyin...',1);
		document.getElementById('popupFrame').src = '/popup_fotoyorumekle.php';
		
	}
	
	function dialogFotograf(objtip,objsubtip,objid)	
	{
		subDialogShow(250,50,'Yükleniyor Lütfen Bekleyin...',1);
		document.getElementById('popupFrame').src = '/popup_fotoekle.php?objtip='+objtip+'&objsubtip='+objsubtip+'&objid='+objid;
		
	}
	
	function dialogProfilResim()	
	{
		subDialogShow(250,50,'Yükleniyor Lütfen Bekleyin...',1);
		document.getElementById('popupFrame').src = '/popup_profilresim.php';
		
	}
	
	function dialogAdresEkle()	
	{
		subDialogShow(250,50,'Yükleniyor Lütfen Bekleyin...',1);
		document.getElementById('popupFrame').src = '/popup_adresekle.php';
		
	}
	
	function dialogAdresDuzenle(id)	
	{
		subDialogShow(250,50,'Yükleniyor Lütfen Bekleyin...',1);
		document.getElementById('popupFrame').src = '/popup_adresekle.php?kayitid='+id;
		
	}	

	function dialogMesajGonder()	
	{
		subDialogShow(250,50,'Yükleniyor Lütfen Bekleyin...',1);
		document.getElementById('popupFrame').src = '/popup_mesajgonder.php';
		
	}

	function dialogMapSec(objid,x,y)	
	{
		subDialogShow(250,50,'Yükleniyor Lütfen Bekleyin...',1);
		document.getElementById('popupFrame').src = '/popup_mapsec.php?objid='+objid+'&gmap_x='+x+'&gmap_y='+y;
		
	}
	
	function dialogExMesajGonder(id)	
	{
		subDialogShow(250,50,'Yükleniyor Lütfen Bekleyin...',1);
		document.getElementById('popupFrame').src = '/popup_mesajgonder.php?uyeid='+id;
		
	}
	
	function dialogArkadasOner(objtip,objid)
	{
			// objtip =  1 ; gyerler
			// objtip =  2 ; hotel
			// objtip =  3 ; sehir
		subDialogShow(250,50,'Yükleniyor Lütfen Bekleyin...',1);	
		document.getElementById('popupFrame').src = '/popup_arkadasoner.php?objtip='+objtip+'&objid='+objid;
		
	}	
	
	function uyeKontrol(username)
	{
		var temp = new sack('_uyeIDkontrol.php?username='+username);	
		temp.onCompletion = function(){
			
			if (temp.response == "0")
			document.getElementById('kontrolDebug').innerHTML = 'Geçerli Kullanici Adi';
			else
			if (temp.response == "1")
			document.getElementById('kontrolDebug').innerHTML = 'Lütfen sadece [A..Z] ve [0..9] arasi karakterleri kullanin';
			else
			if (temp.response == "2")
			document.getElementById('kontrolDebug').innerHTML = 'Bu kullanici adi kullaniliyor';

		}
		temp.runAJAX();			
	}