function getLogin () {
	
	var y = document.getElementById("userName");	
	var z = document.getElementById("userPassword");
	var t = document.getElementById("fk_project_id");
	
	loginControl=true;
	var denyWords = new Array();
		denyWords[0] = "'";
		denyWords[1] = "&";
		denyWords[2] = "drop";
		denyWords[3] = "database";
		denyWords[4] = "select";
		denyWords[5] = "where";
		denyWords[6] = "select";
		denyWords[7] = "from";
		denyWords[8] = "<";
		denyWords[9] = ">";
		denyWords[10] = "|";
		denyWords[11] = "update";
		denyWords[12] = "*";
		
		
			strSearch=y.value;
			strSearch2=z.value;

			loginCOntrol = true;
			
			for (i=0; i < 13; i++) {
				if (strSearch.indexOf(denyWords[i]) > -1) {
					getBox('typeError');
					loginControl=false;
					return;
					break;
				}
			}
			
			for (i=0; i < 13; i++) {
				if (strSearch2.indexOf(denyWords[i]) > -1) {
					
					getBox('typeError');
					loginControl=false;
					return;
					break;
				}
			}	
			
			if (z.value == "" || y.value =="") {
				
				getBox('spaceError');
				loginControl=false;
				return;
			}			
			
			if (t.options[t.selectedIndex].value =='') {
				
				getBox('projectError');
				loginControl=false;
				return;
			}
			
			
			strVar = z.value;

	
			if (loginControl) { 
				
				frmLogin.action="login.asp";
				frmLogin.submit();
			}	
	
	
}

function getBox (boxType) {
	

	
	var x = document.getElementById("lb");
	var y = document.getElementById("blackbox");	
	var z = document.getElementById("boxMessage");
	
	switch (boxType) {
		
			case "typeError":
			z.innerHTML = "Lütfen sifrenizi girerken 0-9 ve A-Z, a-z arasi karakterler kullanin...";
			break;
			
			case "spaceError":
			z.innerHTML = "Lütfen kullanici adinizi ve sifrenizi girin.";
			break;
			
			case "projectError":
			z.innerHTML = "Lutfen konutunuzu seciniz.";
			break;			
			
	}
			x.style.visibility="visible";
			y.style.visibility="visible";			
	
	
}

function closeBox () {
	
	var x = document.getElementById("lb");
	var y = document.getElementById("blackbox");
	
	x.style.visibility="hidden";
	y.style.visibility="hidden";		
	
}

function openModule (moduleName) {
	
	var x = document.getElementById("moduleArea")
	
	x.src = moduleName +"/default.asp"
	
}

function click() {
	
	var xA = document.getElementById("altMenu");

	
	if (event.button==2) {

		x=event.clientX;
		y=event.clientY;

		xA.style.left = x + "px";
		xA.style.top = y + "px";		
		xA.style.visibility="visible";
		return false;
		
	} else {
		
		if (xA.style.visibility=="visible") {
			
			closeAltMenu();
			
		}
		
	}
}
//document.onmousedown=click






function closeAltMenu() {
	
	var xA = document.getElementById("altMenu");
	xA.style.visibility="hidden";
	
}

function altMenuProcess(param) {
	
	switch(param) {
		
		case 3:
		window.location="logout.asp";
		break;
		
		
	}
	
}

function chooseHouse () {
	
		if (document.getElementById("opened").value == "") {
		
			alert("Lütfen giris yapmak istediginiz daireyi seçiniz.");
			return false;
			
		} else {
		
			frmLogin.action="login.asp?loginType=chooseHouse";
			frmLogin.submit();
		
		}	
	
}




 menuItems = new Array();
 menuItemNum = 0;

 function addMenuItem(text, url, img){
  if(img) menuItems[menuItemNum] = new Array(text, url, img);
  else if(text) menuItems[menuItemNum] = new Array(text, url);
  else menuItems[menuItemNum] = new Array();
  menuItemNum++;
 }
     //AYARLAR BASLANGICI
 menuWidth = 68; //menu width /menü uzunlugu
 menuHeight = 22; //menu height /menü yüksekligi
 menuDelay = 0; //delay before menu appears /menü çikis zamani
 menuSpeed = 1; //speed which menu appears (lower=faster) /menü açilis hizi
 menuOffset = 2; //offset of menu from mouse pointer /menünün mouse imlecine olan uzakligi


 addMenuItem("Çikis","logout.asp");



 if(window.navigator.appName == "Microsoft Internet Explorer" && window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE") + 5, window.navigator.appVersion.indexOf("MSIE") + 8) >= 5.5)
  isIe = 1;
 else
  isIe = 0;

 if(isIe){
  menuContent = '<table id="rightMenu" width="0" height="0" cellspacing="0" cellpadding="0" style="font:menu;color:menutext;"><tr height="1"><td style="background:threedlightshadow" colspan="4"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedhighlight" colspan="2"></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="10"><td style="background:threedlightshadow"></td><td style="background:threedhighlight"></td><td style="background:threedface"><table cellspacing="0" cellpadding="0" nowrap style="font:menu;color:menutext;cursor:default;">';
  for(m=0;m<menuItems.length;m++){
   if(menuItems[m][0] && menuItems[m][2])
    menuContent += '<tr height="17" onMouseOver="this.style.background=\'highlight\';this.style.color=\'highlighttext\';" onMouseOut="this.style.background=\'threedface\';this.style.color=\'menutext\';" onClick="parent.window.location.href=\'' + menuItems[m][1] + '\'"><td style="background:threedface" width="1" nowrap></td><td width="21" nowrap><img src="' + menuItems[m][2] + '"></td><td nowrap>' + menuItems[m][0] + '</td><td width="21" nowrap></td><td style="background:threedface" width="1" nowrap></td></tr>';
   else if(menuItems[m][0])
    menuContent += '<tr height="17" onMouseOver="this.style.background=\'highlight\';this.style.color=\'highlighttext\';" onMouseOut="this.style.background=\'threedface\';this.style.color=\'menutext\';" onClick="parent.window.location.href=\'' + menuItems[m][1] + '\'"><td style="background:threedface" width="1" nowrap></td><td width="21" nowrap></td><td nowrap>' + menuItems[m][0] + '</td><td width="21" nowrap></td><td style="background:threedface" width="1" nowrap></td></tr>';
   else
    menuContent += '<tr><td colspan="5" height="4"></td></tr><tr><td colspan="5"><table cellspacing="0"><tr><td width="2" height="1"></td><td width="0" height="1" style="background:threedshadow"></td><td width="2" height="1"></td></tr><tr><td width="2" height="1"></td><td width="100%" height="1" style="background:threedhighlight"></td><td width="2" height="1"></td></tr></table></td></tr><tr><td colspan="5" height="3"></td></tr>';
  }
  menuContent += '</table></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedhighlight"></td><td style="background:threedface"></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedshadow" colspan="3"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threeddarkshadow" colspan="5"></td></tr></table>';

  menuPopup = window.createPopup();
  menuPopup.document.body.innerHTML = menuContent;
 }

 function showMenu(){
  menuXPos = event.clientX + menuOffset;
  menuYPos = event.clientY + menuOffset;

  menuXIncrement = menuWidth / menuSpeed;
  menuYIncrement = menuHeight / menuSpeed;

  menuTimer = setTimeout("openMenu(0,0)", menuDelay);

  return false;
 }


 function openMenu(height, width){
  iHeight = height;
  iWidth = width;

  menuPopup.show(menuXPos, menuYPos, iWidth, iHeight, document.body);

  if(iHeight < menuHeight)
   menuTimer = setTimeout("openMenu(iHeight + menuYIncrement, iWidth + menuXIncrement)", 1);
  else
   clearTimeout(menuTimer);
 }


 if(isIe) document.oncontextmenu = showMenu;

function checkEnter(e){ 
var characterCode 

if(e && e.which){ 
e = e
characterCode = e.which 
}
else{
e = event
characterCode = e.keyCode 
}

if(characterCode == 13){ 

	
	var y = document.getElementById("userName");	
	var z = document.getElementById("userPassword");
	var t = document.getElementById("fk_project_id");
	
	loginControl=true;
	var denyWords = new Array();
		denyWords[0] = "'";
		denyWords[1] = "&";
		denyWords[2] = "drop";
		denyWords[3] = "database";
		denyWords[4] = "select";
		denyWords[5] = "where";
		denyWords[6] = "select";
		denyWords[7] = "from";
		denyWords[8] = "<";
		denyWords[9] = ">";
		denyWords[10] = "|";
		denyWords[11] = "update";
		denyWords[12] = "*";
		
		
			strSearch=y.value;
			strSearch2=z.value;

			loginCOntrol = true;
			
			for (i=0; i < 13; i++) {
				if (strSearch.indexOf(denyWords[i]) > -1) {
					getBox('typeError');
					loginControl=false;
					return;
					break;
				}
			}
			
			for (i=0; i < 13; i++) {
				if (strSearch2.indexOf(denyWords[i]) > -1) {
					
					getBox('typeError');
					loginControl=false;
					return;
					break;
				}
			}	
			
			if (z.value == "" || y.value =="") {
				
				getBox('spaceError');
				loginControl=false;
				return;
			}			
			
			if (t.options[t.selectedIndex].value =='') {
				
				getBox('projectError');
				loginControl=false;
				return;
			}
			
			
			strVar = z.value;

	
			if (loginControl) { 
				
				frmLogin.action="login.asp";
				frmLogin.submit();
			}

return false 

}
else{
return true 
}

}

