$(document).ready(function(){ showCertDesc(1); $("#tab1").removeClass('sel'); $("#tab7").addClass('sel'); $('#zhizhao_pic')[0].src=corp_license_pic; }); function changenavbg1(k) { if(k==1) {getObject1('top_1').className='navsel';} else {getObject1('top_1').className='';} for(i=1;i<=6;i++) {if(i==k) {getObject1('top_'+i).className='navsel';} else {getObject1('top_'+i).className='';} } } function getObject1(objectId) {if(document.getElementById && document.getElementById(objectId)) { return document.getElementById(objectId);} else if (document.all && document.all(objectId)) { return document.all(objectId);} else if (document.layers && document.layers[objectId]) { return document.layers[objectId];} else {return false;} } function smalltabs(n){ for(i=1;i<=imageshow_cnt;i++) { if(n==i) { document.getElementById("s_img"+i).className="smallddsel"; document.getElementById("bigimg"+i).style.display=""; document.getElementById("count").value=i; document.getElementById("currently").innerHTML=i; } else { document.getElementById("s_img"+i).className="smallnosel"; document.getElementById("bigimg"+i).style.display="none"; } } showCertDesc(n); } function smallback(){ var dlml=Number(document.getElementById("ones").style.marginLeft.replace(/px/g,'')); if(dlml==0) { return; } document.getElementById("ones").style.marginLeft=(dlml+120)+'px'; } function smallnext(){ var dlml=Number(document.getElementById("ones").style.marginLeft.replace(/px/g,'')); var ddnum=(0-($("dd","#ones").length-1)*120)+"px"; if($("#ones").css("margin-left")==ddnum) { return; } else{document.getElementById("ones").style.marginLeft=(dlml-120)+'px';} } function bigback() { var countvalues=Number(document.getElementById("count").value); showCertDesc(countvalues); if(countvalues < 2) { viewThumbs(1); return; } else{ for(i=1;i<=imageshow_cnt;i++) { if(countvalues-1==i) { document.getElementById("s_img"+i).className="smallddsel"; document.getElementById("bigimg"+i).style.display=""; document.getElementById("currently").innerHTML=countvalues-1; } else { document.getElementById("s_img"+i).className="smallnosel"; document.getElementById("bigimg"+i).style.display="none"; } } document.getElementById("count").value=countvalues-1; } } function bignext() { var countvalues=Number(document.getElementById("count").value); showCertDesc(countvalues); if(countvalues==imageshow_cnt) { viewThumbs(2); return; } else{ for(i=1;i<=imageshow_cnt;i++) { if(countvalues+1==i) { document.getElementById("s_img"+i).className="smallddsel"; document.getElementById("bigimg"+i).style.display=""; document.getElementById("currently").innerHTML=countvalues+1; } else { document.getElementById("s_img"+i).className="smallnosel"; document.getElementById("bigimg"+i).style.display="none"; } } document.getElementById("count").value=countvalues+1; } } function showCertDesc(n){ $('#show_cert_desc').html($('#hide_desc_'+n).html()); } function viewThumbs(s){ var tmp=tmp1=0; tmp1=parseInt($('#view').val()); if(s == 1){ tmp = tmp1-1; while(global_cnt[tmp]<=0 && tmp>=0){ tmp--; } } else{ tmp = tmp1+1; while(global_cnt[tmp]<=0 && tmp<=3){ tmp++; } } if(tmp<=3 && tmp>=0 && global_cnt[tmp]>0){ $('#view').val(tmp); location.href="?id="+corp_id+"&menuindex=25&view="+tmp; } } function addBookmark(title,url) { if (window.sidebar) { window.sidebar.addPanel(''+title, ''+url,""); } else if( document.all ) { window.external.AddFavorite(''+url, ''+title); } else if( window.opera && window.print ) { return true; } } function changeTabs(n){ $("#tab"+n).addClass("sel"); } function classOpen(n){ if($("img",$("#Class_"+n)).attr("src").indexOf("_-")!=-1) { $("img",$("#Class_"+n)).attr("src","../../images/shop/new_shop_2010/icon_+.jpg"); } else { $("img",$("#Class_"+n)).attr("src","../../images/shop/new_shop_2010/icon_-.jpg"); } $('[id^=Class_'+n+'_]').toggle(); } $(document).ready(function(){ $('.search_radio').click(function(){ if($(this)[0].id=='search_ic'){ $('form#frm_searchLeft').attr({ action:shop_site+'?id=33&menuindex=17&stype=search' }) }else{ $('form#frm_searchLeft').attr({ action:shop_site+'?id=33&menuindex=12&stype=search' }) } }); $('form#frm_searchLeft').submit(function(){ var __l = $.trim($('#q', $('#frm_searchLeft')).val()).replace(/[\u4e00-\u9fa5]/g,'aa').length; if($('#search_ic')[0].checked && __l<4){ alert('输入搜索内容不得小于4个字符。'); return false; }else if($('#search_nic')[0].checked && __l<3){ alert('输入搜索内容不得小于3个字符。'); return false; } }); $('.btn_search').click(function(){ var d = (typeof $('demand').val() != "undefined") ? $('demand').val() : 0; $('#frm_corp_search').attr({'action':shop_site+'?id=33&menuindex=7&demand='+d}) $('#frm_corp_search').submit(); }); $('#srch_type').change(function(){ if($(this).val()==1){ $('#q').val('请输入您要查找的IC型号').css({'color':'#A1A1A1'}); }else{ $('#q').val('请输入您要查找的产品名称或型号').css({'color':'#A1A1A1'}); } }); $('#q').focus(function(){ if($(this).val()=='请输入您要查找的IC型号' && $('#srch_type').val()==1){ $('#q').val('').css({'color':'#000'}); }else if($(this).val()=='请输入您要查找的产品名称或型号' && $('#srch_type').val()==2){ $('#q').val('').css({'color':'#000'}); } }); $('form[name="frm_corp_search"]').submit(function(){ var v = $('#q', $(this)).val() || ""; var vl = v.replace(/[\u4e00-\u9fa5]/g,"aa").length; if($('#srch_type').val()==1 && $('#q').val() == '请输入您要查找的IC型号'){ alert('请输入您要查找的产品!'); return false; }else if($('#srch_type').val()==2 && $('#q').val() == '请输入您要查找的产品名称或型号'){ alert('请输入您要查找的产品!'); return false; }else if(vl<1){ alert('请输入您要查找的产品!'); return false; }else if(vl<2 && $('#srch_type').val()==2){ alert('请输入至少2个字符!'); return false; }else if(vl<4 && $('#srch_type').val()==1){ alert('请输入至少4个字符!'); return false; } }); }); function showloginpop(str){ var browserName=navigator.userAgent.toLowerCase(); $("body").append("