/* Set Cookies For Color Theme Start */
function setCookie(c_name,value)
{
	var exdate=new Date();
	var expiredays = 365
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
	var url = window.location;
	window.location = url;
}
/* Set Cookies For Color Theme End */


/* Drop Down Menu Start */
var timeout    = 500;
var closetimer = 0;
var ddmenuitem = 0;

function jsddm_open()
{  jsddm_canceltimer();
   jsddm_close();
   
   ddmenuitem = $(this).find('ul').css('visibility', 'visible');
   $(this).children('a').addClass('hover');
   }

function jsddm_close()
{  	if(ddmenuitem) 
	{
		ddmenuitem.css('visibility', 'hidden'); 
	}
	
	jQuery('#jsddm > li').children('a').removeClass('hover');
}

function jsddm_timer()
{  closetimer = window.setTimeout(jsddm_close, timeout);}

function jsddm_canceltimer()
{  if(closetimer)
   {  window.clearTimeout(closetimer);
      closetimer = null;}}

jQuery(function($){  
	$('#jsddm > li').hover(
		function(){
			jsddm_canceltimer();
			jsddm_close();
			
			ddmenuitem = $(this).find('ul').css('visibility', 'visible');
			$(this).children('a').addClass('hover');
		},
		function(){
			jsddm_timer()
		}
	)
	
	
});

document.onclick = jsddm_close;

/* Drop Down Menu End */


/* Increase/Decrease Font Size Start */
var min=8;
var max=18;
function increaseFontSize() {
   var p = document.getElementsByTagName('body');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('body');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}
/* Increase/Decrease Font Size End */
