﻿function chooseLocation()
{
	//var langs = document.getElementById('lang');
	//if (langs!=null)
	//    document.location.href=langs.options[langs.selectedIndex].value
    var lang = Langs.GetSelectedItem();
    if (lang!=null) 
        document.location.href=lang.value;
}

function open_flash(FlashUrl, WindowWidth, WindowHeight, WindowTitle)
{
	var oWindow = null;
	var WindowName = 'win' + Math.floor( Math.random()*1000 );
	var Width = WindowWidth ? WindowWidth : 600;
	var Height = WindowHeight ? WindowHeight : screen.height - 300;

	var WindowLeft = Math.round( (screen.width-Width)/2 );
	var WindowTop =  Math.round( (screen.height-Height)/2 ) - 35;

	var WindowOptions = 'status=yes,menubar=no,toolbar=no';
	WindowOptions += ',resizable=no,scrollbars=no,location=no';
	WindowOptions += ',width='  + Width;
	WindowOptions += ',height=' + Height;
	WindowOptions += ',left='   + WindowLeft;
	WindowOptions += ',top='    + WindowTop;

	var oWindow = window.open(FlashUrl,WindowName,WindowOptions,WindowTitle);
	oWindow.focus();
}

function OpenClose(div_id)
{
    var moreContent = window.document.getElementById(div_id);
    if (moreContent!=null)
        moreContent.style.display = (moreContent.style.display=="" || moreContent.style.display =="none" ? "block" : "none");
}


function OpenCloseContent(flag)
{
    var moreContent = window.document.getElementById("MoreContent");
    var shortContent = window.document.getElementById("ShortContent");
    if (moreContent!=null && shortContent!=null)
    {
        if (flag)
        {
            moreContent.style.display = "block";
            shortContent.style.display = "none";
        }
        else
        {
            moreContent.style.display = "none";
            shortContent.style.display = "block";
        }
    }
}
function open_win(adr,wid,ht)
{
    var str = 'resizable=yes,toolbar=no,statusbar=no,scrollbars=yes,width=' + wid + ',height=' + ht;
	var childwindow = window.open(adr,'myWindow', str);
	childwindow.focus();
}   
function drawCopyright()
{
    var startYear = 1993;
    var currentYear = (new Date()).getFullYear();
    document.write("Copyright &copy; "+(startYear==currentYear ? currentYear : startYear+" - "+currentYear)+" Logrus LLC");
}

function setSearchBox()
{
	var obj = window.document.getElementById("q");
	if (obj!=null)
		obj.value = Query;
}
function changeSearchBox(obj, isClear)
{
	if (isClear)
	{
		if (obj.value == Query) 
			obj.value = '';
	}
	else
	{
		if (obj.value == '') 
			obj.value = Query;
	}
}
function goSearchOld()
{
    document.forms["serachbox"].submit();
}

function goSearch()
{
    var obj_action = document.getElementById("sfaction");
    var obj_searchform = document.getElementById("serachbox");
    var obj_srcquery = document.getElementById("q");
    var obj_query = document.getElementById("query");
    if (obj_action!=null && obj_searchform!=null && obj_query!=null && obj_srcquery!=null)
    {
        obj_searchform.action = obj_action.value;
        obj_query.value=obj_srcquery.value;
        obj_searchform.submit();
    }
}
function photo_win(img_path,img_alt)
{
var str, StrBody;

	str = 'resizable=yes,width=50,height=50,screenX=50,screenY=50,left=50,top=50,scrollbars=yes';
	
	if (document.all){ 
		StrBody = '<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="White" _onblur="self.window.close();" _onresize="self.window.location.reload();">';
	} else {
		StrBody = '<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="White" _onblur="self.window.close();">';
	}
		
	var win_op = self.open('','show', str);
	win_op.document.open();
	win_op.document.writeln('<html>');
	win_op.document.writeln('<head>');
	win_op.document.writeln('<title>' + img_alt + '</title>');
	win_op.document.writeln('<script>');
	win_op.document.writeln('function resize_img() {');
	win_op.document.writeln('var width = document.image.width;');
	win_op.document.writeln('var height = document.image.height;');
	win_op.document.writeln('var ScreenWidth = self.screen.width-100;');
	win_op.document.writeln('var ScreenHeight = self.screen.height-100;');
	win_op.document.writeln('if (document.all){');
	win_op.document.writeln('	if(width <= ScreenWidth && height <= ScreenHeight){');
	win_op.document.writeln('		self.resizeTo((width+30),(height + 45));');	
	win_op.document.writeln('	} else if(width > ScreenWidth && height <= ScreenHeight){');
	win_op.document.writeln('		self.resizeTo(ScreenWidth,height+45);');	
	win_op.document.writeln('	} else if(width <= ScreenWidth && height > ScreenHeight){');
	win_op.document.writeln('		self.resizeTo(width+30,ScreenHeight);');	
	win_op.document.writeln('	} else { ');	
	win_op.document.writeln('		self.resizeTo(ScreenWidth,ScreenHeight);');		
	win_op.document.writeln('	}');
	win_op.document.writeln('} else { self.resizeTo(width,height); }');
	win_op.document.writeln('}');
	win_op.document.writeln('</script>');	
	win_op.document.writeln('</head>');
	win_op.document.writeln(StrBody);
	win_op.document.writeln('<img name="image" src='+ img_path + ' border=0 alt="'+img_alt+'" onload="resize_img();">');
	win_op.document.writeln('</body>');
	win_op.document.writeln('</html>');		
	win_op.document.close();
	return void(0);
}
