var tab1Url = '';var tab1Dat = '';
var tab2Url = '';var tab2Dat = '';
var upcomingVUrl = '';
if (widgetSingle==null || widgetSingle.length==0){
	var widgetSingle = '';
}

if (widgetType=='spiritualActivities'){
 tab1Url = mvcApplicationURL+"Schedules/GetUpcomingEvents?EventTypes=U";
 tab1Dat = "spiritualActivities";
 tab2Url = joomlaApplicationURL+'seva_activities/xml/sevaWidget_getInvolved.xml';
 tab2Dat = "getInvolved";
 slider1ID='spiritualCurrentProgN';slider2ID='spiritualgetInvolved';
 var toShowMonth='';var toShowYear='';
 var orangeTxt = 'sevaAct_crntprog_txtbg_Oran2.jpg';
 var orangeBgImg1A = 'sevaAct_currntprog_bg_Orang2A.png';
 var orangeBgImg2A = 'sevaAct_getInvolved_bg_Orang2A.png';
 var orangeBgImg1B = 'sevaAct_currntprog_bg_Orang2B.png';
 var orangeBgImg2B = 'sevaAct_getInvolved_bg_Orang2B.png';
 var orangeContrImg = 'sevaAct_contrbute_bg_Orange.png';
}
else{
 tab1Url = joomlaApplicationURL+'seva_activities/xml/sevaWidget_currentAct.xml';
 tab1Dat = "currentActivities";
 tab2Url = joomlaApplicationURL+'seva_activities/xml/sevaWidget_getInvolved.xml';
 tab2Dat = "getInvolved";
 upcomingVUrl = mvcApplicationURL+"Schedules/GetUpcomingEvents?EventTypes=VSA";
 slider1ID='sevaCurrentProgN';slider2ID='sevagetInvolved';
 var blueTxt = 'sevaAct_crntprog_txtbg_Blue.jpg';
 var blueBgImg1A = 'sevaAct_currntprog_bg_BlueA.png';
 var blueBgImg2A = 'sevaAct_getInvolved_bg_BlueA.png';
 var blueBgImg1B = 'sevaAct_currntprog_bg_BlueB.png';
 var blueBgImg2B = 'sevaAct_getInvolved_bg_BlueB.png';
 var blueContrImg = 'sevaAct_contrbute_bg_Blue.png';
 var purpleTxt = 'sevaAct_crntprog_txtbg_Purp.png';
 var purpleBgImg1A = 'sevaAct_currntprog_bg_PurpleA.png';
 var purpleBgImg2A = 'sevaAct_getInvolved_bg_PurpleA.png';
 var purpleBgImg1B = 'sevaAct_currntprog_bg_PurpleB.png';
 var purpleBgImg2B = 'sevaAct_getInvolved_bg_PurpleB.png';
 var purpleContrImg = 'sevaAct_contrbute_bg_Purple.png';
 var greenTxt = 'sevaAct_crntprog_txtbg_Green.jpg';
 var greenBgImg1A = 'sevaAct_currntprog_bg_GreenA.png';
 var greenBgImg2A = 'sevaAct_getInvolved_bg_GreenA.png';
 var greenBgImg1B = 'sevaAct_currntprog_bg_GreenB.png';
 var greenBgImg2B = 'sevaAct_getInvolved_bg_GreenB.png';
 var greenContrImg = 'sevaAct_contrbute_bg_Green.png';
 if (widgetSingle=='greenSingle'){
 var greenBgImg1A = 'sevaAct_currntprog_bg_GreenC.png';
 var greenBgImg2A = 'sevaAct_currntprog_bg_GreenC.png';
 var greenBgImg1B = 'sevaAct_currntprog_bg_GreenC.png';
 var greenBgImg2B = 'sevaAct_currntprog_bg_GreenC.png';
 }
}

var SWpath = joomlaApplicationURL+'seva_activities/images/';
var additionalLength = 0;var tabUpcoming = '';
var tab1XML='';var tab2XML='';
var hrefArrT1 = new Array();var hrefArrT2 = new Array();
var imgArrT1 = new Array();var imgArrT2 = new Array();
var txtArrT1 = new Array();var txtArrT2 = new Array();
var miscArrT1 = new Array();var miscArrT2 = new Array();
var contrArrT1 = new Array();var contrArrT2 = new Array();
var currentTimeSW = new Date();
var currentMonthtoCheck = currentTimeSW.getMonth();

function toTitleCaseSW(str){
 return str.replace(/\w\S*/g, function(txt){
 return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
 });
}

function getSWMonth(){
var monthsSW = new Array(12);
   monthsSW[0]  = "January";
   monthsSW[1]  = "February";
   monthsSW[2]  = "March";
   monthsSW[3]  = "April";
   monthsSW[4]  = "May";
   monthsSW[5]  = "June";
   monthsSW[6]  = "July";
   monthsSW[7]  = "August";
   monthsSW[8]  = "September";
   monthsSW[9]  = "October";
   monthsSW[10] = "November";
   monthsSW[11] = "December";
   var tmp1 = currentTimeSW.getMonth();
 return monthsSW[tmp1];
}

function makeDateSW(swinDate){
 var sWDateYr = (swinDate.substring(0,4));
 var sWDateMt = (swinDate.substring(5,7));
 var sWDateDy = (swinDate.substring(8,10));
 var sWnewDate=new Date();
 sWnewDate.setFullYear(sWDateYr,sWDateMt-1,sWDateDy);
 return sWnewDate;
}//end sWmakeDate

function GetHttpSW(url){
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
 xmlhttpSW=new XMLHttpRequest();
}
else
{// code for IE6, IE5
 xmlhttpSW=new ActiveXObject("Microsoft.XMLHTTP");
 }
 try{
  xmlhttpSW.open("GET",url,false);
  xmlhttpSW.send();
 }catch (err){return null;}
 if (window.DOMParser)
 {
  parser=new DOMParser();
  xmlDocSW=parser.parseFromString(xmlhttpSW.responseText,"text/xml");
  }
  else // Internet Explorer
  {
   xmlDocSW=new ActiveXObject("Microsoft.XMLDOM");
   xmlDocSW.async="false";
   xmlDocSW.loadXML(xmlhttpSW.responseText);
   } 
   var ScheduleViewDataModel = xmlDocSW.getElementsByTagName("ScheduleViewDataModel");
   if (ScheduleViewDataModel.length > 0) {return ScheduleViewDataModel;}
   else return null;
}//GetHttpSW

function getSWdata(url){
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttpSWD=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttpSWD=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttpSWD.open("GET",url,false);
xmlhttpSWD.send();
xmlDoc=xmlhttpSWD.responseXML; 
xmlData=xmlDoc.getElementsByTagName('Slide'); 
return xmlData;
}

function toArray(tabData,tabName){
for (var counter=0;counter<tabData.length;counter++){ 
try{if (tabData[counter].getElementsByTagName("text")[0].hasChildNodes()){
text=(tabData[counter].getElementsByTagName("text")[0].childNodes[0].nodeValue);}else text='';
}catch (exp){text='';}
try{if (tabData[counter].getElementsByTagName("contribution")[0].hasChildNodes()){
contribution=(tabData[counter].getElementsByTagName("contribution")[0].childNodes[0].nodeValue);}else contribution='';
}catch (exp){contribution='';}
try{if (tabData[counter].getElementsByTagName("Imagepath")[0].hasChildNodes()){
imagepath=(tabData[counter].getElementsByTagName("Imagepath")[0].childNodes[0].nodeValue);}else imagepath=joomlaApplicationURL+'common/images/transparent.png';
}catch (exp){imagepath='';}
try{if (tabData[counter].getElementsByTagName("Url")[0].hasChildNodes()){
url=(tabData[counter].getElementsByTagName("Url")[0].childNodes[0].nodeValue);}else url='';
}catch (exp){url='';}
if (tabName=='currentActivities'){
hrefArrT1[counter]=url;
imgArrT1[counter]=joomlaApplicationURL+"seva_activities/images/"+imagepath+".jpg";
txtArrT1[counter]=text;}//end Tab1
if (tabName=='getInvolved'){
hrefArrT2[counter]=url;
imgArrT2[counter]=joomlaApplicationURL+"seva_activities/images/"+imagepath+".jpg";
contrArrT2[counter]=contribution;
txtArrT2[counter]=text;}//end Tab2
}//end for
}//end toArray

function toArrayUpcoming(tabData){
var counter2=0;
for (var counter1=0;counter1<tabData.length;counter1++){ 
try{if (tabData[counter1].getElementsByTagName("evtDesc")[0].hasChildNodes()){
eventnamesw=(tabData[counter1].getElementsByTagName("evtDesc")[0].childNodes[0].nodeValue);}else eventnamesw='';
}catch (exp){eventnamesw='';}
try{if (tabData[counter1].getElementsByTagName("evtDate")[0].hasChildNodes()){
datesw=(tabData[counter1].getElementsByTagName("evtDate")[0].childNodes[0].nodeValue);}else datesw='';
}catch (exp){datesw='';}
try{if (tabData[counter1].getElementsByTagName("evtDateTime")[0].hasChildNodes()){
evtDateTimeSW=(tabData[counter1].getElementsByTagName("evtDateTime")[0].childNodes[0].nodeValue);}else evtDateTimeSW='';
}catch (exp){evtDateTimeSW='';}
try{if (tabData[counter1].getElementsByTagName("evtIdentifyflag")[0].hasChildNodes()){
evtIdentifyflagsw=(tabData[counter1].getElementsByTagName("evtIdentifyflag")[0].childNodes[0].nodeValue);}else evtIdentifyflagsw='';
}catch (exp){evtIdentifyflagsw='';}
var tmpDate = new Date();
tmpDate=makeDateSW(evtDateTimeSW);
try{if (tabData[counter1].getElementsByTagName("evtYear")[0].hasChildNodes()){
yearasw=(tabData[counter1].getElementsByTagName("evtYear")[0].childNodes[0].nodeValue);}else yearasw='';
}catch (exp){yearasw='';}
try{if (tabData[counter1].getElementsByTagName("evtFullMonth")[0].hasChildNodes()){
monthasw=(tabData[counter1].getElementsByTagName("evtFullMonth")[0].childNodes[0].nodeValue);}else monthasw='';
}catch (exp){monthasw='';}
try{if (tabData[counter1].getElementsByTagName("evtMonth")[0].hasChildNodes()){
evtmonthsw=(tabData[counter1].getElementsByTagName("evtMonth")[0].childNodes[0].nodeValue);}else evtmonthsw='';
}catch (exp){evtmonthsw='';}
try{if (tabData[counter1].getElementsByTagName("evtLinkName")[0].hasChildNodes()){
onclickurlsw=(tabData[counter1].getElementsByTagName("evtLinkName")[0].childNodes[0].nodeValue);}else onclickurlsw='';
}catch (exp){onclickurlsw='';}
try{if (tabData[counter1].getElementsByTagName("evtImage")[0].hasChildNodes()){
imagepsw=(tabData[counter1].getElementsByTagName("evtImage")[0].childNodes[0].nodeValue);}else  imagepsw=joomlaApplicationURL+'common/images/transparent.png';
}catch (exp){imagepsw=joomlaApplicationURL+'common/images/transparent.png';}
if (widgetType!='spiritualActivities'){if (imagepsw!=''){imagepsw=imagepsw.replace(".jpg", "-SW.jpg");}}
if (eventnamesw.search(/Visit to Home for the Abandoned/i) != -1){imagepsw=joomlaApplicationURL+'seva_activities/images/Visit-to-Home-for-the-Abandoned.jpg';}
if (eventnamesw.search(/Medical Outreach Programme for Animals/i) != -1){imagepsw=joomlaApplicationURL+'seva_activities/images/Medical-Outreach-Programme-for-Animals.jpg';}
if (eventnamesw.search(/Gwala For A Day/i) != -1){imagepsw=joomlaApplicationURL+'seva_activities/images/Gwala-For-A-Day.jpg';}
if (eventnamesw.search(/Vocational Workshop at Orphanage/i) != -1){imagepsw=joomlaApplicationURL+'seva_activities/images/Vocational-Workshop-at-Orphanage.jpg';}
if (eventnamesw.search(/Vocational Training/i) != -1){imagepsw=joomlaApplicationURL+'seva_activities/images/Vocational-Workshop-at-Orphanage.jpg';}
if (eventnamesw.search(/Viklang Camp/i) != -1){imagepsw=joomlaApplicationURL+'seva_activities/images/First%20residential%20rehabilitation%20camp.jpg';}
if (eventnamesw.search(/Outreach Gynecology and Paediatric camp/i) != -1){imagepsw=joomlaApplicationURL+'seva_activities/images/Outreach-Gynecology-and-Paediatric-camp.jpg';}
if (eventnamesw.search(/Humanitarian Care/i) != -1){imagepsw=mvcApplicationURL+'Content/Schedules/images/seva-1-SW.jpg';}
try{if (tabData[counter1].getElementsByTagName("evtNote")[0].hasChildNodes()){
descrsw=(tabData[counter1].getElementsByTagName("evtNote")[0].childNodes[0].nodeValue);}else descrsw='';
}catch (exp){descrsw='';}
try{if (tabData[counter1].getElementsByTagName("evtPlace")[0].hasChildNodes()){
placesw=(tabData[counter1].getElementsByTagName("evtPlace")[0].childNodes[0].nodeValue);}else placesw='';
}catch (exp){placesw='';}
try{if (tabData[counter1].getElementsByTagName("isRegistrationReq")[0].hasChildNodes()){
regneededsw=(tabData[counter1].getElementsByTagName("isRegistrationReq")[0].childNodes[0].nodeValue);}else regneededsw='';
}catch (exp){regneededsw='';}
try{if (tabData[counter1].getElementsByTagName("evtRegistrationLink")[0].hasChildNodes()){
reglinksw=(tabData[counter1].getElementsByTagName("evtRegistrationLink")[0].childNodes[0].nodeValue);}else reglinksw='';
}catch (exp){reglinksw='';}
try{if (tabData[counter1].getElementsByTagName("evtWidgetLink")[0].hasChildNodes()){
evtWidgetLink=(tabData[counter1].getElementsByTagName("evtWidgetLink")[0].childNodes[0].nodeValue);}else evtWidgetLink='';
}catch (exp){evtWidgetLink='';}
var upcemth1sw='';var upcemth2sw='';
var upcedate1sw='';var upcedate2sw='';
var write_datesw = datesw+"  "+monthasw+" "+yearasw;;
if (evtmonthsw.search(' - ') != -1){
 upcemth1sw = toTitleCaseSW(evtmonthsw.substring(0,3)); 
 upcemth2sw = toTitleCaseSW(evtmonthsw.substring(6,9));
 var upcedateCtsw = datesw.search(' - ');
 upcedate1sw = datesw.substring(0,upcedateCtsw);
 upcedate2sw = datesw.substring(upcedateCtsw+2);
 write_datesw = upcedate1sw+' '+upcemth1sw+' - '+upcedate2sw+' '+upcemth2sw+' '+yearasw;;
}
if (eventnamesw.search(/shramyajna/i) == -1 && evtIdentifyflagsw.indexOf("V") !=-1 && tmpDate>currentTimeSW && widgetType!='spiritualActivities'){
// hrefArrT2[counter2+additionalLength]=onclickurlsw;
  if (onclickurlsw.length<5){
  hrefArrT2[counter2+additionalLength]=evtWidgetLink;}
 else hrefArrT2[counter2+additionalLength]=onclickurlsw;
 imgArrT2[counter2+additionalLength]=imagepsw;
 miscArrT2[counter2+additionalLength]=write_datesw+ ', '+placesw;
 txtArrT2[counter2+additionalLength]=eventnamesw;
// contrArrT2[counter2+additionalLength]='';
  if (regneededsw=='true'){
  contrArrT2[counter2+additionalLength]=reglinksw;}
 else contrArrT2[counter2+additionalLength]='';
 counter2++;
}//end if not shramyajna & is seva
else if (widgetType=='spiritualActivities' && tmpDate.getMonth()==currentMonthtoCheck && tmpDate>currentTimeSW){
 toShowMonth=monthasw;toShowYear=yearasw;
 hrefArrT1[counter2+additionalLength]=onclickurlsw;//alert('**'+onclickurlsw.length+'**')
// if (onclickurlsw.length<2) {hrefArrT1[counter2+additionalLength]='#';}
 imgArrT1[counter2+additionalLength]=imagepsw;
 miscArrT1[counter2+additionalLength]=write_datesw+ ', '+placesw;
 txtArrT1[counter2+additionalLength]=eventnamesw;
 if (regneededsw=='true'){
  contrArrT1[counter2+additionalLength]=reglinksw;}
 else contrArrT1[counter2+additionalLength]='';
 counter2++;
}//end if spiritualActivities
}//end for
if (toShowMonth=='' || toShowMonth==null) {toShowMonth=getSWMonth();toShowYear=currentTimeSW.getFullYear();}
if (counter2==0){
 hrefArrT1[0]='';
 imgArrT1[0]=joomlaApplicationURL+'common/images/transparent.png';
 txtArrT1[0]='No further Events this Month';
}
}//end toArrayUpcoming

if (widgetType=='spiritualActivities'){
 tab1XML=GetHttpSW(tab1Url);
 toArrayUpcoming(tab1XML);
 if (txtArrT1.length==1 && txtArrT1[0]=='No further Events this Month') {
  currentMonthtoCheck=currentTimeSW.getMonth()+1;
  toArrayUpcoming(tab1XML);
 }
}
else{
 tab1XML=getSWdata(tab1Url);
 tabUpcoming = GetHttpSW(upcomingVUrl);
 toArray(tab1XML,tab1Dat);
}
tab2XML=getSWdata(tab2Url);
toArray(tab2XML,tab2Dat);

if (widgetType=='spiritualActivities'){
 additionalLength = tab1XML.length;
}
else {
 additionalLength = tab2XML.length;
 toArrayUpcoming(tabUpcoming);
}

function removeBR(txtAlt){
// return txtAlt.replace("<br/>","-");
 return txtAlt.replace(/<br\/>/gi,"-");
}

var count=0;

if (tab1Url=='sevaWidget_currentAct.xml'){
 tab1SliderName='sevaCurrentProgN';
 tab1Type='currentActivities';
 imgArrayTab1=imgArrT1;hrefArrayTab1=hrefArrT1;txtArrayTab1=txtArrT1;
}
else if (tab1Url=='sevaWidget_getInvolved.xml'){
 tab1SliderName='sevagetInvolved';
 tab1Type='getInvolved';
 imgArrayTab1=imgArrT2;hrefArrayTab1=hrefArrT2;txtArrayTab1=txtArrT2;
}

if (tab2Url=='sevaWidget_currentAct.xml'){
 tab2SliderName='sevaCurrentProgN';
 tab2Type='currentActivities';
 imgArrayTab2=imgArrT1;hrefArrayTab2=hrefArrT1;txtArrayTab2=txtArrT1;
}
else if (tab2Url=='sevaWidget_getInvolved.xml'){
 tab2SliderName='sevagetInvolved';
 tab2Type='getInvolved';
 imgArrayTab2=imgArrT2;hrefArrayTab2=hrefArrT2;txtArrayTab2=txtArrT2;
}

var Txt = blueTxt;
var bgImg1A = blueBgImg1A;
var bgImg2A = blueBgImg2A;
var contrImg = purpleContrImg;
if (widgetCol=='Blue'){
Txt = blueTxt;
bgImg1A = blueBgImg1A;
bgImg1B = blueBgImg1B;
bgImg2A = blueBgImg2A;
bgImg2B = blueBgImg2B;
contrImg = blueContrImg;
}
if (widgetCol=='Orange'){
Txt = orangeTxt;
bgImg1A = orangeBgImg1A;
bgImg1B = orangeBgImg1B;
bgImg2A = orangeBgImg2A;
bgImg2B = orangeBgImg2B;
contrImg = orangeContrImg;
}
if (widgetCol=='Purple'){
Txt = purpleTxt;
bgImg1A = purpleBgImg1A;
bgImg1B = purpleBgImg1B;
bgImg2A = purpleBgImg2A;
bgImg2B = purpleBgImg2B;
contrImg = purpleContrImg;
}
if (widgetCol=='Green'){
Txt = greenTxt;
bgImg1A = greenBgImg1A;
bgImg1B = greenBgImg1B;
bgImg2A = greenBgImg2A;
bgImg2B = greenBgImg2B;
contrImg = greenContrImg;
}

if (widgetType!='spiritualActivities' && widgetSingle!="greenSingle"){
// if (widgetType!='getInvolved')	{
  document.write('<style type="text/css">');
  document.write('.stabs-nav a, .stabs-nav a span.bg1 {');
  document.write('width:87px;height:35px;background: url('+SWpath+bgImg1A+') no-repeat;}');
  document.write('.stabs-nav .stabs-selected a span.bg1 {');
  document.write('width:87px;height:35px;background: url('+SWpath+bgImg1B+') no-repeat;}');
  document.write('.stabs-nav .stabs-disabled a span.bg1 {');
  document.write('width:87px;height:35px;background: url('+SWpath+bgImg1A+') no-repeat;}');
  document.write('</style>');
  document.write('<style type="text/css">');
  document.write('.stabs-nav a, .stabs-nav a span.bg2 {');
  document.write('width:99px;height:35px;background: url('+SWpath+bgImg2A+') no-repeat;}');
  document.write('.stabs-nav a, .stabs-selected a span.bg2 {');
  document.write('width:99px;height:35px;background: url('+SWpath+bgImg2B+') no-repeat;}');
  document.write('.stabs-nav a, .stabs-disabled a span.bg2 {');
  document.write('width:99px;height:35px;background: url('+SWpath+bgImg2A+') no-repeat;}');  
  document.write('</style>');
  document.write('<style type="text/css">');
  document.write('.sevaContribute2Tab{');
  document.write('margin-top:-5px;color:#ffffff;width:65px;height:25px;line-height:25px;padding:0 0 0 0px;background: url('+SWpath+contrImg+') no-repeat;}');
  document.write('.sevaContribute2Tab a{');
  document.write('width:65px;height:25px;display:block;color:#ffffff;}');
  document.write('.sevaContribute2Tab a:hover{');
  document.write('text-decoration:underline;font-weight:normal;}');
  document.write('</style>');
  var styleTxt = 'background:url('+SWpath+Txt+') no-repeat 0 0;position:relative;margin-top:0px;width:186px;height:100px;text-align:center;line-height:15px;padding:0px 0 0 0}';

//  document.write('<div style="width:208px;height:274px;overflow;hidden;"');
  document.write('<div id="widget-2Tab" class="textnormal" style="width:208px;height:274px;">');
  document.write(' <ul id="stabsWidget">');
  document.write('  <li style="background:url('+SWpath+bgImg1A+')no-repeat;width:87px;height:35px;"><a href="#frag-1"><span class="bg1">'+tab1Names+'</span></a></li>');
  document.write('  <li style="background:url('+SWpath+bgImg2A+')no-repeat;width:99px;height:35px;"><a href="#frag-2"><span class="bg2">'+tab2Names+'</span></a></li>');
  document.write(' </ul>');
// }//end if widget not getInvolved
/* else if (widgetType=='getInvolved')	{
  document.write('<style type="text/css">');
  document.write('.stabs-nav{margin:0 0 0 24px;}');
  document.write('.stabs-nav a, .stabs-nav a span.bg1 {');
  document.write('width:95px;left:0px;position:relative;z-index:5;height:35px;background: url('+SWpath+bgImg1A+') no-repeat right top;}');
  document.write('.stabs-nav .stabs-selected a span.bg1 {');
  document.write('width:95px;left:0px;position:relative;z-index:5;height:35px;background: url('+SWpath+bgImg1B+') no-repeat right top;}');
  document.write('.stabs-nav .stabs-disabled a span.bg1 {');
  document.write('width:95px;left:0px;position:relative;z-index:5;height:35px;background: url('+SWpath+bgImg1A+') no-repeat right top;}');
  document.write('</style>');
  document.write('<style type="text/css">');
  document.write('.stabs-nav a, .stabs-nav a span.bg2 {');
  document.write('width:107px;position:relative;z-index:1;margin-left:0px;height:35px;background: url('+SWpath+bgImg2A+') no-repeat right top;}');
  document.write('.stabs-nav a, .stabs-selected a span.bg2 {');
  document.write('width:107px;position:relative;z-index:1;margin-left:0px;height:35px;background: url('+SWpath+bgImg2B+') no-repeat right top;}');
  document.write('.stabs-nav a, .stabs-disabled a span.bg2 {');
  document.write('width:107px;position:relative;z-index:1;margin-left:0px;height:35px;background: url('+SWpath+bgImg2A+') no-repeat right top;}');  
  document.write('</style>');
  document.write('<style type="text/css">');
  document.write('.sevaContribute2Tab{');
  document.write('margin-top:-5px;color:#ffffff;width:65px;height:25px;line-height:25px;padding:0 0 0 0px;background: url('+SWpath+contrImg+') no-repeat;}');
  document.write('.sevaContribute2Tab a{');
  document.write('width:65px;height:25px;display:block;color:#ffffff;}');
  document.write('.sevaContribute2Tab a:hover{');
  document.write('text-decoration:underline;font-weight:normal;}');
  document.write('</style>');
  var styleTxt = 'background:url('+SWpath+Txt+') no-repeat 0 0;float:left;margin-top:0px;width:186px;height:100px;text-align:center;line-height:15px;padding:0px 0 0 0}';

//  document.write('<div style="width:210px;height:274px;overflow;hidden;"');
  document.write('<div id="widget-2Tab" class="textnormal" style="width:210px;height:269px;margin-left:2px;">');
  document.write(' <ul>');
  document.write('  <li class="stabs" style="background:url('+SWpath+bgImg1A+')no-repeat right top;left:-4px;position:relative;z-index:5;width:95px;height:35px;"><a href="#frag-1"><span class="bg1">'+tab1Names+'</span></a></li>');
  document.write('  <li class="stabs" style="background:url('+SWpath+bgImg2A+')no-repeat right top;width:107px;position:relative;z-index:1;margin-left:-20px;height:35px;"><a href="#frag-2"><span class="bg2">'+tab2Names+'</span></a></li>');
  document.write(' </ul>');
 }*///end if widget not getInvolved
document.write("<div id='frag-1' style='height:225px;'>");
document.write("<div id='sevaCurrentProgN' class='sevaCurrentProgN-sliderwrapper'>");
for(count=0;count < imgArrT1.length; count++)
{
	document.write("<div class='contentdiv'>");
	 document.write("<div class='featuredN'>");
          document.write("<div class='sevaActscrollDivN'>");
           document.write("<ul class='sevaActcurnDivN'>");
            document.write("<li style='list-style: none;'>");
             document.write("<a href='"+hrefArrT1[count]+"'>");
             document.write("<img style='float:left;' src='"+imgArrT1[count]+"' alt='"+removeBR(txtArrT1[count])+"' title='"+removeBR(txtArrT1[count])+"' /></a><br class='clear' />");
            if (widgetType=="spiritualActivities"){
             document.write("<div class='dateOverlay'>"+toShowMonth+" "+toShowYear+"</div>");
			}
//             if (widgetCol=="Green"){
//			  document.write("<div style='"+styleTxt+"'><span class='fcWhite fs11 block PR' style='top:-1px;'>"+txtArrT1[count]+"</span>");
//             }else
			  document.write("<div style='"+styleTxt+"'><span class='fcWhite fs11 block'>"+txtArrT1[count]+"</span>");
              if (miscArrT1[count]!=null){
			   document.write("<span class='fcWhite fs11'>"+miscArrT1[count]+"</span>");
              }
			  document.write("</div>");
             document.write("</li>");
            document.write("</ul>");
           document.write("</div>");
          document.write("</div>");
	 document.write("</div>"); //Slide 1 End
}
	document.write("<div id='paginate-sevaCurrentProgN' class='sevaCurrentProgNpagination'>");
     document.write("<a href='#' class='prev1'><img class='sevaActdownN' src='"+joomlaApplicationURL+"seva_activities/images/sevaAct_downarw.gif'></a>");
     document.write("<a href='#' class='next1'><img class='sevaActupN' src='"+joomlaApplicationURL+"seva_activities/images/sevaAct_uparw.gif'></a>");
	document.write("</div>");
document.write("</div>"); //End sevaCurrentProg

featuredcontentslider.init({
id: 'sevaCurrentProgN',  //id of main slider DIV
contentsource: ['inline', ''],  //Valid values: ['inline', ''] or ['ajax', 'path_to_file']
toc: 'markup',  //Valid values: '#increment', 'markup', ['label1', 'label2', etc]
nextprev: ['Previous', 'Next'],  //labels for 'prev' and 'next' links. Set to '' to hide.
revealtype: 'click', //Behavior of pagination links to reveal the slides: 'click' or 'mouseover'
enablefade: [true, 0.2],  //[true/false, fadedegree]
autorotate: [true, 4000],  //[true/false, pausetime]
onChange: function(previndex, curindex){  //event handler fired whenever script changes slide
}})
document.write('</div>');/*end frag1*/

document.write("<div id='frag-2' style='height:225px;'>");
document.write("<div id='sevagetInvolved' class='sevagetInvolved-sliderwrapper'>");
for(count=0;count < imgArrT2.length; count++)
{
	document.write("<div class='contentdiv'>");
	 document.write("<div class='featuredN'>");
          document.write("<div class='sevaActscrollDivN'>");
           document.write("<ul class='sevaActcurnDivN'>");
            document.write("<li style='list-style: none;'>");
             document.write("<a href='"+hrefArrT2[count]+"'>");
             document.write("<img style='float:left;' src='"+imgArrT2[count]+"' alt='"+removeBR(txtArrT2[count])+"' title='"+removeBR(txtArrT2[count])+"' /></a><br class='clear' />");
/*             if (widgetCol=="Green"){
			  document.write("<div style='"+styleTxt+"'><span class='fcWhite fs11 block PR' style='top:-2px;'>"+txtArrT2[count]+"</span>");
             }else*/
			  document.write("<div style='"+styleTxt+"'><span class='fcWhite fs11 block'>"+txtArrT2[count]+"</span>");
              if (miscArrT2[count]==null){
			   document.write("<br /><span class='floatL marL50 fcWhite WebRupee'>Rs.&nbsp;</span><span class='floatL fcWhite fs11'>"+contrArrT2[count]+"</span><a href='"+hrefArrT2[count]+"'><span class='sevaContribute2Tab marL5 floatL fs11'>Contribute</span></a>");
              }
			  else document.write("<span class='fcWhite fs11'>"+miscArrT2[count]+"</span>");
              if (contrArrT2[count].length>5){
			   document.write("<br /><span class='regMdLink floatR marR5'><a href='"+contrArrT2[count]+"' target='_new'>Register</a></span>");
              }
			  document.write("</div>");
             document.write("</li>");
            document.write("</ul>");
           document.write("</div>");
          document.write("</div>");
	 document.write("</div>"); //Slide 1 End
}
	document.write("<div id='paginate-sevagetInvolved' class='sevagetInvolvedpagination'>");
     document.write("<a href='#' class='prev1'><img class='sevaActdownN' src='"+joomlaApplicationURL+"seva_activities/images/sevaAct_downarw.gif'></a>");
     document.write("<a href='#' class='next1'><img class='sevaActupN' src='"+joomlaApplicationURL+"seva_activities/images/sevaAct_uparw.gif'></a>");
	document.write("</div>");
document.write("</div>"); //End sevagetInvolved

featuredcontentslider.init({
id: 'sevagetInvolved',  //id of main slider DIV
contentsource: ['inline', ''],  //Valid values: ['inline', ''] or ['ajax', 'path_to_file']
toc: 'markup',  //Valid values: '#increment', 'markup', ['label1', 'label2', etc]
next2prev2: ['Previous', 'Next'],  //labels for 'prev' and 'next' links. Set to '' to hide.
revealtype: 'click', //Behavior of pagination links to reveal the slides: 'click' or 'mouseover'
enablefade: [true, 0.2],  //[true/false, fadedegree]
autorotate: [true, 4000],  //[true/false, pausetime]
onChange: function(previndex, curindex){  //event handler fired whenever script changes slide
}})
document.write('</div>');/*end frag2*/

document.write('</div>');

}/*end if not orange*/
/**************************************************************************************************************/
else if (widgetType=='spiritualActivities' && widgetSingle!="greenSingle"){
document.write('<style type="text/css">');
document.write('.stabs-nav a, .stabs-nav a span.bg1 {');
document.write('width:70px;height:35px;background: url('+SWpath+bgImg1A+') no-repeat;}');//line-height:13px;
document.write('.stabs-nav a, .stabs-selected a span.bg1 {');
document.write('width:70px;height:35px;background: url('+SWpath+bgImg1B+') no-repeat;}');//line-height:13px;
document.write('.stabs-nav a, .stabs-disabled a span.bg1 {');
document.write('width:70px;height:35px;background: url('+SWpath+bgImg1A+') no-repeat;}');//line-height:13px;
document.write('</style>');
document.write('<style type="text/css">');
document.write('.stabs-nav a, .stabs-nav a span.bg2 {');
document.write('width:81px;height:35px;background: url('+SWpath+bgImg2A+') no-repeat;}');//line-height:24px;
document.write('.stabs-nav a, .stabs-selected a span.bg2 {');
document.write('width:81px;height:35px;background: url('+SWpath+bgImg2B+') no-repeat;}');//line-height:24px;
document.write('.stabs-nav a, .stabs-disabled a span.bg2 {');
document.write('width:81px;height:35px;background: url('+SWpath+bgImg2A+') no-repeat;}');//line-height:24px;
document.write('</style>');
document.write('<style type="text/css">');
document.write('.sevaContribute2Tab{');
document.write('margin-top:-5px;color:#ffffff;width:65px;height:25px;line-height:25px;padding:0 0 0 0px;background: url('+SWpath+contrImg+') no-repeat;}');
document.write('.sevaContribute2Tab a{');
document.write('width:65px;height:25px;display:block;color:#ffffff;}');
document.write('.sevaContribute2Tab a:hover{');
document.write('text-decoration:underline;font-weight:normal;}');
document.write('</style>');
var styleTxt = 'display:block;position:relative;margin-top:-80px;z-index:2 !important;background:#000;width:151px;height:80px;text-align:center;line-height:15px;padding:0px 0 0 0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=70);-moz-opacity: 0.85;-ms-filter:"alpha(opacity=85)";filter:alpha(opacity=85);opacity:0.85;}';

//document.write('<div style="width:185px;height:285px;overflow;hidden;"');
document.write('<div id="widget-2Tab" class="textnormal" style="width:208px;height:269px;">');
document.write(' <ul id="stabsWidget">');
document.write('  <li style="background:url('+SWpath+bgImg1A+')no-repeat;width:70px;height:35px;"><a href="#frag-1"><span class="bg1">'+tab1Names+'</span></a></li>');
document.write('  <li style="background:url('+SWpath+bgImg2A+')no-repeat;width:81px;height:35px;"><a href="#frag-2"><span class="bg2">'+tab2Names+'</span></a></li>');
document.write(' </ul>');

document.write("<div id='frag-1' style='height:225px;'>");
document.write("<div id='"+slider1ID+"' class='"+slider1ID+"-sliderwrapper'>");
for(count=0;count < imgArrT1.length; count++)
{
	document.write("<div class='contentdiv'>");
	 document.write("<div class='featuredN'>");
          document.write("<div class='sevaActscrollDivN'>");
           document.write("<ul class='sevaActcurnDivN2'>");
            document.write("<li>");
            if (hrefArrT1[count].length<5){
             document.write("<img src='"+imgArrT1[count]+"' alt='"+removeBR(txtArrT1[count])+"' title='"+removeBR(txtArrT1[count])+"' /><br class='clear' />");
            }else{
			 document.write("<a href='"+hrefArrT1[count]+"' target='_new'>");
             document.write("<img style='float:left;' src='"+imgArrT1[count]+"' alt='"+removeBR(txtArrT1[count])+"' title='"+removeBR(txtArrT1[count])+"' /></a><br class='clear' />");
            }/*
            if (widgetType=="spiritualActivities"){
             document.write("<div class='dateOverlay'>"+toShowMonth+" "+toShowYear+"</div>");
			}*/
			  document.write("<div style='"+styleTxt+"'><span class='fcWhite fs11 block'>"+txtArrT1[count]+"</span>");
              if (miscArrT1[count]!=null){
			   document.write("<span class='fcWhite fs11'>"+miscArrT1[count]+"</span>");
              }
              if (contrArrT1[count].length>5){
			   document.write("<br /><span class='regMdLink'><a href='"+contrArrT1[count]+"' target='_new'>Register</a></span>");
              }
			  document.write("</div>");
			 document.write("</li>");
             document.write("<img src='"+SWpath+Txt+"' height='20px' width='151px' border='0'");
			document.write("</ul>");
           document.write("</div>");
          document.write("</div>");
	 document.write("</div>"); //Slide 1 End
}
	document.write("<div id='paginate-"+slider1ID+"' class='"+slider1ID+"pagination'>");
     document.write("<a href='#' class='prev1'><img class='sevaActdownN' src='"+joomlaApplicationURL+"seva_activities/images/sevaAct_downarw.gif'></a>");
     document.write("<a href='#' class='next1'><img class='sevaActupN' src='"+joomlaApplicationURL+"seva_activities/images/sevaAct_uparw.gif'></a>");
	document.write("</div>");
document.write("</div>"); //End sevaCurrentProg

featuredcontentslider.init({
id: slider1ID,  //id of main slider DIV
contentsource: ['inline', ''],  //Valid values: ['inline', ''] or ['ajax', 'path_to_file']
toc: 'markup',  //Valid values: '#increment', 'markup', ['label1', 'label2', etc]
nextprev: ['Previous', 'Next'],  //labels for 'prev' and 'next' links. Set to '' to hide.
revealtype: 'click', //Behavior of pagination links to reveal the slides: 'click' or 'mouseover'
enablefade: [true, 0.2],  //[true/false, fadedegree]
autorotate: [true, 4000],  //[true/false, pausetime]
onChange: function(previndex, curindex){  //event handler fired whenever script changes slide
}})
document.write('</div>');/*end frag1*/

document.write("<div id='frag-2' style='height:225px;'>");
document.write("<div id='"+slider2ID+"' class='"+slider2ID+"-sliderwrapper'>");
for(count=0;count < imgArrT2.length; count++)
{
	document.write("<div class='contentdiv'>");
	 document.write("<div class='featuredN'>");
          document.write("<div class='sevaActscrollDivN'>");
           document.write("<ul class='sevaActcurnDivN2'>");
            document.write("<li>");
             document.write("<a href='"+hrefArrT2[count]+"' target='_new'>");
             document.write("<img style='float:left;' src='"+imgArrT2[count]+"' alt='"+removeBR(txtArrT2[count])+"' title='"+removeBR(txtArrT2[count])+"' /></a><br class='clear' />");
              document.write("<div style='"+styleTxt+"'><span class='fcWhite fs11 block'>"+txtArrT2[count]+"</span>");
              if (miscArrT2[count]==null){
			   document.write("<br /><span class='floatL marL30 fcWhite WebRupee'>Rs.&nbsp;</span><span class='floatL fcWhite fs11'>"+contrArrT2[count]+"</span><a href='"+hrefArrT2[count]+"' target='_new'><span class='sevaContribute2Tab marL5 floatL fs11'>Contribute</span></a>");
              }
			  else document.write("<span class='fcWhite fs11'>"+miscArrT2[count]+"</span>");
			  document.write("</div>");
             document.write("</li>");
             document.write("<img src='"+SWpath+Txt+"' height='20px' width='151px' border='0'");
            document.write("</ul>");
           document.write("</div>");
          document.write("</div>");
	 document.write("</div>"); //Slide 1 End
}
	document.write("<div id='paginate-"+slider2ID+"' class='"+slider2ID+"pagination'>");
     document.write("<a href='#' class='prev1'><img class='sevaActdownN' src='"+joomlaApplicationURL+"seva_activities/images/sevaAct_downarw.gif'></a>");
     document.write("<a href='#' class='next1'><img class='sevaActupN' src='"+joomlaApplicationURL+"seva_activities/images/sevaAct_uparw.gif'></a>");
	document.write("</div>");
document.write("</div>"); //End sevagetInvolved

featuredcontentslider.init({
id: slider2ID,  //id of main slider DIV
contentsource: ['inline', ''],  //Valid values: ['inline', ''] or ['ajax', 'path_to_file']
toc: 'markup',  //Valid values: '#increment', 'markup', ['label1', 'label2', etc]
next2prev2: ['Previous', 'Next'],  //labels for 'prev' and 'next' links. Set to '' to hide.
revealtype: 'click', //Behavior of pagination links to reveal the slides: 'click' or 'mouseover'
enablefade: [true, 0.2],  //[true/false, fadedegree]
autorotate: [true, 4000],  //[true/false, pausetime]
onChange: function(previndex, curindex){  //event handler fired whenever script changes slide
}})
document.write('</div>');/*end frag2*/

document.write('</div>');
}//end if spiritualAct
/********************************************************************************************************/
else if (widgetSingle=='greenSingle'){
  document.write('<style type="text/css">');
  document.write('.stabs-nav a, .stabs-nav a span.bg1 {');
  document.write('width:186px;height:35px;background: url('+SWpath+bgImg1A+') no-repeat;}');
  document.write('</style>');

  document.write('<style type="text/css">');
  document.write('.singleButtonSW{');
  document.write('padding:4px;font-size:14px;}');
  document.write('</style>');
  document.write('<style type="text/css">');
  document.write('.sevaContribute2Tab{');
  document.write('margin-top:-5px;color:#ffffff;width:65px;height:25px;line-height:25px;padding:0 0 0 0px;background: url('+SWpath+contrImg+') no-repeat;}');
  document.write('.sevaContribute2Tab a{');
  document.write('width:65px;height:25px;display:block;color:#ffffff;}');
  document.write('.sevaContribute2Tab a:hover{');
  document.write('text-decoration:underline;font-weight:normal;}');
  document.write('</style>');
  var styleTxt = 'background:url('+SWpath+Txt+') no-repeat 0 0;position:relative;margin-top:-5px;width:186px;height:100px;text-align:center;line-height:15px;padding:0px 0 0 0}';

document.write('<div id="widget-2Tab" class="textnormal" style="width:208px;height:269px;">');

document.write(' <ul id="stabsWidget">');
document.write('  <li style="background:url('+SWpath+bgImg1A+')no-repeat;width:186px;height:35px;"><a href="#frag-1"><span class="bg1"><span class="singleButtonSW">'+tab1Names+'</span></span></a></li>');
document.write(' </ul>');

document.write("<div id='frag-1' style='height:225px;'>");
document.write("<div id='sevaCurrentProgN' class='sevaCurrentProgN-sliderwrapper'>");
for(count=0;count < imgArrT1.length; count++)
{
	document.write("<div class='contentdiv'>");
	 document.write("<div class='featuredN'>");
          document.write("<div class='sevaActscrollDivN'>");
           document.write("<ul class='sevaActcurnDivN'>");
            document.write("<li style='list-style: none;'>");
             document.write("<a href='"+hrefArrT1[count]+"'>");
             document.write("<img src='"+imgArrT1[count]+"' alt='"+removeBR(txtArrT1[count])+"' title='"+removeBR(txtArrT1[count])+"' /></a><br class='clear' />");
            if (widgetType=="spiritualActivities"){
             document.write("<div class='dateOverlay'>"+toShowMonth+" "+toShowYear+"</div>");
			}
//             if (widgetCol=="Green"){
//			  document.write("<div style='"+styleTxt+"'><span class='fcWhite fs11 block PR' style='top:-1px;'>"+txtArrT1[count]+"</span>");
//             }else
			  document.write("<div style='"+styleTxt+"'><span class='fcWhite fs11 block'>"+txtArrT1[count]+"</span>");
              if (miscArrT1[count]!=null){
			   document.write("<span class='fcWhite fs11'>"+miscArrT1[count]+"</span>");
              }
			  document.write("</div>");
             document.write("</li>");
            document.write("</ul>");
           document.write("</div>");
          document.write("</div>");
	 document.write("</div>"); //Slide 1 End
}
	document.write("<div id='paginate-sevaCurrentProgN' class='sevaCurrentProgNpagination'>");
     document.write("<a href='#' class='prev1'><img class='sevaActdownN' src='"+joomlaApplicationURL+"seva_activities/images/sevaAct_downarw.gif'></a>");
     document.write("<a href='#' class='next1'><img class='sevaActupN' src='"+joomlaApplicationURL+"seva_activities/images/sevaAct_uparw.gif'></a>");
	document.write("</div>");
document.write("</div>"); //End sevaCurrentProg

featuredcontentslider.init({
id: 'sevaCurrentProgN',  //id of main slider DIV
contentsource: ['inline', ''],  //Valid values: ['inline', ''] or ['ajax', 'path_to_file']
toc: 'markup',  //Valid values: '#increment', 'markup', ['label1', 'label2', etc]
nextprev: ['Previous', 'Next'],  //labels for 'prev' and 'next' links. Set to '' to hide.
revealtype: 'click', //Behavior of pagination links to reveal the slides: 'click' or 'mouseover'
enablefade: [true, 0.2],  //[true/false, fadedegree]
autorotate: [true, 4000],  //[true/false, pausetime]
onChange: function(previndex, curindex){  //event handler fired whenever script changes slide
}})
document.write('</div>');/*end frag1*/
document.write('</div>');
}//end if getInvolvedSingle
