objects = document.getElementsByTagName("object");
for (var i = 0; i < objects.length; i++)
{
objects[i].outerHTML = objects[i].outerHTML;
}


//function pageHeight() {return window.innerHeight != null? window.innerHeight: document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight:document.body != null? document.body.clientHeight:null;}
function getPageSize(){
		var x,y;
		if (self.innerHeight) // all except Explorer
		{
			x = self.innerWidth;
			y = self.innerHeight;
		}
		else if (document.documentElement && document.documentElement.clientHeight)
			// Explorer 6 Strict Mode
		{
			x = document.documentElement.clientWidth;
			y = document.documentElement.clientHeight;
		}
		else if (document.body) // other Explorers
		{
			x = document.body.clientWidth;
			y = document.body.clientHeight;
		}


		var x1,y1;
		var test1 = document.body.scrollHeight;
		var test2 = document.body.offsetHeight
		if (test1 > test2) // all but Explorer Mac
		{
			x1 = document.body.scrollWidth;
			y1 = document.body.scrollHeight;
		}
		else // Explorer Mac;
			 //would also work in Explorer 6 Strict, Mozilla and Safari
		{
			x1 = document.body.offsetWidth;
			y1 = document.body.offsetHeight;
		}

		arrayPageSize = new Array(x,y,x1,y1) 
		return arrayPageSize;
}

function printResource(url){

    window.open(url,'printwindow','top=50,left=50,width=1000,height=700,menubar=yes,scrollbars=yes');

}

/* leaving site message*/

 function leave(link){
 
   text = "";
   if (getCook() == "") {
    text = "You are leaving www.mdct.net. The information contained in the new selected website and the opinions\ntherein expressed do not necessarily reflect the opinions of Springer; nor does Springer confirm them.";
   } else if (getCook() == "ch")  {
    text = "您将离开mdct.net网站。您选择的新网站的内容和建议不代表Springer的建议，并未受到Springer的认可";
   }
   if (confirm(text))
     window.open(link,'ext');
 }

 function leave2(){
 
   if (getCook() == "") {
    text = "You are leaving www.mdct.net. The information contained in the new selected website and the opinions\ntherein expressed do not necessarily reflect the opinions of Springer; nor does Springer confirm them.";
   } else if (getCook() == "ch")  {
    text = "您将离开mdct.net网站。您选择的新网站的内容和建议不代表Springer的建议，并未受到Springer的认可";
   }
   if (confirm(text))
     document.searchMDCT.submit();
 }

/*popUp*/
function openCenteredPopUp(url, title, features){


    width=screen.availWidth;
    left=(width/2) - parseInt(getFeaturesParameter(features, 'width'))/2;

    height=screen.availHeight;
    tops=(parseInt(height)/2) - parseInt(getFeaturesParameter(features, 'height'))/2;

    window.open(url, title, features + ',left=' + left + ',top=' + tops);


} 

function searchDbChange(rb){

        radioColl = document.getElementById('searchDiv').getElementsByTagName('input');

        if(rb.value != 1){

                for(i = 0; i < radioColl.length; i++){
                        if(radioColl[i].name == 'whereMDCT'){
                                radioColl[i].disabled = true;
                        }
                }


        }else{

                for(i = 0; i < radioColl.length; i++){
                        if(radioColl[i].name == 'whereMDCT'){
                                radioColl[i].disabled = false;
                        }
                }

        }

}



function getFeaturesParameter(features, parName){

    paramValue = '';
    pind = features.indexOf(parName) + parName.length;
    pind++;
    while(features.charAt(pind) != '' && features.charAt(pind) != ','){
        paramValue += features.charAt(pind);
        pind++;
    }

    return paramValue;
}

 function apriVid(lv,lv2,lv3){

    openCenteredPopUp('http://mdct.smm-srl.it/eng/symposia/videoplayer/playerfset.php?lv='+lv+'&lv2='+lv2+'&lv3='+lv3+'&chDiv='+lv3,'pop','width=700, height=520,scrollbars=no');
 
 }
 

 
function chSt(id){

      if (document.getElementById(id).style.display == "")
        document.getElementById(id).style.display="none";
	  else	   
	    document.getElementById(id).style.display=""; 
		
		document.getElementById('mp').style.color="#003d6e";
		document.getElementById('tc').style.color="#003d6e";
		document.getElementById('pp').style.color="#003d6e";
		document.getElementById('cs').style.color="#003d6e";
		document.getElementById('n').style.color="#003d6e";
		
      switch (id)
	  {
	    case "mdctProt" :{
     	  document.getElementById('patPrep').style.display="none";
		  document.getElementById('cmSaf').style.display="none";
		  document.getElementById('techCons').style.display="none";
		 document.getElementById('new').style.display="none";
		  document.getElementById('mp').style.color="#FF9933";
		 break;
		}
		case "techCons" :{
     	  document.getElementById('patPrep').style.display="none";
		  document.getElementById('cmSaf').style.display="none";
		  document.getElementById('mdctProt').style.display="none";
		  document.getElementById('new').style.display="none";
		  document.getElementById('tc').style.color="#FF9933";
		 break;
		}
	    case "patPrep" :{
     	  document.getElementById('techCons').style.display="none";
		  document.getElementById('cmSaf').style.display="none";
		  document.getElementById('mdctProt').style.display="none";
		  document.getElementById('new').style.display="none";
		  document.getElementById('pp').style.color="#FF9933";
		 break;
		}
		case "cmSaf" :{
     	  document.getElementById('patPrep').style.display="none";
		  document.getElementById('techCons').style.display="none";
		  document.getElementById('mdctProt').style.display="none";
		  document.getElementById('new').style.display="none";
		  document.getElementById('cs').style.color="#FF9933";
		 break;
		}
		
		case "new" :{
     	  document.getElementById('patPrep').style.display="none";
		  document.getElementById('cmSaf').style.display="none";
		  document.getElementById('techCons').style.display="none";
		  document.getElementById('mdctProt').style.display="none";
		  document.getElementById('n').style.color="#FF9933";
		 break;
		}
		
	    default:break;
	  }
     
	
	
}

function chArea(val){
	window.open("/signUp/chArea.php?ar="+val,"ar","top=200,left=400,width=220,height=203,scrollbars=0,resizable=0");	
}

function openPopUp (url,name,spec){
	window.open(url,name,spec);	
}

function getFeaturesParameter(features, parName){

    paramValue = '';
    pind = features.indexOf(parName) + parName.length;
    pind++;
    while(features.charAt(pind) != '' && features.charAt(pind) != ','){
        paramValue += features.charAt(pind);
        pind++;
    }

    return paramValue;
}


function openCenteredPopUp(url, title, features){


    width=screen.availWidth;
    left=(width/2) - parseInt(getFeaturesParameter(features, 'width'))/2;

    height=screen.availHeight;
    tops=(parseInt(height)/2) - parseInt(getFeaturesParameter(features, 'height'))/2;

    window.open(url, title, features + ',left=' + left + ',top=' + tops);


}
/*endPopUp*/

/*swapImages*/
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];}
}
/*endSwapImage*/

function outSite(url){
   
   if (confirm("You are leaving www.mdct.net. The information contained in the new selected website\n may not comply with the opinions therein expressed, and do not necessarily reflect the opinions of Springer; nor does Springer confirm them.")) 
       return true; 
   else 
       return false;	   
	
}

/* Navigation Guide*/

function toggleNavGuide() {
	
	var guideTable = document.getElementById('navGuide');
	var guideArrowImg = document.getElementById('guideArrow');
	
	if (guideTable.style.display == 'none') {
		guideTable.style.display = '';
		guideArrowImg.src = '/mdct/img/arrowWhiteOnAzzGrayDown.gif';
	}else{
		guideTable.style.display = 'none';
		guideArrowImg.src = '/mdct/img/arrowWhiteOnAzzGrayDx.gif';
	}
}

/*CT Findings Answer 01*/

function findingsAnswer01() {
	
	var rb = document.findingsForm01.Q1_F;
	var selVal = 0;
	
	for (i = 0; i < rb.length; i++) {
		
		if(rb[i].checked) {
			selVal = rb[i].value;
			break;
		}
	}
	
	if (selVal == 0) {
		alert('Please, choose an option.');	
	}else if(selVal == 3) {
		window.location = '03C.jsp';	
	}else {
		window.location = '03W.jsp';	
	}
}

/*Possible Diagnosis Answer 01*/

function diagnosisAnswer01() {
	
	var rb = document.diagnosisForm01.Q2_PD;
	var selVal = 0;
	
	for (i = 0; i < rb.length; i++) {
		
		if(rb[i].checked) {
			selVal = rb[i].value;
			break;
		}
	}
	
	if (selVal == 0) {
		alert('Please, choose an option.');	
	}else if(selVal == 5) {
		window.location = '05.jsp';	
	}else {
		window.location = '05W.jsp';	
	}
}

/*CT Findings Answer 02*/

function findingsAnswer02() {
	
	var rb = document.findingsForm02.Q1_F;
	var selVal = 0;
	
	for (i = 0; i < rb.length; i++) {
		
		if(rb[i].checked) {
			selVal = rb[i].value;
			break;
		}
	}
	
	if (selVal == 0) {
		alert('Please, choose an option.');	
	}else if(selVal == 2) {
		window.location = '03C.jsp';	
	}else {
		window.location = '03W.jsp';	
	}
}

/*Possible Diagnosis Answer 02*/

function diagnosisAnswer02() {
	
	var rb = document.diagnosisForm02.Q2_PD;
	var selVal = 0;
	
	for (i = 0; i < rb.length; i++) {
		
		if(rb[i].checked) {
			selVal = rb[i].value;
			break;
		}
	}
	
	if (selVal == 0) {
		alert('Please, choose an option.');	
	}else if(selVal == 3) {
		window.location = '05.jsp';	
	}else {
		window.location = '05W.jsp';	
	}
}


if(navigator.appName.indexOf('Microsoft Internet Explorer') != -1){bch = 0;}
else if(navigator.appName.indexOf('Netscape') != -1){bch = 1;}
else{ bch = 0;}


function initLayerAs(){



	var top = 190;

	//if(navigator.userAgent.indexOf("Macintosh") != -1)

	//	top -= 3;



	document.write('<div id=\"searchDiv\" style=\" top: ' + top + 'px; left: 0; background-color: #0b2540; position:absolute; width:259px;  visibility:hidden; border-left:1px solid #CCCCCC; border-bottom:1px solid #CCCCCC;\">');

	//document.write('<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">');

//	document.write('<tr><td>&nbsp;</td></tr>');

//	document.write('<tr><td class=\"white\" style="padding-top: 5px; padding-bottom: 5px; padding-left: 23px"><strong><a href=\"01.jsp\">Listed by Topic</a></strong></td></tr>');

//	document.write('<tr><td class=\"white\" style="padding-top: 5px; padding-bottom: 5px; padding-left: 23px"><strong><a href=\"#\" onClick=\"return false;\">Listed by Symposia</a></strong></td></tr>');

//	document.write('</table>');

	document.write('<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center"  style="margin-bottom: 10px; margin-top: 10px">');

	document.write('<tr>');

	document.write('<td valign="top">');

	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');

	document.write('<tr>');

	document.write('<td width="23"><input id="whereID" name="where" onClick="searchDbChange(this);" type="radio" value="1" checked/></td>');

	document.write('<td width="5">&nbsp;</td>');

	document.write('<td valign="middle" bgcolor="#153c63" style="padding-left: 3px"><p class="small" style="color: white">MDCT.net</p></td>');

	document.write('</tr>');

/*	document.write('<tr>');

	document.write('<td><input name="where" onClick="searchDbChange(this);" type="radio" value="2" /></td>');

	document.write('<td>&nbsp;</td>');

	document.write('<td valign="middle"  style="padding-left: 3px"><p class="small" style="color: white">the Web </p></td>');

*/	document.write('</tr>');

	document.write('<tr>');

	document.write('<td><input name="where" id="whereID3" onClick="searchDbChange(this);" type="radio" value="3" /></td>');

	document.write('<td>&nbsp;</td>');

	document.write('<td valign="middle" style="padding-left: 3px"><p class="small" style="color: white">SpringerLink</p></td>');

	document.write('</tr>');

	document.write('<tr>');

	document.write('<td><input name="where" id="whereID4" onClick="searchDbChange(this);" type="radio" value="4" /></td>');

	document.write('<td>&nbsp;</td>');

	document.write('<td valign="middle" style="padding-left: 3px"><p class="small" style="color: white">PubMed</p></td>');

	document.write('</tr>');

	document.write('</table>');

	document.write('</td>');

	document.write('<td>');

	document.write('<table width="100%" bgcolor="#153c63" border="0" cellspacing="0" cellpadding="0">');

	document.write('<tr>');

	document.write('<td width="23"><input id="whereMDCTID1" name="whereMDCT" type="radio" value="1" checked /></td>');

	document.write('<td width="5">&nbsp;</td>');

        if (getCook() == "") 
        	document.write('<td valign="middle"><p class="small" style="color: white">all MDCT.net</p></td>');
        else if (getCook() == "ch") 
        	document.write('<td valign="middle"><p class="small" style="color: white">所有MDCT.net</p></td>');

	document.write('</tr>');

	document.write('<tr>');

	document.write('<td><input id="whereMDCTID2" name="whereMDCT" type="radio" value="2" /></td>');

	document.write('<td>&nbsp;</td>');

        if (getCook() == "") 
        	document.write('<td valign="middle"><p class="small" style="color: white">Clinical Cases</p></td>');
        else if (getCook() == "ch") 
        	document.write('<td valign="middle"><p class="small" style="color: white">临床病例</p></td>');

	document.write('</tr>');

	document.write('<tr>');

	document.write('<td><input id="whereMDCTID3" name="whereMDCT" type="radio" value="3" /></td>');

	document.write('<td>&nbsp;</td>');

        if (getCook() == "") 
        	document.write('<td valign="middle"><p class="small" style="color: white">Protocols</p></td>');
        else if (getCook() == "ch") 
        	document.write('<td valign="middle"><p class="small" style="color: white">治疗方案</p></td>');

	document.write('</tr>');

	document.write('<tr>');

	document.write('<td><input id="whereMDCTID4" name="whereMDCT" type="radio" value="4" /></td>');

	document.write('<td>&nbsp;</td>');

        if (getCook() == "") 
        	document.write('<td valign="middle"><p class="small" style="color: white">e-Lectures</p></td>');
        else if (getCook() == "ch") 
        	document.write('<td valign="middle"><p class="small" style="color: white">电子教程</p></td>');

	document.write('</tr>');

	document.write('</table>');

	document.write('</td>');

	document.write('</tr>');

	document.write('<tr>');

	document.write('<td align="right" colspan="2" valign="middle"><a style="font-size:9px; color:#FFFFFF;" href="#" onclick="asClick(\'searchDiv\',\'asCell\',\'asCellOk\',\'asLink\');return false;" >[&nbsp;X&nbsp;]</a>&nbsp;&nbsp;</td>');        
        document.write('</td>');

	document.write('</tr>');

	document.write('</table>');


	document.write('</div>');

	document.getElementById('searchDiv').style.opacity = 1;
  /*       
        if (typeof document.getElementById('searchDiv').style.filter !='undefined') 
            document.getElementById('searchDiv').style.filter = "alpha(opacity=0)";

        
	if (typeof document.getElementById('searchDiv').style.filter !='undefined') 
            document.getElementById('searchDiv').style.filter.item('alpha').opacity = 100;

 
	if (document.getElementById('searchDiv').filters) 
            document.getElementById('searchDiv').style.filter = "alpha(opacity=0)";


	if (document.getElementById('searchDiv').filters) 
            document.getElementById('searchDiv').filters.item('alpha').opacity = 100;
*/



	document.write('<div onMouseOver=\"divOnAs(\'loginDiv\')\" onMouseOut=\"toHideDivAs(\'loginDiv\',\'loginTd\',\'\',\'loginLink\')\" id=\"loginDiv\" style=\"top: ' + top + 'px; left: 0; background-color: #7D972F; position:absolute; width:299px; z-index:1; visibility:hidden\">');

	document.write('<form name=\"xmlLoginForm\" onSubmit="return xmlLogin(this);">');
	document.write('<table width="80%" border="0" cellspacing="0" cellpadding="0" align="center"  style="margin-bottom: 10px; margin-top: 10px">');

	document.write('<tr>');

	document.write('<td colspan=\"2\">&nbsp;</td>');
	document.write('</tr>');
	document.write('<tr>');

	document.write('<td style=\"color: white\">Email:</td><td><input class=\"search\" type=\"text\" style=\"width:140px\" name=\"username\"></td>');
	document.write('</tr>');
	document.write('<tr>');

	document.write('<td style=\"color: white; padding-top: 15px;\">Password:</td><td style=\"padding-top: 15px;\"><input class=\"search\"  style=\"width:140px\" type=\"password\" name=\"password\"></td>');

	document.write('</tr>');
	document.write('<tr>');

	document.write('<td style=\"padding-top: 15px;\">&nbsp;</td><td style=\"padding-top: 15px;\"><table width=\"100%\" border="0" cellspacing=\"0\" cellpadding=\"0\"><tr><td><input type=\"submit\" name=\"loginBtnDiv\" value=\"Login\"></td><td style="padding-left: 15px"><span style=\"display: none; color: white\" id=\"loginErr\">Wrong user name or password</span></td></tr></table></td>');

	document.write('</tr>');
	document.write('<tr>');

	document.write('<td colspan=\"2\">&nbsp;</td>');
	document.write('</tr>');
	document.write('</table>');
	document.write('</form>');

	document.write('</div>');

/*
	if (document.getElementById('loginDiv').filters) 
             document.getElementById('loginDiv').style.filter = "alpha(opacity=0)";

	if (document.getElementById('loginDiv').filters) 
             document.getElementById('loginDiv').filters.item('alpha').opacity = 100;


	if (typeof document.getElementById('loginDiv').style.filter !='undefined') 
             document.getElementById('loginDiv').style.filter = "alpha(opacity=0)";

	if (typeof document.getElementById('loginDiv').style.filter !='undefined') 
             document.getElementById('loginDiv').filters.item('alpha').opacity = 100;

*/
        assignSearch();
}


function asClick(d,c,okc,asl){

    if(document.getElementById(d).style.visibility == "visible"){

        divInHtml = document.getElementById("asClickDiv").innerHTML;
        divInHtml = divInHtml.replace("Close","Advanced Search");
        document.getElementById("asClickDiv").innerHTML = divInHtml;

        hideDivAs(d,c,okc,asl);
    }else{

        divInHtml = document.getElementById("asClickDiv").innerHTML;
        divInHtml = divInHtml.replace("Advanced Search","Close");
        document.getElementById("asClickDiv").innerHTML = divInHtml;

        showDivAs(d,c,okc,asl);
      
    }

}

function showDivAs(d,c,okc,asl){



	//divOnAs(d);

	
        if(d == 'searchDiv')

		shLeft = setLeft() + 620;
	else
		shLeft = setLeft() + 0;


	document.getElementById(d).style.left = shLeft + "px";

	document.getElementById(d).style.visibility= "visible";



	//document.getElementById(c).style.backgroundColor = '#7D972F';
	/*if(okc != '')

		document.getElementById(okc).style.backgroundColor = '#7D972F';
        */
	document.getElementById(asl).style.color = 'white';

}



function toHideDivAs(d,c,okc,asl){

	eval("AsTimeout" + d + " = setTimeout(\"hideDivAs('" + d + "','" + c + "','" + okc + "','" + asl + "')\", 40);");

}



function hideDivAs(d,c,okc,asl){

	document.getElementById(d).style.visibility = "hidden";

	//document.getElementById(c).style.backgroundColor = "#EBEBEB";
	/*if(okc != '')

		document.getElementById(okc).style.backgroundColor = "#EBEBEB";
        */ 
	document.getElementById(asl).style.color = "#999999";

}



function divOnAs(d){

	eval("toType = typeof(AsTimeout" + d + ");");

	if(toType != "undefined"){

		eval("clearTimeout(AsTimeout" + d + ");");

	}

}



function setLeft(){



            if(navigator.appName.indexOf("Netscape")!=-1){

                    if(window.innerWidth < 860)

                            return 0;

                    else if (navigator.userAgent.indexOf("Safari") != -1){

                            return ((window.innerWidth - 860)/2) + 1;

		    }else{

			    return ((window.innerWidth - 860)/2) - 8;

		    }

            }

            else{

                    if(window.innerWidth < 860)

                            return 0;

                    else

                            return ((document.body.offsetWidth - 860)/2) + 1;



            }

    }



function makePostRequest(url, f, handler){


	var http_request = false;
	
	
	if (window.XMLHttpRequest) {
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject) {
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	
	if(!http_request){
		alert("XMLHTTPRequest not supported.");
		return false;
	}

	eval("http_request.onreadystatechange = function(){ " + handler + "(http_request,f); };");
	http_request.open("POST", url, true);
	http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

	var fieldStr = "";

	for (var i = 0; i < f.elements.length; i++){

		if( i == 0)
			fieldStr = f.elements[i].name + "=" + encodeURIComponent(f.elements[i].value);
		else
			fieldStr += "&" + f.elements[i].name + "=" + encodeURIComponent(f.elements[i].value);
	}
	
	http_request.send(fieldStr);

}

function xmlLogin(f){

    document.getElementById('loginErr').style.display = 'none';
    for (var i = 0; i < f.elements.length; i++){
        f.elements[i].disabled = true;
    }

    makePostRequest('http://www.mdct.net/mdct/eng/login/xml_login.jsp',f,'xmlLoginDisplay');

    return false;
}

function xmlLoginDisplay(http_request,f){

	if(http_request.readyState == 4){
		if(http_request.status == 200){
			var xmldoc = http_request.responseXML;
			var root_node = xmldoc.documentElement;
			var mess = "yes";//root_node.firstChild.firstChild.firstChild.nodeValue;

			if(mess == "yes"){
				location.reload();
				for (var i = 0; i < f.elements.length; i++){
        				f.elements[i].disabled = false;
    				}
                        }
			else{
				for (var i = 0; i < f.elements.length; i++){
        				f.elements[i].disabled = false;
    				}
			    	document.getElementById('loginErr').style.display = '';

                        }

		}else{
			alert("Connection problem.");
		}
	}

}


/*
 search configuration check
*/


function checkSearchConf(){

 var coll = document.getElementById("searchDiv").getElementsByTagName("input");
 var ww = "";
 var ww2 = "";

 for (i=0;i< coll.length;i++){
 
   if ((coll[i].name == "where") && (coll[i].checked == true))
      ww = coll[i].value;
 }

 if (ww == "1") {
   for (i=0;i< coll.length;i++){
 
   if ((coll[i].name == "whereMDCT") && (coll[i].checked == true))
      ww2 = coll[i].value;
   }

   if (ww2 == "1") 
     document.getElementById("index").value = "htsearchMDCT";
   else if (ww2 == "2")   
     document.getElementById("index").value = "htsearchMDCTCC";
   else if (ww2 == "3") 
     document.getElementById("index").value = "htsearchMDCTPR";
   else if (ww2 == "4") 
     document.getElementById("index").value = "htsearchMDCTEL";
   else
     document.getElementById("index").value = "htsearchMDCT";

   document.searchMDCT.action="/mdct/eng/seInt/index.html";
   document.searchMDCT.target="_self";
   document.getElementById("wordText").name="query";
   document.searchMDCT.submit();

 } else if (ww == "4") {
  /* pubmed */

  document.searchMDCT.action="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?CMD=search&DB=pubmed";
  document.searchMDCT.encoding="application/x-www-form-urlencoded";
  document.searchMDCT.target="_blank";
  document.getElementById("searchConfig").value="pubmed";
  document.getElementById("wordText").name="term";

  Go('search');

 } else if (ww == "3") {
  /* springerlink */ 
  document.searchMDCT.target="_self";
  document.getElementById("wordText").name="k";
  document.getElementById("searchConfig").value="springerlink";
  document.searchMDCT.action="Javascript: goSpLink(document.getElementById('wordText').value)";
  //leave2();
  document.searchMDCT.submit();
 }
  
  
 }

function goSpLink(val){

  window.open("http://www.springerlink.com/content/?k="+val,'',''); 

}

function assignSearch(){

 var wwid= "";
 var wwid2= "";
 
 if (document.getElementById("searchConfig").value == "htsearchMDCT") {wwid="whereID"; wwid2="whereMDCTID1";}
 else if (document.getElementById("searchConfig").value == "htsearchMDCTPR") {wwid="whereID"; wwid2="whereMDCTID3";}
 else if (document.getElementById("searchConfig").value == "htsearchMDCTCC") {wwid="whereID"; wwid2="whereMDCTID2";}
 else if (document.getElementById("searchConfig").value == "htsearchMDCTEL") {wwid="whereID"; wwid2="whereMDCTID4";}
 else if (document.getElementById("searchConfig").value == "pubmed") {wwid="whereID4"; wwid2="";}
 else if (document.getElementById("searchConfig").value == "springerlink") {wwid="whereID3"; wwid2="";}
 

 var coll = document.getElementById("searchDiv").getElementsByTagName("input");
 var ww = "";
 var ww2 = "";

 for (i=0;i< coll.length;i++){

   if (coll[i].id == wwid)
     coll[i].checked = "true";

   if (coll[i].id == wwid2)
     coll[i].checked = "true";
 }

  

}

function assignSearchSE(){

 var wwid= "";
 var wwid2= "";
 
 if (document.getElementById("searchConfig").value == "htsearchMDCT") {wwid="whereID"; wwid2="whereMDCTID1";}
 else if (document.getElementById("searchConfig").value == "htsearchMDCTPR") {wwid="whereID"; wwid2="whereMDCTID3";}
 else if (document.getElementById("searchConfig").value == "htsearchMDCTCC") {wwid="whereID"; wwid2="whereMDCTID2";}
 else if (document.getElementById("searchConfig").value == "htsearchMDCTEL") {wwid="whereID"; wwid2="whereMDCTID4";}
 else if (document.getElementById("searchConfig").value == "pubmed") {wwid="whereID4"; wwid2="";}
 else if (document.getElementById("searchConfig").value == "springerlink") {wwid="whereID3"; wwid2="";}
 

 var coll = document.getElementsByTagName("input");
 var ww = "";
 var ww2 = "";

 for (i=0;i< coll.length;i++){

   if (coll[i].id == wwid)
     coll[i].checked = "true";

   if (coll[i].id == wwid2)
     coll[i].checked = "true";
 }

  

}


/* pubmed search facility*/

function Go(cmd)
{
    inGo=true;
    var frm = document.searchMDCT;
    var sel = frm.db;
    frm.CMD.value = escape(cmd);
    if ( cmd =='Pager' ) { frm.cmd.value = ''; }  else { frm.cmd.value = cmd; }
    AddLimits();
    var q = frm.action;
    frm.action = q.substring(0, q.indexOf('?')) + '?CMD=' +frm.CMD.value + '&DB='+sel.value;
    leave2();
    inGo=false;
}

function AddLimits()
{
  var frm = document.searchMDCT;
  var sel = frm.db;
  if (sel.value == "pubmed" ) {
    var a = Element("auth_dd");
    if( a != null ) {
      AddToQuery('author_','Auth','pmfilter_AuthOp','AND',false);
    }
    var j = Element("journ_dd");
    if( j != null ) {
      AddToQuery('journ_','Jour','','OR',true);
    }
  }
}

function Element(id)
{
  if (document.getElementById!=null) {
    return document.getElementById(id);
  }
  if (document.all!=null) {
    return document.all[id];
  }
  if (document.layers!=null) {
    return document.layers[id];
  }
  return null;
}

/* for search engine*/


function initLayerAsSE(){



	var top = 285;

	//if(navigator.userAgent.indexOf("Macintosh") != -1)

	//	top -= 3;


	document.write('<div onMouseOver=\"divOnAs(\'loginDiv\')\" onMouseOut=\"toHideDivAs(\'loginDiv\',\'loginTd\',\'\',\'loginLink\')\" id=\"loginDiv\" style=\"top: ' + top + 'px; left: 0; background-color: #7D972F; position:absolute; width:299px; z-index:1; visibility:hidden\">');

	document.write('<form name=\"xmlLoginForm\" onSubmit="return xmlLogin(this);">');
	document.write('<table width="80%" border="0" cellspacing="0" cellpadding="0" align="center"  style="margin-bottom: 10px; margin-top: 10px">');

	document.write('<tr>');

	document.write('<td colspan=\"2\">&nbsp;</td>');
	document.write('</tr>');
	document.write('<tr>');

	document.write('<td style=\"color: white\">Email:</td><td><input class=\"search\" type=\"text\" style=\"width:140px\" name=\"username\"></td>');
	document.write('</tr>');
	document.write('<tr>');

	document.write('<td style=\"color: white; padding-top: 15px;\">Password:</td><td style=\"padding-top: 15px;\"><input class=\"search\"  style=\"width:140px\" type=\"password\" name=\"password\"></td>');

	document.write('</tr>');
	document.write('<tr>');

	document.write('<td style=\"padding-top: 15px;\">&nbsp;</td><td style=\"padding-top: 15px;\"><table width=\"100%\" border="0" cellspacing=\"0\" cellpadding=\"0\"><tr><td><input type=\"submit\" name=\"loginBtnDiv\" value=\"Login\"></td><td style="padding-left: 15px"><span style=\"display: none; color: white\" id=\"loginErr\">Wrong user name or password</span></td></tr></table></td>');

	document.write('</tr>');
	document.write('<tr>');

	document.write('<td colspan=\"2\">&nbsp;</td>');
	document.write('</tr>');
	document.write('</table>');
	document.write('</form>');

	document.write('</div>');

	if (document.getElementById('loginDiv').filters) document.getElementById('loginDiv').style.filter = "alpha(opacity=0)";

	if (document.getElementById('loginDiv').filters) document.getElementById('loginDiv').filters.item('alpha').opacity = 100;


        assignSearchSE();
}


function searchDbChangeSE(rb){

        radioColl = document.getElementsByTagName('input');

        if(rb.value != 1){

                for(i = 0; i < radioColl.length; i++){
                        if(radioColl[i].name == 'whereMDCT'){
                                radioColl[i].disabled = true;
                        }
                }


        }else{

                for(i = 0; i < radioColl.length; i++){
                        if(radioColl[i].name == 'whereMDCT'){
                                radioColl[i].disabled = false;
                        }
                }

        }

}


function checkSearchConfSE(){

 var coll = document.getElementsByTagName("input");
 var ww = "";
 var ww2 = "";

 for (i=0;i< coll.length;i++){
 
   if ((coll[i].name == "where") && (coll[i].checked == true))
      ww = coll[i].value;
 }

 if (ww == "1") {
   for (i=0;i< coll.length;i++){
 
   if ((coll[i].name == "whereMDCT") && (coll[i].checked == true))
      ww2 = coll[i].value;
   }

   if (ww2 == "1") 
     document.getElementById("index").value = "htsearchMDCT";
   else if (ww2 == "2")   
     document.getElementById("index").value = "htsearchMDCTCC";
   else if (ww2 == "3") 
     document.getElementById("index").value = "htsearchMDCTPR";
   else if (ww2 == "4") 
     document.getElementById("index").value = "htsearchMDCTEL";
   else
     document.getElementById("index").value = "htsearchMDCT";

   document.searchMDCT.action="/mdct/eng/seInt/index.html";
   document.searchMDCT.target="_self";
   document.getElementById("wordText").name="query";
   document.searchMDCT.submit();

 } else if (ww == "4") {
  /* pubmed */

  document.searchMDCT.action="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?CMD=search&DB=pubmed";
  document.searchMDCT.encoding="application/x-www-form-urlencoded";
  document.searchMDCT.target="_blank";
  document.getElementById("searchConfig").value="pubmed";
  document.getElementById("wordText").name="term";

  Go('search');

 } else if (ww == "3") {
  /* springerlink */ 
  document.searchMDCT.target="_self";
  document.getElementById("wordText").name="k";
  document.getElementById("searchConfig").value="springerlink";
  document.searchMDCT.action="Javascript: goSpLink(document.getElementById('wordText').value)";
  //leave();
  document.searchMDCT.submit();

 }
  
  
 }

/* per nuovo motore ricerca interno */

function checkSearchConfSENew(){

 var coll = document.getElementsByTagName("input");
 var ww = "";
 var ww2 = "";

 for (i=0;i< coll.length;i++){
 
   if ((coll[i].name == "where") && (coll[i].checked == true))
      ww = coll[i].value;
 }

 if (ww == "1") {
   for (i=0;i< coll.length;i++){
 
   if ((coll[i].name == "whereMDCT") && (coll[i].checked == true))
      ww2 = coll[i].value;
   }

   if (ww2 == "1") 
     document.getElementById("index").value = "htsearchMDCT";
   else if (ww2 == "2")   
     document.getElementById("index").value = "htsearchMDCTCC";
   else if (ww2 == "3") 
     document.getElementById("index").value = "htsearchMDCTPR";
   else if (ww2 == "4") 
     document.getElementById("index").value = "htsearchMDCTEL";
   else
     document.getElementById("index").value = "htsearchMDCT";

   document.search.action="";
   document.search.target="_self";
   document.getElementById("wordText").name="query";
   document.search.submit();

 } else if (ww == "4") {
  /* pubmed */

  document.search.action="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?CMD=search&DB=pubmed";
  document.search.encoding="application/x-www-form-urlencoded";
  document.search.target="_blank";
  document.getElementById("searchConfig").value="pubmed";
  document.getElementById("wordText").name="term";

  Go2('search');

 } else if (ww == "3") {
  /* springerlink */ 
  document.search.target="_self";
  document.getElementById("wordText").name="k";
  document.getElementById("searchConfig").value="springerlink";
  document.search.action="Javascript: goSpLink(document.getElementById('wordText').value)";
  //leave();
  document.search.submit();

 }
  
  
 }

function Go2(cmd)
{
    inGo=true;
    var frm = document.search;
    var sel = frm.db;
    frm.CMD.value = escape(cmd);
    if ( cmd =='Pager' ) { frm.cmd.value = ''; }  else { frm.cmd.value = cmd; }
    AddLimits2();
    var q = frm.action;
    frm.action = q.substring(0, q.indexOf('?')) + '?CMD=' +frm.CMD.value + '&DB='+sel.value;
    leave3();
    inGo=false;
}

function AddLimits2()
{
  var frm = document.search;
  var sel = frm.db;
  if (sel.value == "pubmed" ) {
    var a = Element("auth_dd");
    if( a != null ) {
      AddToQuery('author_','Auth','pmfilter_AuthOp','AND',false);
    }
    var j = Element("journ_dd");
    if( j != null ) {
      AddToQuery('journ_','Jour','','OR',true);
    }
  }
}

 function leave3(){
 
   text = "You are leaving www.mdct.net. The information contained in the new selected website and the opinions\ntherein expressed do not necessarily reflect the opinions of Springer; nor does Springer confirm them.";
   if (confirm(text))
     document.search.submit();
 }

/* fine nuovo motore ricerca interno */

 function gesCol(val){

  var i = 1;

  while (eval("document.getElementById('colInt"+i+"1')") != null) {
 
   idColo = eval("document.getElementById('colInt"+i+"1')"); 
   if (("col"+i+"1") == (val+"1"))
     idColo.style.display = "";  
   else    
     idColo.style.display = "none";  
   i++;
  }

 
 }


function mm() {

 if (window.location.href.indexOf("?")  == -1) {

  document.write("We are sorry, but the newsletter activation procedure could not be completed.  <br /><br />You may manually subscribe to the newsletter by logging in and <a href=\"/mdct/eng/account/profile.html\">modifying your profile.</a>  <br /><br />Thank you for your interest in MDCT.net.<br /><br />Your MDCT.net Team");
 
 } else {

  document.write("The Newsletter has already been activated for this account.<br /><br />If you wish to unsubscribe,  <a href=\"/mdct/eng/account/profile.html\">login in and modify your profile</a>  <br /><br />Thank you for your interest in MDCT.net.<br /><br />Your MDCT.net Team");

 }

}

function getCook() {

if ((document.cookie != null) && (document.cookie != "undefined") && (document.cookie != "")) { 

 coo = "" +document.cookie;
 ind = coo.indexOf("MDCT_LANG_VAL");
 if (ind == -1) 
  return "";
 ind1= coo.indexOf(';',ind);
 if (ind1 == -1)   
  ind1 = coo.length;
  if (unescape(coo.substring(ind+14,ind1)) == "en")
    return "";
  else 
    return unescape(coo.substring(ind+14,ind1));
 
} else {
  return "";
}

}

/* language select section */

  function siteLang(lang) {
  
    var name = "MDCT_LANG_VAL";
    var value = lang;
    var path = "/";
    var domain = "mdct.net";

    var expiration_date = new Date();
    expiration_date.setTime(expiration_date.getTime() + (1000 * 60 * 60 * 24 * 365));

    if (lang == "en") {

        var cookie_string = escape (name) + "=" + escape (value) + "; expires=" + expiration_date ;
	cookie_string += "; path=" + path + "; domain=" + domain;
        document.cookie = cookie_string;

    } else if (lang == "ch") {

        var cookie_string = escape (name) + "=" + escape (value) + "; expires=" + expiration_date ;
	cookie_string += "; path=" + path + "; domain=" + domain;
        document.cookie = cookie_string;
   
    } else { 

    }

    window.location.reload();

  }

/* end language select section */




function limitText(limitField, limitNum) {
    if (limitField.value.length > limitNum) {
        limitField.value = limitField.value.substring(0, limitNum);
    } 
}

function checkSurvey() {

 f = document.surveyForm;

 if ((f.r1[0].checked == false) && (f.r1[1].checked == false) && (f.r1[2].checked == false) && (f.r1[3].checked == false) && (f.r1[4].checked == false)) {
  alert("Please answer Question 1");
  return false;
 } 

 if ((f.r2[0].checked == false) && (f.r2[1].checked == false) && (f.r2[2].checked == false) && (f.r2[3].checked == false) && (f.r2[4].checked == false)) {
  alert("Please answer Question 2");
  return false;
 } 

 f1 = f.r3_1.options[f.r3_1.selectedIndex].value; 
 f2 = f.r3_2.options[f.r3_2.selectedIndex].value;
 f3 = f.r3_3.options[f.r3_3.selectedIndex].value;
 f4 = f.r3_4.options[f.r3_4.selectedIndex].value;
 f5 = f.r3_5.options[f.r3_5.selectedIndex].value;

 if ( (f1*f2*f3*f4*f5) != 120) {
  alert("Please give a preference order to items in Question 3");
  return false;
 } 

 if ((f.r4[0].checked == false) && (f.r4[1].checked == false)) {
  alert("Please answer Question 4");
  return false;
 } 

 if ((f.r5[0].checked == false) && (f.r5[1].checked == false)) {
  alert("Please answer Question 5");
  return false;
 } 

 if (f.why5.value=="") {
  alert("Please explain answer to Question 5");
  return false;
 } 

 if ((f.r6[0].checked == false) && (f.r6[1].checked == false)) {
  alert("Please answer Question 6");
  return false;
 } 

 if (f.comments.value=="") {
  alert("Please leave your comments");
  return false;
 } 

 f.submit(); 

}