﻿//---------- Function That Can Resize the Image ----------//
function GetImageHeightWidthStyle( _objImg , maxWidth  , maxHeight )
{

    var objImage = new Image();
    objImage.src = _objImg.src;
        
    var height = _objImg.height;
    var width = _objImg.width;
   
    var ratio =   height /  _objImg.width;

    if (height > maxHeight) 
    {
        height = maxHeight;
        width = Math.round(height / ratio);
    } 
    else if(width > maxWidth) 
    {
        width = maxWidth;
        height = Math.round(width * ratio);
    }

    if( width == 0 ){width = maxWidth;}
    if( height == 0 ){height = maxHeight;}

    _objImg.width = width;   
    _objImg.height = height;  
//    alert( width + "(W) X "+ height +"(H)" );
}
function SetImageDimension_W150_H150( _objImg ){GetImageHeightWidthStyle(_objImg , 150 , 150 );}
function SetImageDimension_W200_H200( _objImg ){GetImageHeightWidthStyle(_objImg , 200 , 200 );}
function SetImageDimension_W150_H150( _objImg ){GetImageHeightWidthStyle(_objImg , 150 , 150 );}
function SetImageDimension_W125_H125( _objImg ){GetImageHeightWidthStyle(_objImg , 125 , 125 );}
function SetImageDimension_W100_H100( _objImg ){GetImageHeightWidthStyle(_objImg , 100 , 100 );}
function SetImageDimension_W75_H75( _objImg ){GetImageHeightWidthStyle(_objImg , 75 , 75 );}
function SetImageDimension_Custom( _objImg , width , height ){GetImageHeightWidthStyle(_objImg  , width , height);}

/*
//---------- Show the progress Image On Load ----------//
var imagenames = new Array('Images/ProgressBar.gif'); 
var imagesdone=false; 
var loaded=0, preloader;

//var txt ='<div class="LOADING"><img src="Images/ProgressBar.gif" alt="Loading Please Wait" border="0"/><br />Loading</div>'; 
var txt = '<div id="preloader" class="PROGRESS" align="center"><img src="Images/Loading2.gif" style="background: transparent;" alt="Loading" /><br /><b>Loading</b></div>';
document.write(txt); 

 function loadimages()
 { 
     preloader=document.getElementById('preloader'); 
     for(n=0; n < imagenames.length; n++)
     { 
         if (document.images) 
         {
                //
         }
               
         setTimeout('checkload('+ n +')' ,n*100); 
         dispbars();
     } 
 } 


function dispbars()
{   
    loaded++; 
    if(loaded >= imagenames.length) setTimeout('hidepreloader()',800); 
} 


function checkload(index){ 
    setTimeout('checkload('+index+')', 100); 
} 


function hidepreloader()
{ 
    preloader.style.visibility="hidden"; 
    imagesdone=true; 
} 
loadimages(); 
dispbars();   
*/


///////////////////////////////////////
<!--
var message = "";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
// --> 
///////////////////////////////////////
