function BenaUrls(code)
{
            switch (code)
            {
                case "rundgang": 
                    OpenDialog('http://www.bena.at/Portals/6/Rundgang/','VirtuellerRundgang',770,450);
                    break;
                    
                case "home":
                    document.location.href = 'http://www.virtualoffice.at';
                    break;
            }
        }
       
function My_SendContactForm() { 
    var valid = true;
    
    /*if ($F('company') == '')
    {
        valid = false;
        $('company').addClassName('missing');
    }
    else
    {
        $('company').removeClassName('missing');
    }
    
    if ($F('firstname') == '')
    {
        valid = false;
        $('firstname').addClassName('missing');
    }
    else
    {
        $('firstname').removeClassName('missing');
    }
    */

            var title = '';
			if ($('titleFrau').checked || $('titleHerr').checked){
                if ($('titleFrau').checked) title = $('titleFrau').value;
                if ($('titleHerr').checked) title = $('titleHerr').value;
				$('areaTitle').removeClassName('missing');
			} else {
				valid = false;
				$('areaTitle').addClassName('missing');
			}

    if ($F('lastname') == 'Surname' || $F('lastname') == '')
    {
        valid = false;
        $('lastname').addClassName('missing');
    }
    else
    {
        $('lastname').removeClassName('missing');
    }
    
    if ($F('email') == '')
    {
        valid = false;
        $('email').addClassName('missing');
    }
    else
    {
        $('email').removeClassName('missing');
    }

	if ($F('phone') == ''){
        valid = false;
        $('phone').addClassName('missing');
    } else {
        $('phone').removeClassName('missing');
    }
    
    var comment = $('comment') ? $F('comment') : '';
    var infoVO = $('infoVO') ? $F('infoVO') : '';
    var typeVO = $('typeVO') ? $F('typeVO') : '';
    var infoTS = $('infoTS') ? $F('infoTS') : '';
    var infoS = $('infoS') ? $F('infoS') : '';
    var typeS = $('typeS') ? $F('typeS') : '';


    if (!valid) return;
    
    new Ajax.Request('http://www.virtualoffice.at/portals/sendContactMail.aspx', { 
        onSuccess: My_ContactFormSent, method: 'post', 
        parameters: {
            page: 'virtualofficeEN', 
            company: $F('company'), 
            title: title, 
            firstname: $F('firstname'), 
            lastname: $F('lastname'), 
            email: $F('email'), 
            phone: $F('phone'), 
            comment: comment,
            infoVO: infoVO, 
            typeVO: typeVO, 
            infoTS: infoTS, 
            infoS: infoS, 
            typeS: typeS, 
            location: $F('location')
     }}); 
     
     document.location.href = '/default.aspx?tabid=759';
} 

function My_SendContactForm_SIDE() { 

    var valid = true;

	if ($F('lastname_side') == 'Surname' || $F('lastname_side') == ''){
        valid = false;
        $('lastname_side').addClassName('missing');
    } else {
        $('lastname_side').removeClassName('missing');
    }
    
    if ($F('email_side') == '') {
        valid = false;
        $('email_side').addClassName('missing');
    } else {
        $('email_side').removeClassName('missing');
    }

	if ($F('phone_side') == ''){
        valid = false;
        $('phone_side').addClassName('missing');
    } else {
        $('phone_side').removeClassName('missing');
    }
    
    if (!valid) return;
    
    var comment = $('comment_side') ? $F('comment_side') : '';
    var infoVO = 'on';
    var typeVO = $('typeVO_side') ? $F('typeVO_side') : '';
    var infoTS = $('infoTS_side') ? $F('infoTS_side') : '';
    var infoS = $('infoS_side') ? $F('infoS_side') : '';
    var typeS = $('typeS_side') ? $F('typeS_side') : '';
    
    new Ajax.Request('http://www.virtualoffice.at/portals/sendContactMail.aspx', { 
        onSuccess: My_ContactFormSent, method: 'post', 
        parameters: {
            page: 'virtualofficeEN', 
            company: $F('company_side'), 
            title: $F('title_side'), 
            firstname: $F('firstname_side'), 
            lastname: $F('lastname_side'), 
            email: $F('email_side'), 
            phone: $F('phone_side'), 
            comment: comment,
            infoVO: infoVO, 
            typeVO: typeVO, 
            infoTS: infoTS, 
            infoS: infoS, 
            typeS: typeS, 
            location: $F('location_side')
     }}); 
     document.location.href = '/default.aspx?tabid=759';
} 

function My_ContactFormSent() {  }

var tabs_en = [745,746,747,748,750,751,752,753,756,754,755];
var tabs_de = [537,539,540,541,718,542,543,719,547,545,546];

function GetTabForLang(lang) 
{            
    if (lang == 'en')
    {
        for (var i = 0; i < tabs_de.length; i++)
            if (tabs_de[i] == currentTabId && tabs_en[i] > 0) return tabs_en[i];
        
        return 745;
    }
    else
    {
        for (var i = 0; i < tabs_en.length; i++)
            if (tabs_en[i] == currentTabId && tabs_de[i] > 0) return tabs_de[i];
        
        return 537;
    }                    
}
