/******************************************************************************
* javascript.js                                                               *
*******************************************************************************
* Invotech Solutions CMS		                                              *
* =========================================================================== *
* Software Version:           IS CMS 1.1                                      *
* Software by:                Invotech Solutions (http://www.invotech.se)	  *
* Copyright 2004-2007 by:     Invotech Solutions HB (http://www.invotech.se)  *
* Support:  				  kontakt@invotech.se	                          *
*******************************************************************************
* Detta program är reglerat av licensavtal av Invotech Solutions		      *
*                                                                             *
* Se "license.txt" för deltaljer om Invotech Solutions HB licensavtal.	      *
*																			  *
******************************************************************************/

function addslashes(str)
{
	str=str.replace(/\'/g,'\\\'');
	str=str.replace(/\"/g,'\\"');
	str=str.replace(/\\/g,'\\\\');
	str=str.replace(/\0/g,'\\0');
	return str;
}
function stripslashes(str)
{
	str=str.replace(/\\'/g,'\'');
	str=str.replace(/\\"/g,'"');
	str=str.replace(/\\\\/g,'\\');
	str=str.replace(/\\0/g,'\0');
	return str;
}

function getOffsetX(oNode)
{
	var iOffsetLeft = 0;

	while(oNode.offsetParent)
	{
		iOffsetLeft += oNode.offsetLeft;
		oNode = oNode.offsetParent;
	}

	iOffsetLeft += document.body.offsetLeft;

	return iOffsetLeft;
}

function getOffsetY(oNode)
{
	var iOffsetTop = 0;

	while(oNode.offsetParent)
	{
		//alert(oNode.type);
		iOffsetTop += oNode.offsetTop;
		oNode = oNode.offsetParent;
	}

	iOffsetTop += document.body.offsetTop;
	
	return iOffsetTop;
}

function evenemang(id,key) {
var open_var = ("http://www.eventonline.se/anmalan.php?eid=" + id + "&key=" + key);
	SkrivUtWnd = window.open(open_var, "anmalan", "width=332,height=650,status=no,location=no,menubar=no,scrollbars=yes,toolbar=no,resizable=no");
	SkrivUtWnd.focus();
	return;
}

function checkSIZE()
{

	if(document.getElementById)
	{	
		var eventscroll = document.getElementById('eventscroll');
		var myDiv = document.getElementById("myDiv");
	}
	else 
		if(document.all)
			{
				var eventscroll = document.getElementById('eventscroll');			
				var myDiv = document.all['myDiv'];
			}


	var temp = eventscroll.offsetHeight;
	if(temp > 400)
	{
		eventscroll.style.height = 400;
		eventscroll.style.overflow = 'auto';
	}
	
	var h = myDiv.offsetHeight + 43;
	var w = 763;
	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	
	w = w+60;
	h = h+47;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
			w = w + 50;
			h = h + 18;
	 }
	}
	
	window.resizeTo(w,h); 
}

var ajaxObjects = new Array();
function calendar_nav(str,element)
{
	var ajaxqs = "";
	var ajaxIndex = ajaxObjects.length;	
	ajaxObjects[ajaxIndex] = new sack();
	var ajaxqs = "&ajax=true";

	if(element)
		ajaxObjects[ajaxIndex].element = element;
	
	ajaxObjects[ajaxIndex].onCompletion = function() {/*alert(ajaxObjects[ajaxIndex].response);*/ ajaxObjects[ajaxIndex].element.innerHTML = ajaxObjects[ajaxIndex].response; } ;	// Specify function that will be executed after file has been found
	
	ajaxObjects[ajaxIndex].requestFile = str + ajaxqs;	// Specifying which file to get
//alert(ajaxObjects[ajaxIndex].requestFile);
	ajaxObjects[ajaxIndex].runAJAX(); // Execute AJAX function
}

