// JavaScript Document
$(document).ready(function(){
	// Tabs
	$('#tabs').tabs();
	
});

title = "Serbest Muhasebeci Mali Müşavir Hüseyin Bayazıt";
url = "http://www.bayazitmuhasebe.com";
function sg_sk() {
	if (window.sidebar) { // Mozilla Firefox Bookmark
	window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
	window.external.AddFavorite( url, title);}else if(window.opera && window.print) {
	// Opera Hotlist
	return true; }}
function sg_as(){
	if (document.all){document.body.style.behavior='url(#default#homepage)';  document.body.setHomePage(url);}else if (window.sidebar){if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");}catch(e){alert("Firefox ayarlarınız açılış sayfanızı değiştirmenize izin vermiyor.");}}var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch); prefs.setCharPref('browser.startup.homepage',url); }}

function printOut(){
	var a=$("#content .rightArea .contentTitle").html();
	var b=$("#content .rightArea .breadCrumb").html();
	var c=$("#content .rightArea .singlePage").html();
	var d=window.open('','','width=750,height=600,scrollbars=yes,toolbar=yes');
	d.document.open("text/html");
	d.document.write('<html><head><link rel="stylesheet" href="css/main-print.css" /></head></html>');
	d.document.write('<div class="logo"><img src="images/logo.png"></div><div class="printpage">'+a+'<div class="breadCrumb">'+b+'</div><div class="singlePage">'+c+'</div></div>');
	d.document.close();
	d.print()
};

function Browser() {
    var b = navigator.appName;
    if (b == "Netscape") this.b = "ns";
    else if ((b == "Opera") || (navigator.userAgent.indexOf("Opera") > 0)) this.b = "opera";
    else if (b == "Microsoft Internet Explorer") this.b = "ie";
    if (!b) alert('Unidentified browser./nThis browser is not supported,');
    this.version = navigator.appVersion;
    this.v = parseInt(this.version);
    this.ns = (this.b == "ns" && this.v >= 4);
    this.ns4 = (this.b == "ns" && this.v == 4);
    this.ns6 = (this.b == "ns" && this.v == 5);
    this.ie = (this.b == "ie" && this.v >= 4);
    this.isIE = (this.b == "ie" && this.v >= 4);
    this.ie4 = (this.version.indexOf('MSIE 4') > 0);
    this.ie5 = (this.version.indexOf('MSIE 5') > 0);
    this.ie55 = (this.version.indexOf('MSIE 5.5') > 0);
    this.ie6 = (this.version.indexOf('MSIE 6') > 0);
    this.opera = (this.b == "opera");
    this.dom = (document.createElement && document.appendChild && document.getElementsByTagName) ? true : false;
    this.def = (this.ie || this.dom); // most used browsers, for faster if loops
    var ua = navigator.userAgent.toLowerCase();
    if (ua.indexOf("win") > -1) this.platform = "win32";
    else if (ua.indexOf("mac") > -1) this.platform = "mac";
    else this.platform = "other";
}
is = new Browser();
browser = new Browser();


if (is.Mac && is.IE) {
    Array.prototype.push = function(val) {
        this[this.length] = val;
    }
}

//Sadece Harf
function onlyLetter(e) {

    var InvalidChars = "!#/*{[()]},.-_;%^><\\?+:='`|";

    var keyCode = (is.ns) ? e.which : event.keyCode;
    if (keyCode > 47 && keyCode < 58) {
        return false;
    }

    for (i = 0; i <= InvalidChars.length - 1; i++) {
        if (keyCode == InvalidChars.charCodeAt(i)) {
            return false;
        }
    }
}
//Sadece Sayı
function onlyNumber(e) {
    var keyCode = (is.ns) ? e.which : event.keyCode;
    if ((keyCode < 48 || keyCode > 57) && keyCode != 8 && keyCode != 0) {
        return false;
    }
}
function alanKodKontrol(e,t){
	var r = /([1-9][0-9]*)$/;
	
	result = r.exec(t.value);
	
	if (result != null) {
		t.value = result[1];
	} else {
		t.value = "";
	}
		
}

function winOpener(theURL, winName, scrollbars, resizable, width, height) {
	
	winFeatures = 'left=' + (screen.availWidth-10-width)/2 + ',top=' + (screen.availHeight-30-height)/2 + ',scrollbars=' + scrollbars + ',resizable=' + resizable + ',width=' + width + ',height=' + height + ',toolbar=0,location=0,status=1,menubar=0'
  	window.open(theURL, winName, winFeatures);
}
