jQuery.extend({getCookie:function(d){var b=document.cookie.split("; ");for(var c=0;c<b.length;c++){var a=b[c].split("=");if(d==a[0]){return decodeURIComponent(a[1])}}return""},setCookie:function(b,d,c){var a=b+"="+encodeURIComponent(d);if(c!=null){a+="; expires="+c}document.cookie=a},removeCookie:function(a){document.cookie=a+"=; expires=Fri, 31 Dec 1999 23:59:59 GMT;"}});$.tabs=function(a,f){var d="selected";var e=a;var c=(typeof f=="number")?f-1:0;$(e+">div:lt("+c+")").add(e+">div:gt("+c+")").hide();$(e+">ul>li:eq("+c+")").addClass(d);var b=$(e+">ul>li:eq("+c+")").attr("url");if(b){$(e+">div:eq("+c+")").load(b)}$(e+">ul>li").click(function(){if(!$(this).is("."+d)){var h=$(e+">ul>li").index(this);var i=$(e+">div:eq("+h+")");var g=$(this).attr("url");if(g){i.load(g)}if(i.size()>=0){$(e+">div:visible").hide();i.show();$(e+">ul>li").removeClass(d);$(this).addClass(d)}else{alert("There is no such container.")}}return false})};function drop_confirm(b,a){if(confirm(b)){window.location=a}}function go2(a){window.location=a}function change_captcha(a){a.attr("src","index.php?app=captcha&"+Math.round(Math.random()*10000))}function price_format(a){if(typeof(PRICE_FORMAT)=="undefined"){PRICE_FORMAT="&yen;%s"}a=number_format(a,2);return PRICE_FORMAT.replace("%s",a)}function number_format(d,g){if(g<0){return d}d=Number(d);if(isNaN(d)){d=0}var h=d.toString();var b=h.split(".");var c=b[0];var a=b[1];if(h.indexOf(".")==-1){if(g==0){return h}var f="";for(var e=0;e<g;e++){f+="0"}h=h+"."+f}else{if(a.length==g){return h}if(a.length>g){h=h.substr(0,h.length-(a.length-g));if(g==0){h=c}}else{for(var e=0;e<g-a.length;e++){h+="0"}}}return h}function collect_content(b,c){var a=SITE_URL+"/index.php?app=my_favorite&act=add&&ajax=1";$.getJSON(a,{id:c,modelid:b},function(d){alert(d.msg)})}function collect_group(b){var a=SITE_URL+"/index.php?app=my_favorite&act=add&type=group&jsoncallback=?&ajax=1";$.getJSON(a,{item_id:b},function(c){alert(c.msg)})}function getFullPath(a){if(a){if(window.navigator.userAgent.indexOf("MSIE")>=1){a.select();return document.selection.createRange().text}else{if(window.navigator.userAgent.indexOf("Firefox")>=1){if(a.files){return a.files.item(0).getAsDataURL()}return a.value}}return a.value}}function sendmail(a){$(function(){var b=document.createElement("script");b.type="text/javascript";b.src=a;document.getElementsByTagName("head")[0].appendChild(b)})}function GetCookie(a){if(document.cookie.length>0){c_start=document.cookie.indexOf(a+"=");if(c_start!=-1){c_start=c_start+a.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1){c_end=document.cookie.length}return unescape(document.cookie.substring(c_start,c_end))}}return null}function SetCookie(b,c,a){var d=new Date();d.setDate(d.getDate()+a);document.cookie=b+"="+escape(c)+((a==null)?"":";expires="+d.toGMTString())}function addLoadEvent(a){var b=window.onload;if(typeof window.onload!="function"){window.onload=a}else{window.onload=function(){b();a()}}}function moveElement(h,i,g,c){if(!document.getElementById){return false}if(!document.getElementById(h)){return false}var d=document.getElementById(h);if(d.movement){clearTimeout(d.movement)}if(!d.style.left){d.style.left="0px"}if(!d.style.top){d.style.top="0px"}var e=parseInt(d.style.left);var b=parseInt(d.style.top);if(e==i&&b==g){return true}if(e<i){var f=Math.ceil((i-e)/10);e=e+f}if(e>i){var f=Math.ceil((e-i)/10);e=e-f}if(b<g){var f=Math.ceil((g-b)/10);b=b+f}if(b>g){var f=Math.ceil((b-g)/10);b=b-f}d.style.left=e+"px";d.style.top=b+"px";var a="moveElement('"+h+"',"+i+","+g+","+c+")";d.movement=setTimeout(a,c)}function classNormal(a,c){var e=$("#"+a).find("li");var d=$("#"+c).find("li");for(var b=0;b<e.length;b++){e[b].className="normal";d[b].className="normal"}}function classCurrent(a,b,e){var d=$("#"+a).find("li");var c=$("#"+b).find("li");d[e].className="current";c[e].className="current"}function indexfocusChange(){if(!$("#index_focus_turn")||!$("#index_focus_turn_btn")){return}$("#index_focus_turn").onmouseover=function(){atuokey=true};$("#index_focus_turn").onmouseout=function(){atuokey=false};var b=$("#index_focus_turn_btn").find("li");if(!b||b.length==0){return}var a=b.length;b[0].onmouseover=function(){moveElement("index_focus_turn_picList",0,0,5);classNormal("index_focus_turn_btn","index_focus_turn_tx");classCurrent("index_focus_turn_btn","index_focus_turn_tx",0)};if(a>=2){b[1].onmouseover=function(){moveElement("index_focus_turn_picList",0,-188,5);classNormal("index_focus_turn_btn","index_focus_turn_tx");classCurrent("index_focus_turn_btn","index_focus_turn_tx",1)}}if(a>=3){b[2].onmouseover=function(){moveElement("index_focus_turn_picList",0,-376,5);classNormal("index_focus_turn_btn","index_focus_turn_tx");classCurrent("index_focus_turn_btn","index_focus_turn_tx",2)}}if(a>=4){b[3].onmouseover=function(){moveElement("index_focus_turn_picList",0,-564,5);classNormal("index_focus_turn_btn","index_focus_turn_tx");classCurrent("index_focus_turn_btn","index_focus_turn_tx",3)}}}setInterval("indexautoFocusChange()",5000);var atuokey=false;function indexautoFocusChange(){if(!$("#index_focus_turn")||!$("#index_focus_turn_btn")){return}if(atuokey){return}var d=$("#index_focus_turn_btn").find("li");var c=d.length;for(var a=0;a<c;a++){if(d[a].className=="current"){var b=a}}if(b==0&&c!=1){moveElement("index_focus_turn_picList",0,-188,5);classNormal("index_focus_turn_btn","index_focus_turn_tx");classCurrent("index_focus_turn_btn","index_focus_turn_tx",1)}if(b==1&&c!=2){moveElement("index_focus_turn_picList",0,-376,5);classNormal("index_focus_turn_btn","index_focus_turn_tx");classCurrent("index_focus_turn_btn","index_focus_turn_tx",2)}if(b==2&&c!=3){moveElement("index_focus_turn_picList",0,-564,5);classNormal("index_focus_turn_btn","index_focus_turn_tx");classCurrent("index_focus_turn_btn","index_focus_turn_tx",3)}if(b==3){moveElement("index_focus_turn_picList",0,0,5);classNormal("index_focus_turn_btn","index_focus_turn_tx");classCurrent("index_focus_turn_btn","index_focus_turn_tx",0)}if(b==1&&c==2){moveElement("index_focus_turn_picList",0,0,5);classNormal("index_focus_turn_btn","index_focus_turn_tx");classCurrent("index_focus_turn_btn","index_focus_turn_tx",0)}if(b==2&&c==3){moveElement("index_focus_turn_picList",0,0,5);classNormal("index_focus_turn_btn","index_focus_turn_tx");classCurrent("index_focus_turn_btn","index_focus_turn_tx",0)}}addLoadEvent(indexfocusChange);
