var popupStatus=0;function loadPopup(){if(popupStatus==0){$("#backgroundPopup").css({opacity:"0.7"});$("#backgroundPopup").fadeIn(200);$("#popupContact").fadeIn(200);popupStatus=1}}function centerPopup(){var c=document.documentElement.clientWidth,b=document.documentElement.clientHeight,a=$("#popupContact").height(),d=$("#popupContact").width();$("#popupContact").css({position:"absolute",top:b/2-a/2,left:c/2-d/2});$("#backgroundPopup").css({height:b})}
function disablePopup(){if(popupStatus==1){$("#backgroundPopup").fadeOut(200);$("#popupContact").fadeOut(200);popupStatus=0}}function ShowPopup(c){$.get("ajax.php",{getID:c},function(b){$("#output").html(b);centerPopup();loadPopup()})}
$(document).ready(function(){function c(){disablePopup();$("#map_div").fadeOut("fast",function(){$("#map_div").css("background-image","url(images/ks_map.png)");$("#map_div").fadeIn("fast")});$("#toptext").html("<p>Click on the county of the high school or college you are attending to meet your admissions counselor.</p>");$("#backtous").fadeIn("slow");$("#displayed_image").val("ks_map.png")}function b(){disablePopup();$("#backtous").fadeOut();$("#output").html("");$("#map_div").fadeOut("fast",function(){$("#map_div").css("background-image",
"url(images/us_map.png)");$("#map_div").fadeIn("fast")});$("#backtous").fadeOut();$("#toptext").html("<p>Click on your home state to meet your admissions counselor.</p>");$("#displayed_image").val("us_map.png")}$("#backtous").hide();$("#map_div").click(function(a){pos_x=a.offsetX?a.offsetX:a.pageX-$("#map_div").offset().left;pos_y=a.offsetY?a.offsetY:a.pageY-$("#map_div").offset().top;$.getJSON("ajax.php",{getColor:$("#displayed_image").val(),Xoffset:pos_x,Yoffset:pos_y},function(d){switch(d.RGB){case 0:ShowPopup(261);
break;case 1292173312:case 1073742344:ShowPopup(222);break;case 166109184:ShowPopup(91);break;case 620766093:ShowPopup(270);break;case 78643250:ShowPopup(268);break;case 16777215:$("#displayed_image").val()=="us_map.png"&&c();break}})});$("#popupContactClose").click(function(){disablePopup()});$("#backtous").click(function(){b();return false});$("body").keypress(function(){popupStatus==1&&disablePopup()})});

