	
	jQuery.noConflict();
	
	jQuery(document).ready(function(){
	
		//jQuery('div#photos > a').lightBox();
		
		jQuery('a[@rel*=lightbox]').lightBox();
  		
		jQuery("div#left-links > a").mouseover(function(event){
			jQuery(this).stop().animate({marginLeft: "-5px"}, 100);
			jQuery(this).children('.txt').attr("src", "images/menu/"+this.id+"-on.png");
		});
		
		jQuery("div#left-links > a").mouseout(function(event){
			jQuery(this).stop().animate({marginLeft: "0px"}, 100);
			jQuery(this).children('.txt').attr("src", "images/menu/"+this.id+".png");
		});
		
		jQuery("div#login-register > div > a").mouseover(function(event){
			jQuery(this).children('.txt').attr("src", "images/"+this.id+"-on.png");
		});
		
		jQuery("div#login-register > div > a").mouseout(function(event){
			jQuery(this).children('.txt').attr("src", "images/"+this.id+".png");
		});
		
	});
	
	function showLogin(){
		hideRegister();
		jQuery("div#login").stop().animate({marginTop: "0px"}, 500, function() {jQuery("input#username").focus();});
	}
	
	function showRegister(){
		hideLogin();
		jQuery("div#register").stop().animate({marginTop: "0px"}, 500, function() {jQuery("input#r_username").focus();});
	}
	
	function hideLogin(){
		jQuery("div#login").stop().animate({marginTop: "-100px"}, 500);
	}
	
	function hideRegister(){
		jQuery("div#register").stop().animate({marginTop: "-400px"}, 500);
	}
	
	function key_enter(e, form){
		var keynum;
		if(window.event) // ie
		{keynum = e.keyCode;}
		else if(e.which) // netscape/firefox/opera
		{keynum = e.which;}
		if (keynum == '13')
		{
			if (form == 'login'){
				loginSend();
				if (jQuery.browser.safari){
					loginSend();
				}
			} else if (form == 'register'){
				registerSend();
			} else if (form == 'status'){
				jQuery('input#status-update-button').trigger('click');
			}
		}
	}
	
	function open_profile_pm_form(){
		jQuery('div.profile-right-container').fadeOut();
		jQuery('div.profile-ajax-cont').load('forms/profile-pm.php');
	}
	
	function loginSend(){
		var username = jQuery.trim(jQuery("input#username").val());
		var userpass = jQuery.trim(jQuery("input#userpass").val());
		var miniLog = jQuery("div#loginMiniLog");
		var log = jQuery("div#loginLog");
		var r = Math.round(Math.random()*100000000000);
		ajaxWait(miniLog);
			jQuery.ajax({type: 'post', url: 'actions/user.php?login&'+r, data: {username: username, userpass: userpass},
				success: function(data) {
					jQuery(log).html(data); 
					jQuery(miniLog).html('<img class="button" src="images/icon/cross.png" onclick="hideLogin()" alt="kapat">');
					if (jQuery.browser.safari){
						loginSend();
					}
				}
					
			});
	}
	
	function registerSend(){
		var username = jQuery.trim(jQuery("input#r_username").val());
		var userpass01 = jQuery.trim(jQuery("input#r_userpass").val());
		var userpass02 = jQuery.trim(jQuery("input#r_userpass_confirm").val());
		var email = jQuery.trim(jQuery("input#r_email").val());
		var miniLog = jQuery("div#registerMiniLog");
		var log = jQuery("div#registerLog");
		var r = Math.round(Math.random()*100000000000);
		ajaxWait(miniLog);
			jQuery.ajax({type: 'post', url: 'actions/user.php?register&'+r, 
			data: {username: username, userpass01: userpass01, userpass02: userpass02, email: email},
				success: function(data) {jQuery(log).html(data); jQuery(miniLog).html('<img class="button" src="images/icon/cross.png" onclick="hideRegister()" alt="kapat">');}
			});
	}
	

	function crossFixs(){
		if (jQuery.browser.msie){
			jQuery("div#leftMenu div").css({marginTop: "-8px"});
			jQuery("div#loginCont").css({marginLeft: "-13px"});
			jQuery("div#registerCont").css({marginLeft: "-12px"});
		}	
		
		if (jQuery.browser.mozilla){
			jQuery("div#userMenu div").css({marginTop: "-2px"});
			jQuery("div.downMenu").css({top: "87px"});
			jQuery("div#catchDownMenu").css({marginLeft: "58px"});
			jQuery("div#tagDownMenu").css({marginLeft: "140px"});
			jQuery("body").css( {overflow: "scroll"});
		}
		
		if (jQuery.browser.safari){
			jQuery("body").css( {overflow: "scroll"});
			jQuery("div#userMenu div").css({marginTop: "-2px"});
		}
	}
	
	
	function ajaxWrong(log){jQuery(log).load("ajaxwrong.php").show();}
	function ajaxWait(log){jQuery(log).load("ajaxwait.php").show();}
	
	function index(){window.location = 'index.php';}
	
	
	/**
	* zaman bilgilerini kolayca kullanabilmek için geliştirdiğim bir fonksiyon
	* değerleri array'e atıp retun ediyor. nedim - 13.02.2009
	*/
	function nDate(){
			var nDate = new Array();
			var today = new Date();
			var x;
			
			nDate['D'] = today.getDate();
			nDate['M'] = today.getMonth() + 1; /* 0'dan başladığı için +1 */
			nDate['Y'] = today.getFullYear();
			
			nDate['h'] = today.getHours();
			nDate['m'] = today.getMinutes();
			nDate['s'] = today.getSeconds();
			
			for (x in nDate) { /* saat vs. 2 olduğunda 02 döndürmesi için */
				if ( nDate[x] < 10 ) { nDate[x] = '0'+nDate[x]; }
			}
			
			return nDate;
	}
	
	
	/*	format:
	 *	formId = 'formId', logId: '#logId'
	 */
	function formSubmit(formId, logId, action, process){
		ajaxWait(logId);
		jQuery.ajax({
			type: 'post', 
			url: 'actions/'+action+'.php?'+process, 
			data: jQuery('form#'+formId).serialize(),
			success: function(data) {jQuery(logId).empty().html(data).stop().css({backgroundColor: "ffffff", opacity: "100.0"}).effect("highlight").fadeOut(3500);}
		});	
	}
	
	function setGeneralOptions(msg, has, n1, n2, n3, n4){
		jQuery("input#msgOption"+msg).attr("checked","checked");
		jQuery("input#hideAndSeekOption"+has).attr("checked","checked");
		if (n1) {jQuery("input#notify"+n1).attr("checked","checked");}
		if (n2) {jQuery("input#notify"+n2).attr("checked","checked");}
		if (n3) {jQuery("input#notify"+n3).attr("checked","checked");}
		if (n4) {jQuery("input#notify"+n4).attr("checked","checked");}
	}
	
	function showNewsDesc(obj){
		hideDesc();	descIn();
		jQuery(obj).removeClass().addClass("buttonActive").parent().next().show().addClass("newsDescActive");
	}
	
	
	
	
	