﻿//Browser detection
var AgntUsr = navigator.userAgent.toLowerCase();
var DomYes = (document.getElementById) ? 1 : 0; 												// DOM
var NavYes = (AgntUsr.indexOf('mozilla') != -1 && AgntUsr.indexOf('compatible') == -1) ? 1 : 0; 	// Netscape
var ExpYes = (AgntUsr.indexOf('msie') != -1) ? 1 : 0; 											// IExplorer
var Opr = (AgntUsr.indexOf('opera') != -1 || AgntUsr.indexOf('opera') != -1) ? 1 : 0; 				// Opera
var Opr5 = (AgntUsr.indexOf('opera 5') != -1 || AgntUsr.indexOf('opera/5') != -1) ? 1 : 0; 			// Opera 5
var Opr6 = (AgntUsr.indexOf('opera 6') != -1 || AgntUsr.indexOf('opera/6') != -1) ? 1 : 0; 			// Opera 6
var Opr7 = (AgntUsr.indexOf('opera 7') != -1 || AgntUsr.indexOf('opera/7') != -1) ? 1 : 0; 			// Opera 7
var DomNav = (DomYes && NavYes) ? 1 : 0; 														// Netscape 6 up
var Exp5 = (AgntUsr.indexOf('msie 5') != -1) && (AgntUsr.indexOf('gecko') == -1) ? 1 : 0; 		// IE 5
var DomExp = (DomYes && ExpYes) ? 1 : 0; 														// IExplorer 5 up
var Nav4 = (NavYes && !DomYes && document.layers) ? 1 : 0; 										// Netscape 4
var Exp4 = (ExpYes && !DomYes && document.all) ? 1 : 0; 											// IExplorer 4
var Saf = (AgntUsr.indexOf('safari') != -1) ? 1 : 0; 										// Safari
var PosStrt = ((NavYes || ExpYes) && !Opr5) ? 1 : 0; 												// Can start
var OS = "";

var detect = navigator.userAgent.toLowerCase();
function checkIt(string) {
    var place = detect.indexOf(string) + 1;
    var thestring = string;
    return place;
}

if (checkIt('linux')) OS = "Windows";
else if (checkIt('x11')) OS = "Windows";
else if (checkIt('mac')) OS = "Mac";
else if (checkIt('win')) OS = "Windows";
else OS = "an unknown operating system";

function returnWinHeight() {
    var winHeight = 0;
    if (ExpYes && OS != "Mac") {
        if (document.compatMode && document.compatMode != "BackCompat")
            winHeight = document.documentElement.clientHeight;
        else
            winHeight = document.body.clientHeight;
    } else if (OS == "Mac" && Saf) {
        winHeight = window.innerHeight;
    } else {
        if (document.compatMode && document.compatMode != "BackCompat")
            if (document.documentElement.clientHeight > 0)
            winHeight = document.documentElement.clientHeight;
        else
            winHeight = document.body.clientHeight;
        else
            winHeight = document.body.clientHeight;
    }
    return winHeight;
}

function setHeight() {
    var minusHeight = 98;
    document.getElementById("scroll").style.height = (returnWinHeight() - minusHeight) + "px";
}

//on resize
window.onresize = setHeight;

function writeDiv(div, html) {
    var evaldiv;
    if (DomExp || Opr == "1") {
        evaldiv = eval(div);
        evaldiv.innerHTML = html;
    } else if (DomNav) {
        (document.getElementById(div)).innerHTML = html;
    }
}

function MM_swapImgRestore() { //v3.0
    var i, x, a = document.MM_sr; for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc;
}

function MM_preloadImages() { //v3.0
    var d = document; if (d.images) {
        if (!d.MM_p) d.MM_p = new Array();
        var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for (i = 0; i < a.length; i++)
            if (a[i].indexOf("#") != 0) { d.MM_p[j] = new Image; d.MM_p[j++].src = a[i]; } 
    }
}

function MM_findObj(n, d) { //v4.01
    var p, i, x; if (!d) d = document; if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
        d = parent.frames[n.substring(p + 1)].document; n = n.substring(0, p);
    }
    if (!(x = d[n]) && d.all) x = d.all[n]; for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
    for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document);
    if (!x && d.getElementById) x = d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
    var i, j = 0, x, a = MM_swapImage.arguments; document.MM_sr = new Array; for (i = 0; i < (a.length - 2); i += 3)
        if ((x = MM_findObj(a[i])) != null) { document.MM_sr[j++] = x; if (!x.oSrc) x.oSrc = x.src; x.src = a[i + 2]; }
}

function validateString(what) {
    //check if string empty
    if (what != "")
        return false;
    else
        return true;
}
function compareString(what1, what2) {
    //compare 2 strings
    if (what1 == what2)
        return false;
    else
        return true;
}
function stringLength(tString, tLength1, tLength2) {
    //check if string length is in range
    if ((tString.length >= tLength1) && (tString.length <= tLength2))
        return false;
    else
        return true;
}
function validateEmail(what) {
    var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    if (filter.test(what))
        return false;
    else
        return true;
}
function debug(what) {
    document.getElementById("debuger").value += what + "\n";
}

function loadFragmentInToElement(url) {
    var element = document.getElementById("sredina");
    element.innerHTML = '<p><em>Loading ...</em></p>';
    var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.3.0");
    xmlhttp.open("GET", url);
    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            element.innerHTML = xmlhttp.responseText;
        }
    }
    xmlhttp.send(null);
}

function change(id) {
    for (i = 1; i <= 8; i++) {
        navigacijaID = "navigacija-" + i;
        identity = document.getElementById(navigacijaID);
        identity.className = "item";
        if (i <= 7) {
            sepID = "sep-" + i;
            identity2 = document.getElementById(sepID);
            identity2.className = "sep-off";
        }
    }
    navigacijaID = "navigacija-" + id;
    identity3 = document.getElementById(navigacijaID);
    identity3.className = "item-on";
    if (id == 1) {
        sepID = "sep-" + id;
        identity4 = document.getElementById(sepID);
        identity4.className = "sep-on";
    } else {
        if (id == 8) {
            id = id - 1;
            sepID = "sep-" + id;
            identity5 = document.getElementById(sepID);
            identity5.className = "sep-on";
        } else {
            sepID = "sep-" + id;
            identity6 = document.getElementById(sepID);
            identity6.className = "sep-on";
            id = id - 1;
            sepID = "sep-" + id;
            identity7 = document.getElementById(sepID);
            identity7.className = "sep-on";
        }
    }
}

function otvaranje(ukupno, zaOtvoriti) {
    for (i = 1; i <= ukupno; i++) {
        uvjetiID = "uvjeti-" + i;
        identity = document.getElementById(uvjetiID);
        identity.style.display = "none";
    }
    zaPrikazID = "uvjeti-" + zaOtvoriti;
    zaPrikaz = document.getElementById(zaPrikazID);
    zaPrikaz.style.display = "inline";
}

function ispis(div) {
    window.open("/Print.htm", "print", "width=1,height=1,toolbar=no,screenX=0,screenY=0,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");


    //    val = window.opener.document.getElementById(div).innerHTML;
    //    document.getElementById("printContent").innerHTML = val;
    //    
    //    window.print();
}

function poravnavanjeTri(lijevi, centralni, desni) {
    var divDefault = 318;

    var divLeft = document.getElementById(lijevi).offsetHeight;
    var divCenter = document.getElementById(centralni).offsetHeight;
    var divRight = document.getElementById(desni).offsetHeight;

    if (divLeft > divDefault) divDefault = divLeft;
    if (divCenter > divDefault) divDefault = divCenter;
    if (divRight > divDefault) divDefault = divRight;

    document.getElementById(lijevi).style.height = divDefault + "px";
    document.getElementById(centralni).style.height = divDefault + "px";
    document.getElementById(desni).style.height = divDefault + "px";
}

function poravnavanjeDva(lijevi, desni) {
    var divDefault = 318;

    var divLeft = document.getElementById(lijevi).offsetHeight;
    var divRight = document.getElementById(desni).offsetHeight;

    if (divLeft > divDefault) divDefault = divLeft;
    if (divRight > divDefault) divDefault = divRight;

    document.getElementById(lijevi).style.height = divDefault + "px";
    document.getElementById(desni).style.height = divDefault + "px";
}


/**
* SWFObject v1.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
*
* SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
*   legal reasons.
*/
if (typeof deconcept == "undefined") { var deconcept = new Object(); }
if (typeof deconcept.util == "undefined") { deconcept.util = new Object(); }
if (typeof deconcept.SWFObjectUtil == "undefined") { deconcept.SWFObjectUtil = new Object(); }
deconcept.SWFObject = function(_1, id, w, h, _5, c, _7, _8, _9, _a, _b) {
    if (!document.createElement || !document.getElementById) { return; }
    this.DETECT_KEY = _b ? _b : "detectflash";
    this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
    this.params = new Object();
    this.variables = new Object();
    this.attributes = new Array();
    if (_1) { this.setAttribute("swf", _1); }
    if (id) { this.setAttribute("id", id); }
    if (w) { this.setAttribute("width", w); }
    if (h) { this.setAttribute("height", h); }
    if (_5) { this.setAttribute("version", new deconcept.PlayerVersion(_5.toString().split("."))); }
    this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"), _7);
    if (c) { this.addParam("bgcolor", c); }
    var q = _8 ? _8 : "high";
    this.addParam("quality", q);
    this.setAttribute("useExpressInstall", _7);
    this.setAttribute("doExpressInstall", false);
    var _d = (_9) ? _9 : window.location;
    this.setAttribute("xiRedirectUrl", _d);
    this.setAttribute("redirectUrl", "");
    if (_a) { this.setAttribute("redirectUrl", _a); } 
};
deconcept.SWFObject.prototype = { setAttribute: function(_e, _f) {
    this.attributes[_e] = _f;
}, getAttribute: function(_10) {
    return this.attributes[_10];
}, addParam: function(_11, _12) {
    this.params[_11] = _12;
}, getParams: function() {
    return this.params;
}, addVariable: function(_13, _14) {
    this.variables[_13] = _14;
}, getVariable: function(_15) {
    return this.variables[_15];
}, getVariables: function() {
    return this.variables;
}, getVariablePairs: function() {
    var _16 = new Array();
    var key;
    var _18 = this.getVariables();
    for (key in _18) {
        _16.push(key + "=" + _18[key]);
    }
    return _16;
}, getSWFHTML: function() {
    var _19 = "";
    if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) {
        if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "PlugIn"); }
        _19 = "<embed type=\"application/x-shockwave-flash\" src=\"" + this.getAttribute("swf") + "\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\"";
        _19 += " id=\"" + this.getAttribute("id") + "\" name=\"" + this.getAttribute("id") + "\" ";
        var _1a = this.getParams();
        for (var key in _1a) { _19 += [key] + "=\"" + _1a[key] + "\" "; }
        var _1c = this.getVariablePairs().join("&");
        if (_1c.length > 0) { _19 += "flashvars=\"" + _1c + "\""; }
        _19 += "/>";
    } else {
        if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "ActiveX"); }
        _19 = "<object id=\"" + this.getAttribute("id") + "\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\">";
        _19 += "<param name=\"movie\" value=\"" + this.getAttribute("swf") + "\" />";
        var _1d = this.getParams();
        for (var key in _1d) { _19 += "<param name=\"" + key + "\" value=\"" + _1d[key] + "\" />"; }
        var _1f = this.getVariablePairs().join("&");
        if (_1f.length > 0) { _19 += "<param name=\"flashvars\" value=\"" + _1f + "\" />"; }
        _19 += "</object>";
    }
    return _19;
}, write: function(_20) {
    if (this.getAttribute("useExpressInstall")) {
        var _21 = new deconcept.PlayerVersion([6, 0, 65]);
        if (this.installedVer.versionIsValid(_21) && !this.installedVer.versionIsValid(this.getAttribute("version"))) {
            this.setAttribute("doExpressInstall", true);
            this.addVariable("MMredirectURL", escape(this.getAttribute("xiRedirectUrl")));
            document.title = document.title.slice(0, 47) + " - Flash Player Installation";
            this.addVariable("MMdoctitle", document.title);
        } 
    }
    if (this.skipDetect || this.getAttribute("doExpressInstall") || this.installedVer.versionIsValid(this.getAttribute("version"))) {
        var n = (typeof _20 == "string") ? document.getElementById(_20) : _20;
        n.innerHTML = this.getSWFHTML();
        return true;
    } else {
        if (this.getAttribute("redirectUrl") != "") { document.location.replace(this.getAttribute("redirectUrl")); } 
    }
    return false;
} 
};
deconcept.SWFObjectUtil.getPlayerVersion = function(_23, _24) {
    var _25 = new deconcept.PlayerVersion([0, 0, 0]);
    if (navigator.plugins && navigator.mimeTypes.length) {
        var x = navigator.plugins["Shockwave Flash"];
        if (x && x.description) { _25 = new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")); }
    } else {
        try {
            var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
            for (var i = 3; axo != null; i++) {
                axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
                _25 = new deconcept.PlayerVersion([i, 0, 0]);
            } 
        }
        catch (e) { }
        if (_23 && _25.major > _23.major) { return _25; }
        if (!_23 || ((_23.minor != 0 || _23.rev != 0) && _25.major == _23.major) || _25.major != 6 || _24) {
            try { _25 = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(",")); }
            catch (e) { } 
        } 
    }
    return _25;
};
deconcept.PlayerVersion = function(_29) {
    this.major = parseInt(_29[0]) != null ? parseInt(_29[0]) : 0;
    this.minor = parseInt(_29[1]) || 0;
    this.rev = parseInt(_29[2]) || 0;
};
deconcept.PlayerVersion.prototype.versionIsValid = function(fv) {
    if (this.major < fv.major) { return false; }
    if (this.major > fv.major) { return true; }
    if (this.minor < fv.minor) { return false; }
    if (this.minor > fv.minor) { return true; }
    if (this.rev < fv.rev) { return false; } return true;
};
deconcept.util = { getRequestParameter: function(_2b) {
    var q = document.location.search || document.location.hash;
    if (q) {
        var _2d = q.indexOf(_2b + "=");
        var _2e = (q.indexOf("&", _2d) > -1) ? q.indexOf("&", _2d) : q.length;
        if (q.length > 1 && _2d > -1) {
            return q.substring(q.indexOf("=", _2d) + 1, _2e);
        } 
    } return "";
} 
};
if (Array.prototype.push == null) {
    Array.prototype.push = function(_2f) {
        this[this.length] = _2f;
        return this.length;
    };
}
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for backwards compatibility
var SWFObject = deconcept.SWFObject;


/*
this is used for filtered linked selects
use the Init method to initiate a child select and declare its parent

the FilteredSelects must have options with id attributes. 
value for the option is declared in the value attribute of the option element.
parent of the option is declared in the id attribute of the option and must be hold exactly the same value
corresponding value attribute of one of the options of the parent selects - not necessarily the first parent.
*/

function FilteredSelect_Item_CreateOption() {
    return new Option(this.text, this.value);
}

function FilteredSelect_Item(value, filter, text) {
    this.value = value;
    this.filter = filter;
    this.text = text;
    this.checked = false;
    this.createOption = FilteredSelect_Item_CreateOption;
}

function FilteredSelect_Init(filteredSelectId, parentSelectId) {
    s = document.getElementById(filteredSelectId);
    if (s) {
        if (!s.initialized) {
            //fix width
            //s.style.width=s.offsetWidth;
            //prepare the items array from the options
            var items = new Array;
            for (i = 0; i < s.options.length; i++) {
                var item = new FilteredSelect_Item(s.options[i].value, s.options[i].id, s.options[i].innerHTML);
                items[i] = item;
            }
            //attach methods
            document.getElementById(filteredSelectId).Sort = FilteredSelect_Sort;
            document.getElementById(filteredSelectId).Clear = FilteredSelect_Clear;
            document.getElementById(filteredSelectId).Fill = FilteredSelect_Fill;
            document.getElementById(filteredSelectId).AddFilter = FilteredSelect_AddFilter;
            //set FilteredSelect fields
            s.items = items;
            s.initialized = true;
            //if we have a parent select hook to its onchange event handler and run it once
            if (parentSelectId) {
                s.parentSelectId = parentSelectId;
                s.parentSelect = document.getElementById(parentSelectId);
                document.getElementById(parentSelectId).childFilteredSelect = s;
                document.getElementById(parentSelectId).onchange = FilteredSelect_ParentSelect_OnChange;
                document.getElementById(parentSelectId).change = FilteredSelect_ParentSelect_OnChange;
                document.getElementById(parentSelectId).FilterChild = FilteredSelect_ParentSelect_FilterChild;
                //save selectedIndex (IE bug, IE saves selectedIndex on history.back() rather than the selectedValue)
                selectedIndex = s.selectedIndex;
                //run the parents change() to run inital filter
                document.getElementById(parentSelectId).change();
                //restore saved selectedIndex
                //s.selectedIndex = selectedIndex;

            }
        }
    }
    else {
        alert("FilteredSelect javascript error: " + selectId + " does not exist!");
    }
}

function FilteredSelect_Clear() {
    //preserve the selected value
    this.selectedValue = this.value;
    //uncheck all items
    for (i = 0; i < this.items.length; i++) {
        this.items[i].checked = this.items[i].value == "any";
    }
    //clear the select options
    this.innerHTML = '';
}

function FilteredSelect_Fill() {
    for (i = 0; i < this.items.length; i++) {
        if (this.items[i].checked) {
            //add the option
            this.options[this.options.length] = this.items[i].createOption();
            //preserve the selected value
            if (this.options[this.options.length - 1].value == this.selectedValue) {
                this.selectedIndex = this.options.length - 1;
            }
        }
    }
}

function FilteredSelect_Sort() {
    for (i = 0; i < this.options.length - 1; i++) {
        for (j = i; j < this.options.length; j++) {
            if ((this.options[j].innerHTML < this.options[i].innerHTML) && ((this.options[i].value != "any")) || (this.options[j].value == "any")) {
                optioni = new Option(this.options[i].innerHTML, this.options[i].value)
                optionj = new Option(this.options[j].innerHTML, this.options[j].value)
                this.options[i] = optionj;
                this.options[j] = optioni;
            }
        }
    }
}

function FilteredSelect_ParentSelect_FilterChild(targetChild) {
    if (this.value == "any") {
        //if any is selected then we must loop through the entire options collection
        //and add child options to the child select for each existing option in the parent select options collection
        for (var i = 0; i < this.options.length; i++) {
            if (this.options[i].value != "any") {
                targetChild.AddFilter(this.options[i].value);
            }
        }
        //go to the next parent up...		
        if (this.parentSelect) {
            this.parentSelect.FilterChild(targetChild);
        }
    }
    else {
        targetChild.AddFilter(this.value);
    }
}

function FilteredSelect_ParentSelect_OnChange() {
    if (this.childFilteredSelect && this.childFilteredSelect.initialized) {
        //keep the selectedValue if possible
        selectedValue = this.childFilteredSelect.value;
        //clear the child FilteredSelect
        this.childFilteredSelect.Clear();
        //apply new filters to child
        this.FilterChild(this.childFilteredSelect);
        //fill the child filtered select
        this.childFilteredSelect.Fill();
        //disable the child select if only 1 option is available
        this.childFilteredSelect.disabled = this.childFilteredSelect.options.length <= 1
        //call the childs onchange since its options changed its selectedvalue may have also changed
        if (this.childFilteredSelect.childFilteredSelect) this.childFilteredSelect.change();
    }
    else {
        //the child FilteredSelect does not exist yet or isn't initialized yet so we'll recall this function in 10ms
        window.setTimeout("document.getElementById('" + this.id + "').change()", 10);
    }
}

function FilteredSelect_AddFilter(filter) {
    for (i = 0; i < this.items.length; i++) {
        if (this.items[i].filter == filter) {
            this.items[i].checked = true;
        }
    }
}

/**
* jQuery.ScrollTo - Easy element scrolling using jQuery.
* Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
* Dual licensed under MIT and GPL.
* Date: 9/11/2008
* @author Ariel Flesler
* @version 1.4
*
* http://flesler.blogspot.com/2007/10/jqueryscrollto.html
*/
; (function(h) { var m = h.scrollTo = function(b, c, g) { h(window).scrollTo(b, c, g) }; m.defaults = { axis: 'y', duration: 1 }; m.window = function(b) { return h(window).scrollable() }; h.fn.scrollable = function() { return this.map(function() { var b = this.parentWindow || this.defaultView, c = this.nodeName == '#document' ? b.frameElement || b : this, g = c.contentDocument || (c.contentWindow || c).document, i = c.setInterval; return c.nodeName == 'IFRAME' || i && h.browser.safari ? g.body : i ? g.documentElement : this }) }; h.fn.scrollTo = function(r, j, a) { if (typeof j == 'object') { a = j; j = 0 } if (typeof a == 'function') a = { onAfter: a }; a = h.extend({}, m.defaults, a); j = j || a.speed || a.duration; a.queue = a.queue && a.axis.length > 1; if (a.queue) j /= 2; a.offset = n(a.offset); a.over = n(a.over); return this.scrollable().each(function() { var k = this, o = h(k), d = r, l, e = {}, p = o.is('html,body'); switch (typeof d) { case 'number': case 'string': if (/^([+-]=)?\d+(px)?$/.test(d)) { d = n(d); break } d = h(d, this); case 'object': if (d.is || d.style) l = (d = h(d)).offset() } h.each(a.axis.split(''), function(b, c) { var g = c == 'x' ? 'Left' : 'Top', i = g.toLowerCase(), f = 'scroll' + g, s = k[f], t = c == 'x' ? 'Width' : 'Height', v = t.toLowerCase(); if (l) { e[f] = l[i] + (p ? 0 : s - o.offset()[i]); if (a.margin) { e[f] -= parseInt(d.css('margin' + g)) || 0; e[f] -= parseInt(d.css('border' + g + 'Width')) || 0 } e[f] += a.offset[i] || 0; if (a.over[i]) e[f] += d[v]() * a.over[i] } else e[f] = d[i]; if (/^\d+$/.test(e[f])) e[f] = e[f] <= 0 ? 0 : Math.min(e[f], u(t)); if (!b && a.queue) { if (s != e[f]) q(a.onAfterFirst); delete e[f] } }); q(a.onAfter); function q(b) { o.animate(e, j, a.easing, b && function() { b.call(this, r, a) }) }; function u(b) { var c = 'scroll' + b, g = k.ownerDocument; return p ? Math.max(g.documentElement[c], g.body[c]) : k[c] } }).end() }; function n(b) { return typeof b == 'object' ? b : { top: b, left: b} } })(jQuery);

/**
* jQuery.LocalScroll - Animated scrolling navigation, using anchors.
* Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
* Dual licensed under MIT and GPL.
* Date: 6/3/2008
* @author Ariel Flesler
* @version 1.2.6
**/
; (function($) { var g = location.href.replace(/#.*/, ''), h = $.localScroll = function(a) { $('body').localScroll(a) }; h.defaults = { duration: 1e3, axis: 'y', event: 'click', stop: 1 }; h.hash = function(a) { a = $.extend({}, h.defaults, a); a.hash = 0; if (location.hash) setTimeout(function() { i(0, location, a) }, 0) }; $.fn.localScroll = function(b) { b = $.extend({}, h.defaults, b); return (b.persistent || b.lazy) ? this.bind(b.event, function(e) { var a = $([e.target, e.target.parentNode]).filter(c)[0]; a && i(e, a, b) }) : this.find('a,area').filter(c).bind(b.event, function(e) { i(e, this, b) }).end().end(); function c() { var a = this; return !!a.href && !!a.hash && a.href.replace(a.hash, '') == g && (!b.filter || $(a).is(b.filter)) } }; function i(e, a, b) { var c = a.hash.slice(1), d = document.getElementById(c) || document.getElementsByName(c)[0], f; if (d) { e && e.preventDefault(); f = $(b.target || $.scrollTo.window()); if (b.lock && f.is(':animated') || b.onBefore && b.onBefore.call(a, e, d, f) === !1) return; if (b.stop) f.queue('fx', []).stop(); f.scrollTo(d, b).trigger('notify.serialScroll', [d]); if (b.hash) f.queue(function() { location = a.hash; $(this).dequeue() }) } } })(jQuery);


