/*
 * Item Name : pp手机助手 越狱刷机一条龙
 * Copyright 2011, www.25pp.com
 *
 * Version 1.0.0
 * Creator : X_Pilot
 * Created Date   :	2011.12.20
 * Last Edit Date :	2011.12.22
 */

var acticleTitle = { a1 : "红雪" , a2 : "绿雨" , a3 : "Spirit" , a4 : "jailbreakMe" }
var yueyuData = {
	iPhone_4 : { v4_0_0 : "2,4", v4_0_1 : "2,4", v4_0_2 : "2", v4_1 : "2", v4_2_1 : "1", v4_3_1 : "1", v4_3_2 : "1", v4_3_3 : "1,4",
				v4_3_4 : "1", v4_3_5 : "1", v5_0 : "1", v5_0_1 : "1" },
	iPhone_3GS : { v3_1_2 : "3,4", v3_1_3 : "3,4", v4_2_1 : "1", v4_1 : "2", v4_0 : "2,4", v4_0_1 : "2,4", v4_0_2 : "2", v4_3 : "1",
					v4_3_1 : "1", v4_3_2 : "1", v4_3_3 : "1,4", v4_3_4 : "1", v4_3_5 : "1", v5_0 : "1", v5_0_1 : "1" },
	//iPhone_4S : { v5_0 : "4", v5_0_1 : "4" },
	iPod_4 : { v4_1 : "2", v4_2_1 : "1", v4_3_1 : "1", v4_3_2 : "1", v4_3_3 : "1,4", v4_3_4 : "1", v4_3_5 : "1", v5_0 : "1", v5_0_1 : "1" },
	iPod_3 : { v3_1_2 : "3,4", v3_1_3 : "3,4", v4_0_0 : "4", v4_1 : "2", v4_2_1 : "1", v4_3_1 : "1", v4_3_2 : "1", 
				v4_3_3 : "1", v4_3_4 : "1", v4_3_5 : "1", v5_0 : "1", v5_0_1 : "1" },
	iPad_2 : { v4_3_3 : "4" },
	iPad_1 : { v3_2 : "2,4", v3_2_1 : "2,4", v3_2_2 : "2,4", v4_3_1 : "1", v4_3_2 : "1", v4_3_3 : "1", v4_3_4 : "1", v4_3_5 : "1",
				v5_0 : "1", v5_0_1 : "1" }
}

var devType,devVersion,acticles,devTypeSelBox,devVerSelBox,methodList,actIframe,i,j,strHTML;try{devType=external.GetIPhoneType();devVersion=external.GetIPhoneVersion();alert(devType)}catch(e){}devType=!devType?"":devType;devVersion=!devVersion?"":devVersion;$(document).ready(function(){devTypeSelBox=document.getElementById("devTypeSelBox");devVerSelBox=document.getElementById("devVerSelBox");methodList=document.getElementById("methodList");actIframe=document.getElementById("actIframe");document.getElementById("devTypeSpan").innerHTML=devType;document.getElementById("devVerSpan").innerHTML=devVersion;for(i in devTypeSelBox.options){devTypeSelBox.options.remove(0)}devTypeSelBox.add(new Option("请选择您的手机型号",0));for(i in yueyuData){devTypeSelBox.add(new Option(i.replace("_"," "),i))}devTypeSelBox.onchange=function(){devVerSelBoxChange(this.value)};if(devType&&devVersion){for(i=0;i<devTypeSelBox.options.length;i++){if(devTypeSelBox.options[i].text==devType){devTypeSelBox.options[i].selected=true;devVerSelBoxChange(devTypeSelBox.value)}}for(i=0;i<devVerSelBox.options.length;i++){if(devVerSelBox.options[i].text==devVersion){devVerSelBox.options[i].selected=true;makeArticle(devVerSelBox.value)}}}document.getElementById("selectBtn").onclick=function(){if(devTypeSelBox.value==0){alert("请选择手机型号")}else{if(devVerSelBox.value==0){alert("请选择固件版本")}else{makeArticle(devVerSelBox.value)}}}});function devVerSelBoxChange(c){for(var b in devVerSelBox.options){devVerSelBox.options.remove(0)}devVerSelBox.add(new Option("请选择您的固件版本",0));for(var a in yueyuData[c]){devVerSelBox.add(new Option(a.replace("v","").replace(/\_/g,"."),yueyuData[c][a]))}}function makeArticle(b){acticles=b.split(",");strHTML="";for(var a=0;a<acticles.length;a++){strHTML+='<li><a href="pages'+acticles[a]+'.html" title="" target="actIframe">方法 '+(a+1)+"："+acticleTitle["a"+acticles[a]]+"</a></li>"}methodList.innerHTML=strHTML;actIframe.src="pages"+acticles[0]+".html";leftMethodHover()}function leftMethodHover(){var a=$(".container .left li");a[0].className="current";a.hover(function(){if(this.className!="current"){this.className+=" hover"}},function(){$(this).removeClass("hover")});a.click(function(){a.removeClass("current");this.className="current"})};
