function getHeight(){
        var myHeight = 0;

        if( typeof( window.innerWidth ) == 'number' ) {
            //Non-IE
                myHeight = window.innerHeight;
        } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
                myHeight = document.documentElement.clientHeight;
        } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
            //IE 4 compatible
                    myHeight = document.body.clientHeight;
          }
        return myHeight;
}
function getWidth(){
        var myWidth = 0;

        if( typeof( window.innerWidth ) == 'number' ) {
            //Non-IE
                myWidth = window.innerWidth;
        } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
                myWidth = document.documentElement.clientWidth;
        } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
            //IE 4 compatible
                    myWidth = document.body.clientWidth;
          }
        return myWidth;
}

function resizeImg(theOffset){
        var thePan = document.all ? document.all["MyImg"] : document.getElementById("MyImg");
        var winW = 630;
        if (thePan){
         if (navigator.appName.indexOf("Microsoft")!=-1) {
                  winW = document.body.offsetWidth;
                  thePan.width=(winW-theOffset)*0.75;
         }
        }
}
function resetBottom(){
        var myHeight = getHeight();
        var theTable = document.all ? document.all["layoutTable"] : document.getElementById("layoutTable");
        theTable.style.height=myHeight-115;
}
function swap(image,pos){
        var theImage = document.all ? document.all[image] : document.getElementById(image);
        var theText = document.all ? document.all["linkText"] : document.getElementById("linkText");
        if(pos=="over"){
                theImage.src='images/towerBut2.jpg';
             /*   if(image=="phone"){
                        theText.innerHTML="Contact Details";
                }else if(image=="write"){
                        theText.innerHTML="Application Forms";

                }else if(image=="home"){
                        theText.innerHTML="Back to Home Page";

                }else if(image=="radio"){
                        theText.innerHTML="Frequency Assignments";
                }*/
        }else{
                theImage.src='images/towerBut.jpg';
                theText.innerHTML="";
        }
}
function startWaves(){
        var winCenter = getCenter();
        var command2 = 'radiate("div2",20,'+winCenter+',1)';
        var command3 = 'radiate("div3",20,'+winCenter+',1)';
        var command4 = 'radiate("div4",20,'+winCenter+',1)';
        radiate("div1",20,winCenter,1);
        setTimeout(command2,500);
        setTimeout(command3,1000);
        setTimeout(command4,1500);
}
function getCenter(){
        var theCenter = document.all ? document.all["centerPoint"] : document.getElementById("centerPoint");
        var winCenter = theCenter.offsetLeft;
        return winCenter;
}
function radiate(myName,myTop,myStart,diff){
        var length=200;
        var leftName=myName+'Left';
        var rightName=myName+'Right';
        var theLeftDiv = document.all ? document.all[leftName] : document.getElementById(leftName);
        var theRightDiv = document.all ? document.all[rightName] : document.getElementById(rightName);
        myStart=getCenter();
        if (diff<length && (diff+myStart+30)<getWidth()){
                theLeftDiv.style.left= myStart-diff;
                theLeftDiv.style.height=diff*0.3;
                theLeftDiv.style.top=50-diff*0.2;
                theRightDiv.style.left= myStart+diff;
                theRightDiv.style.height=diff*0.3;//0.5
                theRightDiv.style.top=50-diff*0.2;//40
                diff+=5;
                var commandStr = 'radiate(\''+myName+'\','+myTop+','+myStart+','+diff+')';
                setTimeout(commandStr,75);
               }else{
                var commandStr = 'radiate(\''+myName+'\','+myTop+','+myStart+',0)';
                setTimeout(commandStr,75);
        }
        theLeftDiv.style.visibility="visible";
        theRightDiv.style.visibility="visible";
}

function doSubmit(alertLabel){
         var theForm = document.all ? document.all["data"] : document.getElementById("data");

        theForm.submit();
                  alert(alertLabel);


}
function changeValue(label,value){
         var theValue = document.all ? document.all[label] : document.getElementById(label);
         theValue.value=value;


}