
/*
Change Cell Backgrounds -
To add more shock to your site, visit www.DHTML Shock.com
*/

function cOn(td,col){
if(document.getElementById||(document.all && !(document.getElementById))){
	if(typeof col == 'undefined')
		td.style.backgroundColor="#FFFFcc";
	else
		td.style.backgroundColor=col;
}

}

function cOut(td,col){
if(document.getElementById||(document.all && !(document.getElementById))){
	if(typeof col == 'undefined')
		td.style.backgroundColor="#FFFFFF";
	else
		td.style.backgroundColor=col;
}
}

function OpenSound(f)
{
//	var path = "../mp3/";
//	var path = "http://home.online.no/~sohaib/mp3/";
    var path =  "/mp3/"
	//var path =  "http://www.sultana.no/desi/mp3/"
	var side = path + f + ".MP3";
	window.open(side, '_self');
/*
   MSFPhover = ((navigator.appName == "Microsoft Internet Explorer") && 
			   (parseInt(navigator.appVersion) >= 4 ));

   var side = "RingToneOpen.html?Lydnr=" + f;

   if(MSFPhover){
	  window.open(side,'Info','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=300,height=300');
   }
   else{
	  // eller åpne direkte ved NS:
	  window.open(f);
   }
*/	
}

function OpenLogo(f)
{
//   var strExt = ".gif";
   MSFPhover = ((navigator.appName == "Microsoft Internet Explorer") && 
			   (parseInt(navigator.appVersion) >= 4 ));

   var side = "/LogoOpen.html?Logonr=" + f;

//   if(MSFPhover){
	 window.open(side,'Info','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=250,height=290');
	 // window.open(side,'Info');
//   }
//   else{
	  // eller åpne direkte ved NS:
//	  window.open(f);
//   }
}


function OpenLogoPK(strNavn)
{
	var strFil = "PK" + strNavn;
	OpenLogo(strFil);
}
function OpenLogoIN(strNavn)
{
	var strFil = "IN" + strNavn;
	OpenLogo(strFil);
}
function OpenLogoBB(strNavn)
{
	var strFil = "BB" + strNavn;
	OpenLogo(strFil);
}

function OpenTips()
{
	window.open("/OpenTips.html" ,'Tips','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=250,height=150');
}


function OpenUpload()																				  
{
  //<Input TYPE="button" VALUE="Legg til bilde" ONCLICK="JAVASCRIPT:OpenUpload();" style="color:white;background-color:#4682b4" >
	//alert("Denne tjenesten er midlertidig ute av drift\nmvh\nDesi.no");
  window.open("/forum/UploadReceive.asp" ,'upload','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=400,height=300');
}

function OpenImageFolder()	
{
  //<Input TYPE="button" VALUE="Legg til bilde" ONCLICK="JAVASCRIPT:OpenUpload();" style="color:white;background-color:#4682b4" >
	//alert("Denne tjenesten er midlertidig ute av drift\nmvh\nDesi.no");
  window.open("/forum/MyPictures.asp" ,'folder','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=500,height=500');
}


function OpenIcon()
{
  //<Input TYPE="button" VALUE="Legg til bilde" ONCLICK="JAVASCRIPT:OpenUpload();" style="color:white;background-color:#4682b4" >
  window.open('/forum/ShowIcon.html', 'icon', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=600');
}

function AddUserName(strNavn)
{/*
	if(document.forms("form1") != NULL)
	{	
		document.forms("form1").item("message").value += "\n\n<font color='gray'>[Redigert av </font><b>" + 
			"<a href=/forum/mld.asp?visbruker=" + strNavn + "><font color='gray'>" + 
			strNavn + "</font></a></b><font color='gray'>]</font>";
		return true;
	}
	else
	{
		//frames.message.document.body.innerHTML = ''; 
//		if(ToastEdit1ContentFrame != NULL)
//		{
//			ToastEdit1ContentFrame.document.body.innerHTML = '';
//		}
//		else
//			alert('test');
	}
	*/
	return true;
}

function InsertTag(strTag)
{
	document.form1.message.value += "<" + strTag +"> skriv inn tekst her </" + strTag +">";
}


function InsertFontTag(strTag)
{
	document.form1.message.value += "<FONT COLOR=" + strTag +"> skriv inn tekst her </FONT>";
}


function OpenRadio()
{
	window.open('/radio/opensound.asp', '_new', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=265,height=250')
}

function DisableSubmit()
{
	if(document.forms("form1") != NULL)
	{
		document.forms("form1").item("submit").disabled = true;
	}
	else
	if(document.forms("formMain") != NULL)
	{
		document.forms("formMain").item("submit").disabled = true;
	}
	
	
//	document.forms("form1").item("submit").disabled = true;
	
	
}

function WaitText()
{
  txt.innerHTML = "Vennligst vent...";
}

function OpenTipsArticle()
{
	window.open("/Tips.asp" ,'Tips2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=270,height=350');	
}

function OpenDM()
{
	//window.open("/DM/login.asp" ,'DM','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=190,height=200');
	window.open("http://freehost04.websamba.com/desino/login.asp" ,'DM','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=190,height=200');
}

function OpenDMIgnore()
{
	window.open("/DM/ignore.asp" ,'DMIgnore','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=200,height=300');
}

function OpenVideo(Path)
{
	var strFile;
	strFile = "/artikler/openVideo.asp?file=" + Path;		
	window.open(strFile, '_new', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=400,height=300')
}

function AddReplyTxt()
{	
var strReply; 


   if(document.form1 != null)
   {
	   strReply = "[QUOTE]<br>" + rpymsg.innerHTML + "<br>[/QUOTE]";
		var re = new RegExp ('<br>', 'gi') ;
		strReply = strReply.replace(re,'\n');
		document.form1.message.value += strReply;
   }
   else
   if(ToastEdit1ContentFrame != null)
   {
//		var re = new RegExp ('[QUOTE]', 'gi') ;
//		strReply = strReply.replace(re,'<BLOCKQUOTE><HR class=replyHR><div CLASS=replyTEXT>');
		
//		var re2 = new RegExp ('[/QUOTE]', 'gi') ;
//		strReply = strReply.replace(re2,'</div><hr class=replyHR></BLOCKQUOTE>');		
	   strReply = "<BLOCKQUOTE><HR class=replyHR><div CLASS=replyTEXT>" + 
					rpymsg.innerHTML + 
					"</div><hr class=replyHR></BLOCKQUOTE><p>";
			   
		ToastEdit1ContentFrame.document.body.innerHTML += strReply;
		if(document.rplyButton != null && document.rplyButton.AddReplyTxtName != null)
		{
			document.rplyButton.AddReplyTxtName.disabled = true;
		}		
   }
}
	
function OpenPKCoverage()
{
	window.open("/eTrade/CitylistPopup.asp" ,'Citylist','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=250,height=100');
}

//function InsertTest()
//{
//	alert(ToastEdit1ContentFrame.document.body.innerHTML);
//}

function OpenUpload2()
{
	window.open('/forum/UploadReceive.asp' ,'upload2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=350,height=300');
}

function OpenPayVideo(Path)
{
	var strFile;
	strFile = "/viewFile.asp?" + Path;		
	window.open(strFile, 'DesiVideo', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=630,height=450')
}

function OpenPrintPage(Path)
{
	var strFile;
	strFile = "/PrintPage.asp?page=" + Path;		
	window.open(strFile, 'Print', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=610,height=450')
}

function WriteEmail(name, display)
{
  displayed=(typeof(display)=="undefined") ? name+"@"+"desi.no" : display
  emailHost = "desi.no"
  document.write("<a h"+"ref="+"m"+"ailt"+"o:"+name+"@"+emailHost+">"+displayed+"</a>")
}

function countit(){

	var formcontent=document.formMain.subject.value
	formcontent=formcontent.split(" ")
//	document.wordcount.wordcount3.value=formcontent.length
	if(formcontent.length < 2)
	{
		alert("Ditt emne-felt innholder kun " + formcontent.length + " ord.\nEmnet-feltet bør gjenspeile innholdet\ni ditt emne og bør helst være en hel setning.");
	}
//	alert("UNDER DAGSAKTUELL MÅ DU BRUKE EKSISTERENDE EMNER,\nHVIS DITT TEMA OMHANDLER DEBATTEN RUNDT KARIKATUR TEGNINGENE.\n\nNYE TRÅDER VIL BLI SLETTET UTEN VARSEL, HVIS DE OMHANDLER NOE SOM ER BLITT ELLER KAN BLI\nDISKUTERT UNDER EKSISTERENDE TRÅDER\n\nadmin\nDESI.NO");
}
