
function decryptCharcode(n,start,end,offset) {
   n = n + offset;
   if (offset > 0 && n > end) {
   n = start + (n - end - 1);
   } else if (offset < 0 && n < start) {
   n = end - (start - n - 1);
}
return String.fromCharCode(n);
}
// decrypt string
function decryptString(enc,offset) {
var dec = "";
var len = enc.length;
for(var i=0; i < len; i++) {

var n = enc.charCodeAt(i);

if(n=='0x7A')
{ 
   dec+='z';
}

else
{

   if (n >= 0x2B && n <= 0x3A) {
   dec += decryptCharcode(n,0x2B,0x3A,offset); // 0-9 . , - + / :
   } else if (n >= 0x40 && n <= 0x5A) {
   dec += decryptCharcode(n,0x40,0x5A,offset); // A-Z @
   } else if (n >= 0x61 && n <= 0x7A) {
   dec += decryptCharcode(n,0x61,0x7A,offset); // a-z
   } else {
   dec += enc.charAt(i);
   }
}
}
return dec;
}


function linkTo_UnCryptMailto(s) {
   location.href = decryptString(s,-3);
}


function calcimg(w,h)
{
   var imgh=h
   var imgw=w

   if ((imgh > 94) || (imgw > 94)){
   if ( imgh > imgw){
        scalef = imgh/94;
        nimgh  = 94;
	nimgw  = Math.round(imgw/scalef);
   } 
   else 
   {	scalef = imgw/94;
	nimgw  = 94;
	nimgh  = Math.round(imgh/scalef);		
   }

        return new Array(nimgw,nimgh,w,h);  

   }
   else
   {    
        if ((imgw == 0)&&(imgh == 0)) return null;
	if ( imgw == 0) imgw=94;
        if ( imgh == 0) imgh=94;  
    
         return new Array(imgw,imgh,w,h);  
   }
}


function calcimg2(w,h,z)
{
   var imgh=h
   var imgw=w

   if ((imgh > z) || (imgw > z)){
   if ( imgh > imgw){
        scalef = imgh/z;
        nimgh  = z;
	nimgw  = Math.round(imgw/scalef);
   } 
   else 
   {	scalef = imgw/z;
	nimgw  = z;
	nimgh  = Math.round(imgh/scalef);		
   }

        return new Array(nimgw,nimgh,w,h);  

   }
   else
   {    
        if ((imgw == 0)&&(imgh == 0)) return null;
	if ( imgw == 0) imgw=z;
        if ( imgh == 0) imgh=z;  
    
         return new Array(imgw,imgh,w,h);  
   }
}

