﻿
window.onerror=function() {return false;}
// JScript File

// $.extend($.expr[':'],{
//    external: function(a,i,m) {
//        if(!a.href) {return false;}
//        return a.hostname && a.hostname !== window.location.hostname;
//    }
//});

 $(function() {
       var plinkpos=($('.ortavesagcombine').width()-$('#pageslink').width())/2;
       //var plinkpos=($('.contentdetay').width()-($('ul#pageslink').width()))/2;
      // alert(plinkpos);
       plinkpos=plinkpos;
      // $('ul#pageslink').css({'margin-left':plinkpos});
        
        if($('.ortavesagcombine').height()>135)
        {
        var hei = $('.ortavesagcombine').height()-135;
       hei=hei;
       $('.content1pxborder').css({height:hei});
       }
       else
       {
        $('.content1pxborder').css({height:135});
       }
       

      // $('a[href^="http"],a[href^="ftp"],').bind('click', function(event){open(this.href);    return false;});
       $('a[href^="http"],a[href^="ftp"],').bind('click', function(event){
       if(this.hostname!==window.location.hostname){ open(this.href);return false;}});
       
         var lifix=499;
        $('ul#pageslink li').hover(function() {
        if($(this).attr("pleft")>0){$(this).css({'background-position':-$(this).attr("pleft")});}
        }, function() {
        if($(this).attr("pleft")>0){$(this).css({'background-position':-($(this).attr("pleft")-339)});}
        });
        $('ul#pageslink li:gt(0)').click(function() {
        window.location=$(this).find("a").attr("href");return false;
        });$('ul#pageslink li a').hide(); // linkleri gizle
//        if($('ul#comments .commenttext').height()<100){
//        alert($('ul#comments div.commenttext').height());
//        $('div.commenttext').css({height:191});}

        $('ul#intgobek li.btnPrintPage').click(function() {
            printWebPart('iceriktext');return false;
        });
               /*$('ul#intgobek li.formail').click(function(e) {
	    	e.preventDefault();
		    $('#formail').modal({minHeight: 600});return false;
    	});

        $('ul#intgobek li.btnSendPostaModal').click(function(e) {
	    	e.preventDefault();
		    $('#basic-modal-content').modal();return false;
    	}); */   	        

        $('ul#intgobek li').click(function() {
        window.location=$(this).find("a").attr("href");return false;
        });$('ul#intgobek li a').hide();
                $('ul#ulloginer li').click(function() {
        window.location=$(this).find("a").attr("href");return false;
        });
        
        $('ul#hormenutop li').click(function() {
        window.location=$(this).find("a").attr("href");return false;
        });
        $('ul#hormenutop li:eq(0)').css({'border-left':'0px'});
//        $('ul#hormenutop li:eq(0)').css({width:50});
//        $('ul#hormenutop li:eq(1)').css({width:45});
//        $('ul#hormenutop li:eq(2)').css({width:30});
//        $('ul#hormenutop li:eq(3)').css({width:45});
//        $('ul#hormenutop li:eq(4)').css({width:50});
//        $('ul#hormenutop li:eq(5)').css({width:60});
//        $('ul#hormenutop li:eq(6)').css({width:45});
//        $('ul#hormenutop li:eq(7)').css({width:60});
//        $('ul#hormenutop li:eq(8)').css({width:60});
//        $('ul#hormenutop li:eq(9)').css({width:35});
//        $('ul#hormenutop li:eq(10)').css({width:85});
//        $('ul#hormenutop li:eq(11)').css({width:70});
//        $('ul#hormenutop li:eq(12)').css({width:60});
//        $('ul#hormenutop li:eq(13)').css({width:45});
//       //$('ul#hormenutop li a').hide();

         
        $('#latestContent').pager('ul', {});
        
//        $('div#hoverdemo2 p').hover(function() {
//        $('a:external'); // diş linkleri dişar çikart
//  
//        $(this).addClass('pretty-hover');
// 
//      }, function() {
//  
//        $(this).removeClass('pretty-hover');
// 
//      });
      
      
		//$('ul#comments .addComment').hide();
		$("ul#comments .btnaddComment").toggle(function(){
	    $("ul#comments .addComment").slideUp("fast");}, 
        function(){
        $("ul#comments .addComment").slideDown("normal");
        });
		        $("img#nekibu_show_answer").toggle(function(){
	    $("div#nekibu_show_answer_div").slideDown("fast");}, 
        function(){
        $("div#nekibu_show_answer_div").slideUp("normal");
        });

        // easy slider   
     
   

        
         

      	$('div#hoverboxcategories div.ex').hide();
        $('div#hoverboxcategories div.lastt').show();
    	$('div#hoverboxcategories  a[rel^="div"]').click(function(){
    	    var t=$(this).attr('rel');if($(t).is(':visible')){return false;}
    	    if(!$('.'+t).is(':visible')){$('div#hoverboxcategories .ex:visible').slideUp('fast');$('.'+t).slideDown('fast'); return false;}    	               
    	});
    	$('div#hoverboxcategories div.firstt img').addClass("corners iradius12");
         
   
        	$('#menu ul').hide();
    	    $('#menu ul:first').show(); //Optional
    		$('#menu li a').click(function() {
			var checkElement = $(this).next();
			if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
				return false;
			}
			if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
				$('#menu ul:visible').slideUp('normal');
				checkElement.slideDown('normal');
				return false;
			}
	    	});

            
                       $.sifr({
		 path: 'assets/v2/swf/fonts/',
		 save: true});
		 $('h1.conmanset').sifr({ font: 'dinMidStd', textAlign: 'center',verticalAlign:'middle', color: '#313131'});
         $('h1.spec').sifr({ font: 'dinProBlck', textAlign: 'center',verticalAlign:'middle', color: '#003333'});

            // sub cat menu
            //The Accordion Menu
            $('#subcategory ul').hide();
        	//$('#subcategory ul:first').show(); //Optional
		    $('#subcategory li a').click(function() {
			var checkElement = $(this).next();
			if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
				return false;
			}
			if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
				$('#subcategory ul:visible').slideUp('normal');
				checkElement.slideDown('normal');
				return false;
			}
		});

            // end sub cat menu
        
        
        
        
        
   
       
//       var w = $(window).width();
//	    if (w < 1045)
//	    {
//            $(".bigger").removeClass("bigger");
//            $("#topcornerright").hide();
//         }
     $("div#colorbox a").addClass("nounderline"); // 4 manset gobek duzelt
     $("#manssetcover").addClass("manssetcover");
     //$("#manssetcover").hide();
     
     if($('#catxslider').size()==1)
     {
        $('#catxslider').jcarousel({
        auto: 8,
        wrap: 'last',
        scroll:1,
        vertical:true,
        initCallback: catxslider_initCallback
//        buttonNextHTML: null,
//        buttonPrevHTML: null
        });
        };
   if($('#xslider').size()==1)
    {
    $('#xslider').jcarousel({
        auto: 4,
        wrap: 'last',
        scroll:2
        
    });
    };
   
   
   

// fotogaleri label positon ///////////////
if(!$.browser.msie){$(".borderedbox").addClass("br tl");}
//if(!$.browser.msie){$("div.sinter").addClass("bl");}
//$("li").css({display: 'inline-block'});}
$('ul#gameScroll .borderedbox').hide();$('li').hover(function() {$(this).children('.borderedbox').slideDown('fast');}, function() {$(this).children('.borderedbox').slideUp('fast');});

$('ul#fotoScroll .borderedbox').hide();$('li').hover(function() {$(this).children('.borderedbox').slideDown('fast');}, function() {$(this).children('.borderedbox').slideUp('fast');});
$('ul#videoScroll .borderedbox').hide();$('li').hover(function() {$(this).children('.borderedbox').slideDown('fast');}, function() {$(this).children('.borderedbox').slideUp('fast');});
$('div#nekibu .sinter').hide();$('div#nekibu .bgnekibu').hover(function() {$('div#nekibu .sinter').fadeIn('fast');}, function() {$('div#nekibu .sinter').fadeOut('normal');});
$('div#konusuyorum .sinter').hide();$('div#konusuyorum .bgkonusuyorum').hover(function() {$('div#konusuyorum .sinter').fadeIn('fast');}, function() {$('div#konusuyorum .sinter').fadeOut('slow');});
$('div#kecelikalem .sinter').hide();$('div#kecelikalem .bgkecelikalem').hover(function() {$('div#kecelikalem .sinter').fadeIn('fast');}, function() {$('div#kecelikalem .sinter').fadeOut('slow');});
$('div#kecelikalem .sinter').css({'border-color':'#c1127c'});
$('div#konusuyorum .sinter').css({'border-color':'#9fc57a'});

        $('div#intearaktiftrio div.sinter').click(function() {
        window.location=$(this).children().find("a").attr("href");return false;
        });

$('img#galeripic').click(function(){
    $(this).attr('src','/genc/assets/v2/design/pngs/loading.gif'); 
});


// fotogaleri label positon end ///////////

         $('.tr').corner('tr');
         $('.br').corner('br');
         $('.bl').corner('bl');
         $('.br').corner('br');
         $('.tl').corner('tl');
         $('.bottom').corner('bottom');
         $('.corner').corner();
         $('.top').corner('top');
         $('ul#readthis li').corner('bottom');

     
     
    });
        
        
        


function catxslider_initCallback(carousel)
{    jQuery('.catximgslider a').bind('mouseover', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).children().attr('rel')));
        return false;
    });


    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
    
    
    


};

        function printWebPart(tagid){
        if (tagid) {
        //build html for print page
        var html = "<HTML>\n<HEAD>\n"+
            $("head").html()+
            "\n</HEAD>\n<BODY>\n"+
            $("#"+tagid).html()+
            "\n</BODY>\n</HTML>";
        //open new window
        var printWP = window.open("","printWebPart");
        printWP.document.open();
        //insert content
        printWP.document.write(html);
        printWP.document.close();
        //open print dialog
        printWP.print();
        }
    }


function searchGoogle()
{
        var src = "http://google.com";
        $.modal('<iframe src="' + src + '" height="450" width="830" style="border:0">', {
    	closeHTML:"",
    	containerCss:{
		backgroundColor:"#fff",
		borderColor:"#0063dc",
		height:450,
		padding:0,
		width:830
    	},
    	overlayClose:true
        });
}


 $(document).ready(function(){
	$("#sendmail1").click(function(){
	//$("#formail").slideUp();
		var valid = '';
		var isr = ' gerekiyor.';
		var name = $("#name").val();
		var mail = $("#mail").val();
		var subject = $("#subject").val();
		var text = $("#text").val();
		if (name.length<1) {
			valid += '<br />Adınız'+isr;
		}
		if (!mail.match(/^([a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,4}$)/i)) {
			valid += '<br />Doğru Eposta'+isr;
		}
		if (subject.length<1) {
			valid += '<br />Konu'+isr;
		}
		if (text.length<1) {
			valid += '<br />Mesajınız'+isr;
		}
		if (valid!='') {
			$("#response").fadeIn("slow");
			$("#response").html("<b>Hatalar</>:"+valid);
		}
		else {
			var datastr ='name=' + name + '&mail=' + mail + '&subject=' + subject + '&text=' + text;
			$("#response").css("display", "block");
			$("#response").html("Mesaj gönderiliyor .... ");
			$("#response").fadeIn("slow");
			setTimeout("send('"+datastr+"')",1500);
			setTimeout('$("#formbody").fadeOut("normal")',500);
			
		
		}
		return false;
	});
});
function send(datastr){
	$.ajax({	
		type: "POST",
		url: "sendposta.aspx",
		data: datastr,
		cache: false,
		success: function(html){
		$("#response").fadeIn("slow");
		$("#response").html(html);
		setTimeout('$("#response").fadeOut("normal")',1500);
		setTimeout('$("#response").html("Mesaj formunuz alınmıştır, <br> Teşekkür ederiz").fadeIn("normal")',1600);
				
	}
	});
}
