function makeOrd(antal,lalala)
{
	test = document.getElementById('domain').value;
	if(test)
	{
		if(isValidURL(test))
		{
			if(lalala == "internet.dk")
			{
				for (var i=1; i<6; i++)
				{
					var ord_1 = document.getElementById('word_'+i).value;
				}
			}
			
			doAjax("funktioner/performOrd.php?antal="+antal,"ord");
			
			if(lalala == "internet.dk")
			{
				for (var i2=1; i2<6; i2++)
				{
					document.getElementById('word_'+i2).value = ord_1;
				}
			}
		}
	}
}

function newOrd()
{
	
	//doAjax("funktioner/performOrd.php?action=new","ord");
	flaf = document.getElementById("ord").innerHTML;
	document.getElementById("ord").innerHTML = flaf+"<input type=\"text\">";
}

function tester()
{
	for (var i=0; i<20; i++)
	{
		var ord = document.getElementById('word_'+i).value;
		
		document.getElementById('word_'+i).value = ord;
	}
}

function upd()
{
	document.getElementById('submit').disabled = false;
}

function ringMigOp()
{
	stat = document.getElementById('ringMigOp').style.visibility;
	if(stat == 'visible')
	{
		document.getElementById('ringMigOp').style.visibility = 'hidden';
	}
	else
	{
		document.getElementById('ringMigOp').style.visibility = 'visible';
	}
}

function orderReport()
{
	stat = document.getElementById('orderReport').style.visibility;
	if(stat == 'visible')
	{
		document.getElementById('orderReport').style.visibility = 'hidden';
	}
	else
	{
		document.getElementById('orderReport').style.visibility = 'visible';
	}
}

function isValidURL(url)
{
    var RegExp = /^(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/;
    if(RegExp.test(url))
    {
        return true;
    }
    else
    {
		return false;
    }
}

function emptyField(value,id)
{
	//alert(value + ' flaf ' + id);
	field = document.getElementById(id);
	if(field.value == value) { field.value='' }
}

function receiveReport() {
	var email_ = document.getElementById('reportEmail').value;
	doAjax("receiveReport.php?email="+email_,"report");
}

function Search() {
	var word1 = document.getElementById('word_1').value;
	var word2 = document.getElementById('word_2').value;
	var word3 = document.getElementById('word_3').value;
	var word4 = document.getElementById('word_4').value;
	var word5 = document.getElementById('word_5').value;
	var word6 = document.getElementById('word_6').value;
	var word7 = document.getElementById('word_7').value;
	var word8 = document.getElementById('word_8').value;
	var word9 = document.getElementById('word_9').value;
	var word10 = document.getElementById('word_10').value;
	var word11 = document.getElementById('word_11').value;
	var word12 = document.getElementById('word_12').value;
	var word13 = document.getElementById('word_13').value;
	var word14 = document.getElementById('word_14').value;
	var word15 = document.getElementById('word_15').value;
	var word16 = document.getElementById('word_16').value;
	var word17 = document.getElementById('word_17').value;
	var word18 = document.getElementById('word_18').value;
	var word19 = document.getElementById('word_19').value;
	var word20 = document.getElementById('word_20').value;
	var domain_ = document.getElementById('domain').value;
	var url = "";
	url += 'banner/performSearch.php?domain='+domain_+'&word_1='+word1+'&word_2='+word2+'&word_3='+word3+'&word_4='+word4;
	url += '&word_5='+word5+'&word_6='+word6+'&word_7='+word7+'&word_8='+word8+'&word_9='+word9+'&word_10='+word10;
	url += '&word_11='+word11+'&word_12='+word12+'&word_13='+word13+'&word_14='+word14+'&word_15='+word15+'&word_16='+word16;
	url += '&word_17='+word17+'&word_18='+word18+'&word_19='+word19+'&word_20='+word20
	doAjax(url,'step3');
}

function expertCall() {
	var email_ = document.getElementById('emailTlf').value;
	doAjax("expert.php?email="+email_,"expertId");
}
