document.write('<link type="text/css" rel="stylesheet" href="http://invite.linescale.com/survey-invitation.css" />');
document.write('<script type="text/javascript" src="http://invite.linescale.com/juilliard/survey-invitation.js" language="javascript1.5"></script>');

var ns6=document.getElementById&&!document.all
var ie4=document.all

var Selected_Month;
var Selected_Year;
var Current_Date = new Date();
var Current_Month = Current_Date.getMonth();

var Days_in_Month = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
var Month_Label = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');

var Current_Year = Current_Date.getYear();
if (Current_Year < 1000)
Current_Year+=1900

var prevDay;
var prevMonth;
var prevYear;

var nextDay;
var nextMonth;
var nextYear;

var curYear;
var curMonth;
var curDay;

var next_Date;
var prev_Date;
var cur_Date;

var url;
var next = "+";
var pre = "-";
var Today = Current_Date.getDate();

var imagePath="";
var calendarViewType='';

function Header(Year, Month) {

   if (Month == 1) {
   Days_in_Month[1] = ((Year % 400 == 0) || ((Year % 4 == 0) && (Year % 100 !=0))) ? 29 : 28;
   }
   var Header_String = Month_Label[Month] + ' ' + Year;
   return Header_String;
}



function Make_Calendar(Year, Month,url,cur_Date) {
	
   var First_Date = new Date(Year, Month, 1);
   //alert("First_Date: "+First_Date)
   var Heading = Header(Year, Month);
   //alert(Heading)
   var First_Day = First_Date.getDay() + 1;
   //alert("First Day: "+First_Day)
   if (((Days_in_Month[Month] == 31) && (First_Day >= 6)) ||
       ((Days_in_Month[Month] == 30) && (First_Day == 7))) {
      var Rows = 6;
   }
   else if ((Days_in_Month[Month] == 28) && (First_Day == 1)) {
      var Rows = 4;
   }
   else {
      var Rows = 5;
   }

   var HTML_String = '<table cellpadding="0" width="100%" align="right"><tr><td valign="top"><table BORDER=0 CELLSPACING=0 cellpadding=2 width="100%">';

   HTML_String += '<tr><th colspan=7 class="monthName_TopCalendar" align="center"><a onclick=Skip(\''+pre+'\',\''+url+'\') style="padding-right:10px;">&lt;</a>' + Heading + '<a onclick=Skip(\''+next+'\',\''+url+'\') style="padding-left:10px;">&gt;</a></th></tr>';

   HTML_String += '<tr><th ALIGN="CENTER" class="monthDay">S</th><th ALIGN="CENTER" class="monthDay">M</th><th ALIGN="CENTER" class="monthDay">T</th><th ALIGN="CENTER" class="monthDay">W</th>';

   HTML_String += '<th ALIGN="CENTER" class="monthDay">T</th><th ALIGN="CENTER" class="monthDay">F</th><th ALIGN="CENTER" class="monthDay">S</th></tr>';
	
   var Day_Counter = 1;
   var Loop_Counter = 1;
   var showDate;
   var curDay;
   var dupLoop_Counter=1;
   var dupDay_Counter=1;
   var dupcurDay='';
   var rowToShowHighlighted=0;
   var dateToMatch=cur_Date.substring(6);
      for (var j = 1; j <= Rows; j++) {
 	      for (var i = 1; i < 8; i++) {
	         if ((dupLoop_Counter >= First_Day) && (dupDay_Counter <= Days_in_Month[Month])) {
		           		 if(dupDay_Counter<10){
			            	dupcurDay = "0"+dupDay_Counter
			            }else{
			            	dupcurDay = dupDay_Counter;
			            }
			            if(dupcurDay==dateToMatch){
			              rowToShowHighlighted=j;
			            }
	            dupDay_Counter++;    
	         }
	        dupLoop_Counter++;
	      }
     }
   
   
   
   for (var j = 1; j <= Rows; j++) {
         if(rowToShowHighlighted==j && calendarViewType=='week'){
           HTML_String += '<tr ALIGN="left" VALIGN="top" bgcolor="#A8A8A8">';
         }else{
           HTML_String += '<tr ALIGN="left" VALIGN="top">';
         }
      for (var i = 1; i < 8; i++) {
         if ((Loop_Counter >= First_Day) && (Day_Counter <= Days_in_Month[Month])) {
            if ((Day_Counter == Today) && (Year == Current_Year) && (Month == Current_Month)) {
            	 if(Day_Counter<10){
		            	curDay = "0"+Day_Counter
		            }else{
		            	curDay = Day_Counter;
		            }
	         	showDate = curYear+curMonth+curDay
            
            
    	        var arrPos=0;
    	        var flag=0;
				for(arrPos=0;arrPos<dates.length;arrPos++){
				    if(dates[arrPos]==Day_Counter){
				    flag=1;
				    }
				}
				
				if(flag==1){
				    if(rowToShowHighlighted==j && calendarViewType=='week'){
					  HTML_String += '<td BGCOLOR="#A8A8A8" BORDERCOLOR="000000" class="monthDates" align="center"><a href="javascript:void(0)" onclick=showDayView(\''+url+'\',\''+showDate+'\') style="color:#000000; text-decoration:none; font-weight:bold;" >' + Day_Counter + '</a></td>';
				    }else{
				      HTML_String += '<td BGCOLOR="#dddddd" BORDERCOLOR="000000" class="monthDates" align="center"><a href="javascript:void(0)" onclick=showDayView(\''+url+'\',\''+showDate+'\') style="color:#000000; text-decoration:none; font-weight:bold;" >' + Day_Counter + '</a></td>';
				    }
				}
				if(flag==0){
				   if(rowToShowHighlighted==j && calendarViewType=='week'){
					HTML_String += '<td BGCOLOR="#A8A8A8" BORDERCOLOR="000000" class="monthDates" align="center"><a href="javascript:void(0)" onclick=showDayView(\''+url+'\',\''+showDate+'\') style="color:#000000; text-decoration:none" >' + Day_Counter + '</a></td>';
				   }else{
				    HTML_String += '<td BGCOLOR="#dddddd" BORDERCOLOR="000000" class="monthDates" align="center"><a href="javascript:void(0)" onclick=showDayView(\''+url+'\',\''+showDate+'\') style="color:#000000; text-decoration:none" >' + Day_Counter + '</a></td>'; 
				    }
				}
			//	HTML_String += '<td BGCOLOR="FFFFFF" BORDERCOLOR="000000" class="monthDates" align="center"><a href="javascript:void(0)" onclick=showDayView(\''+url+'\',\''+showDate+'\') style="color:#000000; text-decoration:none;" >' + Day_Counter + '</a></td>';  	   
          		flag=0;
           }
            else {
	           		 if(Day_Counter<10){
		            	curDay = "0"+Day_Counter
		            }else{
		            	curDay = Day_Counter;
		            }
	         	showDate = curYear+curMonth+curDay
                var arrPos=0;
    	        var flag=0;
				for(arrPos=0;arrPos<dates.length;arrPos++){
				    if(dates[arrPos]==Day_Counter){
				    flag=1;
				    }
				}
				
				if(flag==1){
				    if(rowToShowHighlighted==j && calendarViewType=='week'){
					HTML_String += '<td BGCOLOR="#A8A8A8" BORDERCOLOR="000000" class="monthDates" align="center"><a href="javascript:void(0)" onclick=showDayView(\''+url+'\',\''+showDate+'\') style="color:#000000; text-decoration:none; font-weight:bold;" >' + Day_Counter + '</a></td>';  //
				    }else{
				    HTML_String += '<td BGCOLOR="FFFFFF" BORDERCOLOR="000000" class="monthDates" align="center"><a href="javascript:void(0)" onclick=showDayView(\''+url+'\',\''+showDate+'\') style="color:#000000; text-decoration:none; font-weight:bold;" >' + Day_Counter + '</a></td>';  //
				    }
				}
				if(flag==0){
				   if(rowToShowHighlighted==j && calendarViewType=='week'){
					HTML_String += '<td BGCOLOR="#A8A8A8" BORDERCOLOR="000000" class="monthDates" align="center"><a href="javascript:void(0)" onclick=showDayView(\''+url+'\',\''+showDate+'\') style="color:#000000; text-decoration:none" >' + Day_Counter + '</a></td>';  //
				    }else{
				    HTML_String += '<td BGCOLOR="FFFFFF" BORDERCOLOR="000000" class="monthDates" align="center"><a href="javascript:void(0)" onclick=showDayView(\''+url+'\',\''+showDate+'\') style="color:#000000; text-decoration:none" >' + Day_Counter + '</a></td>';  //
				    }
				}
				   
			//	HTML_String += '<td BGCOLOR="FFFFFF" BORDERCOLOR="000000" class="monthDates" align="center"><a href="javascript:void(0)" onclick=showDayView(\''+url+'\',\''+showDate+'\') style="color:#000000; text-decoration:none;" >' + Day_Counter + '</a></td>';  //   
          		flag=0;
            }
            Day_Counter++;    
         }
         else {
            HTML_String += '<td BORDERCOLOR="C0C0C0"> </td>';
         }
         Loop_Counter++;
      }
      HTML_String += '</tr>';
   }
   HTML_String += '</table></td></tr></table>';
   cross_el=ns6? document.getElementById("Calendar") : document.all.Calendar
   cross_el.innerHTML = HTML_String;
   
}


function Check_Nums() {
   if ((event.keyCode < 48) || (event.keyCode > 57)) {
      return false;
   }
}



function On_Year() {
   var Year = document.when.year.value;
   if (Year.length == 4) {
      Selected_Month = document.when.month.selectedIndex;
      Selected_Year = Year;
      Make_Calendar(Selected_Year, Selected_Month,url,cur_Date);
   }
}

function On_Month() {
   var Year = document.when.year.value;
   
   if (Year.length == 4) {
      Selected_Month = document.when.month.selectedIndex;
      Selected_Year = Year;
      Make_Calendar(Selected_Year, Selected_Month,url,cur_Date);
   }
   else {
      alert('Please enter a valid year.');
      document.when.year.focus();
   }
}


function loadCalendar(path,prevDate,nextDate,curDate,resourcesRoot) {
//alert(resourcesRoot)
    
	curYear = curDate.substring(0,4)
	curMonth = curDate.substring(4,6)
	curDay = curDate.substring(7,9)
	
	cur_Date = curDate;//curYear+curMonth+curDay
	
	//alert("Current Year: "+curYear)
	//alert("Current Month: "+curMonth)
	prevYear = prevDate.substring(0,3)
	prevMonth = prevDate.substring(4,6)
	prevDay = prevDate.substring(7,9)
	
	prev_Date = prevDate;
	//prevDate = prevYear+prevMonth+prevDay
	
	nextYear = nextDate.substring(0,3)
	nextMonth = nextDate.substring(4,6)
	nextDay = nextDate.substring(7,9)
	
	next_Date = nextDate;
	
	
   if (!ie4&&!ns6){
   return
   }
   var Mid_Screen = Math.round(document.body.clientWidth / 2);
  	 //alert("1-Selected_Month: "+Selected_Month) 	
  	 Selected_Month = parseInt(curMonth-1)//Current_Month;
  	 //alert("2-Selected_Month: "+Selected_Month)
   	 Selected_Year = parseInt(curYear)
    // alert("Selected_Year: "+Selected_Year)
   url = path;
   imagePath = resourcesRoot
   Make_Calendar(Selected_Year, Selected_Month,url,cur_Date);
}



function Skip(Direction,url) {

   if (Direction == '+') {
   	 
   	  if (Selected_Month == 11) {
         Selected_Month = 0//parseInt(curMonth)-1;
         Selected_Year = parseInt(curYear);
         //Selected_Year++;
      }
      else {
      	Selected_Month = parseInt(curMonth)-1;
      	
      }
     
     location=url+"/main/setViewPeriod.do?b=de&date="+next_Date
   }
   else {
   
     if (Selected_Month == 0) {
         Selected_Month = 11//parseInt(curMonth)-1;
         Selected_Year = parseInt(curYear);
         //Selected_Year--;
      }
      else {
        Selected_Month = parseInt(curMonth)-1;
     }
     location=url+"/main/setViewPeriod.do?b=de&date="+prev_Date
   }
  
   Make_Calendar(Selected_Year, Selected_Month,url,cur_Date);
  
}


function replaceFor(){
if (ie4||ns6){
		
		   for (j=0;j<Month_Label.length;j++) {
		      document.writeln('<option value=' + j + '>' + Month_Label[j]);
		   }
		}
}

function showDayView(url,cur_Date){

location=url+"/main/setViewPeriod.do?b=de&viewType=dayView&date="+cur_Date
}


/* ---------------------------------------------------------
	Code For Image Slide Show By Sameer on 5th June 2008
* ---------------------------------------------------------- */

var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed

fadeimages[0]=["/calrsrc.MainCampus/images/Dance1.gif", "", ""] //plain image syntax
fadeimages[1]=["/calrsrc.MainCampus/images/Dance2.gif", "", ""] //image with link syntax
fadeimages[2]=["/calrsrc.MainCampus/images/Dance3.gif", "", ""] //image with link and target syntax
fadeimages[3]=["/calrsrc.MainCampus/images/Dance4.gif", "", ""] //plain image syntax
fadeimages[4]=["/calrsrc.MainCampus/images/Dance5.gif", "", ""] //image with link syntax
fadeimages[5]=["/calrsrc.MainCampus/images/Dance6.gif", "", ""] //image with link and target syntax
fadeimages[6]=["/calrsrc.MainCampus/images/Dance7.gif", "", ""] //plain image syntax
fadeimages[7]=["/calrsrc.MainCampus/images/Dance8.gif", "", ""] //image with link syntax
fadeimages[8]=["/calrsrc.MainCampus/images/Dance9.gif", "", ""] //image with link and target syntax
fadeimages[9]=["/calrsrc.MainCampus/images/Dance10.gif", "", ""] //plain image syntax
fadeimages[10]=["/calrsrc.MainCampus/images/Dance11.gif", "", ""] //image with link syntax
fadeimages[11]=["/calrsrc.MainCampus/images/Dance12.gif", "", ""] //image with link and target syntax
 
var fadeimages2=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages2[0]=["/calrsrc.MainCampus/images/Music1.gif", "", ""] //plain image syntax
fadeimages2[1]=["/calrsrc.MainCampus/images/Music2.gif", "", ""] //image with link syntax
fadeimages2[2]=["/calrsrc.MainCampus/images/Music3.gif", "", ""] //image with link and target syntax
fadeimages2[3]=["/calrsrc.MainCampus/images/Music4.gif", "", ""] //plain image syntax
fadeimages2[4]=["/calrsrc.MainCampus/images/Music5.gif", "", ""] //image with link syntax
fadeimages2[5]=["/calrsrc.MainCampus/images/Music6.gif", "", ""] //image with link and target syntax
fadeimages2[6]=["/calrsrc.MainCampus/images/Music7.gif", "", ""] //plain image syntax
fadeimages2[7]=["/calrsrc.MainCampus/images/Music8.gif", "", ""] //image with link syntax
fadeimages2[8]=["/calrsrc.MainCampus/images/Music9.gif", "", ""] //image with link and target syntax
fadeimages2[9]=["/calrsrc.MainCampus/images/Music10.gif", "", ""] //plain image syntax
fadeimages2[10]=["/calrsrc.MainCampus/images/Music11.gif", "", ""] //image with link syntax
fadeimages2[11]=["/calrsrc.MainCampus/images/Music12.gif", "", ""] //image with link and target syntax

var fadeimages3=new Array() //3rd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages3[0]=["/calrsrc.MainCampus/images/Drama1.gif", "", ""] //plain image syntax
fadeimages3[1]=["/calrsrc.MainCampus/images/Drama2.gif", "", ""] //image with link syntax
fadeimages3[2]=["/calrsrc.MainCampus/images/Drama3.gif", "", ""] //image with link and target syntax
fadeimages3[3]=["/calrsrc.MainCampus/images/Drama4.gif", "", ""] //plain image syntax
fadeimages3[4]=["/calrsrc.MainCampus/images/Drama5.gif", "", ""] //image with link syntax
fadeimages3[5]=["/calrsrc.MainCampus/images/Drama6.gif", "", ""] //image with link and target syntax
fadeimages3[6]=["/calrsrc.MainCampus/images/Drama7.gif", "", ""] //plain image syntax
fadeimages3[7]=["/calrsrc.MainCampus/images/Drama8.gif", "", ""] //image with link syntax
fadeimages3[8]=["/calrsrc.MainCampus/images/Drama9.gif", "", ""] //image with link and target syntax
fadeimages3[9]=["/calrsrc.MainCampus/images/Drama10.gif", "", ""] //plain image syntax
fadeimages3[10]=["/calrsrc.MainCampus/images/Drama11.gif", "", ""] //image with link syntax
fadeimages3[11]=["/calrsrc.MainCampus/images/Drama12.gif", "", ""] //image with link and target syntax

var fadebgcolor="white"

////NO need to edit beyond here/////////////
 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){

this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}

//code by avinav:start 
function openAudioPopUp(resourceRoot){
window.open('/cal/richdata/showAudio.do?resourcesRoot='+resourceRoot,'AudioPage','scrollbars=no,copyhistory=no,resizable=no,menubar=no,scrollbars=yes,status=no,screenX=980,screenY=550,Top=100,left=100,width=700,height=450');
}
function openVideoPopUp(resourceRoot){
window.open('/cal/richdata/showVideo.do?resourcesRoot='+resourceRoot,'VideoPage','scrollbars=no,copyhistory=no,resizable=no,menubar=no,scrollbars=yes,status=no,screenX=980,screenY=550,Top=100,left=100,width=700,height=450');
}
//code by avinav:end


function openEmailPopUp(emailImagePath,dayName,longDate,subId,calPath,guid){
var fullDate = dayName+', '+longDate;
window.open('/cal/email/eventMail.do?b=de&resourcesRoot='+emailImagePath+'&dayName='+fullDate+'&subid='+subId+'&calPath='+calPath+'&guid='+guid,'imagePage','scrollbars=no,copyhistory=no,resizable=no,menubar=no,scrollbars=yes,status=no,screenX=980,screenY=550,Top=100,left=100,width=750,height=450');
}

function openMapItPopUp(subscriptionId,calPath,guid,recurrenceId){
window.open('/cal/location/mapIt.do?b=de&subid='+subscriptionId+'&calPath='+calPath+'&guid='+guid+'&recurrenceId='+recurrenceId,'imagePage','left=20,top=20,width=700,height=450,address=no,toolbar=no,resizable=no,scrollbars=no,menubar=no')
}

function openFutureDatesPopUp(resourceRoot,urlPrefix){

window.open(urlPrefix+'/futureDates.do?resourcesRoot='+resourceRoot,'imagePage','scrollbars=no,copyhistory=no,resizable=no,menubar=no,scrollbars=yes,status=no,screenX=980,screenY=550,Top=100,left=100,width=500,height=350');
}

function fillPastDetails(formObj,searchStr) {
  
  for(var i=0; i < formObj.searchLimits.length; i++){
	if(formObj.searchLimits[i].checked)
	var val=formObj.searchLimits[i].value	
}
  var query=formObj.query.value;
  location=searchStr+"&searchLimits="+val+"&query="+query
}


//function to open event link in new window
//By Swati
//2nd June 2008
function isValidURL(url,urlToPost)
{    
	if(url=="")
	{
		alert("Event link not present ");
	}
	else
	{ 
		var RegExp = /^(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/;
	    if(RegExp.test(url)){   	    
	      var newWindow = window.open(url, '_blank');
	 		newWindow.focus();
	        return false;
	    }else{
	    alert(url+" is not valid URL");
	        return false;
	    }
	}
}

// by avinav on 21 july for bolding dates in javascript calander 

var dates = new Array();
var pos = 0;

function storeDates(date){
	   
	
	var flag = 0;
    var i=0;
	for(i=0;i<dates.length;i++){
		if(dates[i]== date){
			flag=1;		
		}
	}
	
	if(flag == 0){
		dates[pos] = date;
		pos=pos+1;
		
	}
	flag=0;
 
}

function weekOrNot(type){
	
	calendarViewType=type;
	
 
}


