﻿$jq(document).ready(function() {

    var genderSet = false;
    var genderSeekSet = false;
    var photosOnlySet = false;

    // get the PhotoOnly Cookie
    var po = ($jq.readCookie('MatchSearch') != undefined) ? $jq.readCookie('MatchSearch')['SC05'] : null;

    // Set Display Order
    var dis = ($jq.readCookie('MatchSearch') != undefined) ? $jq.readCookie('MatchSearch')['SC06'] : null;
    if (dis) {
        $jq("#dis").val(dis);
    }

    // check for cookie
    if (po == null) {
        // no cookie set photos only :hidden
        $jq("#po").val(1);
    }
    else {
        // this is for display only
        if (po == 1) {
            $jq("#poc").attr('checked', true);
        }
        else {
            $jq("#poc").attr('checked', false);
        }
    }

    // bind click event for Photosonly checkbox
    $jq('#poc').click(function() {
        if (this.checked) {
            $jq("#po").val(1);
        }
        else {
            $jq("#po").val(0);
        }
    });

});