function bookmarksite(title, url)
{
	if (document.all)
		window.external.AddFavorite(url, title);
	//else if (window.sidebar)
		//window.sidebar.addPanel(title, url, "") - adds the site in the side panel...
}

function ow(url, w, h, winname)
{
        mywin = window.open(url, winname, 'toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width='+w+',height='+h);
        if(parseFloat(navigator.appVersion)>=4)
                mywin.focus();
}

function ChooseLocation(FormName) 
{
	tmpStr = 'searchlocation.aspx?';
	tmpStr = tmpStr + 'FormName=' + FormName;
	ow(tmpStr, 510, 300, "searchlocation");
	return false;
}

function ClearLocationFields(FormName)
{
	document.forms[FormName].CountryID.value = "";
	document.forms[FormName].CountryName.value = "";
	document.forms[FormName].StateID.value = "";
	document.forms[FormName].StateName.value = "";
	document.forms[FormName].CityID.value = "";
	document.forms[FormName].CityName.value = "";
	document.forms[FormName].Location.value = "";
	return false;
}
	
function adjust_popup()
{
        var w, h, fixedW, fixedH, diffW, diffH;
        if (document.documentElement && document.body.clientHeight==0) {     // Catches IE6 and FF in DOCMODE
                fixedW = document.documentElement.clientWidth;
                fixedH = document.documentElement.clientHeight;
                window.resizeTo(fixedW, fixedH);
                diffW = fixedW - document.documentElement.clientWidth;
                diffH = fixedH - document.documentElement.clientHeight;
                w = fixedW + diffW + 16; // Vert Scrollbar Always On in DOCMODE.
                h = fixedH + diffH;
                if (w >= screen.availWidth) h += 16;
        } else if (document.all) {
                fixedW = document.body.clientWidth;
                fixedH = document.body.clientHeight;
                window.resizeTo(fixedW, fixedH);
                diffW = fixedW - document.body.clientWidth;
                diffH = fixedH - document.body.clientHeight;
                w = fixedW + diffW;
                h = fixedH + diffH;
                if (h >= screen.availHeight) w += 16;
                if (w >= screen.availWidth)  h += 16;
        } else {
                fixedW = window.innerWidth;
                fixedH = window.innerHeight;
                window.resizeTo(fixedW, fixedH);
                diffW = fixedW - window.innerWidth;
                diffH = fixedH - window.innerHeight;
                w = fixedW + diffW;
                h = fixedH + diffH;
                if (w >= screen.availWidth)  h += 16;
                if (h >= screen.availHeight) w += 16;
        }
        w = Math.min(w,screen.availWidth);
        h = Math.min(h,screen.availHeight);
        window.resizeTo(w,h);
        window.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
}
