﻿// JScript File


function doUnload()
{
 if (window.event.clientX < 0 && window.event.clientY < 0)
 {
   //alert("Window is closing...");
   showEvaluationOnClose();
 }
}


function showEvaluation()
{
//alert("visa utvärdering");
window.open("/utvardering.aspx", "utvardering","location=0,status=0,scrollbars=1,width=450,height=640"); 
}

function showEvaluationOnClose()
{
window.open("/utvardering.aspx?closed=true", "utvardering","location=0,status=0,scrollbars=1,width=450,height=640"); 
}

function showPoll()
{
//alert("visa utvärdering");
window.open("/arets_kooperativ.aspx", "arets_kooperativ","location=0,status=0,scrollbars=1,width=900,height=740"); 
}



function showHide(strElement)
{

if (document.getElementById(strElement).style.display == "block")
{
    document.getElementById(strElement).style.display = "none";
    document.getElementById("Image" + strElement).src = "/images/system/plus.gif"
}

else
{
    document.getElementById(strElement).style.display = "block";
    document.getElementById("Image" + strElement).src = "/images/system/minus.gif"
}

}



<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


// Bookmark
//-------------------------------------------------
/* Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}
//-------------------------------------------------


//-------------------------------------------------
function infoOpen(x)
{
	window.open("/InfoSpec.aspx?ID=" + x + "", "infospec", "width=400,height=450,menubar=no,status=no,resizable=yes,scrollbars=yes");
}
//-------------------------------------------------


//-------------------------------------------------
function openPopup(url,width,height)
{
    var a_int_windowWidth = 600;
    var a_int_windowHeight = 700;

    var int_windowLeft = (screen.width - a_int_windowWidth) / 2;
    var int_windowTop = (screen.height - a_int_windowHeight) / 2;
  
    window.open(url, null, "height="+ height +",width="+ width +",top="+ int_windowTop + ",left=" + int_windowLeft +",status=yes,toolbar=yes,scrollbars=yes,location=no,menubar=yes,resizable=yes");
}
//-------------------------------------------------


function popupNamedWin(URL, winName, width, height)
{
	window.open(URL,winName,"width="+ width +", height="+ height +", status=no, resizable=yes, left=100, top=20, scrollbars, dependent, toolbar=no");
}


//-------------------------------------------------
function fill(obj, text)
{

if (text == "") text = "Sök";

    if (obj.value == "")
    {
		//fill
		obj.value = text;
		
	}

}
//-------------------------------------------------



//-------------------------------------------------
function empty(obj,text)
{

if (text == "") text = "Sök";

    if (obj.value == text)
    {
    	//empty
		obj.value = "";		
	}
}
//-------------------------------------------------


function refreshPage(URL)
{
	document.location=window.location; //URL;
}



//	TinyMCE 

var image_form_win;

function fileBrowserCallBack(field_name, url, type, win) {

	image_form_win = win;

	if(type=="image")
	{
		window.open("/website_admin/admin/tinymce/valj_bild.aspx?fild_name="+ field_name +"&window_name="+ win.name +"","selectImage", "toolbar=no,scrollbars=yes,resizable=yes,width=1000,height=750"); 
	}

	else
	{
		window.open("/website_admin/admin/tinymce/valj_lank.aspx?fild_name="+ field_name +"&window_name="+ win.name +"","selectImage", "toolbar=no,scrollbars=yes,resizable=yes,width=1000,height=750"); 
	}
}


function getImageURLFromOther(field_name,url)
{
	image_form_win.document.forms[0].elements["src"].value = url;
}


function putValueInForm(field_name,strElement,strValue)
{

if(strElement=="alt")
	image_form_win.document.forms[0].elements["alt"].value = strValue;
}



function getURLFromOther(field_name,url)
{
	image_form_win.document.forms[0].elements["href"].value = url;
}

//	Slut TinyMCE 







//-->



