 function login_ok(){

  bb.command.show(document.getElementById('MENUDIV'));
  execload('general/loadpage.jsp','applmainview');
  execload('general/showlogo.jsp','customDiv');
  start_pull();
 }


function login()
	{
		     	bb.document.getElementById('applmainpanel').setAttribute('class','applmainpanel_div_logon');

					execload('general/logout.jsp','PARTNERDIV');

				  execload('general/login_userxml.jsp','PARTNERDIV');



	}

function videoclip(filename){

	var SH= (typeof window.innerHeight != 'undefined' ? window.innerHeight : document.body.offsetHeight)-50;
	var SW = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth)- 15;
  
  if (SW<1100 || SH < 830) {
    bb.document.getElementById('fullFlash').setAttribute('width',SW);		
    bb.document.getElementById('fullFlash').setAttribute('height',SH);	
   SH=SH-30;
  SW=SW-20;	
  execload('videoclip.jsp?filename='+filename+'&height='+SH+'&width='+SW,'fullFlash');
 	
  }
  else
  {
  
 
  SH='840';
  SW='1390';
  bb.document.getElementById('fullFlash').setAttribute('width',SW);		
  bb.document.getElementById('fullFlash').setAttribute('height',SH);
   SH=SH-40;
  SW=SW-20;	
//      alert('videoclip.jsp?filename='+filename+'&height='+SH+'&width='+SW);		
  execload('videoclip.jsp?filename='+filename+'&height='+SH+'&width='+SW,'fullFlash');

  }
   bb.document.getElementById('fullFlash').setAttribute('open','true');		

}

function sPDF(cusid,filename){
 if(cusid!=null) cusid='/'+cusid;

	document.availHeight= (typeof window.innerHeight != 'undefined' ? window.innerHeight : document.body.offsetHeight)-15;
	document.availWidth= (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth)- 15;
   bb.document.getElementById('fullPDF').setAttribute('height',document.availHeight+'px');		
  bb.document.getElementById('fullPDF').setAttribute('width',document.availWidth+'px');		

   execload('showfile.jsp?filename='+cusid+'/'+filename+'.pdf&height='+document.availHeight+'px','fullPDFdiv');
   bb.document.getElementById('fullPDF').setAttribute('open','true');		

}

function showdetail(docid,grafikid){ 	
    var SH= (typeof window.innerHeight != 'undefined' ? window.innerHeight : document.body.offsetHeight)-50;
	var SW = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth)- 15;
  
  if (SW<1100 || SH < 830) {
  bb.document.getElementById('homedetail').setAttribute('width',SW);		
  bb.document.getElementById('homedetail').setAttribute('height',SH);
 }
      
      gPoint= document.getElementById('showscreendumpimg');
      gPoint1= document.getElementById('showadsimg');
      showadsimg
      if (grafikid==null){gPoint.src='resources/Cat_grafik_07_NY_duo.jpg';gPoint1.src='resources/Cat_grafik_07_NY_duo.jpg'; }
      else
      {
      	gPoint.src='resources/Cat_grafik_'+grafikid+'_NY_duo.jpg';
      	gPoint1.src='resources/Cat_grafik_'+grafikid+'_NY_duo.jpg';
     	
      	}
      
      execload('showdoc.jsp?docid='+docid,'homedetail_div');
      
      
      
      bb.document.getElementById('homedetail').setAttribute('open','true');	

}

function  showcalculator(){ 	
    var SH= (typeof window.innerHeight != 'undefined' ? window.innerHeight : document.body.offsetHeight)-50;
	var SW = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth)- 15;
  
  if (SW<1100 || SH < 830) {
  bb.document.getElementById('homedetail').setAttribute('width',SW);		
  bb.document.getElementById('homedetail').setAttribute('height',SH);
 }
      bb.command.load('pricecalc/pricecalcmain.jsp', 'GET', null, null,bb.document.getElementById('homedetail_div'),'replaceChildren',null,null,null,false);

      bb.document.getElementById('homedetail').setAttribute('open','true');	

}






function show_partner(docid){ 	
    var SH= (typeof window.innerHeight != 'undefined' ? window.innerHeight : document.body.offsetHeight)-50;
	var SW = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth)- 15;
  
  if (SW<1100 || SH < 830) {
  bb.document.getElementById('beforepartnermodal').setAttribute('width',SW);		
  bb.document.getElementById('beforepartnermodal').setAttribute('height',SH);
 }
      execload('showdoc.jsp?docid='+docid,'beforePARTNERDIV');
     
       bb.document.getElementById('beforepartnermodal').setAttribute('open','true');	

}




  
	

	function show_screendump(docid){ 	
     
     
    //  bb.document.getElementById('showscreendumpimg').src="Screendumps/"+docid;
      
      document.getElementById('showscreendumpimg').src="Screendumps/"+docid;
  //    alert( document.getElementById('showscreendumpimg').src);
	   
    

}
  
  function show_ads(docid){ 	
     
 //     document.getElementById('showadsimg').src="showads/"+docid;
 //      document.getElementById('showscreendumpimg').src="showads/"+docid;

//      document.gemad="showads/"+docid;
     
     
          
}	
		function show_screendump_blank(){ 	
  
  //   alert(document.getElementById('showscreendumpimg').src)
   
 //     bb.document.getElementById('showscreendumpimg').src="Screendumps/blank.jpg"
      document.getElementById('showscreendumpimg').src=document.gemad;
   
}
     

	
		
function sHTML(cusid,filename){
 if(cusid!=null) cusid='/'+cusid;
 execload('showfile.jsp?filename='+cusid+'/'+filename+'.html&height=660px','sp');
}

function bbHTML(filename){
 execload(filename+'.html','sp');
}

function bbHTMLhome(filename){
   execload(filename+'.html','detail');
   bb.document.getElementById('detail').setAttribute('open','true');		
}



function execload(urlstring,targetDiv,metode,loadseq){
	if(targetDiv) document.getElementById(targetDiv).setAttribute("url",urlstring);

    function fnSuccess(oRequest,oElement) {
  /*          alert("success " + oRequest.status + " " + oRequest.statusText)
            var test_response = oElement
            alert(test_response)
    */    }

    function fnUnSuccess_2(oRequest,oElement)
    {

    	 alert("Internal Error: Restart your application" + oRequest.status + " " + oRequest.statusText);
    	 alert(urlstring);
    	 catpError('Internal Error: Restart your application',urlstring,'','BREAK');

    }

    function fnUnSuccess_1(oRequest,oElement)
    {
        bb.command.load(urlstring, metode, null, null, bb.document.getElementById(targetDiv),'replaceChildren',fnSuccess,fnUnSuccess_2,null,false);

    }

    function fnUnSuccess(oRequest,oElement)
    {
    		bb.command.load(urlstring, metode, null, null, bb.document.getElementById(targetDiv),'replaceChildren',fnSuccess,fnUnSuccess_1,null,false);

    }

     if (targetDiv==null) {targetDiv='loadDiv'}
     if (metode==null) {metode='GET'}

     if (navigator.appName == "Netscape"){

	     if (loadseq=='async')
	     {
	     		bb.command.load(urlstring, metode, null, null, bb.document.getElementById(targetDiv),'replaceChildren',fnSuccess,fnUnSuccess);
				}
				else
					{
			 		bb.command.load(urlstring, metode, null, null, bb.document.getElementById(targetDiv),'replaceChildren',fnSuccess,fnUnSuccess,null,false);
				}
	    }

	    else

	    {
	    	if (loadseq=='async')
	     {
	     		bb.command.load(urlstring, metode, null, null, bb.document.getElementById(targetDiv),'replaceChildren',fnSuccess,null);
				}
				else
					{
			 		bb.command.load(urlstring, metode, null, null, bb.document.getElementById(targetDiv),'replaceChildren',fnSuccess,fnUnSuccess,null,false);
				}

	    }


 	}


function hideandshow(offid,onid) {

 /*         var oAnimationInfo = {attributeName: "display",
							attributeType: "CSS",
							dur: "10ms",
							to: "none",
							fill: "freeze"
					}

					bb.smil.animate(document.getElementById(offid), oAnimationInfo);
*/

         if(onid!=null) bb.command.show(document.getElementById(onid));
         bb.command.hide(document.getElementById(offid));


 /*
				var oAnimationInfo = {attributeName: "opacity",
							attributeType: "CSS",
							dur: "2s",
							to: "1.0",
							fill: "freeze"
					}



					if(onid!=null)bb.smil.animate(document.getElementById(onid), oAnimationInfo);
         
*/


		}
		

function fadein(eid){

var oAnimationInfo = {attributeName: "opacity",
							attributeType: "CSS",
							dur: "10ms",
							to: "0.1",
							fill: "freeze"
					}
var oAnimationInfo1 = {attributeName: "opacity",
							attributeType: "CSS",
							dur: "1s",
							to: "1.0",
							fill: "freeze"
					}
				bb.smil.animate(document.getElementById(eid), oAnimationInfo,function(){ bb.command.show(document.getElementById(eid));bb.smil.animate(document.getElementById(eid), oAnimationInfo1); });

}


function	showmainmenu(){
	
	
	
	
		var oAnimationInfo = {attributeName: "opacity",
							attributeType: "CSS",
							dur: "1s",
							to: "0.0",
							fill: "freeze"
					}
				bb.smil.animate(document.getElementById('cpad'), oAnimationInfo);
        
      	fadein('cplogo');
		    fadein('m1');
		    fadein('m2');
		    fadein('m3');
		    fadein('m4');
		    fadein('m5');
		    fadein('m6');
		   
		   
		
		
		
		
	}	
	
	