//////////////////////////////////////////  
//
//
//	spyka Webmaster social bookmark script
//	(c) 2008 spyka Web Group
//  http://www.spyka.net
//
//	http://www.spyka.net/scripts/easy-social-bookmarks
//
//
//////////////////////////////////////////   
var sites = new Array();
//////////////////////////////////////////  
//
//			START EDITS HERE               
//
//////////////////////////////////////////   

//	html (or any other content) before each bookmark link. e.g. &nbsp; for space or <li> for start of list item
var html_before = '&nbsp;';

//	html (or any other content) after each bookmark link. e.g. &nbsp; for space or </li> to end list item
var html_after	= '&nbsp;';

//	imagepath to icons.	set to 0 to disable icons, e.g. var imagepath = '0';
var imagepath = '/images/_common/social/';


//	bookmarks: 
//				syntax: (be sure to increase x)
//				sites[x] = new Array(Bookmark URL, Bookmark name, Icon URL);
//
//				use {url} in bookmark URL to insert current url
//				use {title} in bookmark URL to insert current page title
//
sites[0] = new Array('http://www.facebook.com/sharer.php?u={url}', 'Facebook', imagepath+'facebook.gif');

sites[1] = new Array('http://twitter.com/home?status={url}', 'Twitter', imagepath+'twitter.gif');

sites[2] = new Array('http://www.pusha.se/posta?url={url}&title={title}', 'Pusha', imagepath+'pusha.gif');

sites[3] = new Array('http://del.icio.us/post?url={url}&title={title}', 'Del.icio.us', imagepath+'delicious.gif');


//sites[0] = new Array('http://digg.com/submit?phase=2&url={url}', 'Digg', imagepath+'digg.gif');
//sites[0] = new Array('http://reddit.com/submit?url={url}&title={title}', 'reddit', imagepath+'reddit.gif');
//sites[0] = new Array('http://furl.net/storeIt.jsp?t={title}&u={url}', 'Furl', imagepath+'furl.gif');
//sites[0] = new Array('http://www.stumbleupon.com/submit?url={url}', 'Stumble', imagepath+'stumble.gif');

//////////////////////////////////////////  
//
//			END EDITS HERE               
//
//////////////////////////////////////////   
function swgbookmarks()
{
	for(i = 0; i < sites.length; i++)
	{
		var g = sites[i];
		var u = g[0];
		u = u.replace('{url}', escape(window.location.href));
		u = u.replace('{title}', escape(encode_utf8(window.document.title)));
		var img = (imagepath == '0') ? '' : '<img src="'+g[2]+'" alt="'+g[1]+'" />';
		var k = '<a href="'+u+'">'+img+g[1]+'</a>&nbsp;';
		//var k = '<a href="'+u+'">'+img+'</a>';
		window.document.write(html_before+k+html_after);				
	}
}

function encode_utf8( s )
{
  return unescape( encodeURIComponent( s ) );
}




// dropdown select location change

function selsub(Url) {
  Url=document.subsites.sites[document.subsites.sites.selectedIndex].value;
  document.location = Url;
}

var excludeUrls = Array(

		
		'http://www.novartisfoundation.org/',
		'http://www.novartis-venturefunds.com',
		'http://www.ADHDinfo.com',
		'http://www.buckleys.com',
		'http://www.clozaril.com',
		'http://www.combipatch.com',
		'http://www.cubicin.com',
		'http://www.estraderm.com',
		'http://www.exforge.com',
		'http://www.focalinxr.com',
		'http://www.gas-x.com',
		'http://www.lamisilk.com',
		'http://www.lescolxl.com',
		'http://www.maaloxus.com',
		'http://www.myfortic.com',
		'http://www.prodiem.ca',
		'http://www.proleukin.com',
		'http://www.tasigna.com',
		'http://www.tekturna.com',
		'http://www.theraflu.com',
		'http://www.thrive2quit.com',
		'http://www.transdermscop.com',
		'http://www.tyzeka.com',
		'http://tyzeka.com',
		'http://www.us.trileptal.com',
		'http://www.vivelledot.com',
		'http://www.voltaren.co.za',
		'http://www.zaditor.com',
		'http://cws.huginonline.com',
		'http://hugin.info',
		'http://www.hugin.info',
		'http://dominoext.novartis.com',
		'http://download.macromedia.com',
		'http://etrials.novartis.com',
		'http://gaia.world-television.com',
		'http://infra.novartis.com',
		'http://mfile.akamai.com',
		'http://nibr.novartis.com',
		'http://novcont05.eu.novartis.net',
		'http://qsm3.asp.quartal.com',
		'http://search.novartis.com',
		'http://services.choruscall.com',
		'http://streamstudio.unit.net',
		'http://streamstudio.world-television.com',
		'http://web.gnf.org',
		'http://www.acromegalyinfo.com',
		'http://www.adhdinfo.com',
		'http://www.ah.novartis.com',
		'http://www.ar.novartis.com',
		'http://www.at.novartis.com',
		'http://www.benefiber.com',
		'http://www.blt.ch',
		'http://www.chiron.com',
		'http://www.cibavision.com',
		'http://www.coartem.com',
		'http://www.comtan.com',
		'http://www.consumer-health.se.novartis.com',
		'http://www.consumerhealth.eg.novartis.com',
		'http://www.corporatecitizenship.novartis.com',
		'http://www.corporate-ir.net',
		'http://www.denavir.com',
		'http://www.deramaxx.novartis.us',
		'http://www.diovan.com',
		'http://www.diovan.info',
		'http://www.elidel.com',
		'http://www.enablex.com',
		'http://www.estradot.com',
		'http://www.excedrin.com',
		'http://www.exelon.com',
		'http://www.exjade.com',
		'http://www.famvir.com',
		'http://www.femara.com',
		'http://www.femarainfo.com',
		'http://www.fenistil.ch',
		'http://www.flea-info.com',
		'http://www.flycontrol.novartis.com',
		'http://www.fmi.ch',
		'http://www.foradil.com',
		'http://www.foradil.us',
		'http://www.fungalnailinfection.com',
		'http://www.gerber.com',
		'http://www.gleevec.com',
		'http://www.glivec.com',
		'http://www.global-hr.orientation.novartis.com',
		'http://www.habitrol.com',
		'http://www.hk.novartis.com',
		'http://www.hu.novartis.com',
		'http://www.id.novartis.com',
		'http://www.in.pharma.novartis.com',
		'http://www.international.myeczema.com',
		'http://www.jubilaeumsstiftung.novartis.com',
		'http://www.kerilotion.com',
		'http://www.lamisil.com',
		'http://www.lamisilat.com',
		'http://www.locations.novartis.com',
		'http://www.lotrel.com',
		'http://www.malariaandhealth.com',
		'http://www.mea.novartis.com',
		'http://www.miacalcin.com',
		'http://www.nibr.novartis.com',
		'http://www.nicotinell.com',
		'http://www.nightanddaycontacts.com',
		'http://www.nitd.novartis.com',
		'http://www.novartis-consumer-health.ch',
		'http://www.novartis-consumerhealth.de',
		'http://www.novartis-transplant.com',
		'http://www.novartis-vaccines.com',
		'http://www.novartis.at',
		'http://www.novartis.be',
		'http://www.novartis.ca',
		'http://www.novartis.ch',
		'http://www.novartis.co.jp',
		'http://www.novartis.co.kr',
		'http://www.novartis.co.uk',
		'http://www.novartis.com',
		'http://www.novartis.com.au',
		'http://www.novartis.com.br',
		'http://www.novartis.com.cn',
		'http://www.novartis.com.co',
		'http://www.novartis.com.mx',
		'http://www.novartis.com.tr',
		'http://www.novartis.cz',
		'http://www.novartis.de',
		'http://www.novartis.dk',
		'http://www.novartis.es',
		'http://www.novartis.fi',
		'http://www.novartis.fr',
		'http://www.novartis.gr',
		'http://www.novartis.is',
		'http://www.novartis.it',
		'http://www.novartis.nl',
		'http://www.novartis.no',
		'http://www.novartis.pl',
		'http://www.novartis.ru',
		'http://www.novartis.se',
		'http://www.novartisclinicaltrials.com',
		'http://www.novartisconsumerhealth.ca',
		'http://www.novartisconsumerhealth.es',
		'http://www.novartisconsumerhealth.nl',
		'http://www.novartisfound.org.uk',
		'http://www.novartisfoundation.com',
		'http://www.novartisoncology.com',
		'http://www.novartisophthalmics.com',
		'http://www.novartisvaccines.com',
		'http://www.o2optix.com',
		'http://www.pharma.us.novartis.com',
		'http://www.prexige.com',
		'http://www.rescula.com',
		'http://www.ritalin.com',
		'http://www.sandostatin.com',
		'http://www.sandoz.com',
		'http://www.stalevo.com',
		'http://www.starlix.com',
		'http://www.tbdots.com',
		'http://www.tiamutin.com',
		'http://www.triaminic.com',
		'http://www.trileptal.com',
		'http://www.us.cibavision.com',
		'http://www.us.novartis.com',
		'http://www.us.novartisoncology.com',
		'http://www.us.novartisophthalmics.com',
		'http://www.us.sandostatin.com',
		'http://www.us.zometa.com',
		'http://www.venturefund.novartis.com',
		'http://www.visudyne.com',
		'http://www.xolair.com',
		'http://www.zelmac.ch',
		'http://www.zelnorm.com',
		'http://www.zometa.com'
		  );

function checkScore(){
			
		 var error = 0;
		 var finalCount = 0
		 var answer1 = getSelectedRadioValue(document.forms['quizForm'].elements['question1']);
		 var answer2 = getSelectedRadioValue(document.forms['quizForm'].elements['question2']);
		 var answer3 = getSelectedRadioValue(document.forms['quizForm'].elements['question3']);
		 var answer4 = getSelectedRadioValue(document.forms['quizForm'].elements['question4']);
		 var answer5 = getSelectedRadioValue(document.forms['quizForm'].elements['question5']);
		 var answer6 = getSelectedRadioValue(document.forms['quizForm'].elements['question6']);

		 	
		 	if (answer1 == "false"){
       document.getElementById("error1").style.display="block";
       error = 1;
		 	} else {
		 		document.getElementById("error1").style.display="none";
		 	}
		 	
		 	
		 	if (answer2 == "false"){
       document.getElementById("error2").style.display="block";
       error = 1;
		 	}else {
		 		document.getElementById("error2").style.display="none";
		 	}
		 	
		 	if (answer3 == "false"){
       document.getElementById("error3").style.display="block";
       error = 1;
		 	} 	else {
		 		document.getElementById("error3").style.display="none";
		 	}
		 	
		 	if (answer4 == "false"){
       document.getElementById("error4").style.display="block";
       error = 1;
		 	}	else {
		 		document.getElementById("error4").style.display="none";
		 	}
		 	
		 	if (answer5 == "false"){
       document.getElementById("error5").style.display="block";
       error = 1;
		 	}	else {
		 		document.getElementById("error5").style.display="none";
		 	}
		 	
		 	if (answer6 == "false"){
       document.getElementById("error6").style.display="block";
       error = 1;
		 	}else {
		 		document.getElementById("error6").style.display="none";
		 	}
		 	
		 	if(error==1){
		 		return false;	
		 	}
		 	
}
function getSelectedRadio(buttonGroup) {
   // returns the array number of the selected radio button or -1 if no button is selected
   if (buttonGroup[0]) { // if the button group is an array (one button is not an array)
      for (var i=0; i<buttonGroup.length; i++) {
         if (buttonGroup[i].checked) {
            return i
         }
      }
   } else {
      if (buttonGroup.checked) { return 0; } // if the one button is checked, return zero
   }
   // if we get to this point, no radio button is selected
   return -1;
} // Ends the "getSelectedRadio" function

function getSelectedRadioValue(buttonGroup) {
   // returns the value of the selected radio button or "" if no button is selected
   var i = getSelectedRadio(buttonGroup);
   if (i == -1) {
      return "false";
   } else {
      if (buttonGroup[i]) { // Make sure the button group is an array (not just one button)
         return true//buttonGroup[i].value;
      } else { // The button group is just the one button, and it is checked
         return true//buttonGroup.value;
      }
   }
} // Ends the "getSelectedRadioValue" function

function getSelectedCheckbox(buttonGroup) {
   // Go through all the check boxes. return an array of all the ones
   // that are selected (their position numbers). if no boxes were checked,
   // returned array will be empty (length will be zero)
   var retArr = new Array();
   var lastElement = 0;
   if (buttonGroup[0]) { // if the button group is an array (one check box is not an array)
      for (var i=0; i<buttonGroup.length; i++) {
         if (buttonGroup[i].checked) {
            retArr.length = lastElement;
            retArr[lastElement] = i;
            lastElement++;
         }
      }
   } else { // There is only one check box (it's not an array)
      if (buttonGroup.checked) { // if the one check box is checked
         retArr.length = lastElement;
         retArr[lastElement] = 0; // return zero as the only array value
      }
   }
   return retArr;
} // Ends the "getSelectedCheckbox" function

function getSelectedCheckboxValue(buttonGroup) {
   // return an array of values selected in the check box group. if no boxes
   // were checked, returned array will be empty (length will be zero)
   var retArr = new Array(); // set up empty array for the return values
   var selectedItems = getSelectedCheckbox(buttonGroup);
   if (selectedItems.length != 0) { // if there was something selected
      retArr.length = selectedItems.length;
      for (var i=0; i<selectedItems.length; i++) {
         if (buttonGroup[selectedItems[i]]) { // Make sure it's an array
            retArr[i] = buttonGroup[selectedItems[i]].value;
         } else { // It's not an array (there's just one check box and it's selected)
            retArr[i] = buttonGroup.value;// return that value
         }
      }
   }
   return retArr;
} // Ends the "getSelectedCheckBoxValue" function


function printResult(){
var count = 0;	
var answer1= getParameter("question1");
var answer2= getParameter("question2");
var answer3= getParameter("question3");
var answer4= getParameter("question4");
var answer5= getParameter("question5");
var answer6= getParameter("question6");


if(answer1 == 1){
	count = count +1;
document.getElementById("question1").style.display="block";
}

if(answer2 == 1){
	count = count +1;
document.getElementById("question2").style.display="block";
}
if(answer3 == 1){
	count = count +1;
document.getElementById("question3").style.display="block";
}
if(answer4 == 1){
	count = count +1;
document.getElementById("question4").style.display="block";
}
if(answer5 == 1){
	count = count +1;
document.getElementById("question5").style.display="block";
}
if(answer6 == 1){
	count = count +1;
document.getElementById("question6").style.display="block";
}

//document.getElementById("result").innerHTML = "Du har svaret ja til "+count+" ud af 6 sp&oslash;rgsm&aring;l";
document.getElementById("result").innerHTML = "Du har svarat ja till "+count+" av 6 fr&aring;gor";



} 

function getParameter(name) {
   var url = window.location.href;
   var paramsStart = url.indexOf("?");

   if(paramsStart != -1){

      var paramString = url.substr(paramsStart + 1);
      var tokenStart = paramString.indexOf(name);

      if(tokenStart != -1){

         paramToEnd = paramString.substr(tokenStart + name.length + 1);
         var delimiterPos = paramToEnd.indexOf("&");

         if(delimiterPos == -1){
            return paramToEnd;
         }
         else {
            return paramToEnd.substr(0, delimiterPos);
         }
      }
   }
}
/*
Instructions.
Alle elements that are required must contain 'id="Req"'
The form that is to be validated must have the same id as the variable 'formId'
@author Timmi,www.daman.dk,timmi@daman.dk
Version 1.2 17/11/2008 
*/

	//----Don't touch------
	var formId = "validateForm"; //id of the form
	 //array for holding passwords
	//----------------------
	
function validering(){
	
	var mandatoryError = document.getElementById("mandatoryError").value+"<br>";
	var emailFormatError = document.getElementById("emailFormatError").value+"<br>";
	var lengthError = document.getElementById("lengthError").value+"<br>";
	var maxLength = document.getElementById("maxLength").value;

	
	//local variables
	var count = 0;
	var error= 0;
	var errorMan = 0;
	var passArr = new Array();
	var errorMsg ="";
	
	

	// get all elements in the form
	var elem = document.getElementById(formId).elements;
	for(var i = 0; i < elem.length; i++){
		
		//check if element is mandatory
		if (elem[i].id == "Req"){
				//check if element is empty
				if (elem[i].value.length != 0){ 
					//element is not empty, do nothing	
				} else {
					//element is empty, set error
					errorMan = 1;
					error = 1;

				}
	} //end if req
}	
	
	//email validation
if(document.getElementById("replyTo") != null){
	
	email = document.getElementById("replyTo").value;
	
	apos=email.indexOf("@");
	dotpos=email.lastIndexOf(".");
	if (apos<1||dotpos-apos<2){
		error=1;
		errorMsg += emailFormatError;
  	}
}

//Check if message is null
if(document.getElementById("message") != null){
		if(document.getElementById(formId).message.value.length > maxLength){
	errorMsg += lengthError;
	error = 1;
	}
}


	if (error == 1){
		//form was filled incorrectly
		if (errorMan == 1){
			errorMsg += mandatoryError;
	}
		document.getElementById("valMsg").innerHTML = "<p>"+errorMsg+"</p>";
		document.getElementById("valMsg").style.display="block";
		return false;
	} else {
		//form was filled correctly
		return true;
	} //end error=1
}//end function


function validering2(){
	
	var mandatoryError = document.getElementById("mandatoryError").value+"<br>";
	var emailFormatError = document.getElementById("emailFormatError").value+"<br>";


	
	//local variables
	var count = 0;
	var error= 0;
	var errorMan = 0;
	var passArr = new Array();
	var errorMsg ="";
	var errorMail="";

	// get all elements in the form
	var elem = document.getElementById(formId).elements;
	for(var i = 0; i < elem.length; i++){
		
		//check if element is mandatory
		if (elem[i].id == "Req"){
				//check if element is empty
				if (elem[i].value.length != 0){ 
					//element is not empty, do nothing
					
					if(elem[i].name == "SendFromEmail" || elem[i].name == "SendToEmail" ){
						email = elem[i].value;
	
						apos=email.indexOf("@");
						dotpos=email.lastIndexOf(".");
						if (apos<1||dotpos-apos<2){
							error=1;
							errorMail = 1;
							
					  	}
					}
						
				} else {
					//element is empty, set error
					errorMan = 1;
					error = 1;

				}
	} //end if req
}	
	


	if (error == 1){
		//form was filled incorrectly
		if (errorMan == 1){
			errorMsg += mandatoryError;
	}
	if (errorMail == 1){
			errorMsg += emailFormatError;
	}
	
	
	
		document.getElementById("valMsg").innerHTML = "<p>"+errorMsg+"</p>";
		document.getElementById("valMsg").style.display="block";
		return false;
	} else {
		//form was filled correctly
		return true;
	} //end error=1
}//end function




function tbTest_focus(e,o){
if(!o.firstTime){
	o.firstTime=true
	o.defaultText = o.value;
	o.value=""

	return
	}

	if(o.value == "" ){
		o.value = o.defaultText;
		o.firstTime = false
	}
	
}

function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}