
function openWin(f_strUrl)
{
	var newWin = window.open(f_strUrl, 'DGWin', 'toolbar=no, width=800, height=600, status=yes, scrollbars=yes, resizable');
}

function openWin(f_strUrl, f_strWidth, f_strHeight)
{
	var newWin = window.open(f_strUrl, 'DGWin', 'toolbar=no, width='+ f_strWidth + ', height=' + f_strHeight + ', status=yes, scrollbars=yes, resizable');
}

function framecheck()
{
	//the page (frameset) where to redirect if both frames are not visible
	var frameset = 'Default.aspx';

	if (parent.location.href == self.location.href)
    {
       	var current = window.self.location.href;
				
       	if (current.indexOf("CartFrame.aspx") != -1)
       		current = "FrontPage.aspx"
       		
       	current = escape(current);
       	
       	//redirection url made here 
       	//(the frameset page as url to redirect + put the current page url in querystring as the value of ReturnUrl-parameter)
		window.location.replace (frameset + '?ReturnUrl=' + current);
	
	}
}

function noframescheck()
{

	if (parent.location.href != self.location.href)
    {
       		parent.location.href = self.location.href;
	}
}

function bindPostBack(f_eventTarget, f_boolSkipValidation, e)
{
	var ns4 = (document.layers)? true:false
	//var ns6 = (document.getElementById && !document.all) ? true:false;
	var ie4 = (document.all)? true:false

	var keyCode;
	if (ns4) keyCode = e.which;
	if (ie4) keyCode = event.keyCode;

	// bind Enter to send form
	if (keyCode == 13)
	{
		if ((typeof(Page_ClientValidate) != 'function' || Page_ClientValidate()) || f_boolSkipValidation)
		{
			__doPostBack(f_eventTarget, '');
			return false;
		}
	}

}

function checkTextLength(f_objInput)
{
	if (f_objInput != null)
		if (f_objInput.value.length > 30)
			f_objInput.value = f_objInput.value.substring(0, 30);
}

function postBack(strUserName, strPassword)
{
	hiddenForm.elements[2].value=strUserName;
	hiddenForm.elements[3].value=strPassword;
	hiddenForm.submit();
}

/// Auto-login feature for development environment
function autoLogin()
{
	if (typeof(Page_ClientValidate) != 'function' ||  Page_ClientValidate()) 
		__doPostBack('TemplatedFirstControl1$_ctl6$Login1$btnLogin','');
}