
function confirmSubmit()
{
    var agree=confirm("Are you sure you wish to continue? There is no UNDO for this operation.");
    if (agree)
	    return true ;
    else
	    return false ;
}
function CheckForm()
{
    //DOB checking
    var objMonth = document.getElementById('ctl00_communityPlaceHolder_ddlMonth');
    var objDay = document.getElementById('ctl00_communityPlaceHolder_ddlDay');
    var objYear = document.getElementById('ctl00_communityPlaceHolder_ddlYear');
    if (objMonth.selectedIndex == 0 && objDay.selectedIndex == 0 && objYear.selectedIndex == 0)
        return true;
    if (objMonth.selectedIndex == 0 || objDay.selectedIndex == 0 || objYear.selectedIndex == 0)
    {
        alert('ERROR! Incorrect date of birth');
        objDay.focus();
        return false;
    }
    return CheckEMail('ctl00_communityPlaceHolder_txtEmail');
	/*
	//Phone checking
    var phone = document.getElementById('ctl00_communityPlaceHolder_txtPhone').value;
	if (phone == '') return true;
	var filter  = /^\d{3}-\d{3}-\d{4}$/;
	if (filter.test(phone)) return true;
	else 
	{
	    alert('ERROR! Incorrect phone number');
	    document.getElementById('ctl00_communityPlaceHolder_txtPhone').focus();
	    return false;
	}
    return true;   
    */ 
}
function Button (obj, button)
{
    document.getElementById(obj).src = "images/" + button;    
}
function CheckCheckBox()
{
    var chb = document.getElementById("ctl00_communityPlaceHolder_chbAccept");;
    if (!chb.checked)
    {
        alert ("Please read and accept terms of use and privacy policy.")
        return false;
    }
    return true;
}

function ValidateAccountForm(){

    return CheckEMail('ctl00_communityPlaceHolder_txtEMail');
 }
function ValidateBusinessForm(){

    return CheckEMail('ctl00_communityPlaceHolder_txtAdsEmail');
 } 
function CheckEMail (strObj)
{
    //EMail checking
    var x = document.getElementById(strObj).value;
	if (x == '') return true;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)) return true;
	else 
	{
	    alert('ERROR! Incorrect email address');
	    document.getElementById(strObj).focus();
	    return false;
	}
	return true;
}


function ValidatePass(){

    
    var p0= document.getElementById('myInfo_txtOldPass');
    var p1= document.getElementById('myInfo_txtNewPass');
    var p2= document.getElementById('myInfo_txtNewPassAgain');
    
    if (p0.value == '')
    {        
        alert ('Please enter your current password.')
        return false
    }
    
    if (p1.value == '' || p2.value == '')
    {
        alert ('Please enter new password.')
        return false
    }
    
    if (p1.value.length < 5)
    {
        p1.value = '';
        p2.value = '';
        alert ('Password should be at least 6 chars long.')
        return false
    }
    
    if (p1.value != p2.value)
    {
        p1.value = '';
        p2.value = '';
        alert ('Password should be the same.')
        return false
    }
    
    return true

}

function SubmitIt()
{
    document.frmTransfer.submit();
}



function FillOtherDropDown(obj)
{
    window.location = "syndication.aspx?vertical=" + obj.options[obj.selectedIndex].text;
}