﻿
function linkthis(obj,link,mrg,actmrg) {
    mrg += 1;
	actmrg -= 1;
    obj.style.marginLeft = mrg + 'px';
    //obj.style.height = '40px';
    document.getElementById("active").style.marginLeft = actmrg + 'px';
    //document.getElementById("active").style.height = '40px';
    //setTimeout(moveobject(obj,link),10);
   if (mrg >= 23 && actmrg <= 0) {
        //document.getElementById("MainContent").style.borderLeft = 'solid 2px #00C';
        window.location = link;
    } else {
        setTimeout(function() {linkthis(obj,link,mrg,actmrg);},1);
    }
    
}

function linknoactive(obj,link,mrg) {
    //obj.style.width = obj.width+1 + 'px';
	mrg += 1;
    obj.style.marginLeft = mrg + 'px';
    
    if (mrg >= 23) {
        window.location = link;
    } else {
        setTimeout(function() {linknoactive(obj,link,mrg)},1);
    }
}

//function moveobject(obj,link) {
//    obj.style.width = obj.width+1 + 'px';
//    obj.style.height = '40px';
//    document.getElementById("active").style.width = document.getElementById("active").width-1 + 'px';
//    document.getElementById("active").style.height = '40px';
//    chkWidth(obj,link);
//    
//}

//function chkWidth(obj,link) {
//    if (obj.width >= 255 && document.getElementById("active").width <= 232) {
//        window.location = link;
//    }
//}

