if (parent.frames.length > 0) 
{
	parent.location.href = self.document.location;
}

function UnCryptMailto(s) {
	var n=0;
	var r="";
	for(var i=0;i<s.length;i++) { 
		n=s.charCodeAt(i); 
		if (n>=8364) {n = 128;}
		r += String.fromCharCode(n-(2)); 
	}
	return r;
}
function linkTo_UnCryptMailto(s)	{
	location.href=UnCryptMailto(s);
}

function checkCat(strng) {
		
		if (strng == "") {
			alert('<?=$txtAlertCat;?>');
			return false;
		}
		return true;
}

function checkUrl(theUrl)
{
var is_protocol_ok=theUrl.indexOf('http://');
var is_protocol_ftp_ok=theUrl.indexOf('ftp://');
var is_protocol_https_ok=theUrl.indexOf('https://');
var is_dot_ok=theUrl.indexOf('.');
if ((is_protocol_ok==-1) && (is_protocol_ftp_ok==-1) && (is_protocol_https_ok==-1) || (is_dot_ok==-1))
 { 
 	<?
 	if ($lang == 'en') {
  ?>		
  		alert('Error: Your url should begin with http:// or https:// or ftp:// and have at least one dot (.)!');
	<? } else { ?>
			alert('Error: URL måste börja med http:// eller https:// eller ftp:// och ha minst 1 punkt (.)!');
	<? } ?>
	return false;
 }
else
 return checkCat(document.addForm.categ.selectedIndex);
}
