//Open Browser Window=============================================================
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//Go To URL=============================================================
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//JumpMenu=============================================================
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//Call JavaScript============================================================
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
//Fullscreen=============================================================
function MachakFull(){
Ie="../index.php";
other="../index.php";
x=screen.availWidth;
y=screen.availHeight;

target = parseFloat(navigator.appVersion.substring(navigator.appVersion.indexOf('.')-1,navigator.appVersion.length));
if((navigator.appVersion.indexOf("Mac")!=-1) &&(navigator.userAgent.indexOf("MSIE")!=-1)&&(parseInt(navigator.appVersion)==4))
	window.open(other,"sub",'scrollbars=yes');
	if (target >= 4){
		if (navigator.appName=="Netscape"){
  	 		var MachakFull=window.open(other,"MachakFull", resizable=yes, menubar=0, status=0, 'scrollbars=no','width='+x+',height='+y+',top=0,left=0');
			MachakFull.moveTo(0,0);
			MachakFull.resizeTo(x,y);
		}
	if (navigator.appName=="Microsoft Internet Explorer")
		window.open(Ie,"MachakFull","fullscreen=yes");
	}
}
//Fullscreen EDITOR=============================================================
function MachakFull_EDITOR(url, password){
Ie=url + "/php/launch.php?password=" + password;
other=Ie;
x=screen.availWidth;
y=screen.availHeight;

target = parseFloat(navigator.appVersion.substring(navigator.appVersion.indexOf('.')-1,navigator.appVersion.length));
if((navigator.appVersion.indexOf("Mac")!=-1) &&(navigator.userAgent.indexOf("MSIE")!=-1)&&(parseInt(navigator.appVersion)==4))
	window.open(other,"sub",'scrollbars=yes');
	if (target >= 4){
		if (navigator.appName=="Netscape"){
  	 		var MachakFull=window.open(other,"MachakFull", resizable=yes, menubar=0, status=0, 'scrollbars=no','width='+x+',height='+y+',top=0,left=0');
			MachakFull.moveTo(0,0);
			MachakFull.resizeTo(x,y);
		}
	if (navigator.appName=="Microsoft Internet Explorer")
		window.open(Ie,"MachakFull","fullscreen=yes");
	}
}
//Lyd kontrollere=============================================================
function MM_controlSound(x, _sndObj, sndFile) { //v3.0
  var i, method = "", sndObj = eval(_sndObj);
  if (sndObj != null) {
    if (navigator.appName == 'Netscape') method = "play";
    else {
      if (window.MM_WMP == null) {
        window.MM_WMP = false;
        for(i in sndObj) if (i == "ActiveMovie") {
          window.MM_WMP = true; break;
      } }
      if (window.MM_WMP) method = "play";
      else if (sndObj.FileName) method = "run";
  } }
  if (method) eval(_sndObj+"."+method+"()");
  else window.location = sndFile;
}
//Print Window=============================================================
function printWindow(frametarget) {
bV = parseInt(navigator.appVersion);
if (bV >= 4) window.print(frametarget);
}

//Single image preview=============================================================
function imagePreview(evt,name) {
	var max_width=275;
	formName01 = document.reciver.filepreview; 
	formName02 = eval("document.form1." +name);
	formName01.value = formName02.value; 
	form1.filefelt.width=max_width;
	with ( document.all ) {
		if(formName02.value==""){
			form1.upload.disabled=true;
			form1.filefelt.border=0;
			filefelt.src = "../grafikk/seethrough.gif";
		}else{
			form1.upload.disabled=false;
			form1.filefelt.border=1;
			form1.filefelt.image=10;
			filefelt.src = formName02.value;
			if(filefelt.width!=0){
				if(filefelt.width>max_width){
					filefelt.width=max_width;
				}
			}
		}
	}
}
//Ny Oppføring text preview=============================================================
function textmultiPreview(evt,antallbilder,antallspesc) {
	if(antallbilder>=2 && antallspesc>=2){
		for(nummer=0;nummer<antallspesc && nummer<antallbilder;nummer++){
			formName01 = document.reciver.filepreview; 
			if(eval("form1.speclink"+nummer).checked==false){
				eval("spectext"+nummer).innerText="Ikke linket!";
			}else if(eval("form1.speclink"+nummer).checked==true && eval("form1.spec"+nummer).value==""){
				eval("spectext"+nummer).innerText="Spesifikasjon må fylles ut!";
			}else{
				eval("spectext"+nummer).innerText=eval("form1.spec"+nummer).value;
			}
		}
	}
}
//Ny Oppføring image preview=============================================================
function imagemultiPreview(evt,name,nummer) {
	var max_width=75;
	formName01 = document.reciver.filepreview; 
	formName02 = eval("document.form1.file" +nummer);
	formName01.value = formName02.value; 
	eval("form1.filefelt" +nummer).width=1;
	with ( document.all ) {
		if(eval("check" +nummer).checked==true){
			eval("form1.filefelt" +nummer).src = "../grafikk/seethrough.gif";
			eval("document.form1.file" +nummer).src="";
			eval("document.form1.file" +nummer).disabled=true;
		}else{
			eval("document.form1.file" +nummer).disabled=false;
		}
		if(formName02.value==""){
			eval("form1.filefelt" +nummer).border=0;
			eval("form1.filefelt" +nummer).src = "../grafikk/seethrough.gif";
		}else{
			eval("form1.filefelt" +nummer).border=1;
			eval("form1.filefelt" +nummer).image=10;
			eval("form1.filefelt" +nummer).src = formName02.value;
			if(eval("form1.filefelt" +nummer).width!=0){
				if(eval("form1.filefelt" +nummer).width<max_width){
					eval("form1.filefelt" +nummer).width=max_width;
				}
			}
		}
		if(formName02.value=="" && eval("check" +nummer).checked==true){
			eval("form1.imagetext"+nummer).disabled=true;
		}else{
			eval("form1.imagetext"+nummer).disabled=false;
		}
	}
}
//Mouseover effect=============================================================
function Chrinaldini_over(name) {
	if (document.all) {
		eval(name+".filters.alpha.opacity=100")
	}
}
function Chrinaldini_out(name) {
	if (document.all) {
		eval(name+".filters.alpha.opacity=50");
	}
}
//T3 Tekst innsetting=============================================================
function t3(name) {
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
    if (start == -1) return null;
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    output = unescape(document.cookie.substring(len,end));
	if(output!=""){
		form1.hovedtekst.value = output;
	}
}
//Deaktivering=============================================================
function upload_deactivate(name) {
	if (document.all) {
		new_button_value="Vennligst vent til opplastingen er ferdig!";
		eval("name").value=new_button_value;
		eval("name").disabled=true;
	}
}
//Dropdown Script


