﻿function popupProposal(filename) {
	// Vis Proposal popup window based on features provided
	
	faq_window = window.open( filename, "proposal_window", "left=110,top=90,width=500,height=480,resizable=1,scrollbars=1,toolbar=0,status=0,location=0,directories=0,menubar=0");
	faq_window.focus();
}

function popupFAQ(filename) {
	// Show FAQ popup window based on features provided
	
	faq_window = window.open(filename, "faq_window", "left=110,top=90,width=570,height=400,resizable=1,scrollbars=1,toolbar=0,status=0,location=0,directories=0,menubar=0");
	faq_window.focus();
	return false;
}

function showbilutleielink(filename) {
	// Show FAQ popup window based on features provided
	
	faq_window = window.open(filename, "bil-utleie | utleie.no", "left=110,top=90,width=800,height=360,resizable=1,scrollbars=1,toolbar=0,status=0,location=0,directories=0,menubar=0");
	faq_window.focus();
	return false;
}


function popupShowAdPictures(filename) {
	// Show Wizard popup window based on features provided

	wizard_window = window.open( filename, "Pictures_window", "left=120,top=100,width=600,height=500,resizable=1,scrollbars=1,toolbar=0,status=1,location=0,directories=0,menubar=0");
	wizard_window.focus();
}

function popupShowAdPrint(filename) {
	// Show Wizard popup window based on features provided

	AdPrint_window = window.open( filename, "Print_window", "left=120,top=100,width=720,height=500,resizable=1,scrollbars=1,toolbar=0,status=1,location=0,directories=0,menubar=0");
	AdPrint_window.focus();
}

function popupEditPictures(filename) {
	// Show Wizard popup window based on features provided

	wizard_window = window.open( filename, "popupEditPictures", "left=120,top=100,width=500,height=360,resizable=1,scrollbars=1,toolbar=0,status=0,location=0,directories=0,menubar=0");
	wizard_window.focus();
}

function popupSendPasswordMail(filename) {
	// Show Sample Web Site popup window based on features provided

	lostPW_window = window.open(filename, "SendPasswordMail_window", "left=120,top=100,width=360,height=200,resizable=0,scrollbars=0,toolbar=0,status=0,location=0,directories=0,menubar=0");
	lostPW_window.focus();
}

/*
function popupSendPasswordMail(filename, Username) {
	// Show Sample Web Site popup window based on features provided
	//document.write(filename)
var AddToURL;
{
if(Username.value.length > 0)
{
AddToURL = "?Email&" + Username;
}
else
{
AddToURL = "";
}
}

	lostPW_window = window.open( filename + AddToURL, "SendPasswordMail_window", "left=120,top=100,width=360,height=200,resizable=0,scrollbars=0,toolbar=0,status=0,location=0,directories=0,menubar=0");
	lostPW_window.focus();
}
*/
function popupShowAdAdress(filename) {
	// Show Sample Web Site popup window based on features provided

	sample_window = window.open( filename, "sample_window", "left=120,top=100,width=310,height=140,resizable=0,scrollbars=1,toolbar=0,status=0,location=0,directories=0,menubar=0");
	sample_window.focus();
}

function popupShowAdBillMrk(filename) {
	// Show Payflow Web Site popup window based on features provided

	payflow_window = window.open( filename, "payflow_window", "left=40,top=100,width=585,height=385,resizable=1,scrollbars=1,toolbar=0,status=0,location=0,directories=0,menubar=0");
	payflow_window.focus();
}

function popupNeedMoreHelp(filename) {
	// Show popupNeedMoreHelp popup window based on features provided

	payflow_window = window.open( filename, "NeedMoreHelp", "left=120,top=100,width=500,height=530,resizable=1,scrollbars=1,toolbar=0,status=0,location=0,directories=0,menubar=0");
	payflow_window.focus();
}

function CloseWindowAndGoTo(newURL) {
	// Changes main window to a new page and closes the popup
	top.close();
	parent.opener.focus();
	parent.opener.location.href = newURL;

	return false
}

function CloseWindowFocusParent() {
	// Changes main window to a new page and closes the popup
	top.close();
	parent.opener.focus();
	
	return false
}

function getImage(name,pictext) {
   document.images["MAINPICTURE"].src = name;
   document.getElementById("pictext").innerText = pictext;
}

function Del(Word) {
// Fjerner ord
a = Word.indexOf("<");
b = Word.indexOf(">");
len = Word.length;
c = Word.substring(0, a);
if(b == -1)
b = a;
d = Word.substring((b + 1), len);
Word = c + d;
tagCheck = Word.indexOf("<");
if(tagCheck != -1)
Word = Del(Word);
return Word;
}

function Check(FieldToCheck) {
// For å sjekke at brukeren ikke har lagt inn HTML-kode i fritekst-feltet
FieldToCheck = Del(FieldToCheck);
//FieldToCheck = Checked;
return true;
}

//function Check() {
// For å sjekke at brukeren ikke har lagt inn HTML-kode i fritekst-feltet
//ToCheck = document.matrix.Description.value;
//Checked = Del(ToCheck);
//document.matrix.Description.value = Checked;
//return true;
//}

function textCounter(field, countfield, maxlimit) {
if (field.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value = maxlimit - field.value.length;
}

function openArticleList(){ 

//var newWin = window.open("http://www.ssfcu.org", "subWindow","height=500,width=700,resizable=yes,scrollbars=yes"); 
this.datamain.location.href="http://utleie.no/utleie-registeret/ArticleList.asp"
} 


//function for workhire staticmenu and rentalregister static menu


function preload(){
if(document.images){
	Open = new Image(16,13)    
	Closed = new Image(16,13)
	Open.src = "/utleie-registeret/static_menu/open.gif"
	Closed.src = "/utleie-registeret/static_menu/closed.gif"
}}


function showhide(what,what2){
if (what.style.display=='none'){
what.style.display='';
what2.src=Open.src
}
else{
what.style.display='none'
what2.src=Closed.src
}
}



