function checkSelect(no, sIndex, logging) {
    if (logging) {
        var pageId = 'none';
        switch (sIndex) {
            case 0:
                pageId = 'coai0006';
                break;
            case 1:
                pageId = 'coai0007';
                break;
            case 2:
                pageId = 'coai0008';
                break;
            case 3:
                pageId = 'coai0009';
                break;
            case 4:
                pageId = 'coai0010';
                break;
            case 5:
                pageId = 'coai0011';
                break;
        }
//      eCrm.log({'pageId': pageId, 'onload': function () { checkSelect(no, sIndex); }});
        eCrm.log({'pageId': pageId});
        setTimeout("checkSelect(" + no + ", " + sIndex + ")", 500);
        return;
    }	

    var linkPath = document.forms[0].elements[no].options[sIndex].value;

    if (linkPath != '') {
        if (linkPath.substr(0,4) == 'EXT=') {
            linkPath = linkPath.substring(4,linkPath.length);
            top.location.href = linkPath;
        }
        self.location.href = linkPath;
    }
}

	
/*		function checkSelect(no,sIndex) {
			var linkPath = document.forms[0].elements[no].options[sIndex].value;
			if (linkPath != '') {
				if (linkPath.substr(0,4) == 'EXT=') {
					linkPath = linkPath.substring(4,linkPath.length);
					top.location.href = linkPath;
				}
				self.location.href = linkPath;
			}
		}
*/

function OpenWindow(url) {
var w = "1000";
var h = "700";
var scroll ="1";
var resizable ="1";
var menu = "1";
var statusbar = "1";
var tool ="1";
var winbreite = (screen.width - w) / 2;
var winhoehe = (screen.height - h) / 2;
winprops = 'scrollbars='+scroll+',resizable='+resizable+',menubar='+menu+', status='+statusbar+', toolbar='+tool+'';
win = window.open(url, "fenster2", winprops);
win.window.focus(); 
}

function checkPopup() {
	if (document.location.href.indexOf("pr_account") != -1) {
		openWin('/pbl/cms/cms/products/pages/konto_karte/cori3624_index.html',490,270,0,0);
	}
	if (document.location.href.indexOf("landing_cori3802") != -1) {
		openWin('/pbl/cms/cms/products/pages/konto_karte/cori3802_index.html',490,370,0,0);
	}
	 if (document.location.href.indexOf("landing_cori3873") != -1) {
	  openWin('/pbl/cms/cms/direct/cori3873_index.html',660,480,0,0);
	 }

	 if (document.location.href.indexOf("landing_cori3874") != -1) {
	  openWin('/pbl/cms/cms/direct/cori3874_index.html',660,480,0,0);
	 }

	 if (document.location.href.indexOf("landing_cori4120") != -1) {
		var where = '/pbl/cms/cms/direct/cori4120_re_micro_baufi_interhyp.html';
		window.open(where, "Baufinanzierung", "height=600, width=1050, scrollbars=yes, resizable=yes");
 	 }

	 if (document.location.href.indexOf("landing_cori4395") != -1) {
	  openWin('/pbl/cms/cms/direct/cori4395_index.html',640,720,0,1);
	 }

	 if (document.location.href.indexOf("landing_cori4796") != -1) {
          openWin('/pbl/cms/cms/direct/cori4796_weihnachtskarte_2007.html',815,550,0,0);
	 }
	 
	 if (document.location.href.indexOf("landing_cori5328") != -1) {
          openWin('/pbl/cms/cms/direct/cori5328_weihnachtskarte_2008.html',815,550,0,0);
	 }
	 
	 if (document.location.href.indexOf("demokonto") != -1) {
	  OpenWindow('/pbl/cms/cms/onlinedemo/pages/onlinedemo_index.html');
	 }

	 // Umfrage
	 if (document.location.href.indexOf("landing_leserumfrage_compass") != -1) {
 	 //alert('Umfrage compass');
	 var where = 'http://survey9.rogator.de/rogator/comdirect_umfrage/leser09/';
	 window.open(where, "Umfrage", "height=600, width=800, scrollbars=yes, resizable=yes");
	 }	

	 // Services
	 if (document.location.href.indexOf("landing_service") != -1) {
openWin('/pbl/cms/cms/products/media/services_preview/flash_services_preview.html','1025','645','0','0');
	 }

	 // TEST: meine comdirect
	 if (document.location.href.indexOf("landing_leistungsspektrum") != -1) {
	  openWin('/pbl/cms/cms/products/media/leistungspektrum/flash_test_0608.html','1025','662','0','0');
	 }

	
}

checkPopup();