﻿
function getCenter(pwidth, pheight) {
    wwidth = screen.width;
    wheigth = screen.height;
    lpos = (wwidth - pwidth) / 2;
    tpos = (wheigth - pheight) / 2;
    return lpos, tpos;
}

function PopItUp(src, w, h, s) {
    if (s) w = w + 17;
    getCenter(w, h);
    Popwin = window.open(src, "pop_up", "toolbar=0,width=" + w + ", height=" + h + ", left=" + lpos + ", top=" + tpos + "; location=0, directories=0, status=1, scrollbars=" + s + ", menubar=0, resizable=0, copyhistory=0");
    Popwin.focus();

}

jQuery.fn.extend({
  scrollTo : function(speed, easing) {
    return this.each(function() {
      var targetOffset = $(this).offset().top;
      $('html,body').animate({scrollTop: targetOffset}, speed, easing);
    });
  }
});

$(document).ready(function() {

    $(".breadcrumb #ctl00_ContentPlaceHolder1_BreadCrumb_BreadCrumb span:last-child a").each(function() {

        $(this).css("padding-left", "0px");
        $(this).css("background", "none");

    });

});

function onlyEmail(e) {
    var InvalidChars = " !#/*{[()]},;%^><\\?+:='`|şŞĞğÜüÇçİıÖö";

    kCode = InvalidChars.charAt(5);

    var keyCode = ($.browser.mozilla) ? e.which : event.keyCode;

    if (keyCode > 127) {
        return false;
    }
    for (i = 0; i <= InvalidChars.length - 1; i++) {
        if (keyCode == InvalidChars.charCodeAt(i)) {
            return false;
        }
    }
    return true;
}

function onlyNumber(e) {
    var keyCode = ($.browser.mozilla) ? e.which : event.keyCode;
    if ((keyCode < 48 || keyCode > 57) && keyCode != 8 && keyCode != 0) {
        return false;
    }
}

function isEmail(value) {
    value = value.replace(/^\s|\s$/g, ""); //trims string
    var regex = new RegExp("^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$", "i");
    return regex.test(value);
}

function setZebra(){
    $('.saglikProfRow').each(function(i){
     if(i % 2 != 1){
	    $(this).addClass("rowGrey")
	}
	});									   
}

$().ready(function() {
    $(".txtbox").focus(function(e) {
    if ($(this).val() == 'E-Posta adresinizi buraya yazınız.')
            $(this).val('');
    }).blur(function() {
        if ($(this).val().length <= 0)
            $(this).val('E-Posta adresinizi buraya yazınız.')
    });
    
    setZebra();
});



 



