var bg;var section=parent.location.hash;var sectionID;var currentSection;var title="";var smartphone1Anchor="#nokiaNuron";var smartphone2Anchor="#motorolaCLIQ";var smartphone3Anchor="#htcHD2";var smartphone4Anchor="#LG170";var smartphone5Anchor="#LGSentio";var smartphone6Anchor="#LGDlite";var smartphone1Section="nokia";var smartphone2Section="motorola";var smartphone3Section="htc";var smartphone4Section="lg170";var smartphone5Section="lgsentio";var smartphone6Section="lgdlite";$(document).ready(function(){$(document)[0].title="";switch(section){case smartphone1Anchor:sectionID=smartphone1Section;title="3G Smartphones: Find the Right Smartphone for You | T-Mobile";break;case smartphone2Anchor:sectionID=smartphone2Section;title="3G Smartphones: Find the Right Smartphone for You | T-Mobile";break;case smartphone3Anchor:sectionID=smartphone3Section;title="3G Smartphones: Find the Right Smartphone for You | T-Mobile";break;case smartphone4Anchor:sectionID=smartphone1Section;title="LG Cell Phones | New LG phone | LG Camera Phone | T-Mobile";break;case smartphone5Anchor:sectionID=smartphone5Section;title="LG Cell Phones | New LG phone | LG Camera Phone | T-Mobile";break;case smartphone6Anchor:sectionID=smartphone6Section;title="LG Cell Phones | New LG phone | LG Camera Phone | T-Mobile";break}$(document)[0].title=title;if(!sectionID){sectionID="nokia"}changeContent(sectionID);var b=document.location.toString();if(b.match("#")){var a="#"+b.split("#")[1];document.getElementById("Spanish").firstChild.attributes.href.value+=a}$("#affordable-smart-phone-content").css({display:"block"},1);$("#affordable-smart-phone-nav").find("li").each(function(){$(this).click(function(){if(this.id!=currentSection){changeContent(this.id)}});$(this).mouseenter(function(){if(this.id!=currentSection){handleRollOver(this.id)}});$(this).mouseleave(function(){if(this.id!=currentSection){handleRollOut(this.id)}})});if($.browser.msie&&$.browser.version.substr(0,1)<7){correctPNG()}});function changeContent(f){$(document)[0].title="";switch(f){case"nokia":title="3G Smartphones: Find the Right Smartphone for You | T-Mobile";break;case"htc":title="3G Smartphones: Find the Right Smartphone for You | T-Mobile";break;case"motorola":title="3G Smartphones: Find the Right Smartphone for You | T-Mobile";break;case"lg170":title="LG Cell Phones | New LG phone | LG Camera Phone | T-Mobile";break;case"lgsentio":title="LG Cell Phones | New LG phone | LG Camera Phone | T-Mobile";break;case"lgdlite":title="LG Cell Phones | New LG phone | LG Camera Phone | T-Mobile";break}$(document)[0].title=title;var e="#"+f;var a="#"+f+"-content";$(".affordable-smart-phone-marquee").each(function(){$(this).css({display:"none"},1)});$(a).css({display:"block"},1);var d=document.getElementById("Spanish").firstChild.attributes.href.value;var c=document.getElementById("Spanish").firstChild.attributes.href.value;if(c.match("#")){var b="#"+c.split("#")[1];switch(f){case smartphone1Section:document.getElementById("Spanish").firstChild.attributes.href.value=d.replace(b,smartphone1Anchor);break;case smartphone2Section:document.getElementById("Spanish").firstChild.attributes.href.value=d.replace(b,smartphone2Anchor);break;case smartphone3Section:document.getElementById("Spanish").firstChild.attributes.href.value=d.replace(b,smartphone3Anchor);break;case smartphone4Section:document.getElementById("Spanish").firstChild.attributes.href.value=d.replace(b,smartphone4Anchor);break;case smartphone5Section:document.getElementById("Spanish").firstChild.attributes.href.value=d.replace(b,smartphone5Anchor);break;case smartphone6Section:document.getElementById("Spanish").firstChild.attributes.href.value=d.replace(b,smartphone6Anchor);break}}handleRollOver(f);handleRollOut(currentSection);currentSection=f;handleLegalText(f);setFonts()}function handleRollOver(a){switch(a){case"nokia":bg="#9ACD32";break;case"lg170":bg="#9ACD32";break;case"htc":bg="#00848E";break;case"lgsentio":bg="#00848E";break;case"motorola":bg="#FFD700";break;case"lgdlite":bg="#FFD700";break}$("#"+a).children("a").animate({backgroundColor:bg},500)}function handleRollOut(a){$("#"+a).children("a").animate({backgroundColor:"#9B9B9B"},500)}function handleLegalText(a){switch(a){case"nokia":$("#legalText").html($("#hdnLegalTab1").val());break;case"lg170":$("#legalText").html($("#hdnLegalTab1").val());break;case"htc":$("#legalText").html($("#hdnLegalTab2").val());break;case"lgsentio":$("#legalText").html($("#hdnLegalTab2").val());break;case"motorola":$("#legalText").html($("#hdnLegalTab3").val());break;case"lgdlite":$("#legalText").html($("#hdnLegalTab3").val());break}}function setFonts(){sIFR.replace(Swis721Reg,{selector:"#nokia-content .phone-info h2",wmode:"transparent",forceTextTransform:true,useStyleCheck:true,repaintOnResize:true,enforcedGridFitType:"pixel",tuneWidth:30,antiAliasType:"advanced",tuneHeight:-4,css:[".sIFR-root { color: #00848E; line-height: 30px; background-color: transparent; }",".title-span { color: #000000 }"]});sIFR.replace(Swis721Reg,{selector:"#lg170-content .phone-info h2",wmode:"transparent",forceTextTransform:true,useStyleCheck:true,repaintOnResize:true,enforcedGridFitType:"pixel",tuneWidth:30,antiAliasType:"advanced",tuneHeight:-4,css:[".sIFR-root { color: #00848E; line-height: 30px; background-color: transparent; }",".title-span { color: #000000 }"]});sIFR.replace(Swis721Reg,{selector:"#motorola-content .phone-info h2",wmode:"transparent",forceTextTransform:true,useStyleCheck:true,repaintOnResize:true,enforcedGridFitType:"pixel",tuneWidth:30,antiAliasType:"advanced",tuneHeight:-4,css:[".sIFR-root { color: #56AA1C; line-height: 30px; background-color: transparent; }",".title-span { color: #000000 }"]});sIFR.replace(Swis721Reg,{selector:"#lgdlite-content .phone-info h2",wmode:"transparent",forceTextTransform:true,useStyleCheck:true,repaintOnResize:true,enforcedGridFitType:"pixel",tuneWidth:30,antiAliasType:"advanced",tuneHeight:-4,css:[".sIFR-root { color: #56AA1C; line-height: 30px; background-color: transparent; }",".title-span { color: #000000 }"]});sIFR.replace(Swis721Reg,{selector:"#htc-content .phone-info h2",wmode:"transparent",forceTextTransform:true,useStyleCheck:true,repaintOnResize:true,enforcedGridFitType:"pixel",tuneWidth:30,antiAliasType:"advanced",tuneHeight:-4,css:[".sIFR-root {color: #F28411; line-height: 30px; background-color: transparent; }",".title-span { color: #000000 }"]});sIFR.replace(Swis721Reg,{selector:"#lgsentio-content .phone-info h2",wmode:"transparent",forceTextTransform:true,useStyleCheck:true,repaintOnResize:true,enforcedGridFitType:"pixel",tuneWidth:30,antiAliasType:"advanced",tuneHeight:-4,css:[".sIFR-root {color: #F28411; line-height: 30px; background-color: transparent; }",".title-span { color: #000000 }"]});sIFR.replace(TM_Ag_Round,{selector:".phone-title h3",wmode:"transparent",forceTextTransform:true,useStyleCheck:true,repaintOnResize:true,enforcedGridFitType:"pixel",tuneWidth:30,antiAliasType:"advanced",tuneHeight:-12,css:[".sIFR-root {color: #6a6a6a; line-height: 20px; background-color: transparent;}"]});sIFR.replace(TM_Ag_Round,{selector:".phone-title h4",wmode:"transparent",forceTextTransform:true,useStyleCheck:true,repaintOnResize:true,enforcedGridFitType:"pixel",tuneWidth:30,antiAliasType:"advanced",tuneHeight:-1,css:[".sIFR-root { color: #6a6a6a; line-height: 20px; background-color: transparent;}"]});sIFR.replace(TM_Ag_Round,{selector:".sub-title",wmode:"transparent",forceTextTransform:true,useStyleCheck:true,repaintOnResize:true,enforcedGridFitType:"pixel",tuneWidth:30,antiAliasType:"advanced",tuneHeight:-7,css:[".sIFR-root { color: #6a6a6a; line-height: 20px; background-color: transparent;}"]});sIFR.replace(TM_Ag_Round,{selector:".price-text",wmode:"transparent",forceTextTransform:true,useStyleCheck:true,repaintOnResize:true,enforcedGridFitType:"pixel",tuneWidth:30,antiAliasType:"advanced",tuneHeight:-10,css:[".sIFR-root { color: #000000; line-height: 21.26px; background-color: transparent; }"]});sIFR.replace(TM_Ag_Round,{selector:".price-text-sup",wmode:"transparent",forceTextTransform:true,useStyleCheck:true,repaintOnResize:true,enforcedGridFitType:"pixel",tuneWidth:30,antiAliasType:"advanced",tuneHeight:-10,css:[".sIFR-root { color: #000000; line-height: 21.26px; background-color: transparent; vertical-align: top }"]})}function correctPNG(){for(var g=0;g<document.images.length;g++){var d=document.images[g];var f=d.src.toUpperCase();if(f.substring(f.length-3,f.length)=="PNG"){var b=(d.id)?"id='"+d.id+"' ":"";var e=(d.className)?"class='"+d.className+"' ":"";var h=(d.title)?"title='"+d.title+"' ":"title='"+d.alt+"' ";var c="display:inline-block;"+d.style.cssText;if(d.align=="left"){c="float:left;"+c}if(d.align=="right"){c="float:right;"+c}if(d.parentElement.href){c="cursor:hand;"+c}var a="<span "+b+e+h+' style="width:'+d.width+"px; height:"+d.height+"px;"+c+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+d.src+"', sizingMethod='scale');\"></span>";d.outerHTML=a;g=g-1}}}(function(d){d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(f,e){d.fx.step[e]=function(g){if(g.state==0){g.start=c(g.elem,e);g.end=b(g.end)}g.elem.style[e]="rgb("+[Math.max(Math.min(parseInt((g.pos*(g.end[0]-g.start[0]))+g.start[0]),255),0),Math.max(Math.min(parseInt((g.pos*(g.end[1]-g.start[1]))+g.start[1]),255),0),Math.max(Math.min(parseInt((g.pos*(g.end[2]-g.start[2]))+g.start[2]),255),0)].join(",")+")"}});function b(f){var e;if(f&&f.constructor==Array&&f.length==3){return f}if(e=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(f)){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])]}if(e=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(f)){return[parseFloat(e[1])*2.55,parseFloat(e[2])*2.55,parseFloat(e[3])*2.55]}if(e=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(f)){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}if(e=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(f)){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}return a[d.trim(f).toLowerCase()]}function c(g,e){var f;do{f=d.curCSS(g,e);if(f!=""&&f!="transparent"||d.nodeName(g,"body")){break}e="backgroundColor"}while(g=g.parentNode);return b(f)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);
