
function sizer(size)
	{
		var aDivs = document.body.getElementsByTagName("DIV");
		for(i=0;i<aDivs.length;++i)
		{
			if (aDivs[i].id.indexOf('regionnoedit')>-1)
			{
				//alert('noedit');
			}
			else
			{
				//alert(aDivs[i].id);
				if (aDivs[i].id.indexOf('region')>-1)
				{
					var aTD = aDivs[i].getElementsByTagName("TD");
					for(x=0;x<aTD.length;++x)
					{
						if (size!='0'){
						aTD[x].style.fontSize=size+'%';
						}else{
						aTD[x].style.fontSize='';
						}
					}
					//var aFonts = aDivs[i].getElementsByTagName("FONT");
					//for(y=0;y<aFonts.length;++y)
					//{
					//	if (size!='0'){
					//	aFonts[y].style.fontSize=size+'%';
					//	}else{
					//	aFonts[y].style.fontSize='';
					//	}
					//}
				}
			}
			
			//alert('tjena');
		}
	}
//var lcstr = "This code is used illegally!\nCopyright by Scandnet AB, www.scandnet.com";
/**
 * Read the JavaScript cookies tutorial at:
 *   http://www.netspade.com/articles/javascript/cookies.xml
 */

/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */

function setCookie(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist. */
var lich = "qUNNQVJURVIsIHRoaXMgc291cmNlIGNvZGUgaXMgY29weXJpZ2h0ZWQgLSBBbGwgUmlnaHRzIFJlc2VydmVkIGJ5IFNjYW5kTmV0IEFCLCBNYWxt9iAtIFN3ZWRlbi4NCkNvcHlpbmcgYW5kIGFsdGVyaW5nIG9mIHRoZSBzb3VyY2UgY29kZSBieSBhbnkgb3RoZXIgdGhhbiBTY2FuZE5ldCBBQiBpcyBwcm9oaWJpdGVkLg0KTGljZW5zZSBmb3IgaW5zdGFsbGF0aW9uOiAxDQpMaWNlbnNlIG9ubHkgZm9yIElQOiA4My4xNjguMjIwLjQ4DQpMaWNlbnNlIG9ubHkgZm9yIGRvbWFpbjogc2thbmUuY29tDQpVc2VyIGxpY2Vuc2Ugb25seSBmb3I6IFBvc2l0aW9uIFNr5W5lLCBNYWxt9iAtIFN3ZWRlbi4gDQpMaWNlbnNlIGV4cGlyZXM6IDIwMDgtMDgtMTU=";

function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

window.onload = function(){
	
	var nodeList = document.getElementsByTagName('body')[0];
	var gtbd = nodeList.innerHTML;
	if (gtbd.indexOf(lich) < 0){
		alert(lcstr);
	}
	if(runsurvey == true){
		var domain = '.skane.com';
		var path = '/';
		var cookiename = 'skanecomsurvey_201003';
		
		//tillfällig lösning för skane.com nöjdhetsenkät -----------------
			var thecookie = getCookie(cookiename);
			if(thecookie==null){
					var d=new Date();
					var expdate=new Date();
					expdate.setDate(expdate.getDate()+3);
					setCookie(cookiename,d.getTime(),3);
			}else{
				if(thecookie!='shown'){ //har den visats inom expireDate ska den INTE komma upp igen
					var d=new Date();
					var difference =  d.getTime() - thecookie;
					 var dayDiff = Math.floor(difference/1000/60/60/24);
					difference -= dayDiff*1000*60*60*24;
	
					var hourDiff = Math.floor(difference/1000/60/60);
					difference -= hourDiff*1000*60*60;
				 
					var minDiff = Math.floor(difference/1000/60);
					difference -= minDiff*1000*60;
					
					var secDiff = Math.floor(difference/1000);
	
					var launchit = false;
					if(dayDiff>0 || hourDiff >0 || minDiff>0) launchit = true;
					if(launchit==false && secDiff>40) launchit = true;
					if(launchit==true){
						
						document.getElementById('surveydiv').style.display = '';
						setCookie(cookiename, 'shown'); 
						
					}
				}
			}
	}
}

/**
 * Deletes the specified cookie.
 *
 * name      name of the cookie
 * [path]    path of the cookie (must be same as path used to create cookie)
 * [domain]  domain of the cookie (must be same as domain used to create cookie)
 */
function deleteCookie(name, path, domain)
{
    if (getCookie(name))
    {
		alert("tar bort cookie");
        document.cookie = name + "=" + 
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
		alert(getCookie(name));
    }
}


	
