
function resizemaintable()
{
//	document.getElementById('maintable').style.height=window.innerHeight;
//	alert(document.getElementById('maintable').offsetHeight);
//	document.getElementById('maintable').offsetHeight=window.innerHeight;
//	alert(document.getElementById('maintable').offsetHeight);
	var l=window.innerHeight;
	if(document.getElementById('page_frame').offsetHeight < l)
	{
		document.getElementById('page_frame').style.height=l+"px";
	}
	if(document.getElementById('subcontent').offsetHeight < l)
	{
		document.getElementById('subcontent').style.height=l+"px";
        }
//	alert(document.getElementById('page_frame').offsetHeight);
}

var currimg = 0;
function change_img()
{
	currimg=currimg+1;
	if(currimg>6)
	{
		currimg=1;
	}
	document.getElementById('photostop').style.background="url(/img/top"+currimg+".jpg)";
	setTimeout("change_img()",3000);
}

var timer_id;
var direction=0;
var curr = 0;

function scroll_iframe(frm,inc)
{
    if (direction == 0)
    {
        curr += inc;
        window.frames[frm].scrollBy( inc,0);
        if(inc>0)
        {
                if(curr > window.frames[frm].document.body.offsetWidth)
                {
                        direction = 1;
                        curr = window.frames[frm].document.body.offsetWidth;
                }
        }
        else
        {
                if(curr <= -window.frames[frm].document.body.offsetWidth)
                {
                        direction = 1;
                        curr = -window.frames[frm].document.body.offsetWidth;
                }
        }
    }
    else if (direction == 1)
    {
        curr -= inc;
        window.frames[frm].scrollBy(-inc,0);
        if(inc>0)
        {
                if(curr <= 0)
                {
                        direction = 0;
                        curr = 0;
                }
        }
        else
        {
                if(curr >= 0)
                {
                        direction = 0;
                        curr = 0;
                }
        }
    }
    
    timer_id=setTimeout("scroll_iframe('" + frm + "'," + inc + ")", 40);
}

function stopScroll()
{
        if (timer_id) clearTimeout(timer_id);
}

function a21_autostart()
{
        change_img();
        if(document.getElementById('hotprop'))
	{
		scroll_iframe('hotprop',1);
	}
	resizemaintable();
}

var hl;

function hot_left()
{
	hl=0;
	setTimeout("hot_left_tm()",20);
}

function hot_left_tm()
{
	window.frames['hotprop'].scrollBy( -9,0);
	hl=hl-5;
	if(hl>-160)
		setTimeout("hot_left_tm()",20);
}	

var hr;

function hot_right()
{
        hr=0;
        setTimeout("hot_right_tm()",20);
}

function hot_right_tm()
{
        window.frames['hotprop'].scrollBy( 9,0);
        hr=hr+5;
        if(hr<160)
                setTimeout("hot_right_tm()",20);
}

function addBookmark(title,url) {
if (window.sidebar) { 
window.sidebar.addPanel(title, url,""); 
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}

var popup=null;
function popWin(theURL,dx,dy)
{

var ScreenWidth=dx;
var ScreenHeight=dy;
var movefromedge=0;
placementx=movefromedge;
placementy=movefromedge;
WinPop=window.open(theURL,"","width="+ScreenWidth+",height="+ScreenHeight+",toolbar=0,location=0,directories=0,status=0,scrollbars=1,menubar=0,resizable=1,left="+placementx+",top ="+placementy+",screenX="+placementx+",screenY="+placementy+",");

}
function popUp(theURL,dx,dy)
{

var movefromedge=50;
placementx=movefromedge;
placementy=movefromedge;
window.open(theURL,"","width="+dx+",height="+dy+",toolbar=0,location=0,directories=0,status=0,scrollbars=1,menubar=0,resizable=1,left="+placementx+",top ="+placementy+",screenX="+placementx+",screenY="+placementy+",");

}
function popUp2(theURL,dx,dy)
{

var movefromedge=50;
placementx=movefromedge;
placementy=movefromedge;
window.open(theURL,"","width="+dx+",height="+dy+",toolbar=1,location=0,directories=0,status=0,scrollbars=1,menubar=0,resizable=1,left="+placementx+",top ="+placementy+",screenX="+placementx+",screenY="+placementy+",");

}

function popUpMax(theURL)
{

window.open(theURL,"_blank","fullscreen=yes,toolbar=0,location=0,directories=0,status=0,scrollbars=1,menubar=0,resizable=1");

}

function x() { return; }

function openURL(url)
        {
                window.opener.location=url;
         	setTimeout("window.close()",2500)
        }

function C21onLoad()
{
        scroll_iframe('scr1', 1, 'v');
}


