function killErrors() { 
    return true; 
} 
window.onerror = killErrors; 

function fontZoom(targetElement,size){
        document.getElementById(targetElement).style.fontSize=size + "px";
}
 
function PicsSwitch(width,height,txtHeight,piclist,linklist,txtlist,bgcolor){
    var focus_width=width;
    var focus_height=height;
    var text_height=txtHeight;
    var flash_url="images/focus.swf";
    var swf_height = focus_height+text_height
  
    var pics= piclist;
    var links= linklist;
    var texts= txtlist;
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=" http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
    document.write('<param name="allowScriptAccess" value="sameDomain">');
    document.write('<param name="movie" value="'+flash_url+'">')
    document.write('<param name="quality" value="high">')
    document.write('<param name="bgcolor" value='+bgcolor+'>')
    document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
    document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
    document.write('<embed src="'+flash_url+'" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor='+bgcolor+' quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage=" http://www.macromedia.com/go/getflashplayer" />');
    document.write('</object>');
} 
 
function flash(_url,w,h,wmode){
    var url = "images/" + _url;
    document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
    document.write(' codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
    document.write(' WIDTH='+w+' HEIGHT='+h+'>');
    document.write(' <PARAM NAME=movie VALUE="'+url+'"> '); 
    document.write(' <PARAM NAME=quality VALUE=autohigh> ');
    document.write(' <PARAM NAME=wmode VALUE="transparent"> '); 
    document.write(' <EMBED SRC="'+url+'" QUALITY="autohigh" wmode="transparent" '); 
    document.write(' NAME=flashad swLiveConnect=TRUE WIDTH='+w+' HEIGHT='+h);
    document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE=" http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
    document.write('</EMBED>');
    document.write('</OBJECT>');
}
 
function Thumbnail(ImgD,w,h){
    var flag = false;
    var image = new Image();
    image.src = ImgD.src;
    if(image.width > 0 && image.height > 0){
        flag = true;
        if(image.width/image.height > w/h){
            if(image.width > w){
                ImgD.width = w;
                ImgD.height = (image.height*w)/image.width;
                ImgD.style.display = "block";
            }else{
                ImgD.width = image.width;
                ImgD.height = image.height;
                ImgD.style.display = "block";
            }
        }else{
            if(image.height > h){
                ImgD.height = h;
                ImgD.width = (image.width*h)/image.height;
                ImgD.style.display ="block";
            }else{
                ImgD.width = image.width;
                ImgD.height = image.height;
                ImgD.style.display = "block";
            }
         }
    }
} 

