if(false){if(typeof(window['YAHOO'])=='undefined'&&typeof(window['YAHOO.widget'])=='undefined'&&typeof(window['YAHOO.widget.Logger'])=='undefined'){var url='http://www.campusexplorer.com/js/logger.js';var headLoc=document.getElementsByTagName("head").item(0);var scriptObj=document.createElement("script");scriptObj.setAttribute("type","text/javascript");scriptObj.setAttribute("charset","utf-8");scriptObj.setAttribute("src",url);headLoc.appendChild(scriptObj);}
var CELoggerLoaded=false;var CELogQueuedMessages=[];if(typeof(window['CELog'])=='undefined'){var CELog=function(message){if(CELoggerLoaded){YAHOO.log(message);}else{CELogQueuedMessages.push(message);}}}
var CELogOnReady=function(){CELoggerLoaded=true;for(i in CELogQueuedMessages){var message=CELogQueuedMessages[i];CELog(message);}}}
var CEConcentrationOptions={"9F474C02":["","group-00A169C0","group-0CD7B5DF","major-62E6F640","group-282374D4","group-4AACAFD9","group-59EC5F25","major-421505E3","group-7AE03C73"],"8EEC7E7A":["","group-C57B9CE4","group-22ACA78E","group-49F21C5E","major-5093F588","group-ACE01FB5","group-47EB5653","group-A6B4623E","group-020CA55B","group-C6FEC2CC","group-237A2414","group-E76D0365"],"8C3C285A":["","major-7230776D","major-D93A064A","major-B13BE68F","major-3E7737B4","major-6FDFA1B8","major-E5C218BD","major-E3595138","major-313BFB84","major-5101FE01","major-421505E3","major-6BBAB59C","major-29D162C5","major-20C982A5","major-7973B917"],"5633E2D9":["","major-D5D2D17F","major-A56CE7C4","major-C24E771C","major-D6904AB7","major-F0A66544"],"395DC581":["","major-4FB87FBD","major-FA7880CB","major-E32A7903"],"31E7F165":["","major-B47B2400","group-EC80F6FC","group-728E9E99","major-8D5DC80B"],"C70BD756":["","major-CFBE23B2","major-4BBC102B","group-04F23703","group-EDAF9801","major-6F2A1B45","group-61520316"],"F154BE64":["","major-D93A064A","major-B13BE68F","major-3E7737B4","major-6FDFA1B8","major-E5C218BD","major-E3595138","major-313BFB84","major-5101FE01","major-421505E3","major-6BBAB59C","major-29D162C5","major-20C982A5","major-7973B917"],"F0322809":["","major-48E7B4AF","major-D1F7B8DA","major-B44E4C23","major-DE4119D4","major-32593A70","major-84EB177D","major-5852647E","major-1066AB6E","major-FB580096","major-86ED91B3","major-60C6E424"],"A4660768":["","group-A0B52F4D","group-F8DCB75F","group-F989D142","group-EA71956D","group-F0322809","group-A432FE02","group-3BFD9B91","major-F76511D8","group-215D9B21","group-BF9655ED","major-60A11E47","group-4960C29E","major-9559C388","major-591056B2"],"A6B4623E":["","major-D3283241","major-FD527C47","major-B350B077"],"E8533CC3":["","major-B955B64D","major-BE37E792","major-468209F8"],"AF7A7A85":["","major-8A34C866","major-9514E469","major-FC99A21B","major-E62FD896","major-F69804D7","major-9EF4C819","major-3EF14306","major-EADEA307","major-CAD810BF","major-6564C1A4"],"67896F10":["","major-4C1BBE4E","group-9378043F","major-52E58917","major-B43D48ED","major-88421B61","group-A75192D3","group-43DAC3FB","group-DFB04A26","major-C295ACCE"],"15ACC4F9":["","group-A4BB693A","group-64BEB199","major-239FAC7B","group-97F0CE33","group-3F833767","group-4546649F","group-CF2A7A1D","group-224BFED2"]};Function.prototype.CEbind=function(obj){var method=this;temp=function(){return method.apply(obj,arguments);};return temp;}
var CampusExplorerSimpleAdd=function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}();var CampusExplorerWidgetManager=function(){var widgets=[];var addWidget=function(widget){widgets[widget.el.id]=widget;}
var getWidget=function(el){return widgets[el];}
var showWidget=function(el){var widget=getWidget(el);if(widget){widget.show();}}
var hideWidget=function(el){var widget=getWidget(el);if(widget){widget.hide();}}
var updateWidget=function(json){var stash=json.stash;if(!stash)return false;var el=stash.element;if(!el)return false;var widget=getWidget(el);if(!widget)return false;if(stash.next_step){widget.nextStep();}else if(stash.first_step){widget.firstStep();}
widget.update(json);if(stash.publisher_callback){eval(stash.publisher_callback+'()');}}
return{addWidget:addWidget,getWidget:getWidget,showWidget:showWidget,hideWidget:hideWidget,updateWidget:updateWidget};}()
var CampusExplorerWidgetBase=function(el,attr){this.el=el;this.div='widget';this.form='lead_request_form';this.source=attr.source;this.tracking=attr.tracking;this.callback=attr.callback;this.prefix=attr.prefix||'campusexplorer_';this.is_popup=attr.popup;this.widget_header=attr.widget_header;this.widget_intro=attr.widget_intro;this.host=attr.host||'www.campusexplorer.com';this.noaction=attr.noaction||false;this.prefilled_values={first_name:attr.first_name,last_name:attr.last_name,phone:attr.phone,emailaddr:attr.emailaddr,address:attr.address,zip_cd:attr.zip_cd};this.scriptCounter=0;this.JSONscriptRequest=function(fullUrl,widget){this.fullUrl=fullUrl;this.noCacheIE='&noCacheIE='+(new Date()).getTime();this.headLoc=document.getElementsByTagName("head").item(0);this.scriptId=widget.prefix+'script'+widget.scriptCounter++;this.buildScriptTag=function(){this.scriptObj=document.createElement("script");this.scriptObj.setAttribute("type","text/javascript");this.scriptObj.setAttribute("charset","utf-8");this.scriptObj.setAttribute("src",this.fullUrl+this.noCacheIE);this.scriptObj.setAttribute("id",this.scriptId);}
this.removeScriptTag=function(){this.headLoc.removeChild(this.scriptObj);}
this.addScriptTag=function(){this.headLoc.appendChild(this.scriptObj);}}
this.getpagesize=function(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;}
windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=xScroll;}else{pageWidth=windowWidth;}
return[pageWidth,pageHeight];};this.getShadow=function(){var shadowID=this.prefix+"widget_abs_shadow";var shadow=document.getElementById(shadowID);if(!shadow){shadow=document.createElement('div');shadow.id=shadowID;shadow.style.display='none';shadow.style.backgroundColor='#000000';shadow.style.opacity='0.5';shadow.style.position='absolute';shadow.style.top=0;shadow.style.left=0;shadow.style.zIndex='9999';var body=document.getElementsByTagName("body").item(0);body.appendChild(shadow);var widget=document.getElementById(this.prefix+this.div);if(widget){widget.parentNode.removeChild(widget);body.appendChild(widget);}}
return shadow;}
this.getShim=function(){var shimID=this.prefix+"widget_shim";var shim=document.getElementById(shimID);if(!shim){var widget=document.getElementById(this.prefix+this.div);shim=document.createElement('iframe');shim.id=shimID;shim.src='javascript:false;';shim.style.display='none';shim.style.opacity=0;shim.style.position='absolute';shim.style.border='medium none';shim.style.margin=0;shim.style.padding=0;shim.style.marginLeft='10px';widget.parentNode.insertBefore(shim,widget);}
return shim;}
this.updateShim=function(){var shim=this.getShim();if(shim){var widget=document.getElementById(this.prefix+this.div);shim.style.top=widget.style.top;shim.style.left=widget.style.left;shim.style.width=widget.offsetWidth+'px';shim.style.height=widget.offsetHeight+'px';shim.style.display="block";}}
this.show=function(args){var page_size=this.getpagesize();var shadow=this.getShadow();shadow.style.display="block";shadow.style.width=page_size[0]+"px";shadow.style.height=page_size[1]+"px";try{shadow.style.filter="alpha(opacity=50)";}catch(e){};var widget=document.getElementById(this.prefix+this.div);widget.style.display="block";var viewport_scroll_offsets={top:window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,left:window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft};viewport_scroll_offsets.top+=50;viewport_scroll_offsets.left+=Math.floor((page_size[0]-widget.offsetWidth)/2);widget.style.position="absolute";widget.style.top=String(viewport_scroll_offsets.top)+"px";widget.style.left=String(viewport_scroll_offsets.left)+"px";if(!args||(args&&!args.next_step&&!args.first_step)){this.requestForm(args);}}
this.hide=function(args){if(!args||(args&&!args.next_step)){var shadow=this.getShadow();if(shadow)shadow.style.display="none";var shim=this.getShim();if(shim)shim.style.display="none";}
document.getElementById(this.prefix+this.div).style.display="none";}
this.dependentSelectEl=function(el){this.el=el;this.saveAllOptions=function(){var options=this.el.getElementsByTagName('option');this.allOptions=[];for(i in options){var option=options[i];if(option&&typeof(option)=='object'){this.allOptions.push(option);}}}
this.setAvailableValues=function(requestedOptions){if(!(requestedOptions&&requestedOptions.length>0)){this.el.disabled=true;return;}
this.el.disabled=false;var showValues={};for(i in requestedOptions){showValues[requestedOptions[i]]=true;}
var currentValue=this.el.value;var newIndex=null;var currentIndex=0;while(this.el.hasChildNodes()){this.el.removeChild(this.el.firstChild);}
for(i in this.allOptions){var option=this.allOptions[i];if(showValues[option.value]){this.el.appendChild(option);if(option.value==currentValue){newIndex=currentIndex}
currentIndex=currentIndex+1;}}
this.el.selectedIndex=newIndex;}
this.saveAllOptions();}
this.saveFormElements=function(){this.elements=new Array();this.elements['areaOfStudy']=document.getElementById(this.prefix+'area_of_study');this.elements['programName']=document.getElementById(this.prefix+'program_name');this.elements['concentration']=document.getElementById(this.prefix+'concentration');this.elements['concentrationWrapper']=document.getElementById(this.prefix+'concentration_wrapper');this.elements['programText']=document.getElementById(this.prefix+'program_text');this.elements['programTextWrapper']=document.getElementById(this.prefix+'program_text_wrapper');if(this.elements['concentration']){this.concentrations=new this.dependentSelectEl(this.elements['concentration']);}}
this.showInput=function(input,wrapper){input.disabled=false;wrapper.style.display='block';}
this.hideInput=function(input,wrapper){wrapper.style.display='none';input.disabled=true;}
this.redrawInput=function(input,wrapper,visible){if(visible){this.showInput(this.elements[input],this.elements[wrapper]);}else{this.hideInput(this.elements[input],this.elements[wrapper]);}}
this.updateConcentrations=function(value){var options=[];if(value){options=CEConcentrationOptions[value];}
this.concentrations.setAvailableValues(options);}
this.areaOfStudyOnChange=function(){this.updateConcentrations(this.elements['areaOfStudy'].value);this.redrawForm();}
this.onFormLoad=function(){this.saveFormElements();this.redrawForm();if(this.elements['areaOfStudy']){this.elements['areaOfStudy'].onchange=this.areaOfStudyOnChange.CEbind(this);}
if(this.elements['programName']){this.elements['programName'].onchange=this.redrawForm.CEbind(this);}}
this.update=function(json){var serialize_form=function(form){var parameters=new Array();for(var i=0;i<form.elements.length;++i){var element=form.elements[i];if(element.name&&!element.disabled&&element.value!=null&&(element.checked||element.nodeName.toUpperCase()=='SELECT'||element.nodeName.toUpperCase()=='TEXTAREA'||element.type=='text'||element.type=='hidden'||element.type=='password')){parameters[parameters.length]=encodeURIComponent(element.name)+
'='+encodeURIComponent(element.value);}}
return parameters.join('&');};this.el.innerHTML=json.body;var myform=document.getElementById(this.prefix+this.form);if(myform){var me=this;myform.onsubmit=function(event){me.request(myform.action+'?'+serialize_form(myform));return false;}
this.onFormLoad();}
if(this.jsr){this.jsr.removeScriptTag();}
if(this.is_popup)this.updateShim();}
this.request=function(url){this.jsr=new this.JSONscriptRequest(url,this);this.jsr.buildScriptTag();this.jsr.addScriptTag();}
this.requestForm=function(args){var url='http://'+this.host+this.request_form_path+
'?widget_element='+this.el.id+'&widget_prefix='+
this.prefix;if(args&&args.college_id)url=url+'&college='+args.college_id;if(args&&args.ipeds_id)url=url+'&ipeds_id='+args.ipeds_id;if(this.college_id)url=url+'&college='+this.college_id;if(this.ipeds_id)url=url+'&ipeds_id='+this.ipeds_id;if(this.source)url=url+'&source='+this.source;if(this.tracking)url=url+'&tracking='+this.tracking;if(this.callback)url=url+'&callback='+this.callback;if(this.is_popup)url=url+'&widget_popup=1';if(this.widget_header)url=url+'&widget_header='+this.widget_header;if(this.widget_intro)url=url+'&widget_intro='+this.widget_intro;if(this.noaction)url=url+'&noaction=1';this.request(url);}
this.onCloseClick=function(){this.hide();return false;}
this.init=function(){if(typeof(this.el)!='object'){this.el=document.getElementById(this.el);}
CampusExplorerWidgetManager.addWidget(this);if(this.is_popup){this.hide();var closeButton=document.getElementById(this.prefix+'close_button');if(closeButton){closeButton.onclick=this.onCloseClick.CEbind(this);}}else{this.requestForm();}}
CampusExplorerSimpleAdd(window,"load",this.init.CEbind(this));}
var CampusExplorerCollegeWidget=function(el,attr){this.request_form_path='/widget/lead-request/';this.ipeds_id=attr.ipeds_id;this.college_id=attr.college_id;CampusExplorerWidgetBase.call(this,el,attr);this.redrawForm=function(){var showProgramText=false;var showConcentration=false;if(this.elements['areaOfStudy']){var value=this.elements['areaOfStudy'].value;if(value&&value=='other_program'){showProgramText=true;}else if(value){showConcentration=true;}}else if(this.elements['programName']){var value=this.elements['programName'].value;if(value&&value=='other_program'){showProgramText=true;}}
this.redrawInput('programText','programTextWrapper',showProgramText);if(this.elements['concentration']){this.redrawInput('concentration','concentrationWrapper',showConcentration);}
var myform=document.getElementById(this.prefix+this.form);for(var i=0;i<myform.elements.length;++i){var element=myform.elements[i];var name=element.name;if(this.prefilled_values[name]&&element.value==''){element.value=this.prefilled_values[name];}}}}
var CampusExplorerWidget=CampusExplorerCollegeWidget;var CampusExplorerProgramsWidget=function(el,attr){this.request_form_path='/widget/programs/lead-request/';CampusExplorerWidgetBase.call(this,el,attr);this.redrawForm=function(){var showConcentration=false;if(this.elements['areaOfStudy']&&this.elements['areaOfStudy'].value){showConcentration=true;}
if(this.elements['concentration']){this.redrawInput('concentration','concentrationWrapper',showConcentration);}}
this.nextStep=function(){if(this.is_popup)this.hide({next_step:1});this.div='selections_screen';this.form='selections_form';this.el=document.getElementById(this.prefix+this.div+'_content');var closeButton=document.getElementById(this.prefix+this.div+'_close_button');if(closeButton){closeButton.onclick=this.onCloseClick.CEbind(this);}
this.onFormLoad=function(){for(var i=1;i<=5;i++){var college=document.getElementById(this.prefix+this.form+'_college_'+i);var program=document.getElementById(this.prefix+this.form+'_program_'+college.value);if(!program)continue;program.onchange=this.checkCollege(college);}
this.updateShim();}
this.checkCollege=function(college){var c=college;return function(college){c.checked=true;}}
this.show({next_step:1});}
this.firstStep=function(){this.hide();this.div='widget';this.form='';this.el=document.getElementById(this.prefix+'content');var widget=document.getElementById(this.prefix+this.div);widget.style.display="block";}}
