﻿//Özel karakter kabul etmeyen fonksiyon.
function Kontrol( e)  {

	olay = document.all ? window.event : e;

	tus = document.all ? olay.keyCode : olay.which;

	if(tus==39||tus==34||tus==43||tus==44||tus==40||tus==41||tus==39||tus==32||tus==46||tus==47||tus==60||tus==62||tus==63||tus==64||tus==126||tus==45||tus==58||tus==59||tus==94||tus==38||tus==92||tus==91||tus==93||tus==123||tus==125||tus==61||tus==42) {

		if(document.all) { olay.returnValue = false; } else { olay.preventDefault(); }

	}

}

/**
* Start SadeceRakam()
* Coded By Mustafa OZCAN
* For more information visit to www.mustafaozcan.net
* Version 1.5.1 Release Date Time :23.03.2009 16:30
* Sample Usage Keypress Event:  onkeypress="return SadeceRakam(event,['-']);"
* -First parameter is event, 
* -Second parameter is optional chars array. 
* -if you want to allow special chars , you must use code like this onkeypress="return SadeceRakam(event,['-','/']); 
* Sample Usage Blur Event: onblur="SadeceRakamBlur(event,true)" 
* Blur Event Second Parameter : Clear [Enter Keys] and [WhiteSpaces] in Value
* For Input:  <input type="text" id="txtInput" onkeypress="return SadeceRakam(event);" onblur="SadeceRakamBlur(event,false)" />
* For TextArea : <textarea cols="50" rows="10" id="txtArea" onkeypress="return SadeceRakam(event,['-']);" onblur="SadeceRakamBlur(event,true)" ></textarea>
*/
function SadeceRakam(e, allowedchars){
	var key = e.charCode == undefined ? e.keyCode : e.charCode;
	if ( (/^[0-9]+$/.test(String.fromCharCode(key))) || key==0 || key==13 || isPassKey(key,allowedchars) ){ return true;}
	else { return false;}
}
function isPassKey(key,allowedchars){
	if (allowedchars != null) {
		for (var i = 0; i < allowedchars.length; i++) {
			if (allowedchars[i]  == String.fromCharCode(key))			 
				return true;
		}
	}
	return false;
}
function SadeceRakamBlur(e,clear){
	var nesne = e.target ? e.target : e.srcElement;
	var val = nesne.value;
	val = val.replace(/^\s+|\s+$/g, "");
	if (clear)val = val.replace(/\s{2,}/g, " ");
	nesne.value = val;
}
/** 
 * End SadeceRakam()
 */
 function RedirectPage(val)
 {
	switch(val)
	{
		case "0":
		window.location("http://www.egos.com.tr/Default.aspx");
		break;
		case "1":
		window.location("http://www.egos.com.tr/kizlarderki.aspx");
		break;
		case "2":
		window.location("http://www.egos.com.tr/stilrehberi.aspx");
		break;
		case "3":
		window.location("http://www.egos.com.tr/FotoWall.aspx");
		break;
		case "4":
		window.location("http://www.egos.com.tr/sehirrehberi.aspx");
		break;
		case "5":
		window.location("http://www.egos.com.tr/sporgundemi.aspx");
		break;
		case "6":
		window.location("http://www.egos.com.tr/etkinliktakvimi.aspx");
		break;
		case "7":
		window.location("http://www.egos.com.tr/eglencedunyasi.aspx");
		break;
		case "8":
		window.location("http://www.egos.com.tr/egoshakkinda.aspx");
		break;
		
	}
 }