/*
String.prototype.trim=function trim(){return this.replace(/^\s+|\s+$/g,"")};
String.prototype.htmlEncode=function htmlEncode(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/,"&quot;")};
String.prototype.stripHtml=function stripHtml(){return this.replace(/<[^>]+>/g,"")};
String.prototype.trimDomain=function trimDomain(){return((this.indexOf("http://")==0)?this.substr(7+this.substr(7).indexOf("/")+1):Jlib.Error("Invalid input parameter, it's not a valid full domain path format (must start with 'http://')."))};String.prototype.trimFileName=function trimFileName(){return this.substr(0,this.lastIndexOf("/")+1)};
String.prototype.trimPath=function trimPath(){return this.substr(this.lastIndexOf("/")+1)};String.prototype.trimFileExtension=function trimFileExtension(){var A=this.lastIndexOf(".");return((A!=-1)?this.substr(0,A):this)};
String.prototype.GetFileExtension=function GetFileExtension(){iDotIndex=this.lastIndexOf(".");return(iDotIndex==-1)?"":this.substr(iDotIndex).toLowerCase()};function StyleProperty2PropertyName(B){var E=B.split("-");var A=E.length;if(A==1){return E[0]}var D=((B.charAt(0)=="-")?(E[0].charAt(0).toUpperCase()+E[0].substring(1)):E[0]);for(var C=1;C<A;C++){D+=(E[C].charAt(0).toUpperCase()+E[C].substring(1))}return D}
*/


var Jlib={
install_folder:"vanyllajs/",

/* 
I'm forced to remove the "function Error(..." sand leave only "function(..." because Google Adsense
shows a strange error only on IE7 even if it seems impossible because it is encapsulated into the 
Jlib object but this is what it is.
I became carzy in finding the issue. On other browsers like FF and Safari it was not showing any 
problems.
*/
Error:function(descr,D,B)
{
   var result="ERROR\n\nJAVASCRIPT FILE: "+(!B?"unknown":B)+"\n";
   result+="FUNCTION: ";
   
   if(D)
   {result+D+"\n"}
   
   else
   {
      if(Jlib.Error.caller)
      {
         var A=Jlib.Error.caller.toString();
         D=A.substring(0,A.indexOf("("));
         result+=D+"\n"
      }
   }
   result+="DESCRIPTION: "+(!descr?"Unknown error!":descr);
   result+="\n\n\nPlease report this error to: info@vanylla.com";
   alert(result);
   return false
}
};

Jlib.Util=
{
   mailto:function mailto(E,D,B,A)
   {
      var C="mailto:"+E+"@"+D;
      if(B)
      {
         C+=("?subject="+escape(B))
      }
      if(A)
      {
         C+=("&amp;body="+escape(A))
      }
      document.location.href=C;
      return false
   },

documentWriteMailAddress:function documentWriteMailAddress(B,A){document.write(B+"@"+A)},
documentWriteMailLink:function documentWriteMailLink(G,F,E,B,D){var C=G+"@"+F;var A="<a"+((D)?(' class="'+D+'"'):"")+' href="#" onclick="return mailto(\''+G+"','"+F+"',"+(E?("'"+E+"'"):(null))+","+(B?("'"+B+"'"):(null))+')">'+C+"</a>";document.write(A)},
documentWriteFlashObject:function documentWriteFlashObject(B,F,E,A,G,C){if(arguments.length!=6){return Jlib.Error("Wrong number of arguments!")}var D="<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+C+"' width='"+E+"' height='"+A+((F)?("' id='"+F):"")+"'>\n";var H="<embed ";D+="<param name='movie' value='"+B+"'>\n";D+="<param name='quality' value='high'>\n";D+="<param name='menu' value='false'>\n";if(G){D+="<param name='wmode' value='transparent'>\n";H+="wmode='transparent' "}else{D+="<param name='wmode' value='opaque'>\n";H+="wmode='opaque' "}H+="src='"+B+"' menu='false' quality='high' width='"+E+"' height='"+A+((F!=null)?("' name='"+F):"")+"' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>";D+=H+"\n";D+="</object>\n";document.write(D);return true},
SearchWebsite:function SearchWebsite(C,A,B){if(typeof C=="string"){C=C.trim();if(C){C=C.replace(" ","+");if(!B){B=window.document.location.hostname}switch(A){case"yahoo.com":document.location.href="http://search.yahoo.com/search?p="+C+"+site%3A"+B+"&fr=yfp-t-477&toggle=1&cop=mss&ei=UTF-8&vc=&fp_ip=IT";break;case"yahoo.it":document.location.href="http://it.search.yahoo.com/search?p="+C+"+site%3A"+B+"&fr=yfp-t-501&ei=UTF-8&meta=vl%3D";break;case"google.it":document.location.href="http://www.google.it/search?hl=it&q="+C+"+site%3A"+B+"&meta=";break;default:document.location.href="http://www.google.com/search?hl=en&q="+C+"+site%3A"+B}}}}};


Jlib.Browser={engine:"",ie_version:0,language:"",os:"",Screen:{width:0,height:0,colors:0},
_Init:function _Init(){if(window.opera){this.engine="OPERA"}else{var C=navigator.userAgent;if(window.attachEvent){this.engine="IE";var A=C.indexOf("MSIE")+5;this.ie_version=parseFloat(C.substring(A,C.indexOf(";",A)))}else{if(C.indexOf("AppleWebKit/")!=-1){this.engine="SAFARI"}else{if(C.indexOf("Gecko/")!=-1){this.engine="GECKO"}}}}if(navigator.platform){var B=navigator.platform;if(B.indexOf("Mac")!=-1){this.os="MAC"}else{if(B.indexOf("Win")!=-1){this.os="WIN"}else{if(B.indexOf("Linux")!=-1){this.os="LINUX"}}}}if(navigator.userLanguage){this.language=navigator.userLanguage}else{if(navigator.language){this.language=navigator.language}}}};
Jlib.Browser._Init();

Jlib.Webpage={
   ScrolledLxT:function ScrolledLxT(){return[document.documentElement.scrollLeft||document.body.scrollLeft,document.documentElement.scrollTop||document.body.scrollTop]},
   VisibleWxH:function VisibleWxH(){var A=self.innerWidth;var B=self.innerHeight;var C=document.compatMode;if((C||(Jlib.Browser.engine=="IE"))&&!(Jlib.Browser.engine=="OPERA")){if(C=="CSS1Compat"){A=document.documentElement.clientWidth;B=document.documentElement.clientHeight}else{A=document.body.clientWidth;B=document.body.clientHeight}}return[A,B]},
   FullWxH:function FullWxH(){return[Math.max((document.body.scrollWidth||0),(document.documentElement.scrollWidth||0),(document.body.offsetWidth||0),(document.body.clientWidth||0),(document.documentElement.clientWidth||0),(self.innerWidth||0)),Math.max((document.body.scrollHeight||0),(document.documentElement.scrollHeight||0),(document.body.offsetHeight||0),(document.body.clientHeight||0),(document.documentElement.clientHeight||0),(self.innerHeight||0))]}};
   Jlib.StopEvent=function StopEvent(C,B){var A=window;if(arguments.length>1){if(B&&B.document){A=B}else{return Jlib.Error("Invalid input parameter, context is not a window object!")}}if(A.event){A.event.cancelBubble=true;A.event.returnValue=false}else{C.stopPropagation();C.preventDefault()}};
   Jlib.WhoFiredEvent=function WhoFiredEvent(C,A){var B=window;if(arguments.length>1){if(A&&A.document){B=A}else{return Jlib.Error("Invalid input parameter, context is not a window object!")}}return(B.event?B.event.srcElement:C.target)};
   Jlib.AppendEvent=function AppendEvent(B,D,C,A){if(B){if(B.attachEvent){return B.attachEvent("on"+D,C)}else{if(B.addEventListener){B.addEventListener(D,C,false);return true}}return Jlib.Error("Neither attachEvent() or addEventListner() methods are defined for the html_element object!")}return Jlib.Error("Invalid input argument: html_element is null!")};
   Jlib.GetElementXY=function GetElementXY(C){var A=y=0;var B;if(C&&C.offsetParent){A=C.offsetLeft;y=C.offsetTop;while(C.offsetParent){C=C.offsetParent;A+=C.offsetLeft;y+=C.offsetTop;if((C.style.position=="absolute")||(C.style.position=="relative")){if(document.defaultView){A+=parseInt(document.defaultView.getComputedStyle(C,null).getPropertyValue("border-left-width"));y+=parseInt(document.defaultView.getComputedStyle(C,null).getPropertyValue("border-top-width"))}else{if((C.style.position=="absolute")&&(typeof C.clientLeft=="number")){A+=C.clientLeft;y+=C.clientTop}}}}}return[A,y]};
   
