var intervalID,btnholder=0,btnholdersize,startscroll,swf,flashwidth,flashheight,iphone,ipad,xml,imagefront,imageback,redirectURL,video,jsonprograms,jsonprogramcategory,pathname=window.location.pathname;$(function(){if($.cookie("barryrememberme")){$("#remembermecheckbox").attr("checked","checked");$("#usernameid").val($.cookie("barryrememberme"))}GetNews(19,3,"Horizontal","no");ipad=navigator.userAgent.match("iPad")!=null;iphone=navigator.userAgent.match("iPhone")!=null;$.ajax({type:"GET",url:"xml/www2.xml",dataType:"xml",success:function(a){xml=a;buildbtns();buildimages();btnholdersize=$("div[id^='btnholder']").size();startscroll=setInterval("scroll()",8e3)}});$.ajax({type:"GET",url:"https://www.barry.edu/xml/programsjson.txt",data:{},dataType:"json",contentType:"application/json;charset=UTF-8",success:function(a){jsonprograms=a;GetCategoryList();$("#programsearch").keyup(function(){BuildProgramListing()})}})});function login(){$(".login-btn").hide();$(".loginthrobber").append('<div style="color:white">loading</div>')}function rememberme(){if($("#remembermecheckbox").is(":checked"))$.cookie("barryrememberme",$("#usernameid").val(),{expires:30});else $.cookie("barryrememberme",null)}function addFlash(){var b={};b.name="Flashplayer";var a={};a.quality="high";a.menu="false";a.scale="noscale";a.wmode="transparent";a.allowFullScreen="true";var c="/scripts/expressInstall.swf",d={};swfobject.embedSWF(swf,"topvideo",flashwidth,flashheight,"9.0.0",c,b,a,d)}function buildbtns(){var a="",b=0;$(xml).find("article").each(function(){a+="<div class='btnholder btnoff' id='btnholder"+b+"'>";a+="</div>";b++});$("#scrollbar").html(a).css("margin-left",(759-b*30)/2);$("#btnholder0").removeClass("btnoff").addClass("btnon");$(".btnholder").click(function(){clearInterval(startscroll);$("#bannerimg"+$(".btnon").attr("id").replace("btnholder","")).css("z-index",0).animate({opacity:0},1e3);$(".btnon").removeClass("btnon").addClass("btnoff");$("#bannerimg"+$(this).attr("id").replace("btnholder","")).css("z-index",6).animate({opacity:1},1e3);$("#btnholder"+$(this).attr("id").replace("btnholder","")).removeClass("btnoff").addClass("btnon")})}function buildimages(){var b="",a=0;$(xml).find("article").each(function(){if($(xml).find("image:eq("+a+")").text()){b="<div id='bannerimg"+a+"' class='banner' onclick=\"redirecttourl('"+$(xml).find("link:eq("+a+")").text()+"'); cancelscroll() \"> <img class='topimg' src='images/"+$(xml).find("image:eq("+a+")").text()+"' /></div>";$("#topcontent").append(b)}else if(ipad||iphone){b="<div id='bannerimg"+a+"'> <video id='videoplayer' controls height='352' width='759' poster='/videos/"+$(xml).find("imagefront:eq("+a+")").text()+"' preload='none' src='/videos/"+$(xml).find("videoIphone:eq("+a+")").text()+"' /></div>";$("#topcontent").append(b);videoplayer.addEventListener("playing",function(){clearInterval(startscroll)},false)}else{video=$(xml).find("video:eq("+a+")").text();imagefront=$(xml).find("imagefront:eq("+a+")").text();imageback=$(xml).find("imageback:eq("+a+")").text();redirectURL=$(xml).find("redirectURL:eq("+a+")").text();b="<div id='bannerimg"+a+"' class='banner' style='background-color:#000; height:352px;'> <div id='topvideo'></div></div>";$("#topcontent").append(b);swf="https://www.barry.edu/videos/Flash_videoplayer_760x310.swf";flashwidth="760";flashheight="310";addFlash()}a++});$(".banner").css("position","absolute");$(".banner").css("top","0px");$(".banner").css("left","0px");$(".banner").css("opacity",0);$(".banner").css("z-index",0);$("#bannerimg0").css("opacity",1).css("z-index",6)}function returnimagefront(){return"https://www.barry.edu/videos/"+imagefront}function returnimageback(){return"https://www.barry.edu/videos/"+imageback}function returnredirectURL(){return"https://www.barry.edu/videos/"+redirectURL}function videoSource(){return"https://www.barry.edu/videos/"+video}function videostarted(){clearInterval(startscroll)}function videoloaded(){$(".loading").hide("slow")}function redirecttourl(a){window.location=a}function stopscroll(){clearInterval(startscroll)}function changebanner(a){clearInterval(startscroll);$("div[id^='btnholder']",$("#scrollbar")).removeClass("btnon").addClass("btnoff");$("#bannerimg"+btnholder).animate({opacity:0},1e3);$("#bannerimg"+btnholder).css("z-index",0);$("#bannerimg"+a).css("z-index",6).animate({opacity:1},1e3);$("#btnholder"+a).removeClass("btnoff").addClass("btnon")}function scroll(){$("#bannerimg"+$(".btnon").attr("id").replace("btnholder","")).css("z-index",0).animate({opacity:0},1e3);$(".btnon").removeClass("btnon").addClass("btnoff");if(btnholder<btnholdersize-1){$("#bannerimg"+(btnholder+1)).css("z-index",6).animate({opacity:1},1e3);btnholder++;$("#btnholder"+btnholder).removeClass("btnoff").addClass("btnon")}else{$("#bannerimg0").css("z-index",6).animate({opacity:1},1e3);btnholder=0;$("#btnholder0").removeClass("btnoff").addClass("btnon")}}function showlocations(){clearInterval(startscroll);$(".ajax-holder").html("");$(".text-content").html("");$(".inner").html("");$(".listing").html("");var b="";count=1;count2=1;var a="<table width='97%' border='0' cellpadding='6' cellspacing='0'><tbody>";if(count2==1){a+="<tr><td height='5'></td></tr><tr>";a+="<td class='ListingAlternativeItemHolder'><b style='font-size:12pt'>&nbsp;&nbsp;Locations</b></td>";a+="</tr><tr><td height='5'></td></tr>";count2=2}a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Alachua County', 'Alachua County Programs')\" >";a+="<td class='ListingItemHolder'> <span class='ListingLink'>Alachua County</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Bahamas', 'Bahamas')\" >";a+="<td class='ListingAlternativeItemHolder'> <span class='ListingLink'>Bahamas</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Brevard County', 'Brevard County Programs')\" >";a+="<td class='ListingItemHolder'> <span class='ListingLink'>Brevard County</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Broward County', 'Broward County Programs')\" >";a+="<td class='ListingAlternativeItemHolder'> <span class='ListingLink'>Broward County</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Collier County', 'Collier County Programs')\" >";a+="<td class='ListingItemHolder'> <span class='ListingLink'>Collier County</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Hillsborough County', 'Hillsborough County Programs')\" >";a+="<td class='ListingAlternativeItemHolder'> <span class='ListingLink'>Hillsborough County</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Lake County', 'Lake County Programs')\" >";a+="<td class='ListingItemHolder'> <span class='ListingLink'>Lake County</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Lee County', 'Lee County Programs')\" >";a+="<td class='ListingAlternativeItemHolder'> <span class='ListingLink'>Lee County</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Leon County', 'Leon County Programs')\" >";a+="<td class='ListingItemHolder'> <span class='ListingLink'>Leon County</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Marion County', 'Marion County Programs')\" >";a+="<td class='ListingAlternativeItemHolder'> <span class='ListingLink'>Marion County</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Miami-Dade County (Main Campus)', 'Miami-Dade County (Main Campus) Programs')\" >";a+="<td class='ListingItemHolder'> <span class='ListingLink'>Miami-Dade County (Main Campus)</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Miami-Dade County (Other Locations)', 'Miami-Dade County (Other Locations) Programs')\" >";a+="<td class='ListingAlternativeItemHolder'> <span class='ListingLink'>Miami-Dade County (Other Locations)</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Orange County', 'Orange County Programs')\" >";a+="<td class='ListingItemHolder'> <span class='ListingLink'>Orange County</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Palm Beach County', 'Palm Beach County Programs')\" >";a+="<td class='ListingAlternativeItemHolder'> <span class='ListingLink'>Palm Beach County</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Pasco County', 'Pasco County Programs')\" >";a+="<td class='ListingItemHolder'> <span class='ListingLink'>Pasco County</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Pinellas County', 'Pinellas County Programs')\" >";a+="<td class='ListingAlternativeItemHolder'> <span class='ListingLink'>Pinellas County</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Polk County', 'Polk County Programs')\" >";a+="<td class='ListingItemHolder'> <span class='ListingLink'>Polk County</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'Sarasota County', 'Sarasota County Programs')\" >";a+="<td class='ListingAlternativeItemHolder'> <span class='ListingLink'>Sarasota County</span></td>";a+="</tr>";a+="<tr onclick=\"BuildProgramCategoryListing('location', 'St. Lucie/Indian River/Martin Counties', 'St. Lucie/Indian River/Martin County Programs')\" >";a+="<td class='ListingItemHolder'> <span class='ListingLink'>St. Lucie/Indian River/Martin Counties</span></td>";a+="</tr>";a+="</tbody></table>";b+=a;$("#Programdiv").html(b)}function GetCategoryList(){$.ajax({type:"GET",url:"https://www.barry.edu/xml/programcategoryjson.txt",data:{},dataType:"json",contentType:"application/json;charset=UTF-8",success:function(d){jsonprogramcategory=d;var e=""+window.location+"",b=e.split("?");if(b[1]){var a=b[1].split("=");a[0]=="county"&&BuildProgramCategoryListing("location",a[1],a[1]+" Programs");var c=a[1].split("&");c[0].toLowerCase()=="all"&&BuildAllProgramListing()}if($.cookie("programcookie")){cookie_exist($.cookie("programcookie"));$.cookie("programcookie",null)}}})}function cookie_exist(b){var a="No";if(b=="Undergraduate Programs"){BuildProgramCategoryListing("Cat",2,"Undergraduate Programs");a="Yes"}if(b=="Bachelor Programs"){BuildProgramCategoryListing("Cat",2,"Bachelor Programs");a="Yes"}if(b=="Graduate Programs"){BuildProgramCategoryListing("Cat",15,"Graduate Programs");a="Yes"}if(b=="Master Programs"){BuildProgramCategoryListing("Cat",15,"Master Programs");a="Yes"}if(b=="Specialist Programs"){BuildProgramCategoryListing("Cat",14,"Specialist Programs");a="Yes"}if(b=="Doctorate Programs"){BuildProgramCategoryListing("Cat",13,"Doctorate Programs");a="Yes"}if(b=="Health Related Programs"){BuildProgramCategoryListing("Cat",3,"Health Related Programs");a="Yes"}if(b=="Evening and Weekend Programs"){BuildProgramCategoryListing("Cat",4,"Evening and Weekend Programs");a="Yes"}if(b=="Non-Degree and Certificate Programs"){BuildProgramCategoryListing("Cat",16,"Non-Degree and Certificate Programs");a="Yes"}if(a=="No"){$("#programsearch").val(b);BuildProgramListing()}}function ProgramSearchInsert(b,c){$.ajax({type:"POST",url:"https://www.barry.edu/webservice/ProgramsHost/programs.svc/ProgramSearchInsert",data:'{"Keyword": "'+b+'" , "IpAddress": "", "Link": "'+c+'"}',dataType:"xml",contentType:"application/json;charset=UTF-8",success:function(){}});var a=new Date;a.setTime(a.getTime()+10*60*1e3);$.cookie("programcookie",b,{expires:a});parent.window.location=c}function BuildProgramListing(){clearInterval(startscroll);$(".ajax-holder").html("");$(".text-content").html("");$(".inner").html("");$(".listing").html("");var g=$("#programsearch").val(),d=$("#programsearch").val();d=d.replace("(","");d=d.replace(")","");var c=jsonprograms,h="";count=1;count2=1;for(var e="ListingItemHolder",b=0;b<c.length;b++){var f=c[b].Name,j=c[b].Keyword;f=f.replace("(","");f=f.replace(")","");var i=c[b].URL,l=f.toLowerCase().match(d.toLowerCase()),k=j.toLowerCase().match(d.toLowerCase());if(l||k){var a="<table width='97%' border='0' cellpadding='6' cellspacing='0'><tbody>";if(count2==1){a+="<tr><td height='5'></td></tr><tr>";a+="<td class='ListingAlternativeItemHolder'><b  style='font-size:12pt'>&nbsp;&nbsp;Search results for: '"+g+"'</b></td>";a+="</tr><tr><td height='5'></td></tr>";count2=2}if(i==""){a+="<tr><td class='"+e+"'> <span class='ListingNoLink'>"+c[b].Name+"</span></td></tr>";a+="<tr><td class='"+e+"'><div style='margin-left:15px;'><p>"+c[b].Description+"</p></div></td></tr>"}else{a+="<tr><td class='"+e+"' onclick=\"ProgramSearchInsert('"+g+"', '"+i+"')\" > <span class='ListingLink'>"+c[b].Name+"</span></td></tr>";a+="<tr><td class='"+e+"'><div style='margin-left:15px;'><p>"+c[b].Description+"</p></div></td></tr>"}a+="</tbody></table>";h+=a;if(count==1){count=2;e="ListingAlternativeItemHolder"}else{count=1;e="ListingItemHolder"}}}$("#Programdiv").html(h)}function BuildAllProgramListing(){clearInterval(startscroll);if(jsonprograms){clearInterval(i);$(".ajax-holder").html("");$(".text-content").html("");$(".inner").html("");$(".listing").html("");var e="",c=jsonprograms,f="";count=1;count2=1;for(var d="ListingItemHolder",b=0;b<c.length;b++){var h=c[b].Name,j=c[b].Keyword,g=c[b].URL,l=h.toLowerCase().match(e.toLowerCase()),k=j.toLowerCase().match(e.toLowerCase());if(l||k){var a="<table width='97%' border='0' cellpadding='6' cellspacing='0'><tbody>";if(count2==1){a+="<tr><td height='5'></td></tr><tr>";a+="<td class='ListingAlternativeItemHolder'><b style='font-size:12pt'>&nbsp;&nbsp;All Programs</b></td>";a+="</tr><tr><td height='5'></td></tr>";count2=2}if(g==""){a+="<tr><td class='"+d+"'> <span class='ListingNoLink'>"+c[b].Name+"</span></td></tr>";a+="<tr><td class='"+d+"'> <div style='margin-left:15px;'><p>"+c[b].Description+"</p></div></td></tr>"}else{a+="<tr><td class='"+d+"' onclick=\"ProgramSearchInsert('All Programs', '"+g+"')\" > <span class='ListingLink'>"+c[b].Name+"</span></td></tr>";a+="<tr><td class='"+d+"'> <div style='margin-left:15px;'><p>"+c[b].Description+"</p></div></td></tr>"}a+="</tbody></table>";f+=a;if(count==1){count=2;d="ListingAlternativeItemHolder"}else{count=1;d="ListingItemHolder"}}}$("#Programdiv").html(f)}else var i=setInterval("BuildAllProgramListing()",3e3)}function BuildProgramCategoryListing(j,m,g){clearInterval(startscroll);if(jsonprogramcategory){var f,i="";$(".ajax-holder").html("");$(".text-content").html("");$(".inner").html("");$(".listing").html("");var d=jsonprogramcategory,k="";count=1;count2=1;for(var b="ListingItemHolder",c=0;c<d.length;c++){var e=d[c].AltName,h=d[c].URL,o=d[c].Category,n=d[c].StudentType,p=d[c].WEBNAME;if(j=="Cat")f=o;if(j=="Student")f=n;if(j=="location")f=p;if(i!=e)if(m=="15"){for(var l=13;l<16;l++)if(f==l){var a="<table width='97%' border='0' cellpadding='6' cellspacing='0'><tbody>";if(count2==1){a+="</tr><tr><td height='5'></td></tr><tr>";a+="<td class='ListingAlternativeItemHolder'><b style='font-size:12pt'>&nbsp;&nbsp;"+g+"</b></td>";a+="</tr></tr><tr><td height='5'></td></tr>";count2=2}if(h==""){a+="<tr><td class='"+b+"'> <span class='ListingNoLink'>"+e+"</span></td></tr>";a+="<tr><td class='"+b+"'><div style='margin-left:15px;'><p>"+d[c].Description+"</p></div></td></tr>"}else{a+="<tr><td class='"+b+"' onclick=\"ProgramSearchInsert('"+g+"', '"+h+"')\" > <span class='ListingLink'>"+e+"</span></td></tr>";a+="<tr><td class='"+b+"'><div style='margin-left:15px;'><p>"+d[c].Description+"</p></div></td></tr>"}a+="</tbody></table>";k+=a;if(count==1){count=2;b="ListingAlternativeItemHolder"}else{count=1;b="ListingItemHolder"}i=e}}else if(f==m){var a="<table width='97%' border='0' cellpadding='6' cellspacing='0'><tbody>";if(count2==1){a+="</tr><tr><td height='5'></td></tr><tr>";a+="<td class='ListingAlternativeItemHolder'><b style='font-size:12pt'>&nbsp;&nbsp;"+g+"</b></td>";a+="</tr></tr><tr><td height='5'></td></tr>";count2=2}if(h==""){a+="<tr><td class='"+b+"'> <span class='ListingNoLink'>"+e+"</span></td></tr>";a+="<tr><td class='"+b+"'><div style='margin-left:15px;'><p>"+d[c].Description+"</p></div></td></tr>"}else{a+="<tr><td class='"+b+"' onclick=\"ProgramSearchInsert('"+g+"', '"+h+"')\" > <span class='ListingLink'>"+e+"</span></td></tr>";a+="<tr><td class='"+b+"'><div style='margin-left:15px;'><p>"+d[c].Description+"</p></div></td></tr>"}a+="</tbody></table>";k+=a;if(count==1){count=2;b="ListingAlternativeItemHolder"}else{count=1;b="ListingItemHolder"}i=e}}$("#Programdiv").html(k)}}function GetNews(a,b,d,c){$.ajax({type:"GET",url:"//www.barry.edu/xml/xml.aspx?id="+a,dataType:"jsonp",success:function(e){d=="Horizontal"&&buildNewsTableHorizontal(e,b,c,a);d=="Vertical"&&buildNewsTableVertical(e,c,a,b)}})}function buildNewsTableVertical(b,g,f,d){if(d=="0")d=b.length;for(var e="<table border='0' cellpadding='3' cellspacing='0'>",a=0;a<d;a++){var c="<tr class='photo-list'> ";c+="<td valign='top' ><a href='http://www.barry.edu/news/details.aspx?ID="+b[a].Article_ID+"&webid="+f+"'><img alt='"+b[a].Title+"' src='"+b[a].Image_URL+"' width='165' style='border-color:#CC0000;border-style:solid;border-width:1px;' /></a></td>";c+="<td valign='top' style='width:250px'><span class='newsDate'>"+b[a].Date_Posted+"</span><br /><a href='http://www.barry.edu/news/details.aspx?ID="+b[a].Article_ID+"&webid="+f+"' class='newsTitle'>"+b[a].Title+"</a>";if(g=="yes")c+="<br>"+b[a].Teaser;c+="</td>";c+="</tr>";e+=c}e+="</table>";$("#news").html(e)}function buildNewsTableHorizontal(b,f,h,g){if(f=="0")f=b.length;var d="<table width='100%' border='0' cellpadding='3' cellspacing='0'><tbody>",e="<tr>";d+=e;for(var a=0;a<f;a++){var c="<td valign='top' align='center'><ul class='photo-list'>";c+="<li><a href='http://www.barry.edu/news/details.aspx?ID="+b[a].Article_ID+"&webid="+g+"'><img alt='"+b[a].Title+"' src='"+b[a].Image_URL+"' width='165' border='0' /></a>";c+="<p><a href='http://www.barry.edu/news/details.aspx?ID="+b[a].Article_ID+"&webid="+g+"'>"+b[a].Title+"</a></p>";c+=" </li>";if(h=="yes")c+="<li>"+b[a].Teaser+"</li>";c+="</ul></td>";e+=c}e+="</tr>";d+=e;d+="</td></tr></tbody></table>";$("#news").html(d)}jQuery.cookie=function(d,c,a){if(typeof c!="undefined"){a=a||{};if(c===null){c="";a.expires=-1}var h="";if(a.expires&&(typeof a.expires=="number"||a.expires.toUTCString)){var b;if(typeof a.expires=="number"){b=new Date;b.setTime(b.getTime()+a.expires*24*60*60*1e3)}else b=a.expires;h="; expires="+b.toUTCString()}var l=a.path?"; path="+a.path:"",j=a.domain?"; domain="+a.domain:"",k=a.secure?"; secure":"";document.cookie=[d,"=",encodeURIComponent(c),h,l,j,k].join("")}else{var f=null;if(document.cookie&&document.cookie!="")for(var g=document.cookie.split(";"),e=0;e<g.length;e++){var i=jQuery.trim(g[e]);if(i.substring(0,d.length+1)==d+"="){f=decodeURIComponent(i.substring(d.length+1));break}}return f}}
