if(!Array.indexOf)Array.prototype.indexOf=function(a){for(var b=0;b<this.length;b++)if(this[b]==a)return b;return-1};document.lang_assoc_array=[];document.loadedLanguages=[];function getLabel(a){var b="",c=document.language;if(document.lang_assoc_array["'"+a+"'"])b=document.lang_assoc_array["'"+a+"'"]["text_"+c];return b}
function callback_init_lang(a,b){var c="";switch(b){case "d":c="text_d";break;case "e":c="text_e";break;case "f":c="text_f";break;case "i":c="text_i";break;case "s":c="text_s";break;default:return}for(var d=0;d<a.length;d++){if(document.loadedLanguages.length>0)e=document.lang_assoc_array["'"+a[d].tag_id+"'"];else{var e=[];e.attribute_name=a[d].attribute_name;e.tag_type=a[d].tag_type;document.lang_assoc_array["'"+a[d].tag_id+"'"]=e}e[c]=a[d].text}document.loadedLanguages&&document.loadedLanguages.push(b)}
function isDeployed(){if(typeof document.deployed=="undefined")return true;return document.deployed}function getMyRootPath(){return isDeployed()?"http://www.vinorg.com":"http://192.168.1.33:8888"}function getSponsorImgPath(){return getMyRootPath()+"/images/sponsors/"}function getDealerImgPath(){return getMyRootPath()+"/images/logos/"}function LTrim(a){if(a==null)return null;for(var b=0;a.charAt(b)==" ";b++);return a.substring(b,a.length)}
function RTrim(a){if(a==null)return null;for(var b=a.length-1;a.charAt(b)==" ";b--);return a.substring(0,b+1)}function Trim(a){return LTrim(RTrim(a))}function LTrimAll(a){if(a==null)return a;for(var b=0;a.charAt(b)==" "||a.charAt(b)=="\n"||a.charAt(b)=="\t";b++);return a.substring(b,a.length)}function RTrimAll(a){if(a==null)return a;for(var b=a.length-1;a.charAt(b)==" "||a.charAt(b)=="\n"||a.charAt(b)=="\t";b--);return a.substring(0,b+1)}function TrimAll(a){return LTrimAll(RTrimAll(a))}
function showBigLabel(a,b,c){var d;if(!c){b=mouseCoords(a);c=ce("div");c.style.left=b.x-50+"px";c.style.top=b.y-50+"px";c.style.zIndex="850";c.style.position="absolute";c.style.border="2px solid #232323";c.style.backgroundImage="url(/images/bg-small-div.png)";c.style.backgroundRepeat="repeat";var e=ce("img");e.src="/images/ajax-loader-big-ff.gif";c.appendChild(e);document.getElementsByTagName("body")[0].appendChild(c)}if(a.src)d=a;else{a=a.target||a.srcElement;e=null;if(!a.thumb||a.thumb==""){for(var g=
0;g<a.attributes.length;g++)if(a.attributes[g].localName=="thumb"){e=a.attributes[g].value;break}if(!e||e=="")return}e=e||a.thumb;a=e.replace(/_thumb/,"");d=new Image;d.src=a}if(d.complete){a=d.width;e=d.height;if(d.width>400||d.height>500)if(d.width>d.height){d.width=400;d.height=400/a*e}else{d.height=500;d.width=500/e*a}a=ce("img");a.src=d.src;a.width=d.width;a.height=d.height;addEventToElement(a,"mouseout",function(){removeMe(c)});removeAllChilds(c);c.appendChild(a)}else setTimeout(function(){showBigLabel(d,
b,c)},500)}function ebi(a){return document.getElementById(a)}function ce(a,b){a=document.createElement(a);if(b!="undefined")a.className=b;return a}function elByName(a){return document.getElementsByName(a)}function removeMe(a){a&&a.parentNode&&a.parentNode.removeChild(a)}function removeDynDiv(a){removeMe(a)}function removeAllChilds(a){if(!a)return false;if(a.hasChildNodes)for(;a.childNodes.length>=1;)a.removeChild(a.firstChild)}
function addEventToElement(a,b,c){if(a.addEventListener)a.addEventListener(b,c,false);else a.attachEvent?a.attachEvent("on"+b,c):eval("e.on"+b+" = myFunction")}function removeEventFromElement(a,b,c){if(a.addEventListener)a.removeEventListener(b,c,false);else a.attachEvent?a.detachEvent("on"+b,c):eval("e.on"+b+" = myFunction")}
function explodeArray(a,b){var c=new Array(1),d=0;for(a=new String(a);a.indexOf(b)>0;){c[d]=a.substr(0,a.indexOf(b));a=a.substr(a.indexOf(b)+1,a.length-a.indexOf(b)+1);d+=1}c[d]=a;return c}function mouseCoords(a){if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};return{x:a.clientX+document.body.scrollLeft-document.body.clientLeft,y:a.clientY+document.body.scrollTop-document.body.clientTop}}function getMouseOffset(a,b){b=b||window.event;a=getPosition(a);b=mouseCoords(b);return{x:b.x-a.x,y:b.y-a.y}}
function getPosition(a){for(var b=0,c=0;a.offsetParent;){b+=a.offsetLeft;c+=a.offsetTop;a=a.offsetParent}b+=a.offsetLeft;c+=a.offsetTop;return{x:b,y:c}}
function AjaxPOSTRequest(a,b,c,d,e,g){function h(){if(f.readyState==4&&f.responseText){var i=eval("("+f.responseText+")");delete f;if(i.alert)typeof myAlert=="function"?myAlert(i.alert,"a"):alert(i.alert);if(i.javascript)for(var l=i.javascript.split(/<split>/igm),k=0,m=l.length;k<m;k++)eval(l[k]);c&&c(i.result,i.exception,d,e,g)}}var f,j=a;if(window.XMLHttpRequest)f=new XMLHttpRequest;else if(window.ActiveXObject)try{f=new ActiveXObject("Msxml2.XMLHTTP")}catch(n){try{f=new ActiveXObject("Microsoft.XMLHTTP")}catch(o){alert("no XMLHttp support detected on your browser");
return null}}if(b!="")j=a+"?"+b;f.open("POST",a,true);f.setRequestHeader("Content-type","application/x-www-form-urlencoded");f.setRequestHeader("Content-length",b.length);f.onreadystatechange=h;f.send(b)}
function shareOnFacebook(a,b,c){if(!c||c==""||c=="undefined")c="en";if(!a||a==""||a=="undefined")a=location.href;b&&b!=""?window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(a)+"&t="+encodeURIComponent(b)+"&lang="+c,"shareVinorg","toolbar=0,status=0,width=626,height=436"):window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(a)+"&lang="+c,"shareVinorg","toolbar=0,status=0,width=626,height=436");return false}
function shareOnTwitter(a,b,c){if(!a||a==""||a=="undefined")a=location.href;if(!c||c==""||c=="undefined")c="en";if(!(b&&b!=""))b=document.title;window.open("http://twitter.com/share?url="+encodeURIComponent(a)+"&text="+encodeURIComponent(b)+"&lang="+c,"shareVinorg","toolbar=0,status=0,width=550,height=450")}
function sendRecomMail(a,b){if(!a||a==""||a=="undefined")a=document.title;b=b.replace("[link]","\n\n"+location.href+"\n\n");b=encodeURIComponent(b);(a=window.open("mailto:?subject="+a+"&body="+b,"emailWindow"))&&a.open&&!a.closed&&a.close()}function sendVinorgMail(a,b,c){(a=window.open("mailto:"+c+"?subject="+a+"&body="+b,"emailWindow"))&&a.open&&!a.closed&&a.close()}
function searchPageURI(a,b){if(a=="w")var c="next=detailW&detWId="+b;else if(a=="p")c="next=detailP&detPId="+b;else if(a=="d")c="next=detailD&detDId="+b;return encodeURIComponent(window.location+"/index.php?"+c)}function setCookie(a,b,c){var d="";if(c){d=new Date;d.setTime(d.getTime()+c*24*60*60*1E3);d="; expires="+d.toGMTString()}document.cookie=a+"="+b+d+"; path=/"}
function setCookieDate(a,b,c){var d=b.getFullYear(),e=b.getMonth()+1;b=b.getDate();if(e<10)e="0"+e;if(b<10)b="0"+b;setCookie(a,e+"-"+b+"-"+d,c)}function setCookieBool(a,b,c){setCookie(a,b,c)}function getCookie(a){a=(new RegExp("(;|^)[^;]*("+a+")=([^;]*)(;|$)")).exec(document.cookie);return a!=null?a[3]:null}function getCookieDate(a){if(a=getCookie(a)){var b=a.split("-");a=b[0]*1-1;var c=b[1];b=b[2];var d=new Date;d.setDate(c);d.setMonth(a);d.setFullYear(b);return d}return null}
function getCookieBool(a){a=getCookie(a);if(a=="false")return false;if(a=="true")return true;return null}function removeCookie(a){setCookie(a,"",-1)}
function gmap_loadSingle(a,b,c,d,e,g,h,f){if(!a)return false;switch(h){case "ter":case google.maps.MapTypeId.TERRAIN:h=google.maps.MapTypeId.TERRAIN;break;case "sat":case google.maps.MapTypeId.SATELLITE:h=google.maps.MapTypeId.SATELLITE;break;case "hyb":case google.maps.MapTypeId.HYBRID:h=google.maps.MapTypeId.HYBRID;break;default:h=google.maps.MapTypeId.ROADMAP;break}g||(g=13);var j=ce("div");j.style.width=b?parseInt(b)+"px":"100%";j.style.height=parseInt(c)+"px";j.border="1px solid #555555";removeAllChilds(a);
a.appendChild(j);a=new google.maps.LatLng(d,e);g=new google.maps.Map(j,{zoom:g,center:a,mapTypeId:h});(new google.maps.Marker({position:a,title:f})).setMap(g)}function getPrecisionLabelId(a){switch(a){case "ROOFTOP":return"l_rooftop";case "RANGE_INTERPOLATED":return"l_range_interpolated";case "GEOMETRIC_CENTER":return"l_geometric_center";case "APPROXIMATE":return"l_approximate";default:return""}}
function openPwdForgottenEntry(){var a=new OverlayForm("search","pwd","insert");a.setTitle(getLabel("l_pwd_frgt_title"));a.setSubTitle(getLabel("l_forgotten_instr"));a.show();return true}function openRegisterEntry(a){a=new OverlayForm(a,"signup","insert");a.setTitle(getLabel("l_register_title"));a.show();return true}function openPasswordResetEntry(){var a=new OverlayForm("search","pwdreset","update");a.setTitle(getLabel("l_change_pwd_id"));a.show();return true}
function openEmailResetEntry(a){var b=new OverlayForm("search","emailreset","update");b.setTitle(getLabel("l_change_email_id"));a&&b.setOnOK(a);b.show();return true}
function openChangeUserAddressEntry(a){var b=new OverlayForm("search","changeuseraddress","update");b.setTitle(getLabel("l_change_address_id"));b.setOnOK(a);b.setGender(document.userGender);b.setGivenName(document.userGivenName);b.setLastName(document.userLastName);b.setAddress(document.userAddress);b.setAddressAdd(document.userAddressAdd);b.setZip(document.userZip);b.setCity(document.userCity);b.setTel(document.userTel);b.setCountryId(document.userCountryId);b.show();return true}
function openChangeUserSettingEntry(a){var b=new OverlayForm("search","changeusersetting","update");b.setTitle(getLabel("l_change_settings_id"));b.setOnOK(a);b.setNewsletter(document.userNewsletter);b.setTooltip(document.userToolTip);b.setCcyId(document.userCurrencyId);b.show();return true}
function isValidEmail(a){if(!a)return false;a=a.toLowerCase();return/^((([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|\/|=|\?|\^|_|`|\{|\||\}|~)+(\.([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|\/|=|\?|\^|_|`|\{|\||\}|~)+)*)@((((([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.))*([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.)[\w]{2,4}|(((([0-9]){1,3}\.){3}([0-9]){1,3}))|(\[((([0-9]){1,3}\.){3}([0-9]){1,3})\])))$/.test(a)?true:false};

