﻿function showhelp() {
	
	
	 var title;
     var text;
     var topmheight;
     var contentmheight;
     var bottommheight;
     var topdheight;
     var bottomdheight;
     var leftmwidth;
     var lightmwidth;
     var rightmwidth;
     var dtop;
     var dleft;
     var arrow;
     var btntext;
     var scrolls;
	 
	var topsize;
	var leftsize;
	var lightheight;
	var lightwidth;
 
    switch (page) {
	
	case 1:
		title = "欢迎来到小宇宙";
		text="欢迎进入你的小宇宙！需要花点时间了解哦！";
		topmheight = bodyheight;
		contentmheight = 0;
		bottommheight= 0;
		leftmwidth = 0;
		lightmwidth = 0;
		rightmwidth = 0;
		dtop= (jQuery(window).height() - jQuery('#dialoghelp').height())/2;
	    dleft= (jQuery(window).width() - jQuery('#dialoghelp').width())/2;
		arrow="arrowno";
		btnprev="上一步";
		btnprevshow="none";
		btnnext="开始了解";
		scrollx=0;
		scrolly=0;
	  break;
	  
	  case 2:
	    topsize= $("#spaceinfo").position().top;
		leftsize= $("#spacemap").position().left;
		lightheight=$("#spaceinfo").height()+$("#spacemap").height()+$(".registerinfo").height();
		lightwidth=$("#spaceinfo").width();

		title = "你的小宇宙";
		text="这是你的<strong>小宇宙</strong>，也就是你的社交圈，你是圈子的中心，朋友们像行星一样围绕着你。";
		topmheight = topsize;
		contentmheight = lightheight;
		bottommheight= bodyheight - topmheight- contentmheight;
		leftmwidth = leftsize;
		lightmwidth = lightwidth;
		rightmwidth = bodywidth-leftmwidth-lightmwidth;
		dtop= topsize + lightheight;
	    dleft= bodyleft+ (lightwidth - $("#dialoghelp").width())/2;
		arrow="arrowup";
		btnprev="上一步";
		btnprevshow="inline";
		btnnext="下一步";
		scrollx=0;
		scrolly=0;
	  break;
	  
	   case 3:
	   if(pagenow=="temporary") {
	    topsize= $(".imagestyle3").eq(0).position().top;
		leftsize= $(".imagestyle3").eq(0).position().left;
		lightheight=$(".imagestyle3").eq(2).position().top+105 - $(".imagestyle3").eq(0).position().top;
		lightwidth=$(".imagestyle3").eq(0).width()+5;
	   
		title = "你的好友";
		text="这是系统指定的好友，陪你玩小宇宙。";
		topmheight = topsize;
		contentmheight = lightheight;
		bottommheight= bodyheight - topmheight- contentmheight;
		leftmwidth = leftsize;
		lightmwidth = lightwidth;
		rightmwidth = bodywidth-leftmwidth-lightmwidth;
		dtop= topsize+(lightheight -$("#dialoghelp").height())/2;
	    dleft= $(".imagestyle3").eq(0).position().left + $(".imagestyle3").eq(0).width()+5;
		arrow="arrowleft";
		btnprev="上一步";
		btnprevshow="inline";
		btnnext="下一步";
		scrollx=0;
		scrolly=340;
	   }
	else  if(pagenow=="index") {
		
		topsize= $(".imagestyle3").eq(0).position().top;
		leftsize= $(".imagestyle3").eq(0).position().left;
		lightheight=$(".imagestyle3").eq(2).position().top+105 - $(".imagestyle3").eq(0).position().top;
		lightwidth=$(".imagestyle3").eq(0).width()+5;
		  
		title = "你的好友";
		text="这是系统帮你约的好友。也可以点击【<strong>邀请朋友做题，把TA吸入你的小宇宙</strong>】 把你生活上的朋友邀请过来哦！";
		topmheight = topsize;
		contentmheight = lightheight;
		bottommheight= bodyheight - topmheight- contentmheight;
		leftmwidth = leftsize;
		lightmwidth = lightwidth;
		rightmwidth = bodywidth-leftmwidth-lightmwidth;
		dtop= topsize-80;
	    dleft= $(".imagestyle3").eq(0).position().left + $(".imagestyle3").eq(0).width()+5;
		arrow="arrowleft";
		btnprev="上一步";
		btnprevshow="inline";
		btnnext="下一步";
		scrollx=0;
		scrolly=50;
		   
	jQuery("#maskstep").css({
    "width":jQuery(".btninvite").width(),
	"height":jQuery(".btninvite").height(),
	"top":jQuery(".btninvite").position().top,
	"left":jQuery(".btninvite").position().left
  });
  
  jQuery("#arrowstep").css({
	"top":jQuery(".btninvite").position().top + 30,
	"left":dleft+220,
	"height":$("#dialoghelp").position().top
  });
		   
		   }
	   
	  break;
	  
//	   case 4:
//	   
//	    topsize= $(".garea").eq(0).position().top;
//		leftsize= $(".garea").eq(0).position().left;
//		lightheight= $(".garea").eq(0).height();
//		lightwidth=$(".garea").eq(0).width();
//	   
//		title = "你与好友的引力";
//		text="这是你与好友的<strong>引力</strong>。引力是指参与好友做<br/>过的测试题，通过你们的答案的异同，测算出</br>彼此之间的相似度。引力从零开始，多多做题,增加引力。";
//		topmheight = topsize;
//		contentmheight = lightheight;
//		bottommheight= bodyheight - topmheight- contentmheight;
//		leftmwidth = leftsize;
//		lightmwidth = lightwidth;
//		rightmwidth = bodywidth-leftmwidth-lightmwidth;
//		dtop= topsize - 210;
//	    dleft= leftsize+ (lightwidth - $("#dialoghelp").width())/2;
//		arrow="arrowdown";
//		btnprev="上一步";
//		btnprevshow="inline";
//		btnnext="下一步";
//		scrollx=0;
//		scrolly=180;
//	  break;
	  
	    case 4:
		
		topsize= $(".peiyang").eq(0).position().top;
		leftsize= $(".peiyang").eq(0).position().left;
		lightheight= $(".peiyang").eq(0).height();
		lightwidth=$(".peiyang").eq(0).width();
		
		title = "培养引力";
		text="你有了好友，马上<strong>培养</strong>。培养指的是参与好<br>友做过的测试题，通过你们的答案的异同，才能<br>测算彼此的引力大小。";
		topmheight = topsize;
		contentmheight = lightheight;
		bottommheight= bodyheight - topmheight- contentmheight;
		leftmwidth = leftsize;
		lightmwidth = lightwidth;
		rightmwidth = bodywidth-leftmwidth-lightmwidth;
		dtop= topsize-70;
	    dleft= leftsize - $("#dialoghelp").width()-15;
		arrow="arrowright";
		btnprev="上一步";
		btnprevshow="inline";
		btnnext="立即体验培养";
		scrollx=0;
		scrolly=200;
	  break;
	  
	  case 7:
  
	    page=5;
		
		arrow="arrowright";
		btnprev="上一步";
		btnprevshow="inline";
		scrollx=0;
		scrolly=200;
	    
	    if(resulttype==1)
	    {	
	    topsize= $(".xi1").eq(0).position().top;
		leftsize= $(".xi1").eq(0).position().left;
		lightheight= $(".xi1").eq(0).height();
		lightwidth=$(".xi1").eq(0).width();
		
		topmheight = topsize;
		contentmheight = lightheight;
		bottommheight= bodyheight - topmheight- contentmheight;
		leftmwidth = leftsize;
		lightmwidth = lightwidth;
		rightmwidth = bodywidth-leftmwidth-lightmwidth;
		dtop= topsize-75;
	    dleft= leftsize - $("#dialoghelp").width()-15;
		
  jQuery("#maskstep").css({
    "width":jQuery("#spacemap").width(),
	"height":jQuery("#spacemap").height(),
	"top":jQuery("#spacemap").position().top,
	"left":jQuery("#spacemap").position().left
  });
  
  jQuery("#arrowstep").css({
	"top":jQuery("#spacemap").height() + jQuery("#spacemap").position().top,
	"left":dleft+150,
	"height":200
  });
     
		    title = "把好友吸入小宇宙";
		    text="缘分啦，你与好友结果一致，引力增加啦！也符合<a href='#' class='blue2'>小宇宙等级规则</a>，点击【<strong>吸</strong>】 ，把TA吸入上方的小宇宙图中，像行星围绕着你，小宇宙升级啦。";
		    btnnext="立即吸入小宇宙";
	        ExplainAdd();
		}
		else
		{
		topsize= $(".peiyang").eq(0).position().top;
		leftsize= $(".peiyang").eq(0).position().left;
		lightheight= $(".peiyang").eq(0).height();
		lightwidth=$(".peiyang").eq(0).width();
		
		topmheight = topsize;
		contentmheight = lightheight;
		bottommheight= bodyheight - topmheight- contentmheight;
		leftmwidth = leftsize;
		lightmwidth = lightwidth;
		rightmwidth = bodywidth-leftmwidth-lightmwidth;
		dtop= topsize-60;
	    dleft= leftsize - $("#dialoghelp").width()-15;
		
		    title = "引力增加为零？";
		    text="很遗憾哦，你的结果与TA不一致，所以引力增加为零。没关系，在尝试一下！";
		    btnnext="继续培养";
		}
	  break;
	
	    }
	
	 jQuery("#dialoghelp").attr("class",arrow);
	 jQuery("#dialoghelp #helpbtnprev").attr("value",btnprev);
	 jQuery("#dialoghelp #helpbtnprev").css("display",btnprevshow);
	 jQuery("#dialoghelp #helpbtnnext").attr("value",btnnext);
	 jQuery("#dialoghelp #helptitle").html(title);
     jQuery("#dialoghelp #helptext").html(text);
     jQuery("#dialoghelp #pageinfo").html(page+"/"+allpage);
     jQuery('#dialoghelp').css({"top":dtop,"left":dleft});
	 
	 jQuery('#newmask .top').css("height",topmheight);
	 jQuery('#newmask .content').css("height",contentmheight);
	 jQuery('#newmask .left').css("height",contentmheight);
	 jQuery('#newmask .lightborder').css("height",contentmheight-6);
	 jQuery('#newmask .bottom').css("height",bottommheight);
	 
	 jQuery('#newmask .left').css("width",leftmwidth);
	 jQuery('#newmask .light').css("width",lightmwidth);
	 jQuery('#newmask .right').css("width",rightmwidth);
	
	if((page==5 && resulttype==1) || (page==3 && pagenow=="index")) {
	   jQuery("#maskstep").show();
	   jQuery("#arrowstep").show();
	  
	 } else {
	   jQuery("#maskstep").hide();
	   jQuery("#arrowstep").hide();
	 }
	
	 //page==6 ? jQuery("#dialoghelp .link6").show() : jQuery("#dialoghelp .link6").hide();
	
	 window.scrollTo(scrollx,scrolly);
	
	}
	
	
	function closehelp() {
  jQuery("#newmask").hide();
  jQuery("#dialoghelp").hide();
  jQuery("#maskstep").hide();
  jQuery("#arrowstep").hide();
  jQuery("#dialoghelp .link6").hide();
  
  if(jQuery("#helpcheck").attr("checked")) {
     //选取不显示帮助
    ExplainAdd();
  }
  
    if ( $.browser.msie && $.browser.version==6.0) {
     $(".spacesearch").show();  
  }
}
