
//JQUERY HORIZONTAL MENU
$(document).ready(function() {
	
	$("a[rel=example_group]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});
	
$("ul#topnav li").hover(function() { //Hover over event on list item
	$(this).css({}); //Add background color + image on hovered list item
	$(this).find("span").show(); //Show the subnav
} , function() { //on hover out...
	$(this).css({}); //Ditch the background
	$(this).find("span").hide(); //Hide the subnav
});
	
});



function den()
{
if(document.getElementById('login_email').value.length==0){
document.getElementById('login_email').value='Mail Adresiniz...';
}
if(document.getElementById('password').value.length==0){
document.getElementById('password').value='Şifreniz...';
}
}


/*GENEL COMMON.JS*/


/* Ajax init */
var initTMR = false;
var yukleniyorTMR = false;
$(document).ajaxComplete(function(event,request, settings){
	if(initTMR){
		clearTimeout(initTMR);
	}
	initTMR = setTimeout("", 200);
}).ajaxStart(function(){
	if(yukleniyorTMR){
		clearTimeout(yukleniyorTMR);
	}
	
	$("#yukleniyor").show();
		}).ajaxStop(function(){
	if(yukleniyorTMR){
		clearTimeout(yukleniyorTMR);
	}
	yukleniyorTMR = setTimeout('$("#yukleniyor").hide(); yukleniyorTMR = false;', 700);

});

/*
	# COMMON javascript func
*/


//
/// toogle
//
function fn_toogle(secici) {
	$(secici).toggle();

}
function fn_display_in(secici) {
	$(secici).css('display','inline');
	
}
function fn_display_none(secici) {
	$(secici).css('display','none');
	
}
function remove(secici) {
	
	
	$(secici).remove();
}


function fn_ara() {
	var ara = $('#inputString').val();
	
	if (ara!="" && ara!='Ürün Adını Giriniz')
		window.location = web_dir+"/ara/"+ara+"/";
		
	}


function get_ilce(){
		$.ajax({
		type: 'GET',
		url:index_script,
		data: "ajax=1&target=home.ilce_getir&id="+$('#sehir').val(),
		success: function(ajaxCevap) {
					$('#ilce').html(ajaxCevap);
			}
		});		
}

/* [Notice]*/
function fn_set_notice(type,title,desc) {
	
var randomNum = Math.floor(Math.random()*394)+1790000;	

var str = '<div id="notif_'+randomNum+'" class="notification-content cm-auto-hide"><div class="notification-'+type+'"><img width="10" onclick="remove(\'#notif_'+randomNum+'\')" height="19" border="0" title="Close" alt="Close" src="'+s_w_tema+'/images/icons/notification_close.gif" class="cm-notification-close hand"><div class="notification-body">'+desc+'</div></div><h1 class="notification-header-'+type+'">'+title+'</h1></div>';

$('.cm-notification-container').append(str);


}
/* /[Notice]*/

/* [Category] */

function lookup(inputString) {

		
		$.ajax({
		type: 'GET',
		url:index_script,
		data: "ajax=1&target=category.ajax_cat&c_ara="+inputString,
		success: function(ajaxCevap) {
					$('#kategori-li').html(ajaxCevap);
					//alert(ajaxCevap);
			}
		});	
		
	
}

function goster_gizle(x) { 



           if ( document.getElementById(x).style.display == '' ) { 



                 document.getElementById(x).style.display = 'none' 



           } else { 



                 document.getElementById(x).style.display = '' 



           } 

} 


var newwin;


function launchwin(winurl,winname,winfeatures)



{


newwin = window.open(winurl,winname,winfeatures);


if(javascript_version > 1.0)



{



setTimeout('newwin.focus();',250);



}



}


