function loadMenu()
{
	$('.top-down').slideDown('slow');
	$('.quick-content').mouseover(function(){$('.top-down').show();});
	$('.top-down').mouseout(function(){$('.top-down').hide();});
}

function logIn()
{
	$('#popup').children('img.close').click(function(){$('#popup-container').css('display','none');$('#popup').fadeOut();});
	$('#popup-container').click(function(){$(this).css('display','none');$('#popup').fadeOut();});
	if($('.subscription-form').length > 0)
	{
		$('.subscription-form').validate();	
	}
}

function showPop()
{
	$('#popup-container').css('display','block'); $('#popup').fadeIn('50');
}


/*if (document.all||document.getElementById)
document.write('<span id="worldclock" style="font:bold 16px Arial;"><\span><br />')*/

zone=0;
isitlocal=true;
ampm='';

function updateclock(z){
zone=z.options[z.selectedIndex].value;
isitlocal=(z.options[0].selected)?true:false;
}

function WorldClock(){

now=new Date();
ofst=now.getTimezoneOffset()/60;
secs=now.getSeconds();
sec=-1.57+Math.PI*secs/30;
mins=now.getMinutes();
min=-1.57+Math.PI*mins/30;
hr=(isitlocal)?now.getHours():(now.getHours() + parseInt(ofst)) + parseInt(zone);
hrs=-1.575+Math.PI*hr/6+Math.PI*parseInt(now.getMinutes())/360;
if (hr < 0) hr+=24;
if (hr > 23) hr-=24;
ampm = (hr > 11)?"PM":"AM";
statusampm = ampm.toLowerCase();

hr2 = hr;
if (hr2 == 0) hr2=12;
(hr2 < 13)?hr2:hr2 %= 12;
if (hr2<10) hr2="0"+hr2;

var finaltime=hr2+':'+((mins < 10)?"0"+mins:mins)+':'+((secs < 10)?"0"+secs:secs)+' '+statusampm;

//if (document.all)
//worldclock.innerHTML=finaltime
//else if (document.getElementById)
//document.getElementById("worldclock").innerHTML=finaltime
$('.worldclock').html(finaltime);
//else if (document.layers){
//document.worldclockns.document.worldclockns2.document.write(finaltime);
//document.worldclockns.document.worldclockns2.document.close();
//}


setTimeout('WorldClock()',1000);
}

//window.onload=WorldClock();

function checkAll()
{
	if($('#check_all').attr('checked')==true)
	{
		$('.check_project').attr('checked',true);
	}else
	{
		$('.check_project').removeAttr('checked');	
	}
}

function verify()
{
	if(confirm('Are you sure you want to delete seleted projects'))	
	{
		$('.projects').submit();	
	}else{return false;}
}
function tabHandler()
{
	$('.tab-content:eq(0)').show();
	$('.tab:eq(0)').addClass('active');
		var obj=$('.tab-content:eq(0)');
		$.post("/loadvideo.php", { url: $('.tab:eq(0)').attr('id'),width:418,height:228}, function(data) {
				obj.children('.video').html(data);
			});
	$('.tab').click(function(){
		if($(this).hasClass('active')!=true)
		{
			$('.tab-content').hide();
			$('.tab').removeClass('active');
			$(this).addClass('active');
			$('.tab-content:eq('+$('.tab').index(this)+')').fadeIn('slow');
			var obj=$('.tab-content:eq('+$('.tab').index(this)+')');
			$.post("/loadvideo.php", { url: $(this).attr('id'),width:418,height:228}, function(data) {
					obj.children('.video').html(data);
				});
		}
	});
}
/***********/
function scrollBanner()
{
	var count=$('.banner-item').length;	
	$('img.move-left').click(function(){
		$('#scrolling').animate({marginLeft:'-336px'},'slow');
		setTimeout('moveLeft()',700);
	});
	$('img.move-right').click(function(){
		$('#scrolling').animate({marginLeft:'336px'},'slow');
		setTimeout('moveRight()',700);
	});
}

	function moveLeft()
	{
		$obj=$('#scrolling').children('.banner-item:first');
		$('#scrolling').children('.banner-item:first').remove();
		$('#scrolling').append('<div class="banner-item">'+$obj.html()+'</div>');
		$('#scrolling').css('margin-left','0px');	
	}
	function moveRight()
	{
		$obj=$('#scrolling').children('.banner-item:last');
		$('#scrolling').children('.banner-item:last').remove();
		$('#scrolling').html('<div class="banner-item">'+$obj.html()+'</div>'+$('#scrolling').html());
		$('#scrolling').css('margin-left','0px');
	}

function searchform()
{
	$('#searchField').focus(function(){
		if($(this).val()=='Search..'){$(this).val('');}					
	});	
	$('#searchField').blur(function(){
		if($(this).val()==''){$(this).val('Search..');}					
	});	
}

