
//TODO: add new image projects
//TODO: add affordance cue for selected image
//TODO: add alt attr to all tags
//TODO: add humans.txt

// Navigation Members
var menu_plate = null;
var menu_set = null;
var current_state = null;

var image_nav = null;
var text_nav = null;
var code_nav = null;
var about_nav = null;
var home_nav = null;

// ABOUT page
var about_plate = null;
var about_circle = null;
var about_set = null;

// CODE page
var code_plate = null;
var code_circle = null;
var code_set = null;

// TEXT page
var text_plate = null;
var text_circle = null;
var text_set = null;

// IMAGE page
var image_plate = null;
var image_circle = null;
var image_set = null;
var image = new Image();
var currentProject = null;
var currentImage = null;
var img0,img1,img2,img3,img4,img5,img6,img7,img8,img9 = null;
var imageNav_set = null;

//SIEVE graphics
var isSieveInit = false;
var sieve_plate = null;
var sSetA = null;
var sSetB = null;
var c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19 = null;

// HOME page
var home_plate = Raphael(350, 100, 617, 566);
var home_set = home_plate.set();

home_plate.importSVG('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="617px" height="566px" viewBox="0 0 617 566" enable-background="new 0 0 617 566" xml:space="preserve"> <g id="Layer_2_copy_2"> <path fill="#FF0000" d="M328.758,186.484c0.678-0.334,1.354-0.67,2.035-0.997C330.111,185.814,329.436,186.15,328.758,186.484z"/> <path fill="#FF0000" d="M324.463,188.664c0.759-0.397,1.519-0.792,2.283-1.18C325.98,187.871,325.222,188.267,324.463,188.664z"/> <path fill="#FF0000" d="M498.826,183.457c0.537,0.241,1.07,0.489,1.604,0.734C499.896,183.945,499.363,183.698,498.826,183.457z"/> <path fill="#FF0000" d="M333.289,184.322c0.549-0.253,1.095-0.513,1.646-0.762C334.384,183.81,333.838,184.069,333.289,184.322z"/> <path fill="#FF0000" d="M312.338,195.551c0.945-0.582,1.898-1.152,2.854-1.719C314.235,194.398,313.283,194.969,312.338,195.551z" /> <path fill="#FF0000" d="M316.275,193.191c0.879-0.514,1.765-1.02,2.652-1.521C318.04,192.171,317.155,192.677,316.275,193.191z"/> <path fill="#FF0000" d="M320.315,190.895c0.82-0.454,1.644-0.903,2.471-1.346C321.959,189.991,321.136,190.441,320.315,190.895z"/> <path fill="#FF0000" d="M311.632,195.991c-1.05,0.652-2.095,1.309-3.132,1.979l0,0 C309.539,197.303,310.582,196.643,311.632,195.991z"/> <path fill="#FF0000" d="M305.178,200.157c1.097-0.741,2.205-1.464,3.316-2.183C307.381,198.69,306.273,199.416,305.178,200.157z"/> <path fill="#FF0000" d="M239.932,272.938c-0.52,0.986-1.035,1.974-1.538,2.97c0,0.001-0.001,0.002-0.001,0.003 c0.506-1.002,1.025-1.997,1.548-2.989C239.938,272.928,239.935,272.933,239.932,272.938z"/> <path fill="#FF0000" d="M244.134,265.36c0.002-0.003,0.004-0.007,0.006-0.01c-0.498,0.854-0.989,1.712-1.475,2.573 c0.003-0.004,0.005-0.009,0.008-0.013C243.154,267.056,243.641,266.206,244.134,265.36z"/> <path fill="#FF0000" d="M241.965,269.174c-0.495,0.894-0.986,1.79-1.467,2.692c0.484-0.906,0.977-1.807,1.475-2.705 C241.97,269.166,241.968,269.17,241.965,269.174z"/> <path fill="#FF0000" d="M240.49,271.881c-0.002,0.003-0.004,0.007-0.006,0.011c0.004-0.009,0.009-0.017,0.014-0.026 C240.495,271.871,240.493,271.876,240.49,271.881z"/> <path fill="#FF0000" d="M246.413,261.548c-0.363,0.591-0.717,1.187-1.072,1.782c0.357-0.598,0.713-1.197,1.077-1.79 C246.416,261.542,246.415,261.545,246.413,261.548z"/> <path fill="#FF0000" d="M245.341,263.33c-0.138,0.231-0.278,0.46-0.416,0.691c0.004-0.006,0.007-0.013,0.011-0.019 C245.07,263.778,245.207,263.555,245.341,263.33z"/> <path fill="#FF0000" d="M238.121,276.456c-0.563,1.122-1.12,2.248-1.662,3.382c0.543-1.137,1.102-2.266,1.666-3.391 C238.124,276.45,238.123,276.453,238.121,276.456z"/> <path fill="#FF0000" d="M249.354,256.907c-0.01,0.015-0.02,0.03-0.029,0.045c0.605-0.929,1.212-1.856,1.832-2.774 C250.546,255.081,249.95,255.994,249.354,256.907z"/> <path fill="#FF0000" d="M248.795,257.756c-0.522,0.811-1.032,1.63-1.543,2.448c-0.005,0.009-0.011,0.018-0.017,0.027 c0.518-0.829,1.034-1.658,1.563-2.479C248.797,257.753,248.796,257.754,248.795,257.756z"/> <path fill="#FF0000" d="M247.235,260.23c0.005-0.009,0.011-0.018,0.017-0.027c-0.28,0.448-0.562,0.894-0.839,1.344 c0.001-0.003,0.003-0.005,0.005-0.008C246.687,261.101,246.963,260.667,247.235,260.23z"/> <polygon fill="#FF0000" points="238.392,275.911 238.392,275.911 238.394,275.908 	"/> <path fill="#FF0000" d="M238.325,276.045c-0.068,0.137-0.136,0.274-0.204,0.411c0.001-0.003,0.003-0.006,0.004-0.009 C238.192,276.313,238.259,276.179,238.325,276.045z"/> <path fill="#FF0000" d="M238.392,275.911c-0.022,0.045-0.044,0.09-0.067,0.134C238.348,276,238.37,275.956,238.392,275.911 C238.392,275.911,238.392,275.911,238.392,275.911z"/> <path fill="#FF0000" d="M249.325,256.952c0.01-0.015,0.02-0.03,0.029-0.045c-0.185,0.284-0.375,0.564-0.559,0.849 c0.001-0.001,0.002-0.003,0.003-0.004C248.971,257.483,249.15,257.22,249.325,256.952z"/> <path fill="#FF0000" d="M240.267,272.304c-0.112,0.211-0.224,0.423-0.335,0.634c0.003-0.005,0.006-0.011,0.009-0.016 C240.049,272.716,240.158,272.51,240.267,272.304z"/> <path fill="#FF0000" d="M240.484,271.892c-0.073,0.137-0.145,0.275-0.217,0.412c0.074-0.141,0.148-0.282,0.223-0.423 C240.488,271.885,240.486,271.889,240.484,271.892z"/> <path fill="#FF0000" d="M244.925,264.021c-0.263,0.442-0.526,0.884-0.786,1.328c-0.002,0.003-0.004,0.007-0.006,0.01 c0.265-0.454,0.534-0.905,0.803-1.357C244.933,264.009,244.929,264.015,244.925,264.021z"/> <path fill="#FF0000" d="M242.206,268.745c-0.08,0.143-0.161,0.286-0.24,0.43c0.002-0.004,0.005-0.008,0.007-0.013 C242.05,269.022,242.128,268.884,242.206,268.745z"/> <path fill="#FF0000" d="M242.665,267.923c-0.154,0.273-0.307,0.548-0.459,0.822c0.156-0.278,0.311-0.557,0.467-0.835 C242.67,267.914,242.668,267.918,242.665,267.923z"/> <path fill="#FF0000" d="M305.178,200.157c-10.641,7.188-20.551,15.374-29.6,24.422c-9.048,9.048-17.233,18.959-24.421,29.599 c7.188-10.64,15.374-20.551,24.422-29.599S294.538,207.345,305.178,200.157z"/> <path fill="#00FF00" d="M612.937,325.693c-2.664-13.02-6.593-25.578-11.653-37.543c-5.061-11.963-11.252-23.333-18.44-33.973 c-7.188-10.64-15.373-20.551-24.421-29.599c-9.049-9.048-18.959-17.233-29.6-24.422c-6.466-4.368-13.204-8.362-20.179-11.964 C508.871,192.101,509,196.035,509,200c0,13.807-1.399,27.288-4.063,40.307s-6.593,25.578-11.653,37.542 c-5.061,11.963-11.252,23.333-18.44,33.973c-7.188,10.64-15.373,20.551-24.421,29.6c-9.049,9.048-18.959,17.232-29.6,24.421 c-6.785,4.584-13.869,8.758-21.212,12.496c-4.173,2.124-8.426,4.111-12.761,5.944c-11.964,5.061-24.523,8.989-37.543,11.653 S322.807,400,309,400s-27.288-1.399-40.307-4.063s-25.578-6.593-37.542-11.653c-4.694-1.985-9.292-4.15-13.794-6.477 c0.565,9.7,1.808,19.219,3.707,28.5c2.664,13.02,6.593,25.578,11.653,37.543c5.061,11.963,11.251,23.332,18.44,33.973 c7.188,10.64,15.374,20.551,24.421,29.6c9.049,9.048,18.959,17.232,29.6,24.421c10.64,7.188,22.009,13.38,33.973,18.44 s24.522,8.989,37.542,11.653C389.713,564.601,403.193,566,417,566s27.287-1.399,40.308-4.063 c13.02-2.664,25.578-6.593,37.542-11.653s23.333-11.252,33.973-18.44c10.641-7.188,20.551-15.373,29.6-24.421 c9.048-9.049,17.232-18.96,24.421-29.6c7.188-10.641,13.38-22.01,18.44-33.973c5.061-11.965,8.989-24.523,11.653-37.543 S617,379.807,617,366S615.601,338.713,612.937,325.693z"/> <path fill="#FF0000" d="M217.236,375.655c0.039,0.718,0.078,1.436,0.12,2.151c-0.096-1.652-0.165-3.311-0.223-4.972 C217.166,373.775,217.192,374.718,217.236,375.655z"/> <path fill="#FF0000" d="M217.087,371.557C217.034,369.711,217,367.858,217,366C217,367.859,217.035,369.71,217.087,371.557z"/> <path fill="#FF0000" d="M217.092,371.857c0.003,0.102,0.008,0.203,0.012,0.306c0.007,0.225,0.022,0.447,0.03,0.672 c-0.015-0.427-0.035-0.852-0.047-1.278C217.09,371.657,217.089,371.758,217.092,371.857z"/> <path fill="#FF0000" d="M217.236,375.655c0.034,0.719,0.078,1.435,0.12,2.151l0,0C217.314,377.091,217.275,376.373,217.236,375.655 z"/> <path fill="#F7931E" d="M242.665,267.923c-0.232,0.412-0.463,0.825-0.692,1.239C242.202,268.748,242.433,268.335,242.665,267.923z" /> <path fill="#F7931E" d="M247.235,260.23c-0.272,0.437-0.548,0.871-0.817,1.31C246.687,261.101,246.963,260.667,247.235,260.23z"/> <path fill="#F7931E" d="M249.325,256.952c-0.174,0.268-0.354,0.531-0.526,0.799C248.971,257.483,249.15,257.22,249.325,256.952z"/> <path fill="#F7931E" d="M240.484,271.892c-0.183,0.342-0.363,0.687-0.543,1.03C240.121,272.579,240.301,272.234,240.484,271.892z" /> <path fill="#F7931E" d="M244.925,264.021c-0.263,0.442-0.526,0.884-0.786,1.328C244.399,264.905,244.663,264.463,244.925,264.021z" /> <path fill="#F7931E" d="M238.392,275.911c-0.09,0.178-0.177,0.357-0.267,0.536C238.215,276.269,238.302,276.089,238.392,275.911z" /> <path fill="#FF0000" d="M506.353,187.036c0.763,0.382,1.526,0.762,2.283,1.153C507.879,187.797,507.115,187.417,506.353,187.036z" /> <path fill="#FF0000" d="M376.693,170.063c9.765-1.998,19.788-3.285,30.015-3.803C396.481,166.779,386.458,168.065,376.693,170.063 c-13.021,2.664-25.579,6.593-37.543,11.653c-0.051,0.021-0.102,0.045-0.152,0.066c0.052-0.021,0.102-0.045,0.152-0.066 C351.115,176.657,363.674,172.728,376.693,170.063z"/> <path fill="#FF0000" d="M502.663,185.234c0.677,0.322,1.353,0.646,2.025,0.975C504.016,185.88,503.341,185.556,502.663,185.234z"/> <path fill="#C69C6D" d="M450.422,341.422c9.048-9.049,17.232-18.96,24.421-29.6c7.188-10.641,13.38-22.01,18.44-33.973 c5.061-11.964,8.989-24.522,11.653-37.542S509,213.807,509,200c0-3.965-0.129-7.899-0.356-11.808 c-0.003-0.001-0.005-0.002-0.008-0.004c-0.757-0.391-1.521-0.771-2.283-1.153c-0.554-0.277-1.107-0.555-1.664-0.827 c-0.673-0.329-1.349-0.653-2.025-0.975c-0.741-0.352-1.486-0.7-2.233-1.043c-0.533-0.246-1.066-0.493-1.604-0.734 c-1.318-0.592-2.643-1.175-3.977-1.74c-11.964-5.06-24.522-8.989-37.542-11.653C444.287,167.399,430.807,166,417,166 c-3.451,0-6.883,0.087-10.292,0.26c-10.227,0.519-20.25,1.805-30.015,3.803c-13.02,2.664-25.578,6.593-37.543,11.653 c-0.051,0.021-0.101,0.045-0.152,0.066c-1.361,0.578-2.716,1.171-4.062,1.777c-0.552,0.249-1.098,0.508-1.646,0.762 c-0.834,0.385-1.668,0.77-2.496,1.166c-0.682,0.327-1.357,0.663-2.035,0.997c-0.672,0.331-1.344,0.661-2.012,1 c-0.765,0.388-1.524,0.783-2.283,1.18c-0.561,0.293-1.119,0.586-1.677,0.885c-0.827,0.443-1.65,0.892-2.471,1.346 c-0.464,0.257-0.926,0.516-1.388,0.776c-0.888,0.501-1.773,1.006-2.652,1.521c-0.363,0.212-0.723,0.427-1.084,0.641 c-0.955,0.566-1.908,1.137-2.854,1.719c-0.236,0.145-0.471,0.294-0.706,0.44c-1.05,0.652-2.095,1.309-3.132,1.979 c1.113,0.72,2.225,1.445,3.322,2.187c10.64,7.188,20.551,15.374,29.6,24.422c9.048,9.048,17.232,18.959,24.422,29.599 c7.188,10.64,13.379,22.009,18.439,33.973c5.061,11.965,8.989,24.523,11.653,37.543S400,352.193,400,366 c0,4.146-0.142,8.257-0.39,12.339c7.343-3.738,14.427-7.912,21.212-12.496C431.463,358.654,441.373,350.47,450.422,341.422z"/> </g> <g id="Layer_3"> <path fill="#FF0000" d="M294.189,189.536c0.846,0.453,1.688,0.912,2.527,1.376C295.878,190.448,295.036,189.989,294.189,189.536z" /> <path fill="#FF0000" d="M290.236,187.475c0.782,0.396,1.559,0.801,2.336,1.207C291.795,188.276,291.019,187.871,290.236,187.475z" /> <path fill="#FF0000" d="M116.819,184.075c0.479-0.22,0.958-0.439,1.439-0.656C117.777,183.635,117.298,183.855,116.819,184.075z"/> <path fill="#FF0000" d="M286.193,185.481c0.701,0.336,1.396,0.681,2.094,1.025C287.59,186.163,286.895,185.817,286.193,185.481z"/> <path fill="#FF0000" d="M298.037,191.651c0.909,0.512,1.815,1.03,2.715,1.556C299.852,192.682,298.947,192.164,298.037,191.651z"/> <path fill="#FF0000" d="M282.056,183.557c0.574,0.259,1.141,0.528,1.712,0.792C283.197,184.085,282.629,183.815,282.056,183.557z" /> <path fill="#FF0000" d="M112.732,186c0.56-0.272,1.123-0.537,1.686-0.804C113.855,185.463,113.292,185.728,112.732,186z"/> <path fill="#FF0000" d="M277.849,181.717c0.102,0.043,0.203,0.089,0.305,0.133C278.052,181.807,277.952,181.76,277.849,181.717 c-11.963-5.06-24.521-8.989-37.541-11.653c-2.848-0.583-5.722-1.094-8.613-1.554c2.891,0.46,5.765,0.971,8.613,1.554 C253.327,172.728,265.885,176.657,277.849,181.717z"/> <path fill="#FF0000" d="M159.693,170.063c2.848-0.583,5.722-1.094,8.613-1.554C165.415,168.97,162.541,169.48,159.693,170.063 c-13.02,2.664-25.579,6.593-37.542,11.653c-0.019,0.008-0.038,0.017-0.058,0.025c0.02-0.008,0.039-0.017,0.058-0.025 C134.115,176.657,146.673,172.728,159.693,170.063z"/> <path fill="#FF0000" d="M301.76,193.803c0.98,0.582,1.96,1.167,2.931,1.765C303.719,194.97,302.741,194.384,301.76,193.803z"/> <path fill="#FF0000" d="M399.884,372.498c-0.065,1.946-0.155,3.887-0.272,5.819C399.729,376.385,399.821,374.445,399.884,372.498z" /> <path fill="#FF0000" d="M251.157,254.178c7.188-10.64,15.374-20.551,24.422-29.599s18.959-17.233,29.599-24.422 c1.097-0.741,2.205-1.464,3.316-2.183c0.002-0.001,0.004-0.002,0.006-0.003c1.113,0.72,2.225,1.445,3.322,2.187 c-2.147-1.451-4.332-2.849-6.537-4.218c1.076,0.668,2.15,1.343,3.214,2.031c-1.113,0.72-2.225,1.445-3.323,2.187 c-10.639,7.188-20.552,15.374-29.6,24.422s-17.236,18.959-24.425,29.599c-0.662,0.98-1.307,1.973-1.952,2.965 c0.042-0.063,0.084-0.126,0.125-0.19C249.93,256.023,250.537,255.096,251.157,254.178z"/> <path fill="#FF0000" d="M350.168,233.918c-2.819-3.203-5.73-6.323-8.746-9.339c-9.049-9.048-18.959-17.233-29.6-24.422 c10.64,7.188,20.551,15.374,29.6,24.422C344.438,227.595,347.348,230.715,350.168,233.918z"/> <path fill="#FF0000" d="M247.241,260.222c0.514-0.824,1.028-1.648,1.554-2.464C248.269,258.573,247.755,259.398,247.241,260.222z" /> <path fill="#FF0000" d="M399.9,372.068c0.06-2.017,0.1-4.037,0.1-6.068C400,368.031,399.964,370.053,399.9,372.068z"/> <path fill="#FF0000" d="M242.681,267.896c0.479-0.848,0.961-1.693,1.452-2.534C243.642,266.202,243.159,267.047,242.681,267.896z" /> <path fill="#FF0000" d="M246.418,261.54c-0.504,0.821-0.998,1.647-1.49,2.477c0.711-1.197,1.434-2.385,2.169-3.565 C246.871,260.813,246.642,261.175,246.418,261.54z"/> <path fill="#FF0000" d="M239.94,272.922c-0.523,0.992-1.042,1.987-1.548,2.989c-0.025,0.049-0.049,0.098-0.073,0.147 c0.665-1.315,1.343-2.622,2.035-3.92C240.216,272.399,240.078,272.661,239.94,272.922z"/> <path fill="#FF0000" d="M238.294,276.108c0.008-0.017,0.017-0.034,0.025-0.05C238.311,276.075,238.303,276.092,238.294,276.108z"/> <path fill="#FF0000" d="M238.125,276.447c-0.14,0.279-0.274,0.562-0.413,0.843c0.195-0.393,0.383-0.79,0.581-1.182 C238.238,276.221,238.182,276.334,238.125,276.447z"/> <path fill="#FF0000" d="M234.667,283.692c-0.334,0.739-0.651,1.487-0.977,2.231c0.405-0.922,0.804-1.848,1.224-2.764 C234.833,283.338,234.748,283.514,234.667,283.692z"/> <path fill="#FF0000" d="M234.914,283.16c0.183-0.4,0.37-0.797,0.556-1.195C235.284,282.363,235.098,282.761,234.914,283.16z"/> <path fill="#FF0000" d="M217.092,371.857C217.033,369.912,217,367.959,217,366c0-13.807,1.399-27.287,4.063-40.307 s6.593-25.578,11.653-37.543c0.316-0.746,0.649-1.484,0.974-2.227c-0.326,0.744-0.669,1.479-0.985,2.227 c-5.06,11.965-9,24.523-11.665,37.543s-4.086,26.5-4.086,40.307c0,1.96,0.046,3.911,0.046,5.857c0,0.001,0,0.002,0,0.004 c0,0.091,0.054,0.182,0.056,0.272c0,0.01,0.024,0.02,0.024,0.029c0.057,1.889,0.167,3.769,0.276,5.644 c-0.109-1.875-0.192-3.756-0.253-5.644C217.1,372.061,217.095,371.959,217.092,371.857z"/> <path fill="#FF0000" d="M235.47,281.965c0.731-1.567,1.474-3.129,2.243-4.675C236.945,278.837,236.201,280.396,235.47,281.965z"/> <path fill="#FF0000" d="M241.973,269.162c-0.501,0.904-0.998,1.812-1.486,2.725c0.513-0.96,1.036-1.914,1.563-2.864 C242.024,269.069,241.999,269.115,241.973,269.162z"/> <path fill="#FF0000" d="M109.39,187.661c0,0.003,0,0.006,0,0.009c0.107-0.054,0.211-0.113,0.318-0.167 C109.603,187.556,109.496,187.607,109.39,187.661z"/> <path fill="#0000FF" d="M275.578,507.422c-9.048-9.049-17.233-18.96-24.421-29.6c-7.188-10.641-13.379-22.01-18.44-33.973 c-5.06-11.965-8.989-24.523-11.653-37.543c-1.899-9.281-3.142-18.8-3.707-28.5c-6.974-3.602-13.713-7.596-20.179-11.964 c-10.64-7.188-20.551-15.373-29.599-24.421c-9.048-9.049-17.233-18.96-24.422-29.6c-7.188-10.641-13.379-22.01-18.44-33.973 c-5.06-11.964-8.989-24.522-11.653-37.542S109,213.807,109,200c0-4.142,0.142-8.25,0.39-12.33 c-7.341,3.737-14.428,7.904-21.212,12.486c-10.641,7.188-20.551,15.374-29.6,24.422c-9.048,9.048-17.233,18.959-24.421,29.599 c-7.188,10.64-13.379,22.009-18.44,33.973c-5.06,11.965-8.989,24.523-11.653,37.543S0,352.193,0,366s1.399,27.287,4.063,40.307 s6.593,25.578,11.653,37.543c5.061,11.963,11.251,23.332,18.44,33.973c7.188,10.64,15.374,20.551,24.421,29.6 c9.049,9.048,18.959,17.232,29.6,24.421c10.64,7.188,22.009,13.38,33.973,18.44s24.522,8.989,37.542,11.653 C172.713,564.601,186.193,566,200,566s27.287-1.399,40.308-4.063c13.02-2.664,25.578-6.593,37.542-11.653 c10.729-4.538,20.975-9.993,30.65-16.254c-1.113-0.721-2.225-1.444-3.322-2.187C294.537,524.654,284.627,516.47,275.578,507.422z" /> <path fill="#FF0000" d="M305.178,531.843c1.098,0.742,2.209,1.466,3.322,2.187l0,0C307.387,533.31,306.275,532.585,305.178,531.843 z"/> <path fill="#00FFFF" d="M311.822,531.843c10.641-7.188,20.551-15.373,29.6-24.421c9.048-9.049,17.232-18.96,24.421-29.6 c7.188-10.641,13.38-22.01,18.44-33.973c5.061-11.965,8.989-24.523,11.653-37.543c1.864-9.111,3.094-18.451,3.674-27.968 c-4.173,2.124-8.426,4.111-12.761,5.944c-11.964,5.061-24.523,8.989-37.543,11.653S322.807,400,309,400s-27.288-1.399-40.307-4.063 s-25.578-6.593-37.542-11.653c-4.694-1.985-9.292-4.15-13.794-6.477c0.565,9.7,1.808,19.219,3.707,28.5 c2.664,13.02,6.593,25.578,11.653,37.543c5.061,11.963,11.251,23.332,18.44,33.973c7.188,10.64,15.374,20.551,24.421,29.6 c9.049,9.048,18.959,17.232,29.6,24.421c1.098,0.742,2.209,1.467,3.322,2.187C309.613,533.31,310.725,532.585,311.822,531.843z"/> <path fill="#00A99D" d="M268.693,395.937c13.02,2.664,26.5,4.063,40.307,4.063s27.287-1.399,40.307-4.063 s25.579-6.593,37.543-11.653c2.034-0.86,4.048-1.757,6.047-2.684c0.004-0.002,0.008-0.003,0.011-0.005 c0.941-0.45,1.904-0.909,2.899-1.374c0.028-0.014,0.057-0.027,0.085-0.041c1.246-0.603,2.487-1.214,3.719-1.841 c0.132-0.067,0.26-0.14,0.391-0.206c0.001-1.872,0.014-3.75,0.077-5.635c0.005-0.144-0.084-0.286-0.08-0.43 c0.062-2.016,0.051-4.037,0.051-6.068c0-13.807-1.424-27.287-4.088-40.307s-6.605-25.578-11.666-37.543 c-1.266-2.99-2.606-5.944-4.011-8.859c-4.214-8.743-9.047-17.133-14.438-25.113c-4.793-7.093-10.038-13.854-15.677-20.26 c-2.819-3.203-5.73-6.323-8.747-9.339c-9.048-9.048-18.959-17.233-29.6-24.422c-1.098-0.742-2.209-1.466-3.322-2.187 c-0.002,0.001-0.004,0.002-0.006,0.003c-1.111,0.719-2.22,1.442-3.316,2.183c-10.64,7.188-20.551,15.374-29.599,24.422 s-17.233,18.959-24.422,29.599c-0.62,0.918-1.227,1.846-1.832,2.774c-0.042,0.064-0.083,0.127-0.125,0.19 c-0.134,0.206-0.271,0.409-0.405,0.615c-0.526,0.816-1.04,1.641-1.554,2.464c-0.048,0.076-0.095,0.152-0.143,0.229 c-0.227,0.362-0.456,0.724-0.68,1.089c-0.504,0.821-0.998,1.647-1.49,2.477c-0.266,0.448-0.533,0.895-0.795,1.345 c-0.491,0.84-0.974,1.686-1.452,2.534c-0.211,0.375-0.421,0.75-0.63,1.127c-0.026,0.046-0.052,0.093-0.078,0.139 c-0.501,0.904-0.998,1.812-1.486,2.725c-0.044,0.083-0.088,0.168-0.133,0.251c-0.138,0.261-0.276,0.522-0.414,0.784 c-0.523,0.992-1.042,1.987-1.548,2.989c-0.09,0.178-0.177,0.358-0.267,0.536c-1.198,2.389-2.354,4.803-3.458,7.245 c-0.667,1.477-1.317,2.963-1.95,4.458c-5.06,11.965-8.989,24.523-11.653,37.543S217,352.193,217,366 c0,1.959,0.033,3.912,0.092,5.857c0.003,0.102,0.008,0.203,0.012,0.306c0.061,1.888,0.144,3.769,0.253,5.644 c4.502,2.326,9.101,4.491,13.794,6.477C243.115,389.344,255.673,393.272,268.693,395.937z"/> <path fill="#00A99D" d="M400.001,378.133L400.001,378.133c-0.131,0.066-0.259,0.139-0.391,0.206 C399.742,378.271,399.87,378.199,400.001,378.133z"/> <path fill="#00A99D" d="M395.88,380.186c0.004-0.002,0.008-0.004,0.012-0.006c-0.028,0.014-0.057,0.027-0.085,0.041 C395.832,380.208,395.854,380.197,395.88,380.186z"/> <polygon fill="#00A99D" points="392.903,381.597 392.907,381.595 392.896,381.6 	"/> <path fill="#00A99D" d="M386.85,384.283c2.034-0.86,4.049-1.757,6.047-2.684C390.897,382.526,388.884,383.423,386.85,384.283z"/> <path fill="#00A99D" d="M392.903,381.597c-0.002,0.001-0.005,0.002-0.007,0.003c-1.998,0.927-4.013,1.823-6.047,2.684 c-11.964,5.061-24.523,8.989-37.543,11.653c13.02-2.664,25.773-6.593,37.738-11.653 C389.082,383.422,390.964,382.524,392.903,381.597z"/> <path fill="#00A99D" d="M395.892,380.18c1.246-0.603,2.487-1.214,3.719-1.841C398.379,378.966,397.138,379.577,395.892,380.18z"/> <path fill="#00A99D" d="M400,378.339c0-0.007,0-0.015,0-0.021c0-0.062,0.001-0.123,0.001-0.185 c-0.131,0.066-0.259,0.139-0.391,0.206c-1.231,0.627-2.473,1.238-3.719,1.841c-0.004,0.002-0.008,0.004-0.012,0.006 C397.171,379.582,398.521,378.967,400,378.339z"/> <path fill="#FFFF00" d="M217.056,372.134c-0.002-0.091-0.056-0.182-0.056-0.272c0-0.002,0-0.003,0-0.004 c0-1.946-0.046-3.897-0.046-5.857c0-13.807,1.422-27.287,4.086-40.307s6.605-25.578,11.665-37.543 c2.313-5.468,4.875-10.805,7.649-16.012c0.043-0.082,0.086-0.165,0.13-0.246c0.001-0.002,0.002-0.003,0.003-0.005 c0.513-0.96,1.036-1.914,1.563-2.864c0.204-0.367,0.409-0.734,0.615-1.1c0.005-0.009,0.011-0.018,0.016-0.027 c0.479-0.848,0.961-1.693,1.452-2.534c0.002-0.004,0.004-0.008,0.007-0.012c0.26-0.444,0.523-0.886,0.786-1.328 c0.001-0.001,0.002-0.003,0.003-0.005c0.711-1.197,1.434-2.385,2.169-3.565c0.046-0.074,0.092-0.147,0.138-0.221 c0.002-0.003,0.003-0.005,0.005-0.008c0.515-0.824,1.028-1.649,1.554-2.464c0.001-0.002,0.002-0.004,0.004-0.006 c0.131-0.204,0.267-0.406,0.401-0.609c0.645-0.992,1.29-1.985,1.952-2.965c7.188-10.64,15.376-20.551,24.425-29.599 s18.961-17.233,29.6-24.422c1.099-0.742,2.21-1.466,3.323-2.187c-1.063-0.688-2.138-1.363-3.214-2.031 c-0.199-0.123-0.396-0.249-0.595-0.371c-0.971-0.598-1.95-1.184-2.931-1.765c-0.336-0.199-0.67-0.398-1.008-0.595 c-0.899-0.526-1.806-1.044-2.715-1.556c-0.439-0.248-0.879-0.494-1.32-0.739c-0.839-0.464-1.682-0.923-2.527-1.376 c-0.537-0.288-1.077-0.571-1.617-0.854c-0.777-0.406-1.554-0.811-2.336-1.207c-0.646-0.328-1.299-0.648-1.949-0.969 c-0.697-0.344-1.393-0.689-2.094-1.025c-0.805-0.385-1.615-0.758-2.426-1.133c-0.571-0.264-1.138-0.533-1.712-0.792 c-1.293-0.583-2.594-1.151-3.902-1.707c-0.102-0.043-0.203-0.09-0.305-0.133c-11.964-5.06-24.522-8.989-37.542-11.653 c-2.848-0.583-5.722-1.094-8.613-1.554C221.37,166.865,210.787,166,200,166s-21.37,0.865-31.694,2.509 c-2.891,0.46-5.765,0.971-8.613,1.554c-13.02,2.664-25.578,6.593-37.542,11.653c-0.02,0.008-0.039,0.017-0.058,0.025 c-1.286,0.544-2.562,1.107-3.834,1.678c-0.481,0.216-0.96,0.436-1.439,0.656c-0.804,0.368-1.603,0.743-2.401,1.121 c-0.562,0.267-1.126,0.532-1.686,0.804c-1.013,0.492-2.021,0.994-3.024,1.503c-0.105,0.053-0.212,0.104-0.318,0.158 c-0.249,4.083-0.39,8.194-0.39,12.339c0,13.807,1.399,27.288,4.063,40.307s6.593,25.578,11.653,37.542 c5.061,11.963,11.252,23.333,18.44,33.973c7.188,10.64,15.374,20.551,24.422,29.6c9.048,9.048,18.959,17.232,29.599,24.421 c6.466,4.368,13.205,8.362,20.179,11.964c-0.109-1.875-0.219-3.755-0.276-5.644C217.08,372.153,217.057,372.144,217.056,372.134z" /> <path fill="#FF0000" d="M248.798,257.751c-0.001,0.002-0.002,0.004-0.004,0.006c0.133-0.207,0.271-0.409,0.405-0.615 C249.065,257.346,248.93,257.547,248.798,257.751z"/> <path fill="#FF0000" d="M244.925,264.021c-0.263,0.442-0.526,0.884-0.786,1.328c-0.002,0.004-0.005,0.008-0.007,0.012 c0.263-0.45,0.529-0.897,0.795-1.345C244.927,264.018,244.926,264.02,244.925,264.021z"/> <path fill="#FF0000" d="M247.235,260.23c-0.046,0.074-0.092,0.147-0.138,0.221c0.048-0.077,0.095-0.153,0.143-0.229 C247.239,260.225,247.237,260.228,247.235,260.23z"/> <path fill="#FF0000" d="M240.484,271.892c-0.043,0.082-0.086,0.164-0.13,0.246c0.044-0.083,0.088-0.168,0.133-0.251 C240.486,271.889,240.485,271.89,240.484,271.892z"/> <path fill="#FF0000" d="M242.665,267.923c-0.206,0.366-0.411,0.732-0.615,1.1c0.209-0.376,0.419-0.752,0.63-1.127 C242.676,267.905,242.67,267.914,242.665,267.923z"/> </g> <g id="Layer_1_copy"> <path opacity="0.53" fill="#FF0000" d="M217,366c0,1.961,0.036,3.914,0.092,5.861C217.033,369.915,217,367.961,217,366z"/> <path opacity="0.53" fill="#FF0000" d="M217.356,377.807c-0.11-1.885-0.194-3.775-0.254-5.673 C217.16,374.031,217.247,375.922,217.356,377.807L217.356,377.807z"/> <path fill="#FF0000" d="M504.937,159.693c-2.664-13.02-6.593-25.578-11.653-37.542s-11.252-23.333-18.44-33.973 c-7.188-10.64-15.373-20.551-24.421-29.599c-9.049-9.048-18.959-17.233-29.6-24.422c-10.64-7.188-22.009-13.379-33.973-18.44 c-11.964-5.06-24.523-8.989-37.543-11.653S322.807,0,309,0s-27.288,1.399-40.307,4.063s-25.578,6.593-37.542,11.653 c-11.964,5.061-23.333,11.252-33.973,18.44c-10.64,7.188-20.551,15.374-29.599,24.422s-17.233,18.959-24.422,29.599 c-7.188,10.64-13.379,22.009-18.44,33.973c-5.06,11.964-8.989,24.522-11.653,37.542c-1.864,9.111-3.094,18.452-3.673,27.968 c4.172-2.124,8.426-4.111,12.761-5.944c11.964-5.06,24.522-8.989,37.542-11.653S186.193,166,200,166s27.288,1.399,40.307,4.063 s25.578,6.593,37.542,11.653c10.729,4.538,20.975,9.993,30.651,16.253c9.676-6.26,19.922-11.715,30.65-16.253 c11.965-5.06,24.523-8.989,37.543-11.653S403.193,166,417,166s27.287,1.399,40.308,4.063c13.02,2.664,25.578,6.593,37.542,11.653 c4.693,1.985,9.292,4.15,13.794,6.476C508.079,178.492,506.836,168.974,504.937,159.693z"/> <path fill="#FF00FF" d="M217.056,372.134c-0.002-0.091-0.056-0.182-0.056-0.272c0-0.002,0-0.003,0-0.004 c0-1.946-0.046-3.897-0.046-5.857c0-13.807,1.422-27.287,4.086-40.307s6.605-25.578,11.665-37.543 c5.061-11.963,11.258-23.333,18.446-33.973c7.188-10.64,15.376-20.551,24.425-29.599s18.961-17.233,29.6-24.422 c1.099-0.742,2.21-1.466,3.323-2.187c-9.676-6.26-19.921-11.715-30.65-16.253c-11.964-5.06-24.522-8.989-37.542-11.653 S213.807,166,200,166s-27.288,1.399-40.307,4.063s-25.578,6.593-37.542,11.653c-4.334,1.833-8.588,3.82-12.761,5.944 c-0.249,4.083-0.39,8.194-0.39,12.339c0,13.807,1.399,27.288,4.063,40.307s6.593,25.578,11.653,37.542 c5.061,11.963,11.252,23.333,18.44,33.973c7.188,10.64,15.374,20.551,24.422,29.6c9.048,9.048,18.959,17.232,29.599,24.421 c6.466,4.368,13.205,8.362,20.179,11.964c-0.109-1.875-0.219-3.755-0.276-5.644C217.08,372.153,217.057,372.144,217.056,372.134z" /> <path opacity="0.53" fill="#FFFF00" d="M217,366c0,1.96,0.036,3.911,0.092,5.857C217.036,369.911,217,367.959,217,366z"/> <path opacity="0.53" fill="#FFFF00" d="M217.104,372.163c0.057,1.889,0.144,3.769,0.253,5.644l0,0 C217.247,375.932,217.161,374.051,217.104,372.163z"/> <path opacity="0.53" fill="#FF0000" d="M217.092,371.861c0.003,0.091,0.008,0.182,0.01,0.272c0,0.01,0.001,0.02,0.001,0.029 c-0.003-0.103-0.009-0.204-0.012-0.306C217.092,371.858,217.092,371.859,217.092,371.861z"/> <path fill="#FFFF00" d="M508.644,188.192c-4.502-2.325-9.101-4.49-13.794-6.476c-11.964-5.06-24.522-8.989-37.542-11.653 C444.287,167.399,430.807,166,417,166s-27.287,1.399-40.307,4.063s-25.578,6.593-37.543,11.653 c-10.729,4.538-20.975,9.993-30.65,16.253c1.113,0.72,2.225,1.445,3.322,2.187c10.64,7.188,20.551,15.374,29.6,24.422 c9.048,9.048,17.232,18.959,24.422,29.599c7.188,10.64,13.379,22.009,18.439,33.973c5.061,11.965,8.989,24.523,11.653,37.543 S400,352.193,400,366c0,4.146-0.142,8.257-0.39,12.339c7.343-3.738,14.427-7.912,21.212-12.496 c10.641-7.188,20.551-15.373,29.6-24.421c9.048-9.049,17.232-18.96,24.421-29.6c7.188-10.641,13.38-22.01,18.44-33.973 c5.061-11.964,8.989-24.522,11.653-37.542S509,213.807,509,200C509,196.035,508.871,192.101,508.644,188.192z"/> <path fill="#FFFFFF" d="M395.937,325.693c-2.664-13.02-6.593-25.578-11.653-37.543c-5.061-11.963-11.252-23.333-18.439-33.973 c-7.189-10.64-15.374-20.551-24.422-29.599c-9.049-9.048-18.96-17.233-29.6-24.422c-1.098-0.742-2.209-1.466-3.322-2.187 c-1.113,0.72-2.225,1.445-3.322,2.187c-10.64,7.188-20.551,15.374-29.599,24.422s-17.233,18.959-24.422,29.599 c-7.188,10.64-13.379,22.009-18.44,33.973c-5.06,11.965-8.989,24.523-11.653,37.543S217,352.193,217,366 c0,1.959,0.033,3.912,0.092,5.857c0.003,0.102,0.008,0.203,0.012,0.306c0.061,1.888,0.144,3.769,0.253,5.644 c4.502,2.326,9.101,4.491,13.794,6.477c11.964,5.061,24.522,8.989,37.542,11.653S295.193,400,309,400s27.287-1.399,40.307-4.063 s25.579-6.593,37.543-11.653c4.335-1.833,8.588-3.82,12.761-5.944c0.248-4.082,0.39-8.193,0.39-12.339 C400,352.193,398.601,338.713,395.937,325.693z"/> <path opacity="0.53" fill="#FF0000" d="M217.102,372.134c-0.002-0.091-0.007-0.182-0.01-0.272 C217.095,371.952,217.1,372.043,217.102,372.134z"/> <path opacity="0.53" fill="#FF0000" d="M308.5,197.97L308.5,197.97c-1.113,0.72-2.225,1.445-3.322,2.187 C306.275,199.415,307.387,198.69,308.5,197.97z"/> </g> </svg>', home_set);


// CODE text
var code_text = "I am a self-taught programmer extremely interested in aesthetic computation.<br><br>Presently, I am most interested in artificial life, machine learning, computer vision, visualizing massive data-sets and leveraging the concept of Photography as it is evaluated in digital form.<br><br>Most of my recent software is under NDA with Affectiva, Inc."
var code_website = "This project holds the source-code to this website.";
var code_sicp = "I am currently going through the SICP Exercises in order to learn how to be a better programmer.<br><br>This repo contains my answers in Scheme / Lisp.";
var code_splicer = "An Adobe AIR application I developed to pixel-splice consecutive image frames into one integrated image.<br><br>This was the application I wrote in order to create my images for my MFA thesis at SVA in early 2007.";
var code_atlantis = "A Java-port of nano-pond. This is a Java-based digital life incubator.";
var code_pychop = "A python wrapper for Houdini to make it easier to code from an external IDE.<br><br>This was mainly to facilitate an easier means of creating and rendering 3d objects within Houdini using its Python interface.";
var code_ocolor = "This is a C++ color library for openFrameworks ported from toxi's java library.";
var code_clarendon = "A multi-threaded, HTML5 Websocket implementation in both Java and Python.<br><br>It uses protocol 76 for its handshaking."

// TEXT text
var text_text = "Stuff I wrote.";
var text_capularis = "An abstract play about machines, memories, and an Unknown Violent Event.";
var text_caught = "A noir play about Poker and paralysis.";
var text_staples = "Surgeons dealing in black-market organs try to accept what it means to be human in a consumer society run amok.";
var text_thesis = "My MFA thesis documenting the 'In Potentia' project. This includes a full explanation of the concept of pixel-splicing, and the software I developed to implement it.";
var text_trauma = "A sci-fi reimagining of a Brother's Grimm tale called 'the Robber Bridegroom'.";
var text_morituri = "An abstract modern-day Western set near Death Valley about a man & his wife, facing his past and her future.";
var text_gauze = "Two WWII vets in post-war 1950's keep a car-accident victim hostage in the basement as a talisman of their own post-traumatic scarring.";

// IMAGE text
var image_text = "My interest in photography comes from a desire to push the bounderies of what is expected and possible in photographs and digital images. <br><br>This could be subverting the optical effect of a camera lens, pushing film beyond its capabilities, seamless digital manipulation - or more recently - using artificial life to transform and subvert our idea of what it means to be a digital image. <br><br>The pixel represents the volatility of the moment within the continuum of the screen. It is dynamic and timeless, smoothly transitioning through data states as effortlessly as it maneuvers through the space of the screen, as the screen, and for the screen.";
var image_amerika = "This series of images depict the paranoia and isolationism seeping into american culture. <br><br>It is ironic to me that the desire to be seen has also become just as prevalent with Twitter and Facebook in our disembodied digital culture.";
var image_olympia = "Who we are:<br><br>alienated, dehumanized, emotionally amputated.<br><br><br><br>yes even you";
var image_plasticity = "Depictions of industrialized bodies and globalized minds where the question 'what are you hiding?' replaces 'what do you know?'";
var image_portrait = "Personal Images.<br><br>squandered potential<br>misguided love<br>my skin is latex<br>my body, biomechanic";
var image_potentia = "In this series I take the first proto-films from Edison, Lumiere, LePrince, et al and pixel-splice them into one integrated image.<br><br>Pixel-splicing is a technique I devised that comprehensively integrates all of the frames of a proto-film into an image.<br><br>As a result, the image contains content information from every frame. This is different from a more traditional photoshop approach of layering the frames over each other.<br><br>Please see the text <em>'In Potentia'</em> for a more technical and critical analysis.";
var image_uncanny = "This series uses ordinary household objects to conflate the still-life, the landscape and the portrait into one image.<br><br>Everything you see is done 'in-camera'. No digital manipulation was used to create these pictures.<br><br>By juxtaposing hardware into a landscape, I suggest a fruitful symbiosis between nature and the constructed, the digital and the analog, truth as we see it & truth as we know it.";

// VIDEO text
var video_b41 = "This piece is a semi-literate, mostly abstract, somewhat amateurish critical exploration into the history of 'indexical reproduction'.";
var video_behind = "This video was supposed to be my pre-thesis year summary analysis of my work so far (in 2007).<br><br>However, ironically the motherboard on my computer fried the day before my presentation, resulting in a shorter, more traditional, more reliable paper-based report.<br><br>The title references the POST sequence that computers run to check themselves for hardware failure.";
var video_heart = "Louis LePrince's Roundhay Garden (1888) is credited as the earliest motion picture.<br><br>This single-channel video divides the frame into 'zones' - one zone per frame. Each zone is set to its relative frame. For example, the second zone is set to frame #2, the third zone to frame #3, etc.<br><br>The film is begun and the individual frames cycle through the sum of all frames from their respective starting point.";
var video_plasticity = "A short film produced in 2000. Directed by Brian Forrest. Screenplay co-written by Oliver Nowak from the original play by Oliver Nowak.";
var video_reel = "An exploration of the liminal space between the still-image and the motion-picture.<br><br>Not quite a screen-saver, not quite a single-channel video, not quite a still-image: these pieces exist on the fringe of the digital medium as evidence of its plasticity.";

function navAboutHome()
{
	about_set.animate({opacity: 0.0},
					  100,
					  ">");
					  
	home_set.animate({opacity: 1.0}, 
					100,
					">");
					  
	$("#_about_strat").css("display", "none");
	$("#_about_strat").animate({opacity: 0.0},
								100);
														 
	$("#_home_strat").animate({opacity: 1.0},
							 100);	
							 
	$("#twitter_container").animate({opacity:1.0}, 100);							 
							 
	resetAll();							
}

function navCodeHome()
{
	sSetA.animate({opacity: 0.0, translation: "265 0"}, 
					100,
					">");
					
	sSetB.animate({opacity: 0.0, translation: "-265 0"},
					100,
					">");

	code_set.animate({opacity: 0.0},
					100,
					">",
					resetCode);
					
	home_set.animate({opacity: 1.0},
					100,
					">",
					resetSieve);
					
	$("#_code_strat").css("display", "none");
	$("#_code_strat").animate({opacity: 0.0},
								100);
								
	$("#_home_strat").animate({opacity: 1.0},
							 100);	
							 
	$("#twitter_container").animate({opacity:1.0}, 100);								 	
							 
	resetAll();					
}

function navTextHome()
{
	sSetA.animate({opacity: 0.0, translation: "265 0"},
					100,
					">");
					
	sSetB.animate({opacity: 0.0, translation: "-265 0"},
					100,
					">");
					
	text_set.animate({opacity: 0.0},
					100,
					">",
					resetText);
					
	home_set.animate({opacity: 1.0},
					100,
					">",
					resetSieve);
					
	$("#_text_strat").css("display", "none");
	$("#_text_strat").animate({opacity: 0.0},
								100);
								
	$("#_home_strat").animate({opacity: 1.0},
							 100);	
							 
	$("#twitter_container").animate({opacity:1.0}, 100);								 	
							 
	resetAll();			
}

function navImageHome()
{
	sSetA.animate({opacity: 0.0, translation: "265 0"},
					100,
					">");
					
	sSetB.animate({opacity: 0.0, translation: "-265 0"},
					100,
					">");
					
	image_set.animate({opacity: 0.0}, 
						100,
						">");
				
	if (imageNav_set != null) {		
		imageNav_set.animate({opacity: 0.0},
								100,
								">",
								resetImage);
	}
						
	home_set.animate({opacity: 1.0},
						100,
						">",
						resetSieve);
						
	$("#_image_strat").css("display", "none");
	$("#_image_strat").animate({opacity: 0.0},
								100);
								
	$("#_home_strat").animate({opacity: 1.0},
								100);
								
	$("#twitter_container").animate({opacity:1.0}, 100);									
								
	resetAll();							
}

function navToNewState(current_state, requested_state)
{
	$(this).stop(true);
	$(this).clearQueue();
		
	var old_strat = "";							
	switch(current_state) {
		case 1:
			old_strat = "about";
		break;
		
		case 2:
			old_strat = "code";
		break;
		
		case 3:
			old_strat = "text";
		break;
		
		case 4:
			old_strat = "image";
		break;
	}
	
	$("#_"+ old_strat + "_strat").css("display", "none");
	$("#_"+ old_strat + "_strat").animate({opacity: 0.0},
								100);

	if (sSetA != null && sSetB != null) {
		sSetA.animate({translation: "265 0"},
						100,
						">");
						
		sSetB.animate({translation: "-265 0"},
						100,
						">");	
	
		resetAll();					
	
		sSetA.animate({translation: "-265 0"},
						100,
						">");
						
		sSetB.animate({translation: "265 0"},
						100,
						">");					
	}
	
	var new_strat = "";
	switch(requested_state) {
		case 1:
			selectAbout();
			new_strat = "about";
		break;
		
		case 2:
			selectCode();
			new_strat = "code";
		break;
		
		case 3:
			selectText();
			new_strat = "text";
		break;
		
		case 4:
			selectImage();
			new_strat = "image";
		break;
	}
							
	$("#_"+ new_strat +"_strat").css("display", "block");
	$("#_"+ new_strat +"_strat").animate({opacity:1.0},
									100, 
									clearAnimation);	
}

function clearAnimation()
{
	$(this).stop(true);
	$(this).clearQueue();
}

function selectAbout()
{
	current_state = 1;
	
	if (about_plate == null) {
		about_plate = Raphael(100, 0, 1280, 1280);
	}	
	
	if (about_circle == null) {
		about_circle = about_plate.circle(530, 360, 512);
	}
	
	about_circle.attr("opacity", 0.0);
	about_circle.attr("stroke", "#BF1D28");
	about_circle.attr("stroke-width", "2");

	createMenuNav();
	home_nav.click(navAboutHome);
	
	about_nav.attr("fill", "#BF1D28");
	
	about_set = menu_plate.set();	
	about_set.push(image_nav,
				  code_nav,
				  text_nav,
				  about_nav,
				  home_nav,
				  about_circle
	);	

	about_set.animate({opacity: 1.0},
					  	  250,
					      "<");
}

function selectCode()
{
	current_state = 2;
	
	if (code_plate == null) {
		code_plate = Raphael(100, 0, 1280, 1280);
	}
	
	if (code_circle == null) {
		code_circle = code_plate.circle(530, 360, 512);
	}
	
	code_circle.attr("opacity", 0.0);
	code_circle.attr("stroke", "#BF1D28");
	code_circle.attr("stroke-width", "2");
	
	createMenuNav();
	home_nav.click(navCodeHome);
	
	code_nav.attr("fill", "#FFF")
	        .attr("stroke", "#000");

	code_set = code_plate.set();
	code_set.push(image_nav,
				  code_nav,
				  text_nav,
				  about_nav,
				  home_nav,
				  code_circle
	);
	
	code_set.animate({opacity: 1.0},
					250,
					"<");
					
	if (!isSieveInit) {
		createSieve();		
	}	
	
	renderSieve();
	configureCodeElements();
}

function selectText()
{
	current_state = 3;
	
	if (text_plate == null) {
		text_plate = Raphael(100, 0, 1280, 1280);
	}
	
	if (text_circle == null) {
		text_circle = text_plate.circle(530, 360, 512);	
	}
	
	text_circle.attr("opacity", 0.0);
	text_circle.attr("stroke", "#BF1D28");
	text_circle.attr("stroke-width", "2");
	
	createMenuNav();
	home_nav.click(navTextHome);
	
	text_nav.attr("fill", "#FFF")
			.attr("stroke", "#000");
	
	text_set = text_plate.set();
	text_set.push(image_nav,
				  code_nav,
				  text_nav,
				  about_nav,
				  home_nav,
				  text_circle);
				  
	text_set.animate({opacity: 1.0},
					250,
					"<");
	
	if (!isSieveInit) {
		createSieve();
	}
	
	renderSieve();
	configureTextElements();
}

function selectImage()
{
	current_state = 4;
	currentProject = "image";
	
	if (image_plate == null) {
		image_plate = Raphael(100, 0, 1280, 1280);
	}
	
	if (image_circle == null) {
		image_circle = image_plate.circle(530, 360, 512);
	}
	
	image_circle.attr("opacity", 0.0);
	image_circle.attr("stroke", "#BF1D28");
	image_circle.attr("stroke-width", "2");
	
	createMenuNav();
	home_nav.click(navImageHome);
	
	image_nav.attr("fill", "#FFF")
			 .attr("stroke", "#000");
	
	image_set = image_plate.set();
	image_set.push(image_nav,
				   code_nav,
				   text_nav,
				   about_nav,
				   home_nav,
				   image_circle);
				   
	image_set.animate({opacity: 1.0},
						250,
						"<");
						
	if (imageNav_set != null) {
		imageNav_set.animate({opacity: 1.0},
								250,
								"<");
	}
						
	if (!isSieveInit) {
		createSieve();
	}			   
	
	renderSieve();
	configureImageElements();
}

function configureCodeElements()
{	
	c0.attr("title", "code for this website");
	c0.attr("cursor", "pointer");
	c0.attr("href", "https://github.com/oliver-nowak/website_2011");
	c0.attr("target", "_blank");
	c0.attr("fill", "#0977B2");
	c0.click();
	c0.hover(function(){$("#_code_body").html(code_website);
						$("#_code_header").html("website c.2011");},
			function(){$("#_code_body").html(code_text);
						$("#_code_header").html("code");});
						
	c2.attr("title", "HTML5 Websocket Implementation");
	c2.attr("cursor", "pointer");
	c2.attr("href", "https://github.com/oliver-nowak/clarendon");
	c2.attr("target", "_blank");
	c2.attr("fill", "#0977B2");
	c2.click();
	c2.hover(function(){$("#_code_body").html(code_clarendon);
						$("#_code_header").html("clarendon");},
			function(){$("#_code_body").html(code_text);
						$("#_code_header").html("code");});
	
	c9.attr("title", "code for the SICP Exercises");
	c9.attr("cursor", "pointer");
	c9.attr("href", "https://github.com/oliver-nowak/SICP-Exercises");
	c9.attr("target", "_blank");
	c9.attr("fill", "#0977B2");
	c9.click();
	c9.hover(function(){$("#_code_body").html(code_sicp);
						$("#_code_header").html("SICP Exercises");},
			function(){$("#_code_body").html(code_text);
						$("#_code_header").html("code");});
			
	c16.attr("title", "code for my pixel splicer");
	c16.attr("cursor", "pointer");
	c16.attr("href", "https://github.com/oliver-nowak/pixel_splicer");
	c16.attr("target", "_blank");
	c16.attr("fill", "#0977B2");
	c16.click();
	c16.hover(function(){$("#_code_body").html(code_splicer);
						$("#_code_header").html("pixel splicer");},
			function(){$("#_code_body").html(code_text);
						$("#_code_header").html("code");});
			
	c6.attr("title", "code for my artificial life incubator");
	c6.attr("cursor", "pointer");
	c6.attr("href", "https://github.com/oliver-nowak/atlantis");
	c6.attr("target", "_blank");
	c6.attr("fill", "#0977B2");
	c6.click();
	c6.hover(function(){$("#_code_body").html(code_atlantis);
						$("#_code_header").html("atlantis");},
			function(){$("#_code_body").html(code_text);
						$("#_code_header").html("code");});
			
	c10.attr("title", "code for creating shapes in Houdini");
	c10.attr("cursor", "pointer");
	c10.attr("href", "https://github.com/oliver-nowak/pychop");
	c10.attr("target", "_blank");
	c10.attr("fill", "#0977B2");
	c10.click();
	c10.hover(function(){$("#_code_body").html(code_pychop);
						$("#_code_header").html("pychop houdini shapes");},
			function(){$("#_code_body").html(code_text);
						$("#_code_header").html("code");});
			
	c18.attr("title", "code for a color framework for openFrameworks");
	c18.attr("cursor", "pointer");
	c18.attr("href", "https://github.com/oliver-nowak/ocolor");
	c18.attr("target", "_blank");
	c18.attr("fill", "#0977B2");
	c18.click();
	c18.hover(function(){$("#_code_body").html(code_ocolor);
						$("#_code_header").html("ocolor color library");},
			function(){$("#_code_body").html(code_text);
						$("#_code_header").html("code");});
}

function configureTextElements()
{
	c1.attr("title", "script for capularis");
	c1.attr("cursor", "pointer");
	c1.attr("href", "http://olivernowak.com/assets/text/olivernowak_capularis.pdf");
	c1.attr("target", "_blank");
	c1.attr("fill", "#0977B2");
	c1.click();
	c1.hover(function(){$("#_text_body").html(text_capularis);
						$("#_text_header").html("capularis");},
			function(){$("#_text_body").html(text_text);
						$("#_text_header").html("text");});
						
	c4.attr("title", "another script");
	c4.attr("cursor", "pointer");
	c4.attr("href", "http://olivernowak.com/assets/text/olivernowak_caughtbetweenbulletandyou.pdf");
	c4.attr("target", "_blank");
	c4.attr("fill", "#0977B2");
	c4.click();
	c4.hover(function(){$("#_text_body").html(text_caught);
						$("#_text_header").html("caught between the bullet & you");},
			function(){$("#_text_body").html(text_text);
						$("#_text_header").html("text");});
						
						
	c13.attr("title", "another script");
	c13.attr("cursor", "pointer");
	c13.attr("href", "http://olivernowak.com/assets/text/olivernowak_chokingonstaples.pdf");
	c13.attr("target", "_blank");
	c13.attr("fill", "#0977B2");
	c13.click();
	c13.hover(function(){$("#_text_body").html(text_staples);
						$("#_text_header").html("choking on staples");},
			function(){$("#_text_body").html(text_text);
						$("#_text_header").html("text");});
						
						
	c17.attr("title", "MFA Thesis");
	c17.attr("cursor", "pointer");
	c17.attr("href", "http://olivernowak.com/assets/text/olivernowak_thesis2008.pdf");
	c17.attr("target", "_blank");
	c17.attr("fill", "#0977B2");
	c17.click();
	c17.hover(function(){$("#_text_body").html(text_thesis);
						$("#_text_header").html("in Potentia");},
			function(){$("#_text_body").html(text_text);
						$("#_text_header").html("text");});
						
	c6.attr("title", "another script");
	c6.attr("cursor", "pointer");
	c6.attr("href", "http://olivernowak.com/assets/text/olivernowak_beautyoftrauma.pdf");
	c6.attr("target", "_blank");
	c6.attr("fill", "#0977B2");
	c6.click();
	c6.hover(function(){$("#_text_body").html(text_trauma);
						$("#_text_header").html("the beauty of trauma and the trauma of beauty");},
			function(){$("#_text_body").html(text_text);
						$("#_text_header").html("text");});
						
						
	c11.attr("title", "another script");
	c11.attr("cursor", "pointer");
	c11.attr("href", "http://olivernowak.com/assets/text/olivernowak_morituri.pdf");
	c11.attr("target", "_blank");
	c11.attr("fill", "#0977B2");
	c11.click();
	c11.hover(function(){$("#_text_body").html(text_morituri);
						$("#_text_header").html("the morituri");},
			function(){$("#_text_body").html(text_text);
						$("#_text_header").html("text");});
						
						
	c18.attr("title", "another script");
	c18.attr("cursor", "pointer");
	c18.attr("href", "http://olivernowak.com/assets/text/olivernowak_aclothlikegauze.pdf");
	c18.attr("target", "_blank");
	c18.attr("fill", "#0977B2");
	c18.click();
	c18.hover(function(){$("#_text_body").html(text_gauze);
						$("#_text_header").html("a cloth like gauze");},
			function(){$("#_text_body").html(text_text);
						$("#_text_header").html("text");});
}



function configureImageElements()
{
	resetImageHover();
	
	c0.attr("title", "amerika");
	c0.attr("cursor", "pointer");
	c0.attr("fill", "#0977B2");
	c0.click(function(){						
						resetVideo();
						resetImageNav();
						resetSieveAttr();
						$("#_image_header").html("amerika");
						currentImage   = 1;
						currentProject = "amerika"; 
						loadImg(currentImage, currentProject);
						createImageNav("amerika");
						labelImage(currentImage, currentProject);
						c0.attr("stroke", "#FEF700");
						c0.attr("stroke-width", "4");
						});				
	c0.hover(function(){
						if (currentProject == "image") {
							$("#_image_body").html(image_amerika);
							$("#_image_header").html("amerika");
						}
						
						},
						function(){
							if (currentProject == "image") {
								resetImageHover();
							} 
						});
			
	////
	c1.attr("title", "b41");
	c1.attr("cursor", "pointer");
	c1.attr("fill", "#0977B2");
	c1.click(function(){
						resetVideo();
						resetImageNav();
						resetSieveAttr();
						$("#_image_header").html("b41");
						currentImage = 0;
						currentProject = "b41";
						loadVideo(currentImage, currentProject);
						labelImage(currentImage+1, currentProject);
						$("#_imageInfo").show();
						c1.attr("stroke", "#FEF700");
						c1.attr("stroke-width", "4");
						});				
	c1.hover(function(){
						if (currentProject == "image") {
							$("#_image_body").html(video_b41);
							$("#_image_header").html("b41");
						}
						
						},
						function(){
							if (currentProject == "image") {
								resetImageHover();
							} 
						});
	////
	
	c3.attr("title", "olympia");
	c3.attr("cursor", "pointer");
	c3.attr("fill", "#0977B2");
	c3.click(function(){
						resetVideo();
						resetImageNav();
						resetSieveAttr();
						$("#_image_header").html("mr.torn + olympia");
						currentImage   = 1;
						currentProject = "olympia"; 
						loadImg(currentImage, currentProject);
						createImageNav("olympia");
						labelImage(currentImage, currentProject);
						c3.attr("stroke", "#FEF700");
						c3.attr("stroke-width", "4");
						});
						
	c3.hover(function(){
						if (currentProject == "image") {
							$("#_image_body").html(image_olympia);
							$("#_image_header").html("mr.torn + olympia");
						}
						},
			function(){
				if (currentProject == "image") {
					resetImageHover();
				} 
			});
	////
	c15.attr("title", "plasticity");
	c15.attr("cursor", "pointer");
	c15.attr("fill", "#0977B2");
	c15.click(function(){
						resetVideo();
						resetImageNav();
						resetSieveAttr();
						$("#_image_header").html("plasticity");
						currentImage   = 1;
						currentProject = "plasticity"; 
						loadImg(currentImage, currentProject);
						createImageNav("plasticity");
						c15.attr("stroke", "#FEF700");
						c15.attr("stroke-width", "4");
						});
						
	c15.hover(function(){
						if (currentProject == "image") {
							$("#_image_body").html(image_plasticity);
							$("#_image_header").html("plasticity");
						}
						},
			function(){
				if (currentProject == "image") {
					resetImageHover();
				} 
			});
	
	///
	c5.attr("title", "my beating heart");
	c5.attr("cursor", "pointer");
	c5.attr("fill", "#0977B2");
	c5.click(function(){
						resetVideo();
						resetImageNav();
						resetSieveAttr();
						$("#_image_header").html("my beating heart");
						currentImage = 0;
						currentProject = "heart";
						loadVideo(currentImage, currentProject);
						labelImage(currentImage+1, currentProject);
						$("#_imageInfo").show();
						c5.attr("stroke", "#FEF700");
						c5.attr("stroke-width", "4");
						});				
	c5.hover(function(){
						if (currentProject == "image") {
							$("#_image_body").html(video_heart);
							$("#_image_header").html("my beating heart");
						}
						
						},
						function(){
							if (currentProject == "image") {
								resetImageHover();
							} 
						});
	//
	c6.attr("title", "portrait");
	c6.attr("cursor", "pointer");
	c6.attr("fill", "#0977B2");
	c6.click(function(){
						resetVideo();
						resetImageNav();
						resetSieveAttr();
						$("#_image_header").html("portraits");
						currentImage   = 1;
						currentProject = "portrait"; 
						loadImg(currentImage, currentProject);
						createImageNav("portrait");
						labelImage(currentImage, currentProject);
						c6.attr("stroke", "#FEF700");
						c6.attr("stroke-width", "4");
						});
						
	c6.hover(function(){
						if (currentProject == "image") {
							$("#_image_body").html(image_portrait);
							$("#_image_header").html("portraits");
						}
						},
			function(){
				if (currentProject == "image") {
					resetImageHover();
				} 
			});
	
	////
	c11.attr("title", "plasticity: 1.7");
	c11.attr("cursor", "pointer");
	c11.attr("fill", "#0977B2");
	c11.click(function(){
						resetVideo();
						resetImageNav();
						resetSieveAttr();
						$("#_image_header").html("plasticity: 1.7");
						currentImage = 0;
						currentProject = "plasticity17";
						loadVideo(currentImage, currentProject);
						labelImage(currentImage+1, currentProject);
						$("#_imageInfo").show();
						c11.attr("stroke", "#FEF700");
						c11.attr("stroke-width", "4");
						});				
	c11.hover(function(){
						if (currentProject == "image") {
							$("#_image_body").html(video_plasticity);
							$("#_image_header").html("plasticity: 1.7");
						}
						
						},
						function(){
							if (currentProject == "image") {
								resetImageHover();
							} 
						});
	///
	
	c13.attr("title", "potentia");
	c13.attr("cursor", "pointer");
	c13.attr("fill", "#0977B2");
	c13.click(function(){
						resetVideo();
						resetImageNav();
						resetSieveAttr();
						$("#_image_header").html("in Potentia");
						currentImage   = 1;
						currentProject = "potentia"; 
						loadImg(currentImage, currentProject);
						createImageNav("potentia");
						labelImage(currentImage, currentProject);
						c13.attr("stroke", "#FEF700");
						c13.attr("stroke-width", "4");
						});
						
	c13.hover(function(){
						if (currentProject == "image") {
							$("#_image_body").html(image_potentia);
							$("#_image_header").html("in Potentia");
						}
						},
			function(){
				if (currentProject == "image") {
					resetImageHover();
				} 
			});
	////
	c16.attr("title", "beyond POST");
	c16.attr("cursor", "pointer");
	c16.attr("fill", "#0977B2");
	c16.click(function(){
						resetVideo();
						resetImageNav();
						resetSieveAttr();
						$("#_image_header").html("beyond POST");
						currentImage = 0;
						currentProject = "behind";
						loadVideo(currentImage, currentProject);
						labelImage(currentImage+1, currentProject);
						$("#_imageInfo").show();
						c16.attr("stroke", "#FEF700");
						c16.attr("stroke-width", "4");
						});				
	c16.hover(function(){
						if (currentProject == "image") {
							$("#_image_body").html(video_behind);
							$("#_image_header").html("beyond POST");
						}
						
						},
						function(){
							if (currentProject == "image") {
								resetImageHover();
							} 	
						});
	///
	
	c17.attr("title", "uncanny");
	c17.attr("cursor", "pointer");
	c17.attr("fill", "#0977B2");
	c17.click(function(){
						resetVideo();
						resetImageNav();
						resetSieveAttr();
						$("#_image_header").html("uncanny valley");
						currentImage   = 1;
						currentProject = "uncanny"; 
						loadImg(currentImage, currentProject);
						createImageNav("uncanny");
						labelImage(currentImage, currentProject);
						c17.attr("stroke", "#FEF700");
						c17.attr("stroke-width", "4");
						});
						
	c17.hover(function(){
							if (currentProject == "image") {
								$("#_image_body").html(image_uncanny);
								$("#_image_header").html("uncanny valley");
							}
						},
			function(){
				if (currentProject == "image") {
					resetImageHover();
				} 
			});
			
	///
	c19.attr("title", "re:elapses");
	c19.attr("cursor", "pointer");
	c19.attr("fill", "#0977B2");
	c19.click(function(){
						resetVideo();
						resetImageNav();
						resetSieveAttr();
						$("#_image_header").html("re:elapses");
						currentImage = 1;
						currentProject = "reel";
						loadVideo(currentImage, currentProject);
						labelImage(currentImage+1, currentProject);
						createImageNav(currentProject, true);
						$("#_imageInfo").show();
						c19.attr("stroke", "#FEF700");
						c19.attr("stroke-width", "4");
						});				
	c19.hover(function(){
						if (currentProject == "image") {
							$("#_image_body").html(video_reel);
							$("#_image_header").html("re:elapses");
						}
						
						},
						function(){
							if (currentProject == "image") {
								resetImageHover();
							} 
						});
	///		
}

function getImgUrl(selImage, selProj)
{
	var _url = "";
	var pad = "";
	if (selImage == 10) { 
		pad = "0";
	} else {
		pad = "00";
	}
	
	_url = selProj + "_" + pad + selImage + ".jpg";
	
	return _url;
}

function getImgLabel(selImage, selProj)
{
	var _url = "";
	var pad = "";
	if (selImage == 10) { 
		pad = "0";
	} else {
		pad = "00";
	}
	
	_url = selProj + "_" + pad + selImage;
	
	return _url;
}

function loadImg(selImage, selProj)
{
	var imgUrl = getImgUrl(selImage, selProj);
	
	$("#_image_body").css("display", "none");
	$("#loader").show();
	$("#_imageInfo").show();
	
	if ( $(image).css("display", "none") ) {
		$(image).fadeIn();
	}
	
	$(image).load(function () { 
		
      $(this).hide();

      // with the holding div #loader, apply:
      $('#loader')
        // remove the loading class (so no background spinner), 
        //.removeClass('_loading')
        
        // then insert our image
        .append(this);

      // fade our image in to create a nice effect
      $(this).fadeIn();
    })
    
    // if there was an error loading the image, react accordingly
    .error(function () {
      // notify the user that the image could not be loaded
    })
    
    // *finally*, set the src attribute of the new image to our image
    .attr('src', '/assets/image/' + selProj + "/" + imgUrl);
}

function loadVideo(selVid, selProj)
{
	var vid = "";
	var pad = "00";
	
	if (selVid > 0) {
		vid = selProj + "_" + pad + selVid;
	} else {
		vid = selProj;
	}

	$("#_image_body").css("display", "none");
	$("#loader").show();
	
	var video_tag = "<source src='/assets/video/"+ vid + ".iphone.mp4'/><source src='/assets/video/" + vid + ".theora.ogv' type='video/ogg; codecs=&#34;theora, vorbis&#34;'/><source src='/assets/video/" + vid + ".webmvp8.webm' type='video/webm; codecs=&#34;vp8, vorbis&#34;'/>";
	
	if ($("#_video_container").length < 1) {
		$("#loader").append("<video id='_video_container' width='460' height='380' controls autoplay loop></video>");
	}
	
	$("#_video_container").append( video_tag );
}

function labelImage(selImage, selProj)
{
	var imgInfo = getImgLabel(selImage, selProj);
	
	$("#_imageInfo").html( eval(imgInfo) );
}

function createImageNav(currentProject, isVideo)
{
	if (!isVideo) {
		img0 = image_plate.path("M 290 620 L 350 620 L 320 560 z");
		img0.attr("opacity", 0.0);	
		img0.attr("cursor", "pointer");
		img0.attr("fill", "url(/assets/image/" + currentProject + "/" + getImgUrl(1, currentProject) + ")");
		img0.attr("stroke-width", "0");
		img0.click(function(){
						currentImage   = 1;
						loadImg(currentImage, currentProject);
						labelImage(currentImage, currentProject);
						});
	} else {
		if (img0 != null) {
			img0.remove();
			img0 = null;
		}
	}
	
	img1 = image_plate.path("M 335 580 L 395 580 L 365 640 z");
	img1.attr("opacity", 0.0);
	img1.attr("cursor", "pointer");
	if (isVideo) {
		img1.attr("fill", "#FF9900");
		img1.click(function(){
						resetVideo();
						currentImage = 1;
						currentProject = "reel";
						loadVideo(currentImage, currentProject);
						labelImage(currentImage, currentProject);
						});
	} else {
		img1.attr("fill", "url(/assets/image/" + currentProject + "/" + getImgUrl(2, currentProject) + ")");
		img1.click(function(){
						currentImage   = 2;
						loadImg(currentImage, currentProject);
						labelImage(currentImage, currentProject);
						});
	}
	img1.attr("stroke-width", "0");
	
	img2 = image_plate.path("M 380 620 L 440 620 L 410 560 z");
	img2.attr("opacity", 0.0);
	img2.attr("cursor", "pointer");	
	if (isVideo) {
		img2.attr("fill", "#FF9900");
		img2.click(function(){
						resetVideo();
						currentImage = 2;
						currentProject = "reel";
						loadVideo(currentImage, currentProject);
						labelImage(currentImage, currentProject);
						});
	} else {
		img2.attr("fill", "url(/assets/image/" + currentProject + "/" + getImgUrl(3, currentProject) + ")");
		img2.click(function(){
						currentImage   = 3;
						loadImg(currentImage, currentProject);
						labelImage(currentImage, currentProject);
						});
	}
	img2.attr("stroke-width", "0");
	
	img3 = image_plate.path("M 425 580 L 485 580 L 455 640 z");
	img3.attr("opacity", 0.0);
	img3.attr("cursor", "pointer");
	if (isVideo) {
		img3.attr("fill", "#FF9900");
		img3.click(function(){
						resetVideo();
						currentImage = 3;
						currentProject = "reel";
						loadVideo(currentImage, currentProject);
						labelImage(currentImage, currentProject);
						});
	} else {
		img3.attr("fill", "url(/assets/image/" + currentProject + "/" + getImgUrl(4, currentProject) + ")");
		img3.click(function(){
						currentImage   = 4;
						loadImg(currentImage, currentProject);
						labelImage(currentImage, currentProject);
						});
	}
	img3.attr("stroke-width", "0");
	
	
	img4 = image_plate.path("M 470 620 L 530 620 L 500 560 z");
	img4.attr("opacity", 0.0);
	img4.attr("cursor", "pointer");
	if (isVideo) {
		img4.attr("fill", "#FF9900");
		img4.click(function(){
						resetVideo();
						currentImage = 4;
						currentProject = "reel";
						loadVideo(currentImage, currentProject);
						labelImage(currentImage, currentProject);
						});
	} else {
		img4.attr("fill", "url(/assets/image/" + currentProject + "/" + getImgUrl(5, currentProject) + ")");
		img4.click(function(){
						currentImage   = 5;
						loadImg(currentImage, currentProject);
						labelImage(currentImage, currentProject);
						});
	}
	img4.attr("stroke-width", "0");
	
	img5 = image_plate.path("M 515 580 L 575 580 L 545 640 z");
	img5.attr("opacity", 0.0);
	img5.attr("cursor", "pointer");
	if (isVideo) {
		img5.attr("fill", "#FF9900");
		img5.click(function(){
						resetVideo();
						currentImage = 5;
						currentProject = "reel";
						loadVideo(currentImage, currentProject);
						labelImage(currentImage, currentProject);
						});
	} else {
		img5.attr("fill", "url(/assets/image/" + currentProject + "/" + getImgUrl(6, currentProject) + ")");
		img5.click(function(){
						currentImage   = 6;
						loadImg(currentImage, currentProject);
						labelImage(currentImage, currentProject);
						});
	}
	img5.attr("stroke-width", "0");
	
	img6 = image_plate.path("M 560 620 L 620 620 L 590 560 z");
	img6.attr("opacity", 0.0);
	img6.attr("cursor", "pointer");
	if (isVideo) {
		img6.attr("fill", "#FF9900");
		img6.click(function(){
						resetVideo();
						currentImage = 6;
						currentProject = "reel";
						loadVideo(currentImage, currentProject);
						labelImage(currentImage, currentProject);
						});
	} else {
		img6.attr("fill", "url(/assets/image/" + currentProject + "/" + getImgUrl(7, currentProject) + ")");
		img6.click(function(){
						currentImage   = 7;
						loadImg(currentImage, currentProject);
						labelImage(currentImage, currentProject);
						});
	}
	img6.attr("stroke-width", "0");
	
	img7 = image_plate.path("M 605 580 L 665 580 L 635 640 z");
	img7.attr("opacity", 0.0);
	img7.attr("cursor", "pointer");
	if (isVideo) {
		img7.attr("fill", "#FF9900");
		img7.click(function(){
						resetVideo();
						currentImage = 7;
						currentProject = "reel";
						loadVideo(currentImage, currentProject);
						labelImage(currentImage, currentProject);
						});
	} else {
		img7.attr("fill", "url(/assets/image/" + currentProject + "/" + getImgUrl(8, currentProject) + ")");
		img7.click(function(){
						currentImage   = 8;
						loadImg(currentImage, currentProject);
						labelImage(currentImage, currentProject);
						});
	}
	img7.attr("stroke-width", "0");
	
	img8 = image_plate.path("M 650 620 L 710 620 L 680 560 z");
	img8.attr("opacity", 0.0);
	img8.attr("cursor", "pointer");
	if (isVideo) {
		img8.attr("fill", "#FF9900");
		img8.click(function(){
						resetVideo();
						currentImage = 8;
						currentProject = "reel";
						loadVideo(currentImage, currentProject);
						labelImage(currentImage, currentProject);
						});
	} else {
		img8.attr("fill", "url(/assets/image/" + currentProject + "/" + getImgUrl(9, currentProject) + ")");
		img8.click(function(){
						currentImage   = 9;
						loadImg(currentImage, currentProject);
						labelImage(currentImage, currentProject);
						});
	}
	img8.attr("stroke-width", "0");
	
	if (!isVideo) {
		img9 = image_plate.path("M 695 580 L 755 580 L 725 640 z");
		img9.attr("opacity", 0.0);
		img9.attr("cursor", "pointer");
		img9.attr("fill", "url(/assets/image/" + currentProject + "/" + getImgUrl(10, currentProject) + ")");
		img9.attr("stroke-width", "0");
		img9.click(function(){
							currentImage   = 10;
							loadImg(currentImage, currentProject);
							labelImage(currentImage, currentProject);
							});
	} else {
		if (img9 != null) {
			img9.remove();
			img9 = null;
		}
	}	
	
	if (imageNav_set == null) {
		imageNav_set = image_plate.set();
		
		imageNav_set.push(img0,
						  img1,
						  img2,
						  img3,
						  img4,
						  img5,
						  img6,
						  img7,
						  img8,
						  img9);
	}
	
	imageNav_set.animate({opacity: 1.0},
							1000,
							"<");				
}

function createMenuNav()
{
	if (menu_plate == null) {
		menu_plate = Raphael(0,0, 100, 400);
	}
	
	if (image_nav == null) {
		image_nav = menu_plate.rect(20, 40, 40, 40);
	}
	
	image_nav.attr("fill", "#000");
	image_nav.attr("title", "view Images");
	image_nav.attr("cursor", "pointer");
	image_nav.attr("opacity", 0.0);
	image_nav.click(function() { 
					navToNewState(current_state, 4);
					});

	if (code_nav == null) {
		code_nav = menu_plate.circle(40, 120, 20);
	}
	
	code_nav.attr("fill", "#000");
	code_nav.attr("title", "compile Code");
	code_nav.attr("cursor", "pointer");
	code_nav.attr("opacity", 0.0);
	code_nav.click(function(){
					navToNewState(current_state,2);
					});
	
	if (text_nav == null) {
		text_nav = menu_plate.path("M 20 200 L 60 200 L 40 160 z");
	}
	
	text_nav.attr("fill", "#000");
	text_nav.attr("title", "read Text");
	text_nav.attr("cursor", "pointer");
	text_nav.attr("opacity", 0.0);
	text_nav.click(function(){
					navToNewState(current_state, 3);
					});
	
	if (about_nav == null) {
		about_nav = menu_plate.text(40, 245, "?");
	}
	
	about_nav.attr("font-size", "60px");
	about_nav.attr("fill", "#000");
	about_nav.attr("title", "understand Me");
	about_nav.attr("cursor", "pointer");
	about_nav.attr("opacity", 0.0);
	about_nav.click(function(){
					navToNewState(current_state, 1);
					});
	
	if (home_nav == null) {
		home_nav = menu_plate.text(40, 305, "@");
	}
	
	home_nav.attr("font-size", "42px");
	home_nav.attr("fill", "#000");
	home_nav.attr("title", "return Home");
	home_nav.attr("cursor", "pointer");
	home_nav.attr("opacity", 0.0);
}

function createSieve()
{
	if (sieve_plate == null)
	{
		sieve_plate = Raphael(100, 100, 1100, 465);
		isSieveInit = true;
	}

	c0 = sieve_plate.circle(140, 100, 40);
	c1 = sieve_plate.circle(230, 100, 40);	
	c4 = sieve_plate.circle(100, 180, 40);
	c5 = sieve_plate.circle(190, 180, 40);
	c8 = sieve_plate.circle(140, 260, 40);
	c9 = sieve_plate.circle(230, 260, 40);
	c12= sieve_plate.circle(100, 340, 40);
	c13= sieve_plate.circle(190, 340, 40);	
	c16= sieve_plate.circle(140, 420, 40);
	c17= sieve_plate.circle(230, 420, 40);
	
	sSetA = sieve_plate.set();
	sSetA.push(c0,
			   c1,
			   c4,
			   c5,
			   c8,
			   c9,
			   c12,
			   c13,
			   c16,
			   c17);
	
	
	
	c2 = sieve_plate.circle(940, 100, 40);
	c3 = sieve_plate.circle(850, 100, 40);
	c6 = sieve_plate.circle(810, 180, 40);
	c7 = sieve_plate.circle(900, 180, 40);
	c10= sieve_plate.circle(850, 260, 40);
	c11= sieve_plate.circle(940, 260, 40);
	c14= sieve_plate.circle(810, 340, 40);
	c15= sieve_plate.circle(900, 340, 40);
	c18= sieve_plate.circle(850, 420, 40);
	c19= sieve_plate.circle(940, 420, 40);

	sSetB = sieve_plate.set();
	sSetB.push(c2,
			   c3,
			   c6,
			   c7,
			   c10,
			   c11,
			   c14,
			   c15,
			   c18,
			   c19);
}

function renderSieve()
{
	sSetA.attr("opacity", 0.0);
	sSetA.attr("fill", "#cccccc");
	sSetA.attr("stroke-width", "0");
	sSetA.translate(265, 0);
	sSetA.animate({opacity: 1.0, translation: "-265 0"}, 500, "<");

	sSetB.attr("opacity", 0.0);
	sSetB.attr("fill", "#cccccc");
	sSetB.attr("stroke-width", "0");
	sSetB.translate(-265,0);
	sSetB.animate({opacity: 1.0, translation:"265 0"}, 500, "<");
}

function resetAll()
{
	resetMenu();
	resetAbout();
	resetCode();
	resetText();
	resetImageNav();
	resetImage();
	resetVideo();
	resetSieve();
}

function resetMenu()
{
	if (menu_plate != null) {
		menu_plate.clear();
		menu_plate.remove();
		menu_plate = null;
		menu_set = null;
		image_nav = null;
		code_nav = null;
		text_nav = null;
		about_nav = null;
		home_nav = null;
	}	
}

function resetAbout()
{
	if (about_plate != null) {
		about_plate.clear();
		about_plate.remove();
		about_plate = null;
		about_circle = null;
	}
}

function resetCode()
{
	if (code_plate != null) {
		code_plate.clear();
		code_plate.remove();
		code_plate = null;
		code_circle = null;
	}
}

function resetText()
{
	if (text_plate != null) {
		text_plate.clear();
		text_plate.remove();
		text_plate = null;
		text_circle = null;
	}
}

function resetImage()
{
	if (image_plate != null) {
		image_plate.clear();
		image_plate.remove();
		image_plate = null;
		image_circle = null;
	}
}

function resetImageHover()
{
	$("#_image_body").html(image_text);
	$("#_image_header").html("image");
	
	$("#_image_body").show();
	$("#_image_header").show();
	
	$("#loader").hide();
	$("#_imageInfo").hide();
}

function resetImageNav()
{
	if (img0 != null)
		img0.remove();
		
	if (img1 != null)
		img1.remove();
	
	if (img2 != null)
		img2.remove();
	
	if (img3 != null)
		img3.remove();
	
	if (img4 != null)
		img4.remove();
		
	if (img5 != null)
		img5.remove();
		
	if (img6 != null)
		img6.remove();
		
	if (img7 != null)
		img7.remove();
		
	if (img8 != null)
		img8.remove();
		
	if (img9 != null)
		img9.remove();
		
	if (imageNav_set != null)
		imageNav_set.remove();
		
	img0,img1,img2,img3,img4,img5,img6,img7,img8,img9 = null;
	imageNav_set = null;
}

function resetVideo()
{
	if ($("#_video_container").length > 0) {
		$("#_video_container").remove();
	}
	
	$(image).hide();
}

function resetSieveAttr()
{
	sSetA.attr("stroke", "#0091FF");
	sSetA.attr("stroke-width", "0");
	sSetB.attr("stroke", "#0091FF");
	sSetB.attr("stroke-width", "0");

}
function resetSieve()
{
	sSetA.translate(-265, 0);	
	sSetB.translate(265, 0);
	
	if (sieve_plate != null) {
		sieve_plate.clear();
		sieve_plate.remove();
	}
	sieve_plate = null;
	isSieveInit = false;
}

