﻿include_a_js_file('http://fast.fonts.com/jsapi/15582bc7-8383-40dc-a7a7-e1a110b8c95c.js');

var piccount=0;


function picloaded(){
   piccount++;
   if(piccount==12){
       trysizepics();
   }
}

function trysizepics(){


 
//  get the window size, if it's too small to hold pics, resize pics.
//  max size for resize = 110+200+308+308  = 926px

   scwidth=f_clientWidth();

   if(scwidth < 926){
//  pics area is the width minus (200+110)=310
//  and we need at least 616

       c2010resizepics((scwidth-310) / 616);
   
   }

}

function c2010resizepics(proportion){
   objes=new Array();
   fings=new Array("shad", "shaddiv", "pic", "picdiv", "pictextdiv", "fuzz", "fuzzdiv");
   textparts=new Array("h", "d");
   objix=0;
   for(i=0; i<4 ; i++){
       for(k=0; k < 7 ; k++){
       		objes[objix]=new getObj(fings[k]+i);

            if(objes[objix].obj){
	            resizeit(i, k, objes[objix].obj, proportion);
            }
            objix++;
       }
       for (k=0; k < 2 ; k++){
          cobj=new getObj("pictext"+textparts[k]+i);
          if(cobj.obj){
          
             cobj.style.fontSize=Math.round(cobj.style.fontSize.replace(/[^0-9]/, "") * proportion)+"%";
          }
       }   
   }
   
  
   cobj=new getObj("picsblock0");
   if(cobj.obj){

	    cobj.style.height=Math.round(String(cobj.obj.offsetHeight).replace(/[^0-9]/, "") * proportion)+"px";

   }    
  
}

function resizeit(i, k,tobj, proportion){

    a=String(tobj.offsetWidth);
    b=String(tobj.offsetHeight);
    tobj.style.width=Math.round(a.replace(/[^0-9]/, "") * proportion)+"px";
    tobj.style.height=Math.round(b.replace(/[^0-9]/, "") * proportion)+"px";
    if(  (  ((i==1)||(i==3))  && ((k == 1)||(k == 3)||(k == 4))  ) || (k == 6)  ){
//   if(i==1){
    
//       alert(tobj.id+" "+tobj.offsetLeft+" . "+tobj.style.width);
//    }
	    tobj.style.left=Math.round(String(tobj.offsetLeft).replace(/[^0-9]/, "") * proportion)+"px";

//    if(i==1){
    
//       alert(tobj.style.left+" - "+tobj.style.width);
//    }

    
    }



}   

	function getObj(name){
	  if (document.getElementById)  {
	  	this.obj = document.getElementById(name);
		if(!this.obj){
			
		} else	if(this.obj.style){
			this.style = this.obj.style;
		}
	} else if (document.all)  {
		this.obj = document.all[name];
		if(document.all[name].style){
			this.style = document.all[name].style;
		}
	}  else if (document.layers)  {
		this.obj = getObjNN4(document,name);
		this.style = this.obj;
	  }
	}

	function getObjNN4(obj,name){
		var x = obj.layers;
		var thereturn;
		for (var i=0;i < x.length;i++)	{
		if (x[i].id == name)
		 	thereturn = x[i];
		else if (x[i].layers.length)
			var tmp = getObjNN4(x[i],name);
			if (tmp) thereturn = tmp;
		}
		return thereturn;
	}


function f_clientWidth() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}
function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}
function f_scrollLeft() {
	return f_filterResults (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}
function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}



