/* JalaliJSCalendar v1.4
 * Copyright (c) 2008 Ali Farhadi (http://farhadi.ir/)
 * 
 * Released under the terms of the GNU General Public License.
 * See the GPL for details (http://www.gnu.org/licenses/gpl.html).
 *
 * Based on "The DHTML Calendar" developed by Dynarch.com. (http://www.dynarch.com/projects/calendar/)
 * Copyright Mihai Bazon, 2002-2005 (www.bazon.net/mishoo)
 *
 * added Extension by shahrokh hassanzadegan sh.h.zadegan@gmail.com
 */

		var oldLink = null;
		// code to change the active stylesheet
		function setActiveStyleSheet(link, title) {
		  var i, a, main;
		  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
			if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
			  a.disabled = true;
			  if(a.getAttribute("title") == title) a.disabled = false;
			}
		  }
		  if (oldLink) oldLink.style.fontWeight = 'normal';
		  oldLink = link;
		  //link.style.fontWeight = 'bold';
		  return false;
		}

		setActiveStyleSheet(document.getElementById("defaultTheme"), "system");

		function setHiddenDate(calendar, date) 
		{
			  if (calendar.dateClicked) 
			  {
			      var y = calendar.date.getFullYear();
				  var m = calendar.date.getMonth();     // integer, 0..11
				  var d = calendar.date.getDate();      // integer, 1..31
				  calendar.params.displayArea.innerHTML = date;
				//  document.getElementById(calendar.params.hiddenField).value = d + "/" + (m+1) + "/" + (y);
				  

				  try{
						ptivate_setHiddenDate(calendar, date);	
				  }catch(e){}
			  }
		};
		

		
