a1=new Image; a1.src="http://misscccp.com/imgs/pzl/22221a.jpg";
a2=new Image; a2.src="http://misscccp.com/imgs/pzl/22222a.jpg";
a3=new Image; a3.src="http://misscccp.com/imgs/pzl/22223a.jpg";
a4=new Image; a4.src="http://misscccp.com/imgs/pzl/22224a.jpg";
a5=new Image; a5.src="http://misscccp.com/imgs/pzl/22225a.jpg";
a6=new Image; a6.src="http://misscccp.com/imgs/pzl/22226a.jpg";
a7=new Image; a7.src="http://misscccp.com/imgs/pzl/22227a.jpg";
a9=new Image; a9.src="http://misscccp.com/imgs/pzl/22229a.jpg";
a10=new Image; a10.src="http://misscccp.com/imgs/pzl/222210a.jpg";
a11=new Image; a11.src="http://misscccp.com/imgs/pzl/222211a.jpg";
a12=new Image; a12.src="http://misscccp.com/imgs/pzl/222212a.jpg";
a13=new Image; a13.src="http://misscccp.com/imgs/pzl/222213a.jpg";
a14=new Image; a14.src="http://misscccp.com/imgs/pzl/222214a.jpg";
a15=new Image; a15.src="http://misscccp.com/imgs/pzl/222215a.jpg";
a16=new Image; a16.src="http://misscccp.com/imgs/pzl/222216a.jpg";
aa1=new Image; aa1.src="http://misscccp.com/imgs/pzl/22221.jpg";
aa2=new Image; aa2.src="http://misscccp.com/imgs/pzl/22222.jpg";
aa3=new Image; aa3.src="http://misscccp.com/imgs/pzl/22223.jpg";
aa4=new Image; aa4.src="http://misscccp.com/imgs/pzl/22224.jpg";
aa5=new Image; aa5.src="http://misscccp.com/imgs/pzl/22225.jpg";
aa6=new Image; aa6.src="http://misscccp.com/imgs/pzl/22226.jpg";
aa7=new Image; aa7.src="http://misscccp.com/imgs/pzl/22227.jpg";
aa9=new Image; aa9.src="http://misscccp.com/imgs/pzl/22229.jpg";
aa10=new Image; aa10.src="http://misscccp.com/imgs/pzl/222210.jpg";
aa11=new Image; aa11.src="http://misscccp.com/imgs/pzl/222211.jpg";
aa12=new Image; aa12.src="http://misscccp.com/imgs/pzl/222212.jpg";
aa13=new Image; aa13.src="http://misscccp.com/imgs/pzl/222213.jpg";
aa14=new Image; aa14.src="http://misscccp.com/imgs/pzl/222214.jpg";
aa15=new Image; aa15.src="http://misscccp.com/imgs/pzl/222215.jpg";
aa16=new Image; aa16.src="http://misscccp.com/imgs/pzl/222216.jpg";
var l=Array(); l[1]=Array(); l[2]=Array(); l[3]=Array(); l[4]=Array();
var processing=0;

function changepics(){
   if(document.images["pht1"].src != a1.src){document.images["pht1"].src = a1.src;} else {document.images["pht1"].src = aa1.src;}
   if(document.images["pht2"].src != a2.src){document.images["pht2"].src = a2.src;} else {document.images["pht2"].src = aa2.src;}
   if(document.images["pht3"].src != a3.src){document.images["pht3"].src = a3.src;} else {document.images["pht3"].src = aa3.src;}
   if(document.images["pht4"].src != a4.src){document.images["pht4"].src = a4.src;} else {document.images["pht4"].src = aa4.src;}
   if(document.images["pht5"].src != a5.src){document.images["pht5"].src = a5.src;} else {document.images["pht5"].src = aa5.src;}
   if(document.images["pht6"].src != a6.src){document.images["pht6"].src = a6.src;} else {document.images["pht6"].src = aa6.src;}
   if(document.images["pht7"].src != a7.src){document.images["pht7"].src = a7.src;} else {document.images["pht7"].src = aa7.src;}
   if(document.images["pht9"].src != a9.src){document.images["pht9"].src = a9.src;} else {document.images["pht9"].src = aa9.src;}
   if(document.images["pht10"].src != a10.src){document.images["pht10"].src = a10.src;} else {document.images["pht10"].src = aa10.src;}
   if(document.images["pht11"].src != a11.src){document.images["pht11"].src = a11.src;} else {document.images["pht11"].src = aa11.src;}
   if(document.images["pht12"].src != a12.src){document.images["pht12"].src = a12.src;} else {document.images["pht12"].src = aa12.src;}
   if(document.images["pht13"].src != a13.src){document.images["pht13"].src = a13.src;} else {document.images["pht13"].src = aa13.src;}
   if(document.images["pht14"].src != a14.src){document.images["pht14"].src = a14.src;} else {document.images["pht14"].src = aa14.src;}
   if(document.images["pht15"].src != a15.src){document.images["pht15"].src = a15.src;} else {document.images["pht15"].src = aa15.src;}
   if(document.images["pht16"].src != a16.src){document.images["pht16"].src = a16.src;} else {document.images["pht16"].src = aa16.src;}
   processing=0;
}

function cross(fromWhat){
  var elem = document.getElementById(fromWhat);
  var i=1;
  var j=1;
  var x;
  var y;
  var strl;
  var this_n;
  var max_l;
  var n=Array(); n[1]=Array(); n[2]=Array(); n[3]=Array(); n[4]=Array();
  if (elem){
   strl=fromWhat.length;
   this_n=fromWhat.substring(3, strl);
   x=this_n%4;
   if(x==0){x=4;}
   if(this_n<5&&this_n>0){
    y=1;
   }else{
    y=(this_n-x)/4+1;
   }
   i=1;
   j=1;
   max_l=0;
   while (i<5) {
    while (j<5){
             n[i][j]=(j-1)*4+i;
             l[j][i]=6-Math.round(Math.sqrt((x-i)*(x-i)+(y-j)*(y-j)));
             if(max_l<l[j][i]){max_l=l[j][i];}
      j++;
    }
    i++;
    j=1;
   }
   processing=1;
   setTimeout('fadeOpacity("pht1", "oR3")', l[1][1]*100);
   setTimeout('fadeOpacity("pht2", "oR3")', l[1][2]*100);
   setTimeout('fadeOpacity("pht3", "oR3")', l[1][3]*100);
   setTimeout('fadeOpacity("pht4", "oR3")', l[1][4]*100);
   setTimeout('fadeOpacity("pht5", "oR3")', l[2][1]*100);
   setTimeout('fadeOpacity("pht6", "oR3")', l[2][2]*100);
   setTimeout('fadeOpacity("pht7", "oR3")', l[2][3]*100);
   setTimeout('fadeOpacity("pht9", "oR3")', l[3][1]*100);
   setTimeout('fadeOpacity("pht10", "oR3")', l[3][2]*100);
   setTimeout('fadeOpacity("pht11", "oR3")', l[3][3]*100);
   setTimeout('fadeOpacity("pht12", "oR3")', l[3][4]*100);
   setTimeout('fadeOpacity("pht13", "oR3")', l[4][1]*100);
   setTimeout('fadeOpacity("pht14", "oR3")', l[4][2]*100);
   setTimeout('fadeOpacity("pht15", "oR3")', l[4][3]*100);
   setTimeout('fadeOpacity("pht16", "oR3")', l[4][4]*100);
   setTimeout('changepics()', 1800);
   setTimeout('fadeOpacity("pht1", "oR3","1")', l[1][1]*100+2000);
   setTimeout('fadeOpacity("pht2", "oR3","1")', l[1][2]*100+2000);
   setTimeout('fadeOpacity("pht3", "oR3","1")', l[1][3]*100+2000);
   setTimeout('fadeOpacity("pht4", "oR3","1")', l[1][4]*100+2000);
   setTimeout('fadeOpacity("pht5", "oR3","1")', l[2][1]*100+2000);
   setTimeout('fadeOpacity("pht6", "oR3","1")', l[2][2]*100+2000);
   setTimeout('fadeOpacity("pht7", "oR3","1")', l[2][3]*100+2000);
   setTimeout('fadeOpacity("pht9", "oR3","1")', l[3][1]*100+2000);
   setTimeout('fadeOpacity("pht10", "oR3","1")', l[3][2]*100+2000);
   setTimeout('fadeOpacity("pht11", "oR3","1")', l[3][3]*100+2000);
   setTimeout('fadeOpacity("pht12", "oR3","1")', l[3][4]*100+2000);
   setTimeout('fadeOpacity("pht13", "oR3","1")', l[4][1]*100+2000);
   setTimeout('fadeOpacity("pht14", "oR3","1")', l[4][2]*100+2000);
   setTimeout('fadeOpacity("pht15", "oR3","1")', l[4][3]*100+2000);
   setTimeout('fadeOpacity("pht16", "oR3","1")', l[4][4]*100+2000);
  }
}
function clickOpacity(fromWhat,sect){
   cross(fromWhat);
}


function setElementOpacity(oElem, nOpacity){
        var p = getOpacityProperty();
        (setElementOpacity = p=="filter"?new Function('oElem', 'nOpacity', 'nOpacity *= 100;        var oAlpha = oElem.filters["DXImageTransform.Microsoft.alpha"] || oElem.filters.alpha;        if (oAlpha) oAlpha.opacity = nOpacity; else oElem.style.filter += "progid:DXImageTransform.Microsoft.Alpha(opacity="+nOpacity+")";'):p?new Function('oElem', 'nOpacity', 'oElem.style.'+p+' = nOpacity;'):new Function)(oElem, nOpacity);
}

function getOpacityProperty(){
        var p;
        if (typeof document.body.style.opacity == 'string') p = 'opacity';
        else if (typeof document.body.style.MozOpacity == 'string') p =  'MozOpacity';
        else if (typeof document.body.style.KhtmlOpacity == 'string') p =  'KhtmlOpacity';
        else if (document.body.filters && navigator.appVersion.match(/MSIE ([\d.]+);/)[1]>=5.5) p =  'filter';

        return (getOpacityProperty = new Function("return '"+p+"';"))();
}

function fadeOpacity(sElemId, sRuleName, bBackward){

        if(processing==0||sRuleName=="oR3"){
        var elem = document.getElementById(sElemId);
        if (!elem || !getOpacityProperty() || !fadeOpacity.aRules[sRuleName]) return;
        var rule = fadeOpacity.aRules[sRuleName];
        var nOpacity = rule.nStartOpacity;
        if (fadeOpacity.aProc[sElemId]) {clearInterval(fadeOpacity.aProc[sElemId].tId); nOpacity = fadeOpacity.aProc[sElemId].nOpacity;}
        if ((nOpacity==rule.nStartOpacity && bBackward) || (nOpacity==rule.nFinishOpacity && !bBackward)) return;
        fadeOpacity.aProc[sElemId] = {'nOpacity':nOpacity, 'tId':setInterval('fadeOpacity.run("'+sElemId+'")', fadeOpacity.aRules[sRuleName].nDalay), 'sRuleName':sRuleName, 'bBackward':Boolean(bBackward)};
        }
}

fadeOpacity.addRule = function(sRuleName, nStartOpacity, nFinishOpacity, nDalay){fadeOpacity.aRules[sRuleName]={'nStartOpacity':nStartOpacity, 'nFinishOpacity':nFinishOpacity, 'nDalay':(nDalay || 30),'nDSign':(nFinishOpacity-nStartOpacity > 0?1:-1)};};

fadeOpacity.back = function(sElemId){fadeOpacity(sElemId,fadeOpacity.aProc[sElemId].sRuleName,true);};

fadeOpacity.run = function(sElemId){
        var proc = fadeOpacity.aProc[sElemId];
        var rule = fadeOpacity.aRules[proc.sRuleName];

        proc.nOpacity = Math.round(( proc.nOpacity + .1*rule.nDSign*(proc.bBackward?-1:1) )*10)/10;
        setElementOpacity(document.getElementById(sElemId), proc.nOpacity);

        if (proc.nOpacity==rule.nStartOpacity || proc.nOpacity==rule.nFinishOpacity) clearInterval(fadeOpacity.aProc[sElemId].tId);
}
fadeOpacity.aProc = {};
fadeOpacity.aRules = {};

