<br />
<b>Deprecated</b>:  Function ereg() is deprecated in <b>/home/webizyum/public_html/1.1/index.php</b> on line <b>101</b><br />
<br />
<b>Deprecated</b>:  Function ereg() is deprecated in <b>/home/webizyum/public_html/1.1/index.php</b> on line <b>108</b><br />
$(document).ready(function() {

	in_array = function(needle, haystack, strict) {
		for(var i = 0; i < haystack.length; i++) {
			if(strict) {
				if(haystack[i] === needle) {
					return true;
				}
			}
			else {
				if(haystack[i] == needle) {
					return true;
				}
			}
		}
		return false;
	};
	
	stripslashes = function(str) {
		return (str+'').replace(/\\(.?)/g, function (s, n1) {
			switch (n1) {
				case '\\':
					return '\\';
				case '0':
					return '\u0000';
				case '':
					return '';
				default:
					return n1;
			}
		});
	};
	
	nl2br = function(str) {
		return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1<br />$2');
	};

	Array.prototype.count = function() {
		var c = 0;
		for(i in this) {
			if(this[i] != undefined) {
				c++;
			}
		}
		return c;
	};
	

	String.prototype.trim = function() {
		return this.replace(/^\s+|\s+$/g,"");
	};
	
	String.prototype.ltrim = function() {
		return this.replace(/^\s+/,"");
	};
	
	String.prototype.rtrim = function() {
		return this.replace(/\s+$/,"");
	};
	
	
	Main = {};
	
	Main.Redir = function(page, time) {
		if(typeof(time) != 'undefined') {
			setTimeout('document.location.href="/1.1";', time*1000);
		}
		else {
			document.location.href = '/1.1' + page;
		}
	};
	
	Main.Reload = function() {
		document.location.href = document.location.href;
	};
	
	Main.Dollar2TL = function(dollar) {
		return Math.round(dollar * 1.5130 * 100) / 100;
	};
	
	Main.SessionSaver = function() {
		$.ajax({
			url: '/1.1/Ajax/general/sessionSaver'
		});
	};
	
	Main.RandomPassword = function(length, useSym) {
		randomPass = '';
		chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
		if(typeof(useSym) != 'undefined' && useSym == 1) {
			chars += '*-!@#${[]}_^+%&/()=?_';
		}
		for(var i = 0; i < length; i++)
		{
			randomPass += chars.charAt(Math.floor(Math.random() * chars.length));
		}
		
		return randomPass;
	};
	
	
	
	
	
	
	
	
	
	
	
	Form = {};
	Form.Validation = {};
	Form.Error = {};
	Form.Var = {};
	
	
	Form.Var.LastId = 0;
	
	Form.Error.Id = function(setNew) {
		if(typeof(setNew) != 'undefined') { Form.Var.LastId++; }
		return 'FormErrorBox__' + Form.Var.LastId;
	};
	
	Form.Error.Show = function (target, message, type) {
		html = '';
		
		html += '<div id="' + this.Id(1) + '" class="FormErrorContainer">';
		html += '	<div class="_border"></div>';
		html += '	<div class="_message">' + message + '</div>';
		html += '</div>';
		
		$('body').append(html);
		
		pos = {};
		pos.left = $('#' + target).position().left + $('#' + target).width();
		pos.top = $('#' + target).position().top;
		
		$('#' + this.Id()).css('left', pos.left);
		$('#' + this.Id()).css('top', pos.top);
	};
	
	Form.Error.Destroy = function(id) {
		if(typeof(target) != 'undefined') {
			$(id).remove();
		}
		else {
			$('.FormErrorContainer').remove();
		}
	};
	

});
