﻿var win = null;

function __createModalDialog (u, n, w, h, pos, scrollbars)
{
	if (pos=="random")
	{
		LeftPosition = (screen.width) ? Math.floor(Math.random() * (screen.width-w)):100;
		TopPosition = (screen.height) ? Math.floor(Math.random() * ((screen.height-h)-75)):100;
	}
	if (pos=="center")
	{
		LeftPosition = ((screen.width) ? (screen.width-w)/2:100) - 4;
		TopPosition = ((screen.height)?(screen.height-h)/2:100) - 14;
	}
	else if ((pos!="center" && pos!="random") || pos==null)
	{
		LeftPosition=50; TopPosition=50
	}

	settings = 'width='+w+', height='+h+', top='+TopPosition+', left='+LeftPosition+', scrollbars='+scrollbars+', location=0, directories=0, status=0, menubar=0, toolbar=0, resizable=1';
	settingsSP2 = 'width='+w+', height='+h+', top='+TopPosition+', left='+LeftPosition+', scrollbars='+scrollbars+', location=1, directories=0, status=1, menubar=1, toolbar=1, resizable=1, fullscreen=1';

	var g_fIsSP2 = false;
	g_fIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1);
	if (g_fIsSP2)
	{
		win = window.open(u, n, settingsSP2)
		if(win.focus)
		{
			win.focus()
		}
	}
	else
	{
		win = window.open(u, n, settings)
		if(win.focus)
		{
			win.focus()
		}
	}
}

function __createModalDialogA (u, n, w, h, pos, scrollbars)
{
	if (pos=="random")
	{
		LeftPosition = (screen.width) ? Math.floor(Math.random() * (screen.width-w)):100;
		TopPosition = (screen.height) ? Math.floor(Math.random() * ((screen.height-h)-75)):100;
	}
	if (pos=="center")
	{
		LeftPosition = ((screen.width) ? (screen.width-w)/2:100) - 4;
		TopPosition = ((screen.height)?(screen.height-h)/2:100) - 14;
	}
	else if ((pos!="center" && pos!="random") || pos==null)
	{
		LeftPosition=50; TopPosition=50
	}

	settings = 'width='+w+', height='+h+', top='+TopPosition+', left='+LeftPosition+', scrollbars='+scrollbars+', location=0, directories=0, status=0, menubar=0, toolbar=0, resizable=1';

	win = window.open(u, n, settings)
	if(win.focus)
	{
		win.focus()
	}
}

function __createModalDialogB (u, n, w, h, pos, scrollbars)
{
	if (pos=="random")
	{
		LeftPosition = (screen.width) ? Math.floor(Math.random() * (screen.width-w)):100;
		TopPosition = (screen.height) ? Math.floor(Math.random() * ((screen.height-h)-75)):100;
	}
	if (pos=="center")
	{
		LeftPosition = ((screen.width) ? (screen.width-w)/2:100) - 4;
		TopPosition = ((screen.height)?(screen.height-h)/2:100) - 14;
	}
	else if ((pos!="center" && pos!="random") || pos==null)
	{
		LeftPosition=50; TopPosition=50
	}

	settings = 'width='+w+', height='+h+', top='+TopPosition+', left='+LeftPosition+', scrollbars='+scrollbars+', location=0, directories=0, status=0, menubar=0, toolbar=0, resizable=0';

	win = window.open(u, n, settings)
	if(win.focus)
	{
		win.focus()
	}
}

function __createModalDialogC (u, n, w, h, pos, scrollbars)
{
	if (pos=="random")
	{
		LeftPosition = (screen.width) ? Math.floor(Math.random() * (screen.width-w)):100;
		TopPosition = (screen.height) ? Math.floor(Math.random() * ((screen.height-h)-75)):100;
	}
	if (pos=="center")
	{
		LeftPosition = ((screen.width) ? (screen.width-w)/2:100) - 4;
		TopPosition = ((screen.height)?(screen.height-h)/2:100) - 38;
	}
	else if ((pos!="center" && pos!="random") || pos==null)
	{
		LeftPosition=50; TopPosition=50
	}

	settings = 'width='+w+', height='+h+', top='+TopPosition+', left='+LeftPosition+', scrollbars='+scrollbars+', location=0, directories=0, status=0, menubar=1, toolbar=0, resizable=1';

	win = window.open(u, n, settings)
	if(win.focus)
	{
		win.focus()
	}
}

function openpics(oID, intLangID)
{
	var g_fIsSP2 = false;
	g_fIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1);
	if (g_fIsSP2)
	{
		f1 = window.open("/cf/o/1004.asp?immo=" + oID + "&lang=" + intLangID, "__FSIMG", "scrollbars=1, location=0, directories=0, status=1, menubar=0, toolbar=0, resizable=1, fullscreen=1");
	}
	else
	{
		f1 = window.open("/cf/o/1004.asp?immo=" + oID + "&lang=" + intLangID, "__FSIMG", "fullscreen=yes", "left=0, top=0");
	}
}