// JavaScript Document
/*function showMenu(item1,item2,but1,but2){
	if(document.getElementById(item1).style.display=='none')
	{
		document.getElementById(item1).style.display='block';
		document.getElementById(but1).className='menu_selected';
		document.getElementById(item2).style.display='none';
		document.getElementById(but2).className='none';
	}
}*/

 /*$('li.special1').click(function(){
										   if(i==1){
											   		$('#pro_menu').hide(100);
													$('li.special2').removeClass('menu_selected');
											   		$('#about_menu').show(100);
													$(this).addClass('menu_selected')
												   }
												   else{
													   i=1;
													   $('#about_menu').show(100);
													   $(this).addClass('menu_selected');}
										  });
		   $('#about_menu').hover(function(){$('#about_menu').show(100);},function(){i=0;
																				   $('li.special1').removeClass('menu_selected');
																				   $('#about_menu').hide(100);
												                });
		   $('li.special2').click(function(){
										   	if(i==1){
													$('#about_menu').hide(100);
													$('li.special1').removeClass('menu_selected');
													$('#pro_menu').show(100);
													$(this).addClass('menu_selected');
											}else{
												i=1;
												$('#pro_menu').show(100);
												$(this).addClass('menu_selected');}
										  });
		   $('#pro_menu').hover(function(){$('#pro_menu').show(100);},function(){i=0;
																			   $('li.special2').removeClass('menu_selected');
																			   $('#pro_menu').hide(100);
												                });
		   */
//banner_navagator
		   //$('#banner_' + n).fadeIn(400);
		   
		   /*$(function(){
			   	for(i=0;i<=5;i++)
						{
							if(i==5){
									$('#banner_' + n).stop().hide(1000);
									if (n<4){
										alert("less than 4"+n);
											n=n++;
											p=p+12;
											}
											else{
												alert("more than 4" + n )
												n=0;
												p=0;
												};								
									$('#banner_navigatpr').animate({"left" : p +'px'});
									$('#banner_' + n).stop().show(1000);
									i=0;							
								};
						}
				});*/
		   /*setTimeout(function animation(){
							    $('#banner_' + n).stop().fadeOut(1000);
								if (n<2){
										n=n++;
										p=p+12;
										}
										else{
											n=0;
											p=0;
											};	
								$('#banner_navigator').animate({"left" : p +'px'});
								$('#banner_' + n).stop().fadeIn(2000);
								console.log(n);
															
								   },2000);*/
		   
		   /*function slideFadeIn(){
			   if(n<2)
			   {
				   n++;
				   p+=12;
			   }else{
				   n=0;
				   p=0;
			   }
			   console.log(n);
			   console.log(p);
			   $('#banner_' + n).fadeOut(1000).fadeIn(2000,slideFadeOut());
		   };
		   
		   function slideFadeOut(){
			   if(n<2)
			   {
				   n++;
				   p+=12;
			   }else{
				   n=0;
				   p=0;
			   }
			   console.log(n);
			   console.log(p);
			   $('#banner_' + n).fadeIn(1000).fadeOut(2000,slideFadeIn());
		   };*/
var i=0; //navigation for the menu and submenu
var n=0; //navigation for the banner
var p=0;
		   
$(function(){
		   
		  
		   
		   	$(' #menu_BAR ul ').css({display: "none"}); // Opera Fix
			$(' #menu_BAR li').hover(function(){
												$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(100);
												},function(){$(this).find('ul:first').css({visibility: "hidden"});
												});
			
			//Rewidth function
			$('li.rewidth').hover(function(){
										   $('#menu_BAR ul').css({width:"278px"});
										   },function(){$('#menu_BAR ul').css({width:"137px"})}
										   );


		   
		 
		   $('#banner_' + n).fadeIn(1000);
		   $("#bullets_nav ul li").eq(n).css({"background":"url(img/bullet_on.gif) no-repeat center top"});
		   
		  // window.setInterval("rotation()", 5000);
		   
		   
		   $('#nav_next').click(function(){
										 if(n<2)
										 	{
												$('#banner_' + n).stop().fadeOut(1000);
												$("#banner_" + n).css({display: "none"});
												$("#bullets_nav ul li").eq(n).css({"background":"url(img/bullet_off.gif) no-repeat center top"});
												n++;
												$('#banner_' + n).stop().fadeIn(2000);
												$("#bullets_nav ul li").eq(n).css({"background":"url(img/bullet_on.gif) no-repeat center top"});
											}
										 });
		   

		   $('#nav_pre').click(function(){
										 if(n>0)
										 	{
												$('#banner_' + n).stop().fadeOut(500);
												$("#banner_" + n).css({display: "none"});
												$("#bullets_nav ul li").eq(n).css({"background":"url(img/bullet_off.gif) no-repeat center top"});
												n--;
												$('#banner_' + n).stop().fadeIn(1000);
												$("#bullets_nav ul li").eq(n).css({"background":"url(img/bullet_on.gif) no-repeat center top"});
										
											}
										 }
								);
		   
		   
		   $('#banner_'+ n +' #pro_thumb img').click(function(){
											  $('#banner_'+ n +' #pro_thumb img').removeClass('img_thum_sel');
											  //var srcimg = $(this).attr('src');
											  //console.log(srcimg);
											  //$('#banner_'+ n +' #banner_img img').attr('src',srcimg.replace('small','large'));
											  $(this).addClass('img_thum_sel');
											  });
		   
});

function display_div(para1,para2)
{
	if(document.getElementById(para1).style.dinav_nextsplay=='block')
	{
		document.getElementById(para1).style.display='none';
		document.getElementById(para2).innerHTML="open";
	}
	else
	{
		document.getElementById(para1).style.display='block';	
		document.getElementById(para2).innerHTML="close";
	}
}
function xx(){
											 if(n<2)
										 	{
													
												$('#banner_' + n).stop().fadeOut(1000);
												$("#banner_" + n).css({display: "none"});
												$("#bullets_nav ul li").eq(n).css({"background":"url(img/bullet_off.gif) no-repeat center top"});
												
												n++;
												$('#banner_' + n).stop().fadeIn(2000);
												$("#bullets_nav ul li").eq(n).css({"background":"url(img/bullet_on.gif) no-repeat center top"});
											
											
										
										setTimeout("xx()", 5000);
										if(n==2)
												n=-1;
											}
										
								
										}

setTimeout("xx()", 5000);




/*
function rotation(current,indicator){
	var current = current++;
	var nextBan = $("#banner_" + current);
	alert(nextBan);
	if (nextBan.length==0)
		{
			nextBan=$("#banner_0");
			indicator=0;
		}
		nextBan.css({opacity:0.0}).animate({opacity:1.0},1000);
		alert(current);
};
*/
/*function rotation(){
	var dec;
	if(n>0){
			dec=n-1;
			$("#banner_"+ dec).stop().fadeOut(500);
			$("#bullets_nav ul li").eq(n).css({"background":"url(img/bullet_off.gif) no-repeat center top"});
			};
	if (n>=3){
		n=0;
		};
	$("#banner_" + n).stop().fadeIn(1000);
	$("#bullets_nav ul li").eq(n).css({"background":"url(img/bullet_on.gif) no-repeat center top"});
	n++;
	}
	
*/

