var mouseover_tid = [];
var mouseout_tid = [];

jQuery(document).ready(function(){
	
	
	jQuery('#childimage img').imgr({size:"10px",color:"#fff",radius:"140px"});
	
	jQuery('.img-list img').imgr({size:"4px",color:"#fff",radius:"100px"});
	
	jQuery('#new-left-image-list-1').children('img').css('width','166px');
	jQuery('#new-left-image-list-1').children('img').css('height','166px');
	
	jQuery('#new-left-image-list-2').children('img').css('width','290px');
	jQuery('#new-left-image-list-2').children('img').css('height','290px');
	
	jQuery('#new-left-image-list-3').children('img').css('width','178px');
	jQuery('#new-left-image-list-3').children('img').css('height','178px');
	jQuery('.new-left-image-list').each(function(){
		var newId = jQuery(this).attr('id');
		//alert(newId);
		var newId = parseInt(newId.replace('new-left-image-list-',''));
		
		if(newId%2 == 0){
			jQuery('#new-left-image-list-'+newId).css('float','left');
			jQuery('#new-left-image-list-'+newId).css('margin-left','10px');
			
			if(newId == 2){
				jQuery('#new-left-image-list-2').children('img').imgr({size:"4px",color:"#fff",radius:"145px"});
			}
		}else{
			jQuery('#new-left-image-list-'+newId).css('float','right');
			jQuery('#new-left-image-list-'+newId).css('margin-right','10px');
			jQuery('#new-left-image-list-'+newId).children('img').imgr({size:"4px",color:"#fff",radius:"90px"});
			if(newId == 1){
				jQuery('#new-left-image-list-1').children('img').imgr({size:"4px",color:"#fff",radius:"83px"});
			}
			if(newId == 3){
				jQuery('#new-left-image-list-3').children('img').imgr({size:"4px",color:"#fff",radius:"89px"});
				jQuery('#new-left-image-list-3').css('margin-right','0px');
			}
		}
	});
	
	/*************************************************************/
	
	jQuery('#new1-left-image-list-1').children('img').css('width','250px');
	jQuery('#new1-left-image-list-1').children('img').css('height','250px');
	jQuery('#new1-left-image-list-1').css('margin-left','100px');

	
	jQuery('#new1-left-image-list-2').children('img').css('width','250px');
	jQuery('#new1-left-image-list-2').children('img').css('height','250px');
	jQuery('#new1-left-image-list-2').css('margin-left','100px');
	jQuery('#new1-left-image-list-2').css('margin-top','100px')
	
	jQuery('#new1-left-image-list-3').children('img').css('width','250px');
	jQuery('#new1-left-image-list-3').children('img').css('height','250px');
	jQuery('#new1-left-image-list-3').css('margin-left','100px');
	jQuery('#new1-left-image-list-3').css('margin-top','180px')
	
	jQuery('#new1-left-image-list-4').children('img').css('width','250px');
	jQuery('#new1-left-image-list-4').children('img').css('height','250px');
	jQuery('#new1-left-image-list-4').css('margin-left','100px');
	jQuery('#new1-left-image-list-4').css('margin-top','800px')
	
	jQuery('#new1-left-image-list-5').children('img').css('width','250px');
	jQuery('#new1-left-image-list-5').children('img').css('height','250px');
	jQuery('#new1-left-image-list-5').css('margin-left','100px');
	jQuery('#new1-left-image-list-5').css('margin-top','1000px')
	
	
	jQuery('#new2-left-image-list-1').children('img').css('width','250px');
	jQuery('#new2-left-image-list-1').children('img').css('height','250px');
	jQuery('#new2-left-image-list-1').css('margin-left','100px');
	jQuery('#new2-left-image-list-1').css('margin-top','400px');
	
	jQuery('#new2-left-image-list-2').children('img').css('width','250px');
	jQuery('#new2-left-image-list-2').children('img').css('height','250px');
	jQuery('#new2-left-image-list-2').css('margin-left','100px');
	jQuery('#new2-left-image-list-2').css('margin-top','600px')
	
	jQuery('#new2-left-image-list-3').children('img').css('width','250px');
	jQuery('#new2-left-image-list-3').children('img').css('height','250px');
	jQuery('#new2-left-image-list-3').css('margin-left','100px');
	jQuery('#new2-left-image-list-3').css('margin-top','2200px')
	
	jQuery('#new2-left-image-list-4').children('img').css('width','250px');
	jQuery('#new2-left-image-list-4').children('img').css('height','250px');
	jQuery('#new2-left-image-list-4').css('margin-left','100px');
	
	jQuery('#new2-left-image-list-5').children('img').css('width','250px');
	jQuery('#new2-left-image-list-5').children('img').css('height','250px');
	jQuery('#new2-left-image-list-5').css('margin-left','100px');
	
	
	jQuery('#new3-left-image-list-1').children('img').css('width','250px');
	jQuery('#new3-left-image-list-1').children('img').css('height','250px');
	
	jQuery('#new3-left-image-list-2').children('img').css('width','190px');
	jQuery('#new3-left-image-list-2').children('img').css('height','190px');	
	jQuery('#new3-left-image-list-3').children('img').css('width','220px');
	jQuery('#new3-left-image-list-3').children('img').css('height','220px');
	
	jQuery('#new3-left-image-list-4').children('img').css('width','160px');
	jQuery('#new3-left-image-list-4').children('img').css('height','160px');

	
	jQuery('#new3-left-image-list-5').children('img').css('width','180px');
	jQuery('#new3-left-image-list-5').children('img').css('height','180px');
	
	jQuery('.new3-left-image-list').each(function(){
		var newId = jQuery(this).attr('id');
		//alert(newId);
		var newId = parseInt(newId.replace('new3-left-image-list-',''));
		
		if(newId%2 == 0){
			jQuery('#new3-left-image-list-'+newId).css('float','left');
			jQuery('#new3-left-image-list-'+newId).css('margin-left','30px');
			jQuery('#new3-left-image-list-'+newId).css('margin-top','-18px');
			
			jQuery('#new2-left-image-list-'+newId).css('margin-left','30px');
			
			
			
			if(newId == 2){
				//jQuery('#new3-left-image-list-2').children('img').imgr({size:"8px",color:"#fff",radius:"90px"});
				jQuery('#new3-left-image-list-2').css('float','left');	
				jQuery('#new3-left-image-list-2').css('margin-top','0px');	
			}
			if(newId == 4){
				//jQuery('#new3-left-image-list-4').children('img').imgr({size:"8px",color:"#fff",radius:"73px"});
				jQuery('#new3-left-image-list-4').css('width','100%');			
				jQuery('#new3-left-image-list-4').css('float','left');	
				jQuery('#new3-left-image-list-4').css('margin-top','-30px');						
		
			}
		}else{
			jQuery('#new3-left-image-list-'+newId).css('float','right');
			jQuery('#new3-left-image-list-'+newId).css('margin-right','10px');
			
			if(newId == 1){
				//jQuery('#new3-left-image-list-1').children('img').imgr({size:"12px",color:"#fff",radius:"135px"});
				jQuery('#new3-left-image-list-1').css('float','right');
			}
			if(newId == 3){
				//jQuery('#new3-left-image-list-3').children('img').imgr({size:"10px",color:"#fff",radius:"110px"});
				jQuery('#new3-left-image-list-3').css('float','right');
				jQuery('#new3-left-image-list-3').css('margin-right','-15px');
				jQuery('#new3-left-image-list-3').css('margin-top','-40px');
				
			}
			if(newId == 5){
				//jQuery('#new3-left-image-list-5').children('img').imgr({size:"12px",color:"#fff",radius:"95px"});
				jQuery('#new3-left-image-list-5').css('float','right');
				jQuery('#new3-left-image-list-5').css('margin-right','48px');
				jQuery('#new3-left-image-list-5').css('margin-top','-22px');
			}
		}
	});
	/*************************************************************/
	
	var contentCenterHeight = jQuery('#contentarea').height()-200;
	jQuery('#content-center').css('height',contentCenterHeight);
	
	
	var mainHeight = jQuery('#main-content').height();
	jQuery('#right').css('height',mainHeight);
	jQuery('#content').css('height',mainHeight);
	
	var rightCenterHeight = jQuery('#content-center').height()+90;
	jQuery('#right-center').css('height',rightCenterHeight);
	
	//var rightHeight = jQuery('#main-content1').height()-400;
	//jQuery('#right-center1').css('height',rightHeight);
	
	//var rightLineHeight = jQuery('#right-center').height();
	//jQuery('#left-line').css('height',rightLineHeight);
	
	//var rightLineHeight = jQuery('#right-center1').height();
	//jQuery('#right').css('height',rightLineHeight);
	
	//var contentHeight = jQuery('#right').height()-60;
	//jQuery('#wraper').css('height',contentHeight);
	/*
	jQuery("#header #mainmenu ul li").hover(
		function () {
			jQuery(this).children('ul').stop().slideDown(600);
		}, 
		function () {
			jQuery(this).children('ul').stop().slideUp(600);
		}
	);
	*/
	jQuery('div.img-list').each(function(){
		var id = jQuery(this).attr('id');
		var id = parseInt(id.replace('child-image-list',''));
		var contentarea1Height = jQuery('#contentarea1').height();
		var top = parseInt((parseInt(id) - 1) * 130)-contentarea1Height+50;
		if(id%2 == 0){
			jQuery('#child-image-list'+id).css('float','left');
			if(jQuery.browser.msie&&(jQuery.browser.version == "7.0")){
				jQuery('#child-image-list'+id).css('margin-left',-100);
			}
			jQuery('#child-image-list'+id).css('margin-top',top+"px");
			jQuery('#child-image-list'+id).css('margin-left',-108);
		}else{
			jQuery('#child-image-list'+id).css('float','right');
			jQuery('#child-image-list'+id).css('margin-top',top+"px");
			jQuery('#child-image-list'+id).css('margin-right',-70);
		}
	});
	
	
	jQuery('#mainmenu ul li').each(function(index){
		jQuery(this).hover(
			function(){
				var _self = this;
				clearTimeout(mouseout_tid[index]);
				mouseover_tid[index] = setTimeout(function() {
					jQuery(_self).find('ul:eq(0)').slideDown(200);
				}, 200);
			},
			function(){
				var _self = this;
				clearTimeout(mouseover_tid[index]);
				mouseout_tid[index] = setTimeout(function() {
					jQuery(_self).find('ul:eq(0)').slideUp(200);
				}, 300);
			}
		);
	});

	var newTemplaterightHeight = jQuery('.new-right').height();
	jQuery('.new-left').css('height',newTemplaterightHeight+80);
	jQuery('#newcontent').css('height',newTemplaterightHeight-95);

	
	
});
