﻿function setImageSize(myImage, obj, size) {
	  var img1 = new Image()
    var val = myImage
    img1.src = val
    var iwidth = img1.width
    var iheight = img1.height
    var z
              
    if(iwidth > iheight){
      if(iwidth > size){
        z = iwidth/size;
        iwidth = size;
        iheight = iheight/z;
      }
    }else{
      if(iheight > size){
        z = iheight/size;
        iheight = size;
        iwidth = iwidth/z;
      }
    }
    obj.height = iheight;
    obj.width = iwidth;
	}
	
	
//Image Gallery
  function ChangePic(pf,ps, size) {
    var img1 = new Image()
    var val = pf;
    img1.src = val
    var iwidth = img1.width
    var iheight = img1.height
    var z
                
    if(iwidth > iheight){
      if(iwidth > size){
        z = iwidth/size;
          iwidth = size;
          iheight = iheight/z;
        }
    }else{
       if(iheight > size){
          z = iheight/size;
          iheight = size;
          iwidth = iwidth/z;
       }
    }
    document.getElementById('GoTo').href = val;
    document.getElementById('PixMain').src = val;
    document.getElementById('PixMain').alt = ps;
    document.getElementById('PixMain').width = iwidth;
    document.getElementById('PixMain').height = iheight;
  }