﻿function checkPassword(i) {

    var dialog = 'dialog' + i;
    
    var dialogBox = $("[id$=" + dialog + "]");

    $("#" + dialogBox.attr('id')).show();

}

$(document).ready(function() {

    $('div .jqmWindow').jqm();

    $(".jqmClose").click(function() {
        $(this).parent().parent("div").hide();
    });

    // Reset Font Size
    var originalFontSize = $('html').css('font-size');
    $(".resetFont").click(function() {
        $('html').css('font-size', originalFontSize);
    });
    // Increase Font Size
    $(".increaseFont").click(function() {
        var currentFontSize = $('html').css('font-size');
        var currentFontSizeNum = parseFloat(currentFontSize, 10);
        var newFontSize = currentFontSizeNum * 1.2;
        $('html').css('font-size', newFontSize);
        return false;
    });
    // Decrease Font Size
    $(".decreaseFont").click(function() {
        var currentFontSize = $('html').css('font-size');
        var currentFontSizeNum = parseFloat(currentFontSize, 10);
        var newFontSize = currentFontSizeNum * 0.8;
        $('html').css('font-size', newFontSize);
        return false;
    });

	$('#services_content').hide();
	$('#services_openclose').click(function() {
		$('#services_content').slideToggle();
		return false;
		});

});

function setCookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}

function getCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}

function deleteCookie(name) {
    setCookie(name,"",-1);
}
