//<![CDATA[
/******************************************************************************
	Page Functions
******************************************************************************/
function init()
{
	var fName = 'File:  page.js\nFunction:  init()';

	try
	{
		setPage();

		_pg.SetButtonStyles();
	}
	catch(e)
	{
		if(_app.Debug) alert(fName + '\n\n' + e.toString());
	}
}

function setPage()
{
	var fName = 'File:  page.js\nFunction:  setPage()';

	try
	{
	    _util.SetHW();

		if(_obj.OK('center')) { _obj.Move('center', ((_app.Height / 2) - 180), ((_app.Width / 2) - 165)); }
		if(_obj.OK('dn1')) { _obj.Move('dn1', ((_app.Height / 2) - 180 + 162), ((_app.Width / 2) - 165 + 54)); }
		if(_obj.OK('dn2')) { _obj.Move('dn2', ((_app.Height / 2) - 180 + 126), ((_app.Width / 2) - 165 + 163)); }
		if(_obj.OK('dn3')) { _obj.Move('dn3', ((_app.Height / 2) - 180 + 18), ((_app.Width / 2) - 165 + 126)); }
		if(_obj.OK('dn4')) { _obj.Move('dn4', ((_app.Height / 2) - 180 + 55), ((_app.Width / 2) - 165 + 19)); }
		if(_obj.OK('dn5')) { _obj.Move('dn5', ((_app.Height / 2) - 180 + 90), ((_app.Width / 2) - 165 + 90)); }
	}
	catch(e)
	{
		if(_app.Debug) alert(fName + '\n\n' + e.toString());
	}
}

function focusPage()
{
	var fName = 'File:  page.js\nFunction:  focusPage()';

	try
	{
		_pg.FocusWindows();
	}
	catch(e)
	{
		if(_app.Debug) alert(fName + '\n\n' + e.toString());
	}
}


/******************************************************************************
	Functions
******************************************************************************/
function showTracker()
{
	if(screen.height > 725)
	{
		_pg.nav2('nvtracker.aspx', true, 725, 825, 'resizable=yes,scrollbars=yes,menubar=no,toolbar=no,location=no,status=no,directories=no');
	}
	else
	{
		_pg.nav2('nvtracker.aspx', true, 508, 825, 'resizable=yes,scrollbars=yes,menubar=no,toolbar=no,location=no,status=no,directories=no');
	}
}

function getSEORanking() {
    try {
        var top = (screen.height / 2) - 200;
        var left = (screen.width / 2) - 200;

        window.open('http://seo.nvasys.com:3333/seoranking.aspx', 'SEO', 'top=' + top + ',left=' + left + ',height=200,width=400', 'resizable=no,scrollbars=no,menubar=no,toolbar=no,location=no,status=no,directories=no');
    }
    catch (e) {
    }
}

function getSEResults()
{
	var fName = 'File:  page.js\nFunction:  getSEResults()';

	try
	{
		var dm = _obj.GetData('ctl00_cpMain_txtDomain');
		var kw = _obj.GetData('ctl00_cpMain_txtKeyword');
	    
		if(dm == '' || kw == '')
		{
			alert('Please provide a Domain Name and Keyword.');
		}
		else
		{
			kw = kw.replace(/\'/gi, '!sq!');
			kw = kw.replace(/\"/gi, '!dq!');
			kw = kw.replace(/\?/gi, '!qm!');
			kw = kw.replace(/\&/gi, '!as!');
	        
	        _cookie.Set('_seo', _app.SID());
	        
			_pg.nav2('seoresults.aspx?dm=' + dm + '&kw=' + kw, true, 300, 450, 'resizable=yes,scrollbars=yes,menubar=no,toolbar=no,location=no,status=yes');
	        
	        _cookie.Del('_seo');
		}
	}
	catch(e)
	{
		if(_app.Debug) alert(fName + '\n\n' + e.toString());
	}
}

function getW3CResults()
{
	var fName = 'File:  page.js\nFunction:  getW3CResults()';

	try
	{
		var dm = _obj.GetData('ctl00_cpMain_txtDomain2');
	    
		if(dm == '')
		{
			alert('Please provide a Domain Name.');
		}
		else
		{
			_pg.nav2('http://validator.w3.org/check?uri=' + dm, 'ex');
		}
	}
	catch(e)
	{
		if(_app.Debug) alert(fName + '\n\n' + e.toString());
	}
}
//]]>
