﻿//==========POPUP WINDOWS==========
function PopWinSm(url, name)
{
	var ops = 'width=550, height=450,scrollbars=0,menubar=0,resizable=0,titlebar=0,location=0,status=0';
	var win = window.open(url, name, ops);
}

function PopWinMed(url, name)
{
	var ops = 'width=790, height=590,scrollbars=1,menubar=0,resizable=0,titlebar=0,location=0,status=0';
	var win = window.open(url, name, ops);
}

function PopWinLg(url, name)
{
	var ops = 'width=1000, height=750,scrollbars=0,menubar=0,resizable=0,titlebar=0,location=0,status=0';
	var win = window.open(url, name, ops);
}

function PopWinContact(url, name)
{
	var ops = 'width=475, height=475, scrollbars=0, menubar=0, resizable=1, titlebar=1, status=1';
	var win = window.open(url, name, ops);
}

function PopWinSubmit(url, name)
{
	var ops = 'width=475, height=500, scrollbars=0, menubar=0, resizable=1, titlebar=1, status=1';
	var win = window.open(url, name, ops);
}

function PopWinUpload(url, name)
{
	var ops = 'width=400, height=250, scrollbars=0, menubar=0, resizable=1, titlebar=1, status=1';
	var win = window.open(url, name, ops);
}

function CloseWindow()
{
    //window.opener = null;
    self.close();
}
     
//==========SEND TO POPUP WINDOWS==========
function PopLoginFail()
{
	PopWinMed('/admin/loginfail.aspx','_popAlert');
}

function PopLoginLock()
{
	PopWinMed('/admin/loginlock.aspx','_popAlert');
}

function PopContact()
{
	PopWinContact('/Contactus.aspx','_popContact');
}

function PopSubmitEvent()
{
	PopWinSubmit('/SubmitEvent.aspx','_popSubmitEvent');
}

//========DATE PICKER======================

function calendarPicker(strField)
{
    /// <param name="strField">String. The JavaScript reference to the field that we want to set, 
    /// in the format: FormName.FieldName 
    /// Please note that JavaScript is case-sensitive.</param>
    window.open('../DatePicker.aspx?field=' + strField, 'calendarPopup', 'width=250,height=190,resizable=yes');
}

//=======AJAX MODALPOPUP HELPERS======================
function showMapDialog()
{
    /// find Google Map MODALPOPUP and load minimap.aspx in to it
    var modalPopupBehaviorCtrl = $find('MPE1Behavior');
    modalPopupBehaviorCtrl.show();
    document.getElementById('divMap').innerHTML = '<iframe runat="server" id="mm" width="500" height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="minimap.aspx?lat1=40.171264&long1=-105.101440&desc1=BDR Construction&lat2=40.381369&long2=-104.694021&desc2=BDR Construction"></iframe><br />';
}

function ChangeIndex()
{
var accChngIndx = $find('Accordion1');
accChngIndx.set_SelectedIndex(0);
}
