///DATE
var tick;
 function stop() {
 clearTimeout(tick);
 }
 function usnotime(chesk)
    {
	var ut=new Date();
	var hour, minute, m, month, date, d, day, year;
	var time="";
	hour=ut.getHours();
	minute=ut.getMinutes();
	m=ut.getMonth();
	date=ut.getDate();
	d=ut.getDay();
	year=ut.getFullYear();
	switch (d) {
		case 0: day = 'Sunday'; break;
		case 1: day = 'Monday'; break;
		case 2: day = 'Tuesday'; break;
		case 3: day = 'Wednesday'; break;
		case 4: day = 'Thursday'; break;
		case 5: day = 'Friday'; break;
		case 6: day = 'Saturday'; break;
		default: day = 'unknown';
		}
	switch (m) {
		case 0: month = 'January'; break;
		case 1: month = 'February'; break;
		case 2: month = 'March'; break;
		case 3: month = 'April'; break;
		case 4: month = 'May'; break;
		case 5: month = 'June'; break;
		case 6: month = 'July'; break;
		case 7: month = 'August'; break;
		case 8: month = 'September'; break;
		case 9: month = 'October'; break;
		case 10: month = 'November'; break;
		case 11: month = 'December'; break;
		default: month = 'unknown';
		}
	time+= day+", "+date+" "+month+" "+year+", "+hour+":"+minute;
	document.getElementById('rtime').innerHTML = time;
	tick=setTimeout("usnotime()",1000);    
	
	}
	
//////
/* SCROLL */
var timer = null;
function ScrollStart( dir , div ) {
	stopScroller();
	timer = window.setInterval( function() { scrollIt( dir , div ) }, 5);
	document.onmouseup=stopScroller;
}
function scrollIt( dir , div ) {
	var obj = document.getElementById(div);
	switch( dir )
	{
		case 'up': obj.scrollTop-=1; break;
		default: obj.scrollTop+=1; break;
	}
}
function stopScroller() {
	window.clearInterval( timer );
}
/* end SCROLL */

function setcurrentimg( id , url ){
	$("#thumbs a").removeClass();
	$("#"+id).addClass('imgcurrent');
	$("#ajaxdiv").hide();
	$("#ajaxdiv").load(url);
	setTimeout(function(){
		$("#ajaxdiv").fadeIn("fast");
	}, 100);
}
function openinfo(){
	$("#open").fadeOut();
	setTimeout(function(){
		$("#info").fadeIn("slow");
		$("#close").fadeIn("slow");
	}, 100);
}

function closeinfo(){
	$("#close").fadeOut();
	setTimeout(function(){
		$("#info").fadeOut("fast");
		$("#open").fadeIn("slow");
	}, 100);
}

// operate menu
		
		
		function operateMenu() {
			var menu=document.getElementById('menu');
			var Lists=menu.getElementsByTagName('LI');
			for(var i=0; i<Lists.length; i++) {
				Lists[i].onmouseover=function() {
					this.className=(this.className=='drop')?'':'drop';
				}
				Lists[i].onmouseout=function() {
					this.className=(this.className=='drop')?'':'drop';
				}
			}
		}

		$(document).ready(function(){
	  // Reset Font Size	
	  
	  var originalFontSize = 11;
	  var cookiefontsize=CookieManager.getCookie('font-size');
	  var cookieFontSizeNum = parseFloat(cookiefontsize, 11);
	  
	  if ((cookieFontSizeNum>10)&&(cookieFontSizeNum<16)){
	  	$('html').css('font-size', cookieFontSizeNum);
	  	CookieManager.setCookie('font-size',cookieFontSizeNum,999);
	  		
	  }else{
	  	$('html').css('font-size', originalFontSize);
	  	CookieManager.setCookie('font-size',originalFontSize,999);
	  	
	  }
	  $(".resetFont").click(function(){
	    $('html').css('font-size', originalFontSize);
	    CookieManager.setCookie('font-size',originalFontSize,999);
		return false;
	  });
	  // Increase Font Size
	  $(".increaseFont").click(function(){
	  	var currentFontSize = $('html').css('font-size');
	 	var currentFontSizeNum = parseFloat(currentFontSize, 11);
	 	if (currentFontSizeNum<16) var newFontSize = currentFontSizeNum+1;
	    else var newFontSize = currentFontSizeNum;
	    
		$('html').css('font-size', newFontSize);
		CookieManager.setCookie('font-size',newFontSize,999);
		return false;
	  });
	  // Decrease Font Size
	  $(".decreaseFont").click(function(){
	  	var currentFontSize = $('html').css('font-size');
	 	var currentFontSizeNum = parseFloat(currentFontSize, 11);
	 	if (currentFontSizeNum>11) var newFontSize = currentFontSizeNum-1;
	 	else var newFontSize = currentFontSizeNum;
	 	
		$('html').css('font-size', newFontSize);
		CookieManager.setCookie('font-size',newFontSize,999);
		return false;
	  });
	  
	});