﻿
jQuery(document).ready(function() {
	
	
	jQuery("#topnav li").prepend("<span></span>"); //Throws an empty span tag right before the a tag
	
	jQuery("#topnav li").each(function() { //For each list item...
		var linkText = jQuery(this).find("a").html(); //Find the text inside of the a tag
		jQuery(this).find("span").show().html(linkText); //Add the text in the span tag
	}); 
	
	jQuery("#topnav li").hover(function() {	//On hover...
		jQuery(this).find("span").stop().animate({ 
			marginTop: "-40" //Find the span tag and move it up 40 pixels
		}, 250);
	} , function() { //On hover out...
		jQuery(this).find("span").stop().animate({
			marginTop: "0" //Move the span back to its original state (0px)
		}, 250);
	});
	
	jQuery('div.photo a').fancyZoom({scaleImg: true, closeOnClick: true});
		jQuery('#medium_box_link').fancyZoom({width:400, height:300});
		jQuery('#large_box_link').fancyZoom();
		jQuery('#flash_box_link').fancyZoom();
	    nbInit()
});

function formatText(index, panel) {
		  return index + "";
	    }
    
        jQuery(function () {
        
            jQuery('.anythingSliderBanner').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 3000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 900,             // How long the slide transition takes
                hashTags: false,                 // Should links change the hashtag in the URL?
                buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        		pauseOnHover: false,             // If true, and autoPlay is enabled, the show will pause on hover
        		startText: "",             // Start text
		        stopText: "",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
            });
            
            jQuery("#slide-jump").click(function(){
                jQuery('.anythingSliderBanner').anythingSlider(6);
            });
            
        });// JavaScript Document

function MM_setTextOfTextfield(objId,x,newText) { //v9.0
  with (document){ if (getElementById){
    var obj = getElementById(objId);} if (obj) obj.value = newText;
  }
}

function formValidate_arama(form) 
  {
  	if ( form.urun_adi_kodu.value == "Ürün adi yada kodu" ) {
       	   form.urun_adi_kodu.value = ""

	   }	   
	return true;
}

function formatText(index, panel) {
		  return index + "";
	    }
    
        jQuery(function () {
        
            jQuery('.anythingSlider').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 3000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 600,             // How long the slide transition takes
                hashTags: true,                 // Should links change the hashtag in the URL?
                buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
        		startText: "Basla",             // Start text
		        stopText: "Dur",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
            });
            
            jQuery("#slide-jump").click(function(){
                jQuery('.anythingSlider').anythingSlider(6);
            });
            
        });
		


function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function siralama(sel){
    document.location = sel.options[sel.options.selectedIndex].value;
  }
  
/**
*rakam
*/
function SadeceRakam(e, allowedchars){
	var key = e.charCode == undefined ? e.keyCode : e.charCode;
	if ( (/^[0-9]+jQuery/.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+jQuery/g, "");
	if (clear)val = val.replace(/\s{2,}/g, " ");
	nesne.value = val;
}
/** 
 * End SadeceRakam()
 */
 
/**
*resimload
*/
document.write("<style type='text/css'>#thephotos {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto1 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto2 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto3 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto4 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto5 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto6 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto7 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto8 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto9 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto10 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto11 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto12 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto13 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto14 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto15 {visibility:hidden;}</style>");

function initImages() {
	imageId = 'thephotos';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function initImage() {
	imageId = 'thephoto1';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function initImage2() {
	imageId = 'thephoto2';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function initImage3() {
	imageId = 'thephoto3';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function initImage4() {
	imageId = 'thephoto4';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function initImage5() {
	imageId = 'thephoto5';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function initImage6() {
	imageId = 'thephoto6';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function initImage7() {
	imageId = 'thephoto7';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function initImage8() {
	imageId = 'thephoto8';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function initImage9() {
	imageId = 'thephoto9';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function initImage10() {
	imageId = 'thephoto10';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function initImage11() {
	imageId = 'thephoto11';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function initImage12() {
	imageId = 'thephoto12';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function initImage13() {
	imageId = 'thephoto13';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function initImage14() {
	imageId = 'thephoto14';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function initImage15() {
	imageId = 'thephoto15';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function fadeIn(objId,opacity) {
	if (document.getElementById) {
		obj = document.getElementById(objId);
		if (opacity <= 100) {
			setOpacity(obj, opacity);
			opacity += 10;
			window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
		}
	}
}
function setOpacity(obj, opacity) {
	opacity = (opacity == 100)?99.999:opacity;
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}
window.onload = function() {
initImages()
initImage()
initImage2()
initImage3()
initImage4()
initImage5()
initImage6()
initImage7()
initImage8()
initImage9()
initImage10()
initImage11()
initImage12()
initImage13()
initImage14()
initImage15()
}
/**
*son
*/
