function setcookie(cookiecontents){
		index = -1;
		var today = new Date();
		today.setTime( today.getTime() );
		var cookie_expire_date = new Date(today.getTime() + (365* 86400000)); 
		document.cookie="MM_TrackableNumber="+cookiecontents+";expires="+cookie_expire_date.toGMTString();
	
}

function setcookieFTM(cookiecontents){
		index = -1;
		var today = new Date();
		today.setTime( today.getTime() );
		var cookie_expire_date = new Date(today.getTime() + (365* 86400000)); 
		document.cookie="MM_TrackableNumbe2="+cookiecontents+";expires="+cookie_expire_date.toGMTString();
	
}



//function to retrive the cookie
function getcookie(){
		//alert('hiu');
	//plcae your default phone number to show in case cookie is not set
	if(document.cookie){ //check if there is a cookie set 
		  index = document.cookie.indexOf("MM_TrackableNumber");
		  index2 = document.cookie.indexOf("MM_TrackableNumbe2");
if (index != -1){
		  
				namestart = (document.cookie.indexOf("=", index) + 1);
				nameend = document.cookie.indexOf("MM_TrackableNumber;", index);
				if (nameend == -1) {nameend = document.cookie.length;}
					document.write ("<img src='images/trackingfront.gif' width='200' height='398' alt='Emily is trained within the traditions of the Conservative, Reconstructionist, and Reform movements.  Contact: 917.512.8058'>");
//tracking no					
		  }
		  
			else
			{
		document.write ("<img src='images/index_10.gif' width='200' height='398' alt='Emily is trained within the traditions of the Conservative, Reconstructionist, and Reform movements.  Contact: 917.405.0696'>");
//default phone
			}
	}
	else
	{
document.write ("<img src='images/index_10.gif' width='200' height='398' alt='Emily is trained within the traditions of the Conservative, Reconstructionist, and Reform movements.  Contact: 917.405.0696'>");
//default phone

	}
}
function getVar(name)
         {
         get_string = document.location.search;         
         return_value = '';
         
         do { //This loop is made to catch all instances of any get variable.
            name_index = get_string.indexOf(name + '=');
            
            if(name_index != -1)
              {
              get_string = get_string.substr(name_index + name.length + 1, get_string.length - name_index);
              
              end_of_value = get_string.indexOf('&');
              if(end_of_value != -1)                
                value = get_string.substr(0, end_of_value);                
              else                
                value = get_string;                
                
              if(return_value == '' || value == '')
                 return_value += value;
              else
                 return_value += ', ' + value;
              }
            } while(name_index != -1)
            
         //Restores all the blank spaces.
         space = return_value.indexOf('+');
         while(space != -1)
              { 
              return_value = return_value.substr(0, space) + ' ' + 
              return_value.substr(space + 1, return_value.length);
							 
              space = return_value.indexOf('+');
              }
          
         return(return_value);        
         }

/*end*/

function getcookie2(){
	//plcae your default phone number to show in case cookie is not set
	if(document.cookie){ //check if there is a cookie set 
		  index = document.cookie.indexOf("MM_TrackableNumber");
		
		  if (index != -1){
				namestart = (document.cookie.indexOf("=", index) + 1);
				nameend = document.cookie.indexOf(";", index);
				if (nameend == -1) {nameend = document.cookie.length;}
					document.write ("<img src='images/contacttracking.gif' style='display: inline; float: left; position: relative; top: 0px; margin-left:0px;' border='0' width='153' height='82'>");
//tracking no					
		  }
		  
			else
			{
		document.write ("<img src='images/emily2nd_05.gif' style='display: inline; float: left; position: relative; top: 0px; margin-left:0px;' border='0' width='153' height='82'>");
//default phone
			}
	}
	else
	{
	document.write ("<img src='images/emily2nd_05.gif' style='display: inline; float: left; position: relative; top: 0px; margin-left:0px;' border='0' width='153' height='82'>");
//default phone

	}
}



function getcookie3(){
	//plcae your default phone number to show in case cookie is not set
	if(document.cookie){ //check if there is a cookie set 
		  index = document.cookie.indexOf("MM_TrackableNumber");
		
		  if (index != -1){
				namestart = (document.cookie.indexOf("=", index) + 1);
				nameend = document.cookie.indexOf(";", index);
				if (nameend == -1) {nameend = document.cookie.length;}
			document.write ("917-512-8058");
//tracking no					
		  }
		  
			else
			{
		document.write ("917-405-0696");
//default phone
			}
	}
	else
	{
	document.write ("917-405-0696");
//default phone

	}
}

