// JavaScript Document
$(document).ready(function(){ 
        /*
		$("ul.sf-menu").supersubs({ 
            minWidth:    6,   // minimum width of sub-menus in em units 
            maxWidth:    20,   // maximum width of sub-menus in em units 
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                               // due to slight rounding differences and font-family 
        }).superfish({autoArrows:true});  // call supersubs first, then superfish, so that subs are 
                         // not display:none when measuring. Call before initialising 
                         // containing tabs for same reason. 
		*/
		
		//$('.scroll-pane').jScrollPane({scrollbarWidth:10,showArrows:false});
		
		//$('newsimage').click(function(){
		//		var img = $(this).attr("name");
		//		
		//});
		/*
		$('.pics').cycle({
			fx: 'scrollUp',
			speed:  1000,
			next: '#next',
			//easing: 'easeOutQuad',
			timeout: 0
		});
		$('.element')
		.before('<div id="pager">')
		.cycle({
			fx: 'fade',
			speed:  1000,
			//easing: 'easeOutQuad',
			pager: '#pager',
			timeout: 10000,
			pause: 1
		});
		*/
		$('.pics').cycle({
				//fx: 'scrollLeft',
				timeout: 6000,	
				//delay:  1000, 
				//easing: 'easeOutQuad',
				speed:  800,
				pause: 1,
				random: 1
				
			}); 
		
		$('.newslist').cycle({
			fx: 'scrollUp',
			speed:  1000,
			next: '#next',
			prev: '#prev',
			//easing: 'easeOutQuad',
			timeout: 0
		});
		
		run_summary();
		//$('hr').attr("noshade","noshade");
		$(document).pngFix(); 
		

}); 

function run_summary(){
		
		$('.clientlist').cycle({
			fx: 'scrollLeft',
			speed:  1000,
			next: '#next',
			prev: '#prev',
			easing: 'easeOutQuad',
			timeout: 0
		});
}

function edit_content(cid,type,action){
	$('.clientlist').html("");
	$('.clientlist').load("clients.php?cid="+cid+"&type="+type+"&Submit="+action,function(){
   			run_summary();
	 });
	
}

/*
setTimeout("showtag()",500);
function showtag(){
	var currcss = $('.sf-menu a.current').attr("class");
	$('.sf-menu li.current').append("<span class='tag "+currcss+"'></span>");
	$('.tag').animate({height:"8px",bottom:"-8px"},600);
	showlisttag();
}

function showlisttag(){
	$('.listtag').animate({width: "11px",right:"-31px"},600);
}
	
function hidelisttag(){
	$('.listtag').animate({ width: "0px",right:"-20px"},600).remove();
	//setTimeout("",600);
}
*/
function load_story(cid){
	$("#col_l").load("content.php",{Submit:"view",cid:cid,ajax:1},function(){
		Shadowbox.init();
	});
	//remove old list tag
	//hidelisttag();
	//append to new div
	//$("#item_"+cid).prepend("<span class='listtag'>&nbsp;</span>");
	//show new tag
	//showlisttag()
	
	return false;
}

function load_client(cid){
	$("#col_client").load("clients.php",{Submit:"view",cid:cid,ajax:1},function(){
		$("#col_client").slideDown();
		//Shadowbox.init();
	});
	
	return false;
}

function close_casestudy(){
 $("#col_client").slideUp(); 
}

function toggleP(me,target) {
	$("#"+me).hide();	
	$("#"+target).fadeIn("slow");	
}
