var theURL=document.URL;var theURLArr=theURL.split("?");if(theURLArr.length>1){var theReferrer=document.referrer;var paraArr=theURLArr[theURLArr.length-1].split("&");var mod_url_flag="Y";for(i=0;i<paraArr.length;i++){if(paraArr[i].indexOf("mod_url")==0){var mod_url=paraArr[i].split("=");if(mod_url[1]=="N")mod_url_flag="N";}}for(i=0;i<paraArr.length;i++){if(mod_url_flag=="Y"){if(paraArr[i].indexOf("trace_code")==0){var trace_code=paraArr[i].split("=");var undefined;var download_link_num=10;var download_link_string="download_link";for(n=0;n<download_link_num;n++){if(n>0)download_link_string="download_link_"+n;if(document.getElementById(download_link_string)!=undefined){var currDownloadURL=document.getElementById(download_link_string).href;var currDownloadURLForProductCode=currDownloadURL.indexOf("product_code=");if(currDownloadURLForProductCode!=-1){document.getElementById(download_link_string).href=document.getElementById(download_link_string).href+"&customize_code="+trace_code[1];}else{var currDownloadURLForMac=currDownloadURL.indexOf("-mac");if(currDownloadURLForMac!=-1){var download_link_lengt=document.getElementById(download_link_string).href.length;var setupName=document.getElementById(download_link_string).href.substr(download_link_lengt-10,10).split(".");var setupURL=document.getElementById(download_link_string).href.substr(0,download_link_lengt-10).split("/");var newName="";for(k=0;k<setupURL.length-1;k++)newName+=setupURL[k]+"/";newName=newName+"customize/"+setupURL[setupURL.length-1];newName=newName+setupName[0]+"(ad-"+trace_code[1]+")";for(j=1;j<setupName.length;j++)newName+="."+setupName[j];document.getElementById(download_link_string).href=newName;}else{var download_link_lengt=document.getElementById(download_link_string).href.length;var setupName=document.getElementById(download_link_string).href.substr(download_link_lengt-10,10).split(".");var setupURL=document.getElementById(download_link_string).href.substr(0,download_link_lengt-10).split("/");var newName="";for(k=0;k<setupURL.length-1;k++)newName+=setupURL[k]+"/";newName=newName+"customize/"+setupURL[setupURL.length-1];newName=newName+setupName[0]+"-"+trace_code[1];for(j=1;j<setupName.length;j++)newName+="."+setupName[j];document.getElementById(download_link_string).href=newName;}}}}var pay_link_num=10;var pay_link_string="pay_link";for(n=0;n<pay_link_num;n++){if(n>0)pay_link_string="pay_link_"+n;if(document.getElementById(pay_link_string)!=undefined)document.getElementById(pay_link_string).href=document.getElementById(pay_link_string).href+"&customize_code="+trace_code[1];}}}}}
