
	function popup(url,width,height,scrollbar){
		window.open(url, '_blank', 'width='+width+', height='+height+', top=0, toolbar=0, location=0, directories=0, status=1, menuBar=0, scrollBars='+scrollbar+', resizable=0');
	return false;
}


function regKontrol(pattern, value){ 
	   r = new RegExp(pattern, "g"); 
	   return r.test(value); 
	} 
	
		var patternEposta   = "^"+"([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0-9_\.\-]+)"+"@"+"([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0-9_\.\-]+)"+"[\.]"+"([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0-9_\.\-]+)"+"$"; 	


			function newsletter_replay(){
					document.getElementById('input_newsletter_email').value = '';
					display('newsletter-info', 'none');
					display('newsletter-box', 'block');
			}
			
			function newsletter(x){
					var error = 0;
	
							var inputs = new Array('name', 'email');
								
								for(var i=0; i < inputs.length; i++){
									if(!($('#input_newsletter_'+inputs[i]).val())){
										document.getElementById('newsletter_'+inputs[i]+'_msg').style.color = '#FF0000';
									error++;
									}else{
										document.getElementById('newsletter_'+inputs[i]+'_msg').style.color = '';
									}
								}
								
								if(!regKontrol(patternEposta, $('#input_newsletter_email').val())){
									document.getElementById('newsletter_email_msg').style.color = '#FF0000';
									error++;
								}else{
									document.getElementById('newsletter_email_msg').style.color = '';
								}
								
								if(!(error)){
									display('newsletter-box', 'none');
									display('newsletter-loader', 'block');
									
									jQuery.post("new_ajax.php?ajax=newsletter&process="+x+"&cahce="+Math.random(), { name: $('#input_newsletter_name').val(), email: $('#input_newsletter_email').val() }, function(data){ eval(data) });
									
								}
								
								
	
			
					}


	function display(id,attack){document.getElementById(id).style.display=attack;}

	function advers(e, ev){
		var alpha = (ev == 0) ? 0.5 : 1;
		jQuery(e).fadeTo('normal', alpha);
	}


	this.classSiteHarita = function(){
	var harita_site = document.getElementById("site-harita")
	if(harita_site){
		this.listItem = function(li){
			if(li.getElementsByTagName("ul").length > 0){
				var ul = li.getElementsByTagName("ul")[0];
				ul.style.display = "none";
				var span = document.createElement("span");
				span.className = "inchis";
				span.style.cursor = "pointer";
				span.onclick = function(){
					ul.style.display = (ul.style.display == "none") ? "block" : "none";
					this.className = (ul.style.display == "none") ? "inchis" : "deschis";
				};
				li.appendChild(span);
			};
		};

		var items = harita_site.getElementsByTagName("li");
		for(var i=0;i<items.length;i++){
			listItem(items[i]);
		};

	};	
};

	function redirect(URL){ window.location.href = URL; }
	
	
	function topSearch_injection(x){
		return x.replace(/</g, '').replace(/>/g, '').replace(/"/, '').replace(/'/, '').replace(/ /, '').replace(/\s/, '');
	}
	
	function topSearch(t, e){
		var textcolor = (t.value == '') ? '#aca899' : '#000000';
		t.style.color = textcolor;
		var keycode = e ? e.which : window.event.keyCode;
		if(!keycode){ keycode = event.keyCode; }
			if(keycode == 13){
				jQuery.post('ajax.php?ajax=search&sorun='+Math.random(), { kelime: t.value }, function(data){ eval(data); });
			}
	}
	
	function topSearch_btn(){
			redirect(site_URL+"notebook-"+topSearch_injection(document.getElementById('searchValue').value)+"-search.html");
	}
	

				function tool(a, x, c){
				var p = (c) ? c.split(',') : '';
					switch(a){
						case 'onmouseover':
							x.className = x.className.replace('off', 'on');
						break;
						
						case 'onmouseout':
							x.className = x.className.replace('on', 'off');
						break;
						
						case 'text':
						var pixel;
								switch(p[0]){
									case '+':
										pixel = beforeFontSize + parseInt(p[1]);
									break;
									case '-':
										pixel = beforeFontSize - parseInt(p[1]);
									break;
								} 
		
							
									if (pixel>20)
										pixel=20;
									if (pixel<12)
										pixel=12;
									
									
									
									document.getElementById(x).style.fontSize = pixel + "px";
									beforeFontSize=pixel;
									
						break;
						
						case 'popup':
						if(x == 'sayfa.html'){ alert('problem, comin soon');  return false; }
							window.open(site_URL+x, '_blank', 'width='+p[0]+', height='+p[1]+', top=0, toolbar=0, location=0, directories=0, status=1, menuBar=0, scrollBars='+[2]+', resizable=0');
	return false;
						break;
					}
				}



	function appenBlogClass(){
		this.url = url;
		this.title = title;
		this.child = child;
		this.HTML = HTML;
		this.stil = stil;
		
		var childURL = new Array();
		var childTitle = new Array();
		var childIMG = new Array();
		
		function stil(x){this.stilNew = x;}
		function url(x){this.dURL = x;}
		function title(x){this.dTitle = x;}
		function child(x, y, z){
			var count = (childURL.length) ? childURL.length : 0;
				childURL[count]	= x;
				childTitle[count] = y; 
				childIMG[count] = z;
		}
		
		function HTML(){
			var forHTML = '';
			
			for(var i=0; i < childURL.length; i++){
				forHTML+= '<a href="'+childURL[i]+this.dURL+'&amp;title='+this.dTitle+'" rel="nofollow" title="'+childTitle[i]+'" target="_blank"><img title="'+childTitle[i]+'" height="16" src="css/images/paylas/'+childIMG[i]+'" width="16"/></a>';
			}
			
			this.stilNew = this.stilNew.match(/(\w+)\s\{(.*?)\}/g);
			var style = '';
			for(var i=0; i < this.stilNew.length; i++){ style += 'div#appenBlog '+this.stilNew[i].replace('this', ''); }
			document.write('<style>'+style+'</style>');
			document.write('<div id="appenBlog"><div><b>Paylaş :</b></div> '+forHTML+'</div>');
		}
		
		
	
	}
	
	function getposOffset(overlay, offsettype){
	var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
	var parentEl=overlay.offsetParent;
	while (parentEl!=null){
	totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
	parentEl=parentEl.offsetParent;
	}
	return totaloffset;
	}
	
	function overlay(curobj, subobj,l,t){
	if (document.getElementById){
	var subobj=document.getElementById(subobj)
	subobj.style.left= l+getposOffset(curobj, "left")+"px"
	subobj.style.top=t+getposOffset(curobj, "top")+"px"
	subobj.style.display="block"
	return false
	}
	else
	return true
	}
	
	function overlayclose(subobj){
	document.getElementById(subobj).style.display="none"
	}
	
	var appenBlog = new appenBlogClass();
		appenBlog.stil(' this { margin-top:10px; clear:both; float:right; } img { border:none; margin:2px 0 0 0; } div { float:left; padding:3px 0 0 0; margin-right:5px; } a { text-align:center; display: block; width: 20px; height: 20px; margin-right: 7px; border: 1px solid #c8c8c8; float: left; } ');
		appenBlog.child('http://digg.com/submit?url=', 'Digg', 'digg.png');
		appenBlog.child('http://reddit.com/submit?url=', 'Reddit', 'reddit.png');
		appenBlog.child('http://del.icio.us/post?url=', 'Del.icio.us', 'delicious.png');
		appenBlog.child('http://ma.gnolia.com/bookmarklet/add?url=', 'Ma.gnolia', 'magnolia.png');
		appenBlog.child('http://www.stumbleupon.com/submit?url=', 'Stumble Upon', 'stumbleupon.png');
		appenBlog.child('http://www.facebook.com/sharer.php?u=', 'Facebook', 'facebook.png');
		appenBlog.child('http://twitter.com/home?status=', 'Twitter', 'twitter.png');
		appenBlog.child('http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=', 'Google', 'google.png');
		appenBlog.child('http://myweb2.search.yahoo.com/myresults/bookmarklet?u=', 'Yahoo! MyWeb', 'myweb.png');
		appenBlog.child('http://furl.net/storeIt.jsp?u=', 'Furl', 'furl.png');
		appenBlog.child('http://blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=', 'BlinkList', 'blinklist.png');
		appenBlog.child('http://www.technorati.com/faves?add=', 'Technorati', 'technorati.png');
		appenBlog.child('http://www.mixx.com/submit?page_url=', 'Mixx', 'mixx.png');
		appenBlog.child('https://favorites.live.com/quickadd.aspx?marklet=1&amp;mkt=en-us&amp;url=', 'Windows Live', 'windowslive.png');

