﻿// JScript File
function externallinks()
{
    var c=document.getElementById('content');
    if(c)
    {
        //alert("Found content id");
        var ls=c.getElementsByTagName('a');
        for(var i=0;i<ls.length;i++){
            if(ls[i].getAttribute('rel')=='external')
            {
                //alert("Found 1!");
                ls[i].className+=ls[i].className?' extlink':'extlink';
                ls[i].title+='(opens in new window)';
                ls[i].onclick=function(){return !window.open(this.href);}
            }
            
        }
    }
    else
    {
        //alert("no content id");
    }
}
window.onload=function(){
    if(!document.getElementById && !document.createTextNode){return;}
    externallinks();
}

function Hitta() {
	var thisurl;
	var thistarget;
	var thisWithOwnerid
	var thisvalue = document.snabblankar-form.snabblankar.options[document.snabblankar-form.snabblankar.selectedIndex].value;
	if (thisvalue != "0") {
		thistarget = thisvalue.substr(0,1);
		thisurl = thisvalue.substr(2);
		if (thistarget == "1") { //nytt fönster
			window.open(thisurl + "?newwin=true");
		} else {
			location = thisurl;
		}
		
	}
}


function Sendmail(){
	var temp;
	var urlname;	
	if (document.Login.epost.value == ""){		
		alert("Fältet E-post måste fyllas i.");		
		return false;
		}	
		temp = location.pathname;
		temp = temp.substr(1,temp.length);
		temp = temp.substr(0,temp.indexOf("/"));
		
	//document.location.href='http://' + location.hostname + '/' + temp +  '/html/sendmail.asp?epost=' + document.Login.epost.value + '&Ownerid=' + document.Login.ownerid.value + '&url=' + document.Login.url.value
	document.location.href='http://' + location.hostname + '/html/sendmail.asp?epost=' + document.Login.epost.value + '&Ownerid=' + document.Login.ownerid.value + '&url=' + document.Login.url.value
	}

