function getElementId(s){return(document.getElementById)?document.getElementById(s):document.all[s];}
var editable={};editable.loadNewEditableArea=function(id,pageId){var URL=SITE_URL+"LoadAjaxCallEditableArea.do?ajaxcall=true&file=jsp/includes/newContent.jsp&editAreaId="+id+"&pageId="+pageId;var formObject=getElementId("EditableContentForm");handleSuccess=function(o){getElementId("editableArea").innerHTML=o.responseText;}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.asyncRequest("POST",URL,callback);}
editable.displayNextEvents=function(SLimit,ELimit,Mode,PageID){var URL=SITE_URL+"LoadAjaxCallMoreServiceuEvents.do?ajaxcall=true&startlimit="+SLimit+"&endlimit="+ELimit+"&mode="+Mode+"&editId="+PageID;handleSuccess=function(o){getElementId("serviceuEvent").innerHTML=o.responseText;serviceUSettings={tl:{radius:10},tr:{radius:10},bl:{radius:10},br:{radius:10},antiAlias:true,autoPad:true,validTags:["div"]}
var serviceUObject=new curvyCorners(serviceUSettings,"ServiceUBOX");serviceUObject.applyCornersToAll();}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.asyncRequest("GET",URL,callback);}
editable.loadNextMonthEvents=function(orgID,depID,currentDate,mode){var URL=SITE_URL+"LoadAjaxCallNextMonthEvents.do?ajaxcall=true&file=jsp/includes/servideuListTPL.jsp&orgID="+orgID+"&depID="+depID+"&currentDate="+currentDate+"&mode="+mode;var loader=getElementId("loaderEvents");handleSuccess=function(o){loader.style.display='none';getElementId("nextmonthEvents").innerHTML=o.responseText;}
callback={success:handleSuccess,failure:this.handleFailure}
loader.style.display='block';YAHOO.util.Connect.asyncRequest("GET",URL,callback);}
editable.saveEditableContent=function(mode,id,pageId){if(mode=='edit'){URL=SITE_URL+"EditableContentAction.do?ajaxcall=true&mode="+mode+"&editId="+id+"&pageId="+pageId;}else{URL=SITE_URL+"EditableContentAction.do?ajaxcall=true&mode="+mode+"&pageId="+pageId;}
var formObject=getElementId("EditableContentForm");var loader=getElementId("loader");handleSuccess=function(o){loader.style.display='none';if(parseInt(o.responseText)==1){alert("Editable Area has been saved successfully");var currentURL=unescape(location.href);location.href=currentURL;}else{getElementId("editableArea").innerHTML=o.responseText;}}
var oEditor=FCKeditorAPI.GetInstance('content');content=oEditor.GetXHTML(true);callback={upload:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.setForm(formObject,true);loader.style.display='block';YAHOO.util.Connect.asyncRequest("POST",URL,callback);}
editable.GetEventDetail=function(OrgID,EventID,OccID){getElementId('GetEventDetailPanel').style.display='block';GetEventDetailPanel.show();var loader=getElementId("loader1");var URL=SITE_URL+"LoadAjaxCallEventDetail.do?ajaxcall=true&file=jsp/includes/eventDetail.jsp&OrgID="+OrgID+"&EventID="+EventID+"&OccID="+OccID;getElementId("GetEventDetailDiv").innerHTML="";handleSuccess=function(o){getElementId("GetEventDetailDiv").innerHTML=o.responseText;loader.style.display='none';}
callback={success:handleSuccess,failure:this.handleFailure}
loader.style.display='block';YAHOO.util.Connect.asyncRequest("GET",URL,callback);}
editable.getAdHocEventDetail=function(EventID){getElementId('GetAdHocEventDetailPanel').style.display='block';GetAdHocEventDetailPanel.show();var loader=getElementId("loader2");var URL=SITE_URL+"LoadAjaxCallAdHocEventDetail.do?ajaxcall=true&file=jsp/includes/adhocEventDetail.jsp&EventID="+EventID;getElementId("GetAdHocEventDetailDiv").innerHTML="";handleSuccess=function(o){getElementId("GetAdHocEventDetailDiv").innerHTML=o.responseText;loader.style.display='none';}
callback={success:handleSuccess,failure:this.handleFailure}
loader.style.display='block';YAHOO.util.Connect.asyncRequest("GET",URL,callback);}
editable.loadTopBanner=function(bannerID,areaID,pageID){getElementId('topBannerPanel').style.display='block';var formObject=getElementId("BannerForm");topBannerPanel.show();var URL=SITE_URL+"LoadAjaxCallBanner.do?ajaxcall=true&file=jsp/includes/topBanner.jsp&bannerID="+bannerID+"&areaID="+areaID;handleSuccess=function(o){getElementId("topBannerDiv").innerHTML=o.responseText;var styleInputs=FileUI;styleInputs.imgPath='images/browse.gif';styleInputs.imgPathOver='images/browse.gif';styleInputs.init();var formObject=getElementId("BannerForm");var linktype_value="";for(i=0;i<formObject.linktype.length;i++)
{if(formObject.linktype[i].checked)
{linktype_value=formObject.linktype[i].value;}}
editable.getLinkType(linktype_value);}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.asyncRequest("GET",URL,callback);}
editable.loadRightBanner=function(bannerID,areaID,pageID){getElementId('rightBannersPanel').style.display='block';var formObject=getElementId("BannerForm");rightBannersPanel.show();var URL=SITE_URL+"LoadAjaxCallBanner.do?ajaxcall=true&file=jsp/includes/rightBanner.jsp&bannerID="+bannerID+"&areaID="+areaID;handleSuccess=function(o){getElementId("rightBannersDiv").innerHTML=o.responseText;var styleInputs=FileUI;styleInputs.imgPath='images/browse.gif';styleInputs.imgPathOver='images/browse.gif';styleInputs.init();var formObject=getElementId("BannerForm");var linktype_value="";for(i=0;i<formObject.linktype.length;i++)
{if(formObject.linktype[i].checked)
{linktype_value=formObject.linktype[i].value;}}
editable.getLinkType(linktype_value);}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.asyncRequest("GET",URL,callback);}
editable.loadMiddleBanner=function(bannerID,areaID,pageID){getElementId('middleBannerPanel').style.display='block';var formObject=getElementId("BannerForm");middleBannerPanel.show();var URL=SITE_URL+"LoadAjaxCallBanner.do?ajaxcall=true&file=jsp/includes/middleBanner.jsp&bannerID="+bannerID+"&areaID="+areaID;handleSuccess=function(o){getElementId("middleBannersDiv").innerHTML=o.responseText;var styleInputs=FileUI;styleInputs.imgPath='images/browse.gif';styleInputs.imgPathOver='images/browse.gif';styleInputs.init();var formObject=getElementId("BannerForm");var linktype_value="";for(i=0;i<formObject.linktype.length;i++)
{if(formObject.linktype[i].checked)
{linktype_value=formObject.linktype[i].value;}}
editable.getLinkType(linktype_value);}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.asyncRequest("GET",URL,callback);}
editable.saveBanner=function(mode,id,pageId,sectionID,area){var countType=0;var index=0;var formObject=getElementId("BannerForm");for(index=0;index<=formObject.linktype.length;index++){if(formObject.linktype[index].checked){countType=1;var linkType=formObject.linktype[index].value;break;}}
if(countType==0){alert("Please select the Link Type and try again!");return;}else{if(linkType=="event"){if(document.BannerForm.eventURL.value=="0"||document.BannerForm.eventURL.value==""){alert("Please select the Event from drop down and try again!");return;}}else if(linkType=="page"){if(document.BannerForm.pageURL.value=="0"||document.BannerForm.pageURL.value==""){alert("Please select the Page from drop down and try again!");return;}}else if(linkType=="externalurl"){if(document.BannerForm.external_url.value=="0"||document.BannerForm.external_url.value==""){alert("Please enter the External URL and try again!");return;}}}
var countOpenAs=0;for(index=0;index<document.BannerForm.open_as.length;index++){if(document.BannerForm.open_as[index].checked){countOpenAs=1;var linkType=document.BannerForm.open_as[index].value;break;}}
if(countOpenAs==0){alert("Please select the Open As field and try again!");return;}
var URL;if(mode=='edit'){URL=SITE_URL+"BannersAction.do?ajaxcall=true&mode="+mode+"&editId="+id+"&sectionid="+sectionID;}else{URL=SITE_URL+"BannersAction.do?ajaxcall=true&mode="+mode+"&sectionid="+sectionID;}
var formObject=getElementId("BannerForm");formObject.fileVal.value=formObject.file1.value;var loader=getElementId("loader");handleSuccess=function(o){loader.style.display='none';if(parseInt(o.responseText)==1){if(area=="top"){alert("New Top Banner has been saved successfully");}else if(area=="right"){alert("New Right Banner has been saved successfully");}else if(area=="middle"){alert("New Middle Banner has been saved successfully");}
var currentURL=unescape(location.href);location.href=currentURL;}else{if(area=="top"){getElementId("topBannerDiv").innerHTML=o.responseText;}else if(area=="right"){getElementId("rightBannersDiv").innerHTML=o.responseText;}else if(area=="middle"){getElementId("middleBannersDiv").innerHTML=o.responseText;}}}
callback={upload:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.setForm(formObject,true);loader.style.display='block';YAHOO.util.Connect.asyncRequest("POST",URL,callback);}
editable.refreshTopBanner=function(pageID){var URL=SITE_URL+"RefershAjaxCallBanner.do?ajaxcall=true&file=jsp/includes/topBannerTPL.jsp&pageID="+pageID+"&area=top";handleSuccess=function(o){getElementId("topBannerArea").innerHTML=o.responseText;}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.asyncRequest("GET",URL,callback);}
editable.refreshRightBanner=function(pageID){var URL=SITE_URL+"RefershAjaxCallBanner.do?ajaxcall=true&file=jsp/includes/rightBannerTPL.jsp&pageID="+pageID+"&area=right";handleSuccess=function(o){getElementId("rightBannerArea").innerHTML=o.responseText;}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.asyncRequest("GET",URL,callback);}
editable.refreshMiddleBanner=function(pageID){var URL=SITE_URL+"RefershAjaxCallBanner.do?ajaxcall=true&file=jsp/includes/middleBannerTPL.jsp&pageID="+pageID+"&area=middle";handleSuccess=function(o){getElementId("middleBannerArea").innerHTML=o.responseText;}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.asyncRequest("GET",URL,callback);}
editable.deleteRightBanner=function(mode,id,img,folder){var bDelete=false;bDelete=confirm("Are you sure you wish to delete the selected record?\n\n\nClick 'Ok' to continue.");if(bDelete==true)
{var URL=SITE_URL+"BannersAction.do?ajaxcall=true&editId="+id+"&mode="+mode+"&image="+img+"&folder="+folder;var loader=getElementId("loader");handleSuccess=function(o){loader.style.display='none';if(parseInt(o.responseText)==1){var currentURL=unescape(location.href);location.href=currentURL;}else{var currentURL=unescape(location.href);location.href=currentURL;}}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.asyncRequest("GET",URL,callback);}else{return false;}}
editable.setNewOldBanners=function(){var formObject=getElementId("RightBannerForm");var Value=getElementId("old_new").value;if(Value=="new"){getElementId("old").style.display="none";getElementId("new").style.display=""}else if(Value=="old"){getElementId("old").style.display="";getElementId("new").style.display="none"}}
editable.getLinkType=function(type){if(type=="event"){getElementId("event").style.display="";getElementId("page").style.display="none";getElementId("external").style.display="none";}else if(type=="page"){getElementId("event").style.display="none";getElementId("page").style.display="";getElementId("external").style.display="none";}else if(type=="externalurl"){getElementId("event").style.display="none";getElementId("page").style.display="none";getElementId("external").style.display="";}else if(type=="noLink"){getElementId("event").style.display="none";getElementId("page").style.display="none";getElementId("external").style.display="none";}}
editable.displayall=function(){var formObject=getElementId("DepRel");var moreRow=getElementId("more_evt").style.display="";}
editable.collapseall=function(){var formObject=getElementId("DepRel");var moreRow=getElementId("more_evt").style.display="none";}
editable.doSearch=function(){var strSearch;strSearch=getElementId("search").value;var URL=SITE_URL+"SearchAction.do?ajaxcall=true&search="+strSearch;window.location.href=URL;}
editable.openPopUp=function(url_add){var strFeatures="toolbar=no,status=no,menubar=no,location=no"
strFeatures=strFeatures+",scrollbars=no,resizable=yes,height=655,width=875"
newWin=window.open(url_add,"Live",strFeatures);newWin.opener=top;}
function getElementId(s){return(document.getElementById)?document.getElementById(s):document.all[s];}
var homePage={};homePage.loadFlashBanner=function(bannerID,areaID){getElementId('flashBannerPanel').style.display='block';flashBannerPanel.show();var loader=getElementId("loaderOne");var URL=SITE_URL+"LoadAjaxCallBanner.do?ajaxcall=true&file=jsp/includes/flashBanner.jsp&bannerID="+bannerID+"&areaID="+areaID;handleSuccess=function(o){loader.style.display='none';getElementId("flashBannerDiv").innerHTML="";getElementId("flashBannerDiv").innerHTML=o.responseText;$("input[type=file]").filestyle({image:"images/browse.gif",imageheight:22,imagewidth:40,width:180});var formObject=getElementId("BannerForm");var linktype_value="";for(i=0;i<formObject.linktype.length;i++)
{if(formObject.linktype[i].checked)
{linktype_value=formObject.linktype[i].value;}}
homePage.getLinkType(linktype_value);var count=getElementId("total").value;if(count>0){for(i=0;i<count;i++){cvi_corner.add(document.getElementById("flaPic"+i),{radius:10,shadow:25,shade:0});cvi_corner.add(document.getElementById("flaButton"+i),{radius:10,shadow:0,shade:0});}}}
callback={success:handleSuccess,failure:this.handleFailure}
loader.style.display='block';YAHOO.util.Connect.asyncRequest("POST",URL,callback);}
homePage.loadAjaxFlashBanner=function(bannerID,areaID){getElementId('flashBannerPanel').style.display='block';flashBannerPanel.show();var loader=getElementId("loaderOne");var formObject=getElementId("BannerForm");var URL=SITE_URL+"LoadAjaxCallFlashBanner.do?ajaxcall=true&bannerID="+bannerID+"&areaID="+areaID;handleSuccess=function(o){loader.style.display='none';getElementId("flashBannerDiv").innerHTML="";getElementId("flashBannerDiv").innerHTML=o.responseText;$("input[type=file]").filestyle({image:"images/browse.gif",imageheight:22,imagewidth:40,width:180});var formObject=getElementId("BannerForm");var linktype_value="";for(i=0;i<formObject.linktype.length;i++)
{if(formObject.linktype[i].checked)
{linktype_value=formObject.linktype[i].value;}}
homePage.getLinkType(linktype_value);var count=getElementId("total").value;if(count>0){for(i=0;i<count;i++){cvi_corner.add(document.getElementById("flaPic"+i),{radius:10,shadow:25,shade:0});cvi_corner.add(document.getElementById("flaButton"+i),{radius:10,shadow:0,shade:0});}}}
callback={success:handleSuccess,failure:this.handleFailure}
loader.style.display='block';YAHOO.util.Connect.asyncRequest("POST",URL,callback);}
homePage.loadMiddleBanner=function(bannerID,areaID){getElementId('homeMiddleBannerPanel').style.display='block';homeMiddleBannerPanel.show();var URL=SITE_URL+"LoadAjaxCallBanner.do?ajaxcall=true&file=jsp/includes/middleBannerHome.jsp&bannerID="+bannerID+"&areaID="+areaID;handleSuccess=function(o){getElementId("homeMiddleBannerDiv").innerHTML=o.responseText;var linktype_value="";var formObject=getElementId("BannerForm");for(i=0;i<formObject.linktype.length;i++)
{if(formObject.linktype[i].checked)
{linktype_value=formObject.linktype[i].value;}}
homePage.getLinkType(linktype_value);var styleInputs=FileUI;styleInputs.imgPath='images/browse.gif';styleInputs.imgPathOver='images/browse.gif';styleInputs.init();}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.asyncRequest("GET",URL,callback);}
homePage.loadResourceBannerHome=function(bannerID,areaID){getElementId('homeResourceBannerPanel').style.display='block';homeResourceBannerPanel.show();var URL=SITE_URL+"LoadAjaxCallBanner.do?ajaxcall=true&file=jsp/includes/resourceBannerHome.jsp&bannerID="+bannerID+"&areaID="+areaID;handleSuccess=function(o){getElementId("homeResourceBannerDiv").innerHTML=o.responseText;var linktype_value="";var formObject=getElementId("BannerForm");for(i=0;i<formObject.linktype.length;i++)
{if(formObject.linktype[i].checked)
{linktype_value=formObject.linktype[i].value;}}
homePage.getLinkType(linktype_value);var styleInputs=FileUI;styleInputs.imgPath='images/browse.gif';styleInputs.imgPathOver='images/browse.gif';styleInputs.init();}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.asyncRequest("GET",URL,callback);}
homePage.loadBottomBanner=function(bannerID,areaID){getElementId('homeBottomBannerPanel').style.display='block';homeBottomBannerPanel.show();var URL=SITE_URL+"LoadAjaxCallBanner.do?ajaxcall=true&file=jsp/includes/bottomBannerHome.jsp&bannerID="+bannerID+"&areaID="+areaID;handleSuccess=function(o){getElementId("homeBottomBannerDiv").innerHTML=o.responseText;var linktype_value="";var formObject=getElementId("BannerForm");for(i=0;i<formObject.linktype.length;i++)
{if(formObject.linktype[i].checked)
{linktype_value=formObject.linktype[i].value;}}
homePage.getLinkType(linktype_value);var styleInputs=FileUI;styleInputs.imgPath='images/browse.gif';styleInputs.imgPathOver='images/browse.gif';styleInputs.init();}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.asyncRequest("GET",URL,callback);}
homePage.saveBanner=function(mode,id,sectionID,area){var countType=0;for(index=0;index<document.BannerForm.link_type.length;index++){if(document.BannerForm.link_type[index].checked){countType=1;var linkType=document.BannerForm.link_type[index].value;break;}}
if(countType==0){alert("Please select the Link Type and try again!");return;}else{if(linkType=="event"){if(document.BannerForm.eventURL.value=="0"||document.BannerForm.eventURL.value==""){alert("Please select the Event from drop down and try again!");return;}}else if(linkType=="page"){if(document.BannerForm.pageURL.value=="0"||document.BannerForm.pageURL.value==""){alert("Please select the Page from drop down and try again!");return;}}else if(linkType=="externalurl"){if(document.BannerForm.external_url.value=="0"||document.BannerForm.external_url.value==""){alert("Please enter the External URL and try again!");return;}}}
var countOpenAs=0;for(index=0;index<document.BannerForm.open_as.length;index++){if(document.BannerForm.open_as[index].checked){countOpenAs=1;var linkType=document.BannerForm.open_as[index].value;break;}}
if(countOpenAs==0){alert("Please select the Open As field and try again!");return;}
var URL;if(mode=='edit'){URL=SITE_URL+"FlashBannerAction.do?ajaxcall=true&mode="+mode+"&editId="+id+"&sectionid="+sectionID;}else{URL=SITE_URL+"FlashBannerAction.do?ajaxcall=true&mode="+mode+"&sectionid="+sectionID;}
var formObject=getElementId("BannerForm");formObject.fileVal.value=formObject.file1.value;var loader=getElementId("loader");handleSuccess=function(o){loader.style.display='none';if(parseInt(o.responseText)==1){alert("New Flash Banner has been saved successfully");flashBannerPanel.hide();var currentURL=unescape(location.href);location.href=currentURL;}else{getElementId("flashBannerDiv").innerHTML=o.responseText;$("input[type=file]").filestyle({image:"images/browse.gif",imageheight:22,imagewidth:40,width:180});var formObject=getElementId("BannerForm");var linktype_value="";for(i=0;i<formObject.linktype.length;i++)
{if(formObject.linktype[i].checked)
{linktype_value=formObject.linktype[i].value;}}
homePage.getLinkType(linktype_value);var count=getElementId("total").value;if(count>0){for(i=0;i<count;i++){cvi_corner.add(document.getElementById("flaPic"+i),{radius:10,shadow:25,shade:0});cvi_corner.add(document.getElementById("flaButton"+i),{radius:10,shadow:0,shade:0});}}
var currentURL=unescape(location.href);location.href=currentURL;}}
callback={upload:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.setForm(formObject,true);loader.style.display='block';YAHOO.util.Connect.asyncRequest("POST",URL,callback);}
homePage.saveBannerAction=function(mode,id,sectionID,area){var countType=0;for(index=0;index<document.BannerForm.linktype.length;index++){if(document.BannerForm.linktype[index].checked){countType=1;var linkType=document.BannerForm.linktype[index].value;break;}}
if(countType==0){alert("Please select the Link Type and try again!");return;}else{if(linkType=="event"){if(document.BannerForm.eventURL.value=="0"||document.BannerForm.eventURL.value==""){alert("Please select the Event from drop down and try again!");return;}}else if(linkType=="page"){if(document.BannerForm.pageURL.value=="0"||document.BannerForm.pageURL.value==""){alert("Please select the Page from drop down and try again!");return;}}else if(linkType=="externalurl"){if(document.BannerForm.external_url.value=="0"||document.BannerForm.external_url.value==""){alert("Please enter the External URL and try again!");return;}}}
var countOpenAs=0;for(index=0;index<document.BannerForm.open_as.length;index++){if(document.BannerForm.open_as[index].checked){countOpenAs=1;var linkType=document.BannerForm.open_as[index].value;break;}}
if(countOpenAs==0){alert("Please select the Open As field and try again!");return;}
var URL;if(mode=='edit'){URL=SITE_URL+"HomeBannerAction.do?ajaxcall=true&mode="+mode+"&editId="+id+"&sectionid="+sectionID;}else{URL=SITE_URL+"HomeBannerAction.do?ajaxcall=true&mode="+mode+"&sectionid="+sectionID;}
var formObject=getElementId("BannerForm");formObject.fileVal.value=formObject.file1.value;var loader=getElementId("loader");handleSuccess=function(o){loader.style.display='none';if(parseInt(o.responseText)==1){alert("Banner has been saved successfully");if(area=='middle'){homeBottomBannerPanel.hide();}else{homeMiddleBannerPanel.hide();}
var currentURL=unescape(location.href);window.location.href=currentURL;}else{getElementId("homeMiddleBannerDiv").innerHTML=o.responseText;}}
callback={upload:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.setForm(formObject,true);loader.style.display='block';YAHOO.util.Connect.asyncRequest("POST",URL,callback);}
homePage.saveResourceBannerAction=function(mode,id,sectionID,area){var countType=0;for(index=0;index<document.BannerForm.linktype.length;index++){if(document.BannerForm.linktype[index].checked){countType=1;var linkType=document.BannerForm.linktype[index].value;break;}}
if(countType==0){alert("Please select the Link Type and try again!");return;}else{if(linkType=="event"){if(document.BannerForm.eventURL.value=="0"||document.BannerForm.eventURL.value==""){alert("Please select the Event from drop down and try again!");return;}}else if(linkType=="page"){if(document.BannerForm.pageURL.value=="0"||document.BannerForm.pageURL.value==""){alert("Please select the Page from drop down and try again!");return;}}else if(linkType=="externalurl"){if(document.BannerForm.external_url.value=="0"||document.BannerForm.external_url.value==""){alert("Please enter the External URL and try again!");return;}}}
var countOpenAs=0;for(index=0;index<document.BannerForm.open_as.length;index++){if(document.BannerForm.open_as[index].checked){countOpenAs=1;var linkType=document.BannerForm.open_as[index].value;break;}}
if(countOpenAs==0){alert("Please select the Open As field and try again!");return;}
var URL;if(mode=='edit'){URL=SITE_URL+"ResourceBannerHomeAction.do?ajaxcall=true&mode="+mode+"&editId="+id+"&sectionid="+sectionID;}else{URL=SITE_URL+"ResourceBannerHomeAction.do?ajaxcall=true&mode="+mode+"&sectionid="+sectionID;}
var formObject=getElementId("BannerForm");formObject.fileVal.value=formObject.file1.value;var loader=getElementId("loader");handleSuccess=function(o){loader.style.display='none';if(parseInt(o.responseText)==1){alert("Resources Banner has been saved successfully");if(area=='middle'){homeResourceBannerPanel.hide();}else{homeResourceBannerPanel.hide();}
var currentURL=unescape(location.href);window.location.href=currentURL;}else{getElementId("homeResourceBannerDiv").innerHTML=o.responseText;}}
callback={upload:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.setForm(formObject,true);loader.style.display='block';YAHOO.util.Connect.asyncRequest("POST",URL,callback);}
homePage.saveRescources=function(fun){var rescourcesForm=getElementId('BannerForm');var pageIDs="";for(i=0;i<rescourcesForm.elements.length;i++){if(rescourcesForm.elements[i].type=='checkbox'){if(rescourcesForm.elements[i].checked==true){rescourceIDs=rescourcesForm.elements[i].value;break;}}}
var URL=SITE_URL+"RescourcesAction.do?ajaxcall=true&function="+fun;var loader=getElementId("loader");handleSuccess=function(o){loader.style.display='none';if(parseInt(o.responseText)==1){alert("Recources has been saved successfully");rescourcesPagePanel.hide();var currentURL=unescape(location.href);location.href=currentURL;}else{getElementId("rescourcesPageDiv").innerHTML=o.responseText;}}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.setForm(rescourcesForm);loader.style.display='block';YAHOO.util.Connect.asyncRequest("POST",URL,callback);}
homePage.deleteFlashBanner=function(mode,id,img){var bDelete=false;bDelete=confirm("Are you sure you wish to delete the selected record?\n\n\nClick 'Ok' to continue.");if(bDelete==true)
{var URL=SITE_URL+"FlashBannerAction.do?ajaxcall=true&editId="+id+"&mode="+mode+"&image="+img;var loader=getElementId("loader");handleSuccess=function(o){loader.style.display='none';if(parseInt(o.responseText)==1){flashBannerPanel.hide();}else{getElementId("flashBannerDiv").innerHTML=o.responseText;}}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.asyncRequest("GET",URL,callback);}else{return false;}}
homePage.ChangeOrder=function(mode,id){var URL=SITE_URL+"FlashBannerAction.do?ajaxcall=true&editId="+id+"&mode="+mode;var loader=getElementId("loader");var formObject=getElementId("BannerForm");handleSuccess=function(o){loader.style.display='none';if(parseInt(o.responseText)==1){homePage.loadFlashBanner(0,0);}else{getElementId("flashBannerDiv").innerHTML=o.responseText;$("input[type=file]").filestyle({image:"images/browse.gif",imageheight:22,imagewidth:40,width:180});var formObject=getElementId("BannerForm");var linktype_value="";for(i=0;i<formObject.linktype.length;i++)
{if(formObject.linktype[i].checked)
{linktype_value=formObject.linktype[i].value;}}
homePage.getLinkType(linktype_value);var count=getElementId("total").value;if(count>0){for(i=0;i<count;i++){cvi_corner.add(document.getElementById("flaPic"+i),{radius:10,shadow:25,shade:0});cvi_corner.add(document.getElementById("flaButton"+i),{radius:10,shadow:0,shade:0});}}}}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.setForm(formObject);loader.style.display='block';YAHOO.util.Connect.asyncRequest("POST",URL,callback);}
homePage.deleteBottomBanner=function(mode,id,img){var bDelete=false;bDelete=confirm("Are you sure you wish to delete the selected record?\n\n\nClick 'Ok' to continue.");if(bDelete==true)
{var URL=SITE_URL+"HomeBannerAction.do?ajaxcall=true&editId="+id+"&mode="+mode+"&image="+img;var loader=getElementId("loader");handleSuccess=function(o){loader.style.display='none';if(parseInt(o.responseText)==1){var currentURL=unescape(location.href);location.href=currentURL;}else{var currentURL=unescape(location.href);location.href=currentURL;}}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.asyncRequest("GET",URL,callback);}else{return false;}}
homePage.getLinkType=function(type){if(type=="event"){getElementId("event").style.display="";getElementId("page").style.display="none";getElementId("external").style.display="none";}else if(type=="page"){getElementId("event").style.display="none";getElementId("page").style.display="";getElementId("external").style.display="none";}else if(type=="externalurl"){getElementId("event").style.display="none";getElementId("page").style.display="none";getElementId("external").style.display="";}else if(type=="noLink"){getElementId("event").style.display="none";getElementId("page").style.display="none";getElementId("external").style.display="none";}}
homePage.loadResources=function(mode,file){getElementId('rescourcesPagePanel').style.display='block';rescourcesPagePanel.show();var URL=SITE_URL+"LoadAjaxCallHome.do?ajaxcall=true&file="+file+"&mode="+mode;handleSuccess=function(o){getElementId("rescourcesPageDiv").innerHTML=o.responseText;}
callback={success:handleSuccess,failure:this.handleFailure}
YAHOO.util.Connect.asyncRequest("GET",URL,callback);}
homePage.wopen=function(url,name,w,h,s,r){w+=32;h+=96;var win=window.open(url,name,'width='+w+', height='+h+', '+'location=no, menubar=no, '+'status=no, toolbar=no, scrollbars= '+s+' , resizable='+r+'');win.resizeTo(w,h);win.focus();}
homePage.getSelectedRadioValue=function(buttonGroup){var i=getSelectedRadio(buttonGroup);if(i==-1){return"";}else{if(buttonGroup[i]){return buttonGroup[i].value;}else{return buttonGroup.value;}}}
var tmp=navigator.appName=='Microsoft Internet Explorer'&&navigator.userAgent.indexOf('Opera')<1?1:0;if(tmp)var isIE=document.namespaces?1:0;if(isIE){if(document.namespaces['v']==null){var stl=document.createStyleSheet();stl.addRule("v\\:*","behavior: url(#default#VML);");document.namespaces.add("v","urn:schemas-microsoft-com:vml");}}
function getRadius(radius,width,height){var part=(Math.min(width,height)/100);radius=Math.max(Math.min(100,radius/part),0);return radius+'%';}
function getImages(className){var children=document.getElementsByTagName('img');var elements=new Array();var i=0;var child;var classNames;var j=0;for(i=0;i<children.length;i++){child=children[i];classNames=child.className.split(' ');for(var j=0;j<classNames.length;j++){if(classNames[j]==className){elements.push(child);break;}}}
return elements;}
function getClasses(classes,string){var temp='';for(var j=0;j<classes.length;j++){if(classes[j]!=string){if(temp){temp+=' '}
temp+=classes[j];}}
return temp;}
function getClassValue(classes,string){var temp=0;var pos=string.length;for(var j=0;j<classes.length;j++){if(classes[j].indexOf(string)==0){temp=Math.min(classes[j].substring(pos),100);break;}}
return Math.max(0,temp);}
function getClassAttribute(classes,string){var temp=0;var pos=string.length;for(var j=0;j<classes.length;j++){if(classes[j].indexOf(string)==0){temp=1;break;}}
return temp;}
function roundedRect(ctx,x,y,width,height,radius,nopath){if(!nopath)ctx.beginPath();ctx.moveTo(x,y+radius);ctx.lineTo(x,y+height-radius);ctx.quadraticCurveTo(x,y+height,x+radius,y+height);ctx.lineTo(x+width-radius,y+height);ctx.quadraticCurveTo(x+width,y+height,x+width,y+height-radius);ctx.lineTo(x+width,y+radius);ctx.quadraticCurveTo(x+width,y,x+width-radius,y);ctx.lineTo(x+radius,y);ctx.quadraticCurveTo(x,y,x,y+radius);if(!nopath)ctx.closePath();}
function addGradient(ctx,x,y,w,h,color,opacity){var tmp=ctx.createLinearGradient(x,y,w,h);var val=(color!=0?0.25:0.35);tmp.addColorStop(0,'rgba('+color+','+color+','+color+',0.9)');tmp.addColorStop(val,'rgba('+color+','+color+','+color+','+opacity+')');tmp.addColorStop(0.75,'rgba('+color+','+color+','+color+',0)');tmp.addColorStop(1,'rgba('+color+','+color+','+color+',0)');return tmp;}
function addRadialStyle(ctx,x1,y1,r1,x2,y2,r2,opacity){var tmp=ctx.createRadialGradient(x1,y1,r1,x2,y2,r2);var opt=Math.min(parseFloat(opacity+0.1),1.0);tmp.addColorStop(0,'rgba(0,0,0,'+opt+')');tmp.addColorStop(0.25,'rgba(0,0,0,'+opacity+')');tmp.addColorStop(1,'rgba(0,0,0,0)');return tmp;}
function addLinearStyle(ctx,x,y,w,h,opacity){var tmp=ctx.createLinearGradient(x,y,w,h);var opt=Math.min(parseFloat(opacity+0.1),1.0);tmp.addColorStop(0,'rgba(0,0,0,'+opt+')');tmp.addColorStop(0.25,'rgba(0,0,0,'+opacity+')');tmp.addColorStop(1,'rgba(0,0,0,0)');return tmp;}
function addShine(ctx,width,height,radius,opacity,extra){var style;var color=(extra!=1?254:0);style=addGradient(ctx,0,radius,radius,radius,color,opacity);ctx.beginPath();ctx.moveTo(0,0);ctx.lineTo(0,height);ctx.lineTo(radius,height);ctx.lineTo(radius,radius);ctx.closePath();ctx.fillStyle=style;ctx.fill();style=addGradient(ctx,radius,0,radius,radius,color,opacity);ctx.beginPath();ctx.moveTo(0,0);ctx.lineTo(width,0);ctx.lineTo(width,radius);ctx.lineTo(radius,radius);ctx.closePath();ctx.fillStyle=style;ctx.fill();}
function addShade(ctx,width,height,radius,opacity){var style;style=addGradient(ctx,width,radius,width-radius,radius,0,opacity);ctx.beginPath();ctx.moveTo(width,0);ctx.lineTo(width,height);ctx.lineTo(width-radius,height-radius);ctx.lineTo(width-radius,radius);ctx.closePath();ctx.fillStyle=style;ctx.fill();style=addGradient(ctx,radius,height,radius,height-radius,0,opacity);ctx.beginPath();ctx.moveTo(width,height);ctx.lineTo(0,height);ctx.lineTo(radius,height-radius);ctx.lineTo(width-radius,height-radius);ctx.closePath();ctx.fillStyle=style;ctx.fill();}
function roundedShadow(ctx,x,y,width,height,radius,opacity){var style;ctx.beginPath();ctx.rect(x,y+height-radius,radius,radius);ctx.closePath();style=addRadialStyle(ctx,x+radius,y+height-radius,radius-x,x+radius,y+height-radius,radius,opacity);ctx.fillStyle=style;ctx.fill();ctx.beginPath();ctx.rect(x+radius,y+height-y,width-(radius*2.25),y);ctx.closePath();style=addLinearStyle(ctx,x+radius,y+height-y,x+radius,y+height,opacity);ctx.fillStyle=style;ctx.fill();ctx.beginPath();ctx.rect(x+width-(radius*1.25),y+height-(radius*1.25),radius*1.25,radius*1.25);ctx.closePath();style=addRadialStyle(ctx,x+width-(radius*1.25),y+height-(radius*1.25),(radius*1.25)-1.5-x,x+width-(radius*1.25),y+height-(radius*1.25),radius*1.25,opacity);ctx.fillStyle=style;ctx.fill();ctx.beginPath();ctx.rect(x+width-x,y+radius,x,height-(radius*2.25));ctx.closePath();style=addLinearStyle(ctx,x+width-x,y+radius,x+width,y+radius,opacity);ctx.fillStyle=style;ctx.fill();ctx.beginPath();ctx.rect(x+width-radius,y,radius,radius);ctx.closePath();style=addRadialStyle(ctx,x+width-radius,y+radius,radius-x,x+width-radius,y+radius,radius,opacity);ctx.fillStyle=style;ctx.fill();}
function addIECorners(){var theimages=getImages('corner');var image;var object;var vml;var div;var pos;var i;var classes='';var iradius=null;var ishadow=null;var ishade=null;var inverse=null;var newClasses='';var maxdim=null;var offset=null;var radius=null;var display="";var flt=null;var width=null;var height=null;var start,head,soft,shadow,fill,foot,end;var left,top,bottom,right,lt,br,linear,inset;for(i=0;i<theimages.length;i++){image=theimages[i];object=image.parentNode;classes=image.className.split(' ');iradius=getClassValue(classes,"iradius");ishadow=getClassValue(classes,"ishadow");ishade=getClassValue(classes,"ishade");inverse=getClassAttribute(classes,"inverse");newClasses=getClasses(classes,"corner");width=image.width;height=image.height;maxdim=Math.min(width,height)/2;iradius=Math.min(maxdim,iradius);offset=4;offset=(ishadow>0?(inverse>0?0:Math.min(Math.max(offset,iradius/2),16)):0);radius=getRadius(iradius,width,height);display=(image.currentStyle.display.toLowerCase()=='block')?'block':'inline-block';vml=document.createElement(['<var style="overflow:hidden;display:'+display+';width:'+width+'px;height:'+height+'px;padding:0;">'].join(''));flt=image.currentStyle.styleFloat.toLowerCase();display=(flt=='left'||flt=='right')?'inline':display;start='<v:group style="zoom:1; display:'+display+'; margin:-1px 0 0 -1px; padding:0; position:relative; width:'+width+'px;height:'+height+'px;" coordsize="'+width+','+height+'">';fill='<v:fill src="'+image.src+'" type="frame" />';foot=(iradius>0?'</v:roundrect>':'</v:rect>');end='</v:group>';soft='';shadow='';lt='';left='';top='';bottom='';right='';if(iradius<=0){if(ishadow>0){if(inverse<=0){ishadow=ishadow/50;offset=8;inset=4;soft='<v:rect strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0 ;width:'+width+'px;height:'+height+'px;"><v:fill color="#ffffff" opacity="0.0" /></v:rect><v:rect strokeweight="0" filled="t" stroked="f" fillcolor="#000000" style="filter:Alpha(opacity='+(ishadow*64)+'), progid:dxImageTransform.Microsoft.Blur(PixelRadius='+inset+', MakeShadow=false); zoom:1;margin:-1px 0 0 -1px;padding: 0;display:block;position:absolute;top:'+inset+'px;left:'+inset+'px;width:'+(width-(3*inset))+'px;height:'+(height-(3*inset))+'px;"><v:fill color="#000000" opacity="1" /></v:rect>';head='<v:rect strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0 ;width:'+(width-offset)+'px;height:'+(height-offset)+'px;">';}else if(inverse>0){ishadow=ishadow/50;iradius=12;linear="linear";head='<v:rect filled="t" stroked="t" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0; width:'+width+'px;height:'+height+'px;">';shadow='<v:stroke weight="0.5" opacity="'+(ishadow/2)+'" color="#000000" />';top='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="'+width+','+iradius+'" path="m 0,0 l '+width+',0,'+width+','+iradius+','+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:'+width+'px; height:'+iradius+'px;"><v:fill method="'+linear+'" type="gradient" angle="0" color="#000000" opacity="0" color2="#000000" o:opacity2="'+ishadow+'" /></v:shape>';left='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="'+iradius+','+height+'" path="m 0,0 l 0,'+height+','+iradius+','+height+','+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:'+iradius+'px; height:'+height+'px;"><v:fill method="'+linear+'" type="gradient" angle="90" color="#000000" opacity="0" color2="#000000" o:opacity2="'+ishadow+'" /></v:shape>';}}else{head='<v:rect strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="margin:-1px 0 0 -1px;padding:0;display:'+display+';width:'+width+'px;height:'+height+'px;">';}
if(ishade>0){ishade=ishade/50;iradius=12;top='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" coordorigin="0,0" coordsize="'+(width-offset)+','+iradius+'" path="m 0,0 l '+(width-offset)+',0,'+(width-offset)+','+iradius+','+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:'+(width-offset)+'px; height:'+iradius+'px;"><v:fill method="linear" type="gradient" angle="0" color="#ffffff" opacity="0" color2="#ffffff" o:opacity2="'+ishade+'" /></v:shape>';left='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" coordorigin="0,0" coordsize="'+iradius+','+(height-offset)+'" path="m 0,0 l 0,'+(height-offset)+','+iradius+','+(height-offset)+','+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:'+iradius+'px; height:'+(height-offset)+'px;"><v:fill method="linear" type="gradient" angle="90" color="#ffffff" opacity="0" color2="#ffffff" o:opacity2="'+ishade+'" /></v:shape>';bottom='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="'+(width-offset)+','+iradius+'" path="m 0,'+iradius+' l '+(width-offset)+','+iradius+','+(width-offset-iradius)+',0,'+iradius+',0 x e" style="position:absolute; margin: 0; top:'+(height-offset-iradius)+'px; left: 0px; width:'+(width-offset)+'px; height:'+iradius+'px;"><v:fill method="linear" type="gradient" angle="180" color="#000000" opacity="0" color2="#000000" o:opacity2="'+ishade+'" /></v:shape>';right='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="'+iradius+','+(height-offset)+'" path="m '+iradius+',0 l '+iradius+','+(height-offset)+',0,'+(height-offset-iradius)+',0,'+iradius+' x e" style="position:absolute; margin: 0; top: 0px; left:'+(width-offset-iradius)+'px; width:'+iradius+'px; height:'+(height-offset)+'px;"><v:fill method="linear" type="gradient" angle="270" color="#000000" opacity="0" color2="#000000" o:opacity2="'+ishade+'" /></v:shape>';}}else{if(ishadow>0){linear="linear sigma";pos=2;if(inverse<=0){ishadow=ishadow/50;inset=Math.round(offset*0.5);soft='<v:rect strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0 ;width:'+width+'px;height:'+height+'px;"><v:fill color="#ffffff" opacity="0.0" /></v:rect><v:roundrect arcsize="'+(radius+inset)+'" strokeweight="0" filled="t" stroked="f" fillcolor="#000000" style="filter:Alpha(opacity='+(ishadow*64)+'), progid:dxImageTransform.Microsoft.Blur(PixelRadius='+inset+', MakeShadow=false); zoom:1;margin:-1px 0 0 -1px;padding: 0;display:block;position:absolute;top:'+inset+'px;left:'+inset+'px;width:'+(width-(3*inset))+'px;height:'+(height-(3*inset))+'px;"><v:fill color="#000000" opacity="1" /></v:roundrect>';head='<v:roundrect arcsize="'+radius+'" strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0; width:'+(width-offset)+'px;height:'+(height-offset)+'px;">';}else if(inverse>0){ishadow=ishadow/50;head='<v:roundrect arcsize="'+radius+'" filled="t" stroked="t" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0; width:'+width+'px;height:'+height+'px;">';shadow='<v:stroke weight="0.5" opacity="'+(ishadow/2)+'" color="#000000" />';top='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="'+width+','+iradius+'" path="m '+iradius+','+iradius+' l '+width+','+iradius+' qy '+(width-iradius)+',0 l '+iradius+',0 x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: -1px; width:'+(width+1)+'px; height:'+iradius+'px;"><v:fill method="'+linear+'" type="gradient" angle="0" color="#000000" opacity="0" color2="#000000" o:opacity2="'+ishadow+'" /></v:shape>';left='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="'+iradius+','+height+'" path="m 0,'+iradius+' l 0,'+(height-iradius)+' qy '+iradius+','+height+' l '+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: -1px; left: 0px; width:'+iradius+'px; height:'+(height+1)+'px;"><v:fill method="'+linear+'" type="gradient" angle="90" color="#000000" opacity="0" color2="#000000" o:opacity2="'+ishadow+'" /></v:shape>';lt='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="'+iradius+','+iradius+'" path="m '+iradius+','+iradius+' l 0,'+iradius+' qy '+iradius+',0 l '+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:'+iradius+'px; height:'+iradius+'px;"><v:fill method="'+linear+'" focus="1" focusposition="1,1" focussize="0.5,0.5" type="gradientradial" color="#000000" opacity="0" color2="#000000" o:opacity2="'+ishadow+'" /></v:shape>';}}else{pos=1;offset=0;head='<v:roundrect arcsize="'+radius+'" strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0; width:'+width+'px;height:'+height+'px;">';}
if(ishade>0){ishade=ishade/50;linear="linear";top='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" coordorigin="0,0" coordsize="'+(width-offset)+','+iradius+'" path="m '+iradius+','+iradius+' l '+(width-offset)+','+iradius+' qy '+(width-offset-iradius)+',0 l '+iradius+',0 x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: -1px; width:'+(width-offset+pos)+'px; height:'+iradius+'px;"><v:fill method="'+linear+'" type="gradient" angle="0" color="#ffffff" opacity="0" color2="#ffffff" o:opacity2="'+ishade+'" /></v:shape>';left='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" coordorigin="0,0" coordsize="'+iradius+','+(height-offset)+'" path="m 0,'+iradius+' l 0,'+(height-iradius-offset)+' qy '+iradius+','+(height-offset)+' l '+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: -1px; left: 0px; width:'+iradius+'px; height:'+(height-offset+pos)+'px;"><v:fill method="'+linear+'" type="gradient" angle="90" color="#ffffff" opacity="0" color2="#ffffff" o:opacity2="'+ishade+'" /></v:shape>';lt='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" coordorigin="0,0" coordsize="'+iradius+','+iradius+'" path="m '+iradius+','+iradius+' l 0,'+iradius+' qy '+iradius+',0 l '+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:'+iradius+'px; height:'+iradius+'px;"><v:fill method="'+linear+'" focus="1" focusposition="1,1" focussize="0.5,0.5" type="gradientradial" color="#ffffff" opacity="0" color2="#ffffff" o:opacity2="'+ishade+'" /></v:shape>';}}
vml.innerHTML=start+soft+head+fill+shadow+foot+right+bottom+top+left+lt+end;vml.className=newClasses;vml.style.cssText=image.style.cssText;vml.style.height=image.height+'px';vml.style.width=image.width+'px';vml.height=image.height;vml.width=image.width;vml.src=image.src;vml.alt=image.alt;if(image.id!='')vml.id=image.id;if(image.title!='')vml.title=image.title;if(image.getAttribute('onclick')!='')vml.setAttribute('onclick',image.getAttribute('onclick'));if(image.getAttribute("usemap")){if(iradius>0){pos=offset;}else{pos=0;}
object.style.position='relative';object.style.height=height+'px';object.style.width=width+'px';image.left=0;image.top=0;image.style.position='absolute';image.style.height=height+'px';image.style.width=width+'px';image.style.left=0+'px';image.style.top=0+'px';image.style.filter="Alpha(opacity=0)";object.insertBefore(vml,image);}else{object.replaceChild(vml,image);}}}
function addCorners(){var theimages=getImages('corner');var image;var object;var canvas;var context;var i;var iradius=null;var ishade=null;var ishadow=null;var inverse=null;var classes='';var newClasses='';var maxdim=null;var style=null;var offset=null;for(i=0;i<theimages.length;i++){image=theimages[i];object=image.parentNode;canvas=document.createElement('canvas');if(canvas.getContext){classes=image.className.split(' ');iradius=getClassValue(classes,"iradius");ishadow=getClassValue(classes,"ishadow");ishade=getClassValue(classes,"ishade");inverse=getClassAttribute(classes,"inverse");newClasses=getClasses(classes,"corner");canvas.className=newClasses;canvas.style.cssText=image.style.cssText;canvas.style.height=image.height+'px';canvas.style.width=image.width+'px';canvas.height=image.height;canvas.width=image.width;canvas.src=image.src;canvas.alt=image.alt;if(image.id!='')canvas.id=image.id;if(image.title!='')canvas.title=image.title;if(image.getAttribute('onclick')!='')canvas.setAttribute('onclick',image.getAttribute('onclick'));maxdim=Math.min(canvas.width,canvas.height)/2;iradius=Math.min(maxdim,iradius);offset=4;offset=(ishadow>0?(inverse>0?0:Math.min(Math.max(offset,iradius/2),16)):0);context=canvas.getContext("2d");if(image.getAttribute("usemap")){object.style.position='relative';object.style.height=image.height+'px';object.style.width=image.width+'px';canvas.left=0;canvas.top=0;canvas.style.position='absolute';canvas.style.left=0+'px';canvas.style.top=0+'px';image.left=0;image.top=0;image.style.position='absolute';image.style.height=image.height+'px';image.style.width=image.width+'px';image.style.left=0+'px';image.style.top=0+'px';image.style.opacity=0;object.insertBefore(canvas,image);}else{object.replaceChild(canvas,image);}
context.clearRect(0,0,canvas.width,canvas.height);context.save();if(ishadow>0&&inverse<=0){ishadow=ishadow/100;if(iradius>0){roundedShadow(context,offset,offset,canvas.width-offset,canvas.height-offset,iradius,ishadow);}else{offset=8;roundedShadow(context,offset,offset,canvas.width-offset,canvas.height-offset,offset,ishadow);}}
globalCompositeOperation="source-in";if(iradius<=0){context.beginPath();context.rect(0,0,canvas.width-offset,canvas.height-offset);context.closePath();}else{roundedRect(context,0,0,canvas.width-offset,canvas.height-offset,iradius);}
context.clip();context.fillStyle='rgba(0,0,0,0)';context.fillRect(0,0,canvas.width,canvas.height);context.drawImage(image,0,0,canvas.width-offset,canvas.height-offset);if(ishadow>0&&inverse>0){ishadow=ishadow/100;if(iradius>0){addShine(context,canvas.width,canvas.height,iradius,ishadow,1);roundedRect(context,0,0,canvas.width,canvas.height,iradius);}else{iradius=16;addShine(context,canvas.width,canvas.height,iradius,ishadow,1);context.beginPath();context.rect(0,0,canvas.width,canvas.height);context.closePath();}
context.strokeStyle='rgba(0,0,0,'+ishadow+')';context.lineWidth=2;context.stroke();}
if(ishade>0){ishade=ishade/100;if(iradius<=0)iradius=16;addShade(context,canvas.width-offset,canvas.height-offset,iradius,ishade);addShine(context,canvas.width-offset,canvas.height-offset,iradius,ishade);}
canvas.style.visibility='visible';}}}
var cornerOnload=window.onload;window.onload=function(){if(cornerOnload)cornerOnload();if(isIE){addIECorners();}else{addCorners();}}
var FileUI={disableText:false,imgPath:'images/browse.gif',imgPathOver:null,textOnly:null,spanClass:'fileInput',init:function(){var spans=document.getElementsByTagName('span')
for(var i=0;i<spans.length;i++){if(spans[i].className.indexOf(this.spanClass)!=-1){this.style(spans[i],spans[i].getElementsByTagName('input')[0])}}},style:function(span,input){setStyle=(navigator.appVersion.indexOf("MSIE")!=-1)?'cssText':'style'
this.setStyle(span,'position:relative;border:1px solid transparent;')
this.setStyle(input,'width:260px;position:absolute;top:0;left:0;z-index:5;-moz-opacity:0;filter:alpha(opacity:0);opacity:0;')
var txtInput=document.createElement('input')
txtInputWidth=180
txtInput.type='text'
this.setStyle(txtInput,'width:'+txtInputWidth+'px;position:absolute;top:0px;left:0px;z-index:10')
input.onchange=function(){txtInput.value=input.value}
txtInput.disabled='disabled'
span.appendChild(txtInput)
var link=document.createElement('a')
linkLeft=txtInputWidth+8
this.setStyle(link,'position:absolute;top:0px;left:'+linkLeft+'px;')
if(this.textOnly===null){var img=document.createElement('img')
img.src=this.imgPath
link.appendChild(img)
if(this.imgPathOver!=null){input.onmouseover=function(){img.src=FileUI.imgPathOver;}
input.onmouseout=function(){img.src=FileUI.imgPath;}}}else{link.innerHTML=this.textOnly
link.href="#"
link.onclick=function(){return false;}
input.onmouseover=function(){link.className='over';}
input.onmouseout=function(){link.className='';}}
span.appendChild(link)},setStyle:function(object,styleText){if(object.style.setAttribute){object.style.setAttribute("cssText",styleText);}
else{object.setAttribute("style",styleText);}}}
function getLowEmbed(){var lowEmbedString=document.getElementById('lowEmbedDiv').value;document.getElementById("mainDiv").style.backgroundImage="url(images/livemedia/main_background.jpg)";document.getElementById("mainDiv").style.width="823px";document.getElementById("mainDiv").style.height="454px";document.getElementById("mainDiv").innerHTML='<table width="874" border="0" cellspacing="0" cellpadding="0"> <tr><td width="37%" height="25">&nbsp;</td><td width="66%">&nbsp;</td></tr><tr><td>&nbsp;</td><td>'+lowEmbedString+'</td> </tr></table>';}
function getHighEmbed(){var highEmbedString=document.getElementById('highEmbedDiv').value;document.getElementById("mainDiv").style.backgroundImage="url(images/livemedia/main_background.jpg)";document.getElementById("mainDiv").style.width="823px";document.getElementById("mainDiv").style.height="450px";document.getElementById("mainDiv").innerHTML='<table width="874" border="0" cellspacing="0" cellpadding="0"> <tr><td width="37%" height="25">&nbsp;</td><td width="66%">&nbsp;</td></tr><tr><td>&nbsp;</td><td>'+highEmbedString+'</td> </tr></table>';}
function roSwap(image,newfile)
{document.getElementById(image).src="/images/"+newfile;}
function showHideSermon(id,image,altName)
{showHideAdminSermon(id);showHide('pod'+id);writeMainImage(image,altName);}
function writeNewVideo(embed){height=340;if(embed.match("<iframe")!=null||embed.match("<object")!=null){document.getElementById("mainImageStream").innerHTML=embed;}
else{var flashObject='';if(embed.match("youtube")!=null){var videoId=embed.replace('http://gdata.youtube.com/feeds/api/videos/','');flashObject='<embed height="100%" width="100%" flashvars="rv.2.thumbnailUrl=http%3A%2F%2Fi1.ytimg.com%2Fvi%2FLslxCwuo5Js%2Fdefault.jpg&amp;rv.7.length_seconds=77&amp;rv.0.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DblrgC_S4r7U&amp;rv.0.view_count=77&amp;rv.2.title=Funny+Plane+Crash&amp;rv.7.thumbnailUrl=http%3A%2F%2Fi1.ytimg.com%2Fvi%2F4dB7HofxZ6g%2Fdefault.jpg&amp;rv.4.rating=0.0&amp;length_seconds=48&amp;rv.0.title=Speedboat+vs.+Helicopter&amp;rv.7.title=Hognekal+Water+Falls&amp;rv.3.view_count=2837401&amp;rv.5.title=Brooke+proudly+wears+her+%22GUNS+SAVE+LIVES%22+Safety+Vest+as+she+loads+Helicopter+Passengers&amp;rv.0.length_seconds=23&amp;rv.4.thumbnailUrl=http%3A%2F%2Fi2.ytimg.com%2Fvi%2F1BapKJGoJxQ%2Fdefault.jpg&amp;fmt_url_map=34%7Chttp%3A%2F%2Fv7.lscache1.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cburst%252Cfactor%26fexp%3D902307%252C904900%26itag%3D34%26ipbits%3D0%26signature%3DCB4DBD61691EE47D139D7D51433F846759E146A4.3B54786EF64AECCABE9CAA08A8843A8EEC6F4F23%26sver%3D3%26expire%3D1254344400%26key%3Dyt1%26factor%3D1.25%26burst%3D40%26id%3Dc529e66a7bc7c168%2C5%7Chttp%3A%2F%2Fv17.lscache6.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cburst%252Cfactor%26fexp%3D902307%252C904900%26itag%3D5%26ipbits%3D0%26signature%3DB9D18E1FCD253FB44E726085BD3718664C5AF1F7.31A81A39D1337B5F1AA4319A59AF17B4C20C9E2D%26sver%3D3%26expire%3D1254344400%26key%3Dyt1%26factor%3D1.25%26burst%3D40%26id%3Dc529e66a7bc7c168&amp;rv.2.rating=4.82014388489&amp;keywords=Helicopterwassen&amp;cr=US&amp;rv.1.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DRw7V2pvwHZs&amp;rv.6.thumbnailUrl=http%3A%2F%2Fi2.ytimg.com%2Fvi%2FIaeORBMs7eY%2Fdefault.jpg&amp;rv.1.id=Rw7V2pvwHZs&amp;rv.3.rating=4.78449502134&amp;rv.6.title=Helicopter+Ride+over+Gatlinburg+Pigeon+Forge+Sevierville+and+Smoky+Mountains&amp;rv.7.id=4dB7HofxZ6g&amp;rv.1.title=Future+Weapons%3A+Apache+Longbow&amp;rv.1.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2FRw7V2pvwHZs%2Fdefault.jpg&amp;rv.5.view_count=283&amp;rv.0.rating=0.0&amp;feature=youtube_gdata&amp;watermark=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Flogo-vfl106645.swf%2Chttp%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fhdlogo-vfl100714.swf&amp;rv.6.author=blackbeartv&amp;rv.3.title=CH46+Sea+Knight+Helicopter+Crash+Lands&amp;rv.5.id=PYXFvMsbx04&amp;rv.4.author=whatsthatdaddy&amp;plid=AAR0zLnfCnI_U3tt&amp;rv.0.id=blrgC_S4r7U&amp;rv.3.length_seconds=46&amp;rv.5.rating=5.0&amp;rv.4.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D1BapKJGoJxQ&amp;sdetail=f%3Ayoutube_gdata%2Cp%3Agdata.youtube.&amp;fexp=902307%2C904900&amp;rv.1.author=DiscoveryNetworks&amp;rv.1.rating=4.77570093458&amp;rv.4.title=My+first+helicopter+ride&amp;rv.5.thumbnailUrl=http%3A%2F%2Fi1.ytimg.com%2Fvi%2FPYXFvMsbx04%2Fdefault.jpg&amp;rv.5.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPYXFvMsbx04&amp;rv.6.length_seconds=345&amp;sourceid=r&amp;rv.0.author=cspteja&amp;rv.3.thumbnailUrl=http%3A%2F%2Fi2.ytimg.com%2Fvi%2FEoHd5LePyVc%2Fdefault.jpg&amp;rv.2.author=THillingworth&amp;rv.6.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIaeORBMs7eY&amp;rv.7.rating=0.0&amp;rv.3.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DEoHd5LePyVc&amp;fmt_map=34%2F0%2F9%2F0%2F115%2C5%2F0%2F7%2F0%2F0&amp;hl=en&amp;rv.7.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4dB7HofxZ6g&amp;rv.2.view_count=69330&amp;rv.4.length_seconds=336&amp;rv.4.view_count=96&amp;rv.2.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DLslxCwuo5Js&amp;rv.5.length_seconds=31&amp;rv.0.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2FblrgC_S4r7U%2Fdefault.jpg&amp;rv.7.author=ramprasad15&amp;sk=qoWGsMni9dkBJd4Aj4oKoOtQpBaEA8OtC&amp;rv.1.view_count=242652&amp;sw=0.05&amp;rv.1.length_seconds=199&amp;rv.6.rating=5.0&amp;rv.5.author=edmlevine&amp;vq=medium&amp;rv.3.id=EoHd5LePyVc&amp;rv.2.id=LslxCwuo5Js&amp;rv.2.length_seconds=82&amp;t=vjVQa1PpcFPWxHXvGx-UCitir_4b96nB8JnRjUFXX6M%3D&amp;rv.6.id=IaeORBMs7eY&amp;video_id=';flashObject=flashObject+videoId+'&amp;rv.6.view_count=5275&amp;rv.3.author=donveto&amp;rv.4.id=1BapKJGoJxQ&amp;rv.7.view_count=23&amp;playnext=0&amp;enablejsapi=1" allowscriptaccess="always" allowfullscreen="true" quality="high" bgcolor="#000000" name="movie_player" id="movie_player" style="" src="http://s.ytimg.com/yt/swf/watch-vfl121305.swf" type="application/x-shockwave-flash"/>';}
else{flashObject='<object id="flvVideo" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="585" height="'+height+'" >'
+'          <param name="movie" value="'+embed+'" />'
+'          <param name="quality" value="high" />'
+'          <param name="allowFullScreen" value="true" />'
+'          <param name="menu" value="false">'
+'          <param name="Flashvars" value="autoStart=1">'
+'          <embed src="'+embed+'" quality="high" flashvars="autoStart=1" allowFullScreen="true" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="585" height="'+height+'"></embed>'
+'          </object>'}
document.getElementById("mainImageStream").innerHTML=flashObject;}
document.getElementById("mainImageStream").style.height=340;document.getElementById("mainImageStream").style.width=585;document.getElementById("main").scrollIntoView();document.getElementById('audioPlayerDiv').innerHTML='';}
function writeAudio(embed,imageLocation)
{var flashObject='<img  src="'+imageLocation+'" style="height: 327px; width: 640px" align="absmiddle" class="corner iradius12"/><object id="flvVideo" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="585" height="20" >'
+'          <param name="movie" value="'+embed+'" />'
+'          <param name="quality" value="high" />'
+'          <param name="allowFullScreen" value="true" />'
+'          <param name="menu" value="false">'
+'          <param name="Flashvars" value="autoStart=1">'
+'          <embed src="'+embed+'" quality="high" flashvars="autoStart=1" allowFullScreen="true" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="640" height="20"></embed>'
+'          </object>'
document.getElementById("mainImageStream").innerHTML=flashObject;document.getElementById("mainImageStream").style.height=340;document.getElementById("mediaVideo").style.display="block";document.getElementById("main").scrollIntoView();}
function writeMainImage(image,altName)
{var imageObject='<img  src="'+image+'" alt="'+altName+'" style="height: 337px; width: 585px"  class="corner iradius12" align="absmiddle"/>';document.getElementById("mainImageStream").innerHTML=imageObject;}
function bigWaitingProcess(elementName){$(elementName).startWaiting('bigWaiting');}
function waitingProcess(elementName){$(elementName).startWaiting('waiting');}
function stopWaitingProcess(elementName){$(elementName).stopWaiting();}
function disableButton(idName){waitingProcess(idName);}