﻿jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};


function show_exhibitions(obj,callee){
	if(obj == "international_exhibitons"){
	  document.getElementById(obj).style.display = "block";
	  document.getElementById("domestic_exhibitions").style.display = "none";
	  document.getElementById("domestic").style.color = "#177299";
	  document.getElementById("domestic").style.border = "1px solid #ccc";
	  document.getElementById("domestic").style.backgroundColor = "#F2F9FC";
	  callee.style.color = "#3f3f3f";
	  callee.style.borderBottom = "none";
	  callee.style.backgroundColor = "#f8f8f8";
	}
	else{
	  document.getElementById(obj).style.display = "block";
	  document.getElementById("international_exhibitons").style.display = "none";
	  document.getElementById("international").style.color = "#177299";
	  document.getElementById("international").style.border = "1px solid #ccc";
	  document.getElementById("international").style.backgroundColor = "#F2F9FC";
	  callee.style.color = "#3f3f3f";
	  callee.style.borderBottom = "none";
	  callee.style.backgroundColor = "#f8f8f8";
	}
}
