String.prototype.Trim=function()
{return this.replace(/(^\s*)|(\s*$)/g,"");}
String.prototype.LTrim=function()
{return this.replace(/(^\s*)/g,"");}
String.prototype.RTrim=function()
{return this.replace(/(\s*$)/g,"");}
function showPoplayer(id){$('<div id="shadowLayer"></div>').appendTo("body");if($.browser.msie&&$.browser.version=="6.0"){var $wHeight=$(window).height();var $dHeight=$(document).height();var $maxHeight=Math.max($dHeight,$wHeight);var ctop=$(window).scrollTop()+$wHeight/2;$("#shadowLayer").css({"position":"absolute","height":$maxHeight});$("#"+id).css({"position":"absolute","top":ctop,"margin-top":"-"+($(this).height()/2-100)+"px"});$(window).scroll(function(){var ctop=$(this).scrollTop()+$wHeight/2;$("#"+id).css({"top":ctop});})}
$("#shadowLayer").show().css("filter","alpha(opacity=50)");$("#"+id).css({"z-index":"10000"}).show();$("#"+id).ajaxStart(function(){$(this).addClass("loading");})}
function hidePoplayer(id){$("#"+id).remove();$("#shadowLayer").remove();}
function getVideo(videoname){var videobox=$("<div id='videobox'>"+"<div class='v_content'>"+"<div id='v_frame'>"+'<object type="application/x-shockwave-flash" data="'+videoname+'" width="600" height="450">'+'<param name="movie" value="'+videoname+'" />'+'<param name="wmode" value="opaque" />'+'<param name="wmode" value="transparent" />'+'<embed src="'+videoname+'" width="600" height="450" wmode="opaque"></embed>'+'</object>'+"</div>"+"<a href='javascript: void(0)' class='close' title='close'></a>"+"</div>"+"</div>");videobox.appendTo("body");showPoplayer("videobox");$("#videobox a.close").click(function(){hidePoplayer("videobox");if($.browser.msie){history.go(0)}})}
function getVideoWithControlBar(videoname){var videobox = $("<div id='videobox'>"+"<div class='v_content'>"+"<div id='v_frame'>"+'<iframe src="'+videoname+'.html" frameborder="0" scrolling="no" width="100%" height="450"></iframe>'+"</div>"+"<a href='javascript: void(0)' class='close' title='close'></a>"+"</div>"+"</div>");videobox.appendTo("body");showPoplayer("videobox");$("#videobox a.close").click(function(){hidePoplayer("videobox");if ( $.browser.msie ) {history.go(0)}})}
function forward_sinaweibo(title){var title=encodeURI(title);var _t=encodeURI(document.title);var _url=encodeURIComponent(document.location);var _assname=encodeURI('name');var _appkey=encodeURI('appkey');var _pic=encodeURI('');var _site='';var _u='http://v.t.sina.com.cn/share/share.php?url='+_url+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic+'&title='+title+'&assname='+_assname;window.open(_u,'','width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');}
function forward_tencentweibo(title){var title=encodeURI(title);var _t=encodeURI(document.title);var _url=encodeURIComponent(document.location);var _assname=encodeURI('name');var _appkey=encodeURI('appkey');var _pic=encodeURI('');var _site='http://www.quanshi.com';var _u='http://v.t.qq.com/share/share.php?url='+_url+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic+'&title='+title+'&assname='+_assname;window.open(_u,'','width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');}
$(document).ready(function(){$('#newstype').cycle({fx:'fade',speed:50,timeout:6000,slideExpr:'li',prev:'#NewsPrev',next:'#NewsNext'});if($("#container dd").length==0){$("#container").hide();$("#product_centent").append("<div class='product_topL'></div><div class='product_topR'></div>");}
if($("#container dd").length!=0){$('#container').cycle({fx:'fade',speed:50,timeout:6000,slideExpr:'dd',pager:'#pager',prev:'#ImgPrev',next:'#ImgNext'});}
if($("#container dd").length==1){$("#Imgpage").hide();}
function showPoplayer(id){$('<div id="shadowLayer"></div>').appendTo("body");if($.browser.msie&&$.browser.version=="6.0"){var $wHeight=$(window).height();var $dHeight=$(document).height();var $maxHeight=Math.max($dHeight,$wHeight);var ctop=$(window).scrollTop()+$wHeight/2;$("#shadowLayer").css({"position":"absolute","height":$maxHeight});$("#"+id).css({"position":"absolute","top":ctop,"margin-top":"-"+($(this).height()/2-100)+"px"});$(window).scroll(function(){var ctop=$(this).scrollTop()+$wHeight/2;$("#"+id).css({"top":ctop});})}
$("#shadowLayer").show().css("filter","alpha(opacity=50)");$("#"+id).css({"z-index":"10000"}).show();$("#"+id).ajaxStart(function(){$(this).addClass("loading");})}
function getForm(id){var mailBox=$("<div id='mailbox'>"+"<div class='mail_top'></div>"+"<div class='mail_content'>"+"<a href='javascript: void(0)' class='close' title='close'></a>"+"<div id='mailform'></div>"+"</div>"+"<div class='mail_bottom'></div>"+"</div>");mailBox.appendTo("body");showPoplayer("mailbox");$("#mailbox a.close").click(function(){hidePoplayer("mailbox");})
$("#mailform").ajaxStart(function(){$(this).addClass("loading");})
$("#mailform").ajaxSuccess(function(){$(this).removeClass("loading");})}
function hidePoplayer(id){$("#"+id).remove();$("#shadowLayer").remove();}
$("#forward_email").click(function(){getForm("mailbox");$("#mailform").load("/assist/contact/");})
$("#mailbox a.close").click(function(){hidePoplayer('mailbox');})
$("#subscibe_button").click(function(){$("#subscibe_email_error").css("display","none");if($('#subscibe_mail').val().length>255){$("#subscibe_email_error").css("display","block");return;}
$("#subscibe_type_error").css("display","none");if($("#subscibe_type").val()==0){$("#subscibe_type_error").css("display","block");return;}
var email_re=/^[a-zA-Z0-9][a-zA-Z0-9._-]*@[a-zA-Z0-9_-]+([\.][a-zA-Z]{2}|[\.][a-zA-Z]{3})+$/;if(!email_re.test($('#subscibe_mail').val())){$("#subscibe_email_error").css("display","block");return;}
$.ajax({type:'POST',url:"/assist/subscibe_save",dataType:'text',data:{'subscibe_mail':$('#subscibe_mail').val(),'subscibe_type':$('#subscibe_type').val()},success:function(res){getForm("mailbox");$("#mailform").load("/assist/contact_ok/"+res);}});})
$("a.top").click(function(){$('html, body').animate({scrollTop:$("body").offset().top},500);})});var cookie={Get:function(n){var re=new RegExp("(?:;)?"+n+"=([^;]*);?");if(re.test(document.cookie))
{return decodeURIComponent(RegExp["$1"]);}else{return null;}},Set:function(n,v){var eTime=new Date();eTime.setTime(eTime.getTime()+(1*3.6e6));var path="/";var domain;var secure;var sCookie=n+"="+encodeURIComponent(v)+";expires="+eTime.toGMTString()+"; path="+path;document.cookie=sCookie;},Del:function(n){var path="/";var domain;var secure;var sCookie=n+"="+""+";expires="+new Date(0).toGMTString()+"; path="+path;document.cookie=sCookie;}};cookie.Set("forwardcpt",document.title);cookie.Set("forwardcpl",document.location);
