﻿//function that make the pic in the right size
function ImgSize(img,size)
{
    if(img.width <= img.height)
    {
        var Yachas = Number(img.width/img.height);
        alert(img.width + " " + img.height + " " +Yachas);
        img.height = size;
        img.width =  Math.floor(Yachas*size);
        
    }
    else if(img.width > img.height)
    {
        var Yachas = Number(img.height/img.width);
        img.width = size;
        img.height =  Math.floor(Yachas*size);       
    }
}

function AJAXread(URL){
    var url = URL;
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp = new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.open("GET",url,false);
    xmlhttp.send(null);
    return xmlhttp.responseText;
}
