// JavaScript Document SetCommercialView.js

var format;
var z1, v1, w1, h1, l1, t1;
var z2, v2, w2, h2, l2, t2;
var z3, v3, w3, h3, l3, t3;
var z4, v4, w4, h4, l4, t4;
var z5, v5, w5, h5, l5, t5;
var z6, v6, w6, h6, l6, t6;
var obj; 
var frn=0,idx=0,format=0;


function setCommercialView(fr) 
{
	frn = ffn + fr;
	
	//alert("Help01: " + "frame No.= " + frn );
	
	switch (frn) {
	  case 0:
		   format = 1; idx=0;  // 1P 450x600 centered          Elvis01
		   break;
	  case 1:
		   format = 2; idx=1;  // 1L 480x360 centered          Elvis02 
		   break;
	  case 2:
		   format = 3; idx=2;  // 1L 600x450 centered          LonniesPub01
		   break;
	  case 3: 
		   format = 4; idx=3;  // 2L 300x225 Left/Right Offset LonniesPub02,03
		   break;
	  case 4: 
		   format = 3; idx=5; //  1L 600x450 centered         NewPaint01
		   break;
	  case 5: 
		   format = 3; idx=6; //  1L 600x450 centered         NewPaint02
		   break;
	  case 6: 
		   format = 3; idx=7; //  1L 600x450 centered         NewPaint03
		   break;
	  case 7: 
		   format = 7; idx=8; //  1P Tall 480x640 centered    NewPaint04
		   break;
	  case 8: 
		   format = 5; idx=9;		   
		   break;	   
	  case 9: 
		   format = 6; idx=14;		   
		   break;	   
		  
	}

    //alert("Help1: " + "format= " + format + "   idx= " + idx + " imgs(idx)= " + imgs[idx] + " ffn= " +ffn);
	document.getElementById("label1").innerHTML = DescText[frn];



//Parameter Settings
  if (format==1) {        //  1P Tall 450x600 centered       Elvis01
       z1="11"; v1="True"; w1="450px"; h1="600px"; l1="100px";  t1="60px";
	   v2="false";v3="false"; v4="false"; v5="false"; v6="false";	   	   
	   
  } else if (format==2) {   //  1L 480x360 centered          Elvis02 
       z1="11"; v1="True"; w1="480px"; h1="360px"; l1="80px";  t1="90px";	   
	   v2="false";v3="false";v4="false"; v5="false"; v6="false";
  
  } else if (format==3) {   //  1L 600x450 centered          LonniesPub01
       z1="11"; v1="True"; w1="600px"; h1="450px"; l1="10px";  t1="60px";
	   v2="false";v3="false";v4="false"; v5="false"; v6="false";
		   
  } else if (format==4) {   // 2L 300x225 Left/Right Offset LonniesPub02,03
       z1="11"; v1="True"; w1="300px"; h1="225px"; l1="10px"; t1="100px";
	   z2="12"; v2="True"; w2="300px"; h2="225px"; l2="320px";t2="340px";	   	   
       v3="false";v4="false";v5="false";v6="false"; 
	   
  } else if (format==5) {   // Make this New Format 5A  2 Portrait over 3 Landscape
       z1="11"; v1="True"; w1="300px"; h1="225px"; l1="10px"; t1="50px";
	   z2="12"; v2="True"; w2="300px"; h2="225px"; l2="320px"; t2="50px";
	   z3="13"; v3="True"; w3="200px"; h3="267px"; l3="10px";  t3="295px";
	   z4="14"; v4="True"; w4="200px"; h4="267px"; l4="220px"; t4="295px";
	   z5="15"; v5="True"; w5="200px"; h5="267px"; l5="430px"; t5="295px";
	   v6="false"; 

  } else if (format==6) {   // Make this New Format 6A: 3 columns of 2 Portrait Imgs
       z1="11"; v1="True"; w1="200px"; h1="280px"; l1="10px";  t1="50px";
	   z2="12"; v2="True"; w2="200px"; h2="280px"; l2="220px"; t2="50px";
	   z3="13"; v3="True"; w3="200px"; h3="280px"; l3="430px"; t3="50px";
	   z4="14"; v4="True"; w4="200px"; h4="280px"; l4="10px";  t4="340px";
	   z5="15"; v5="True"; w5="200px"; h5="280px"; l5="220px"; t5="340px";
 	   z6="16"; v6="True"; w6="200px"; h6="280px"; l6="430px"; t6="340px";
	   
  } else if (format==7) {   // 1P Tall 480x640  NewPaint04  Convert to Format 1E Portrait     
       z1="11"; v1="True"; w1="480px"; h1="640px"; l1="80px";  t1="60px";
 	   v2="false";v3="false";v4="false"; v5="false"; v6="false";
	   
  } else if (format==8) {   // NOT USED 
       z1="11"; v1="True"; w1="600px"; h1="450px"; l1="10px"; t1="60px";
       z2="12"; v2="True"; w2="600px"; h2="600px"; l2="10px"; t2="520px";
       v3="false"; v4="false"; v5="false"; v6="false";	   	   
	   
  } else if (format==9) {   // NOT USED 
       z1="11"; v1="True"; w1="300px"; h1="450px"; l1="10px"; t1="100px";
	   z2="12"; v2="True"; w2="300px"; h2="200x"; l2="320px"; t2="100px";
	   z3="13"; v3="True"; w3="300px"; h3="200px"; l3="320px"; t3="350px";	   
       v4="false"; v5="false"; v6="false";	   	   	  
	   
  } else if (format==10) {   // NOT USED 
       z1="11"; v1="True"; w1="300px"; h1="225px"; l1="10px";  t1="60px";
	   z2="12"; v2="True"; w2="300px"; h2="225px"; l2="330px"; t2="60px";
	   z3="13"; v3="True"; w3="200px"; h3="267px"; l3="10px";  t3="295px";
	   z4="14"; v4="True"; w4="200px"; h4="267px"; l4="220px"; t4="295px";
	   z5="15"; v5="True"; w5="200px"; h5="267px"; l5="430px"; t5="295px";
       v6="false";
       
  } else {     // Reset - Reload   	  
	  v1="false"; v2="false";v3="false"; v4="false"; v5="false"; v6="false";
	  
  }

//Content  Overflow: scroll/hidden
 /*   obj = document.getElementById('content');
	obj = obj.style;
    if (format=="99") 
	{
		obj.overflowY = "scroll";
	} else {
		obj.overflow = "hidden";
	}
*/
//apDiv1	
	obj = document.getElementById('apDiv1');
	obj = obj.style;
	if (v1=="True")
	{
		obj.visibility = "visible";
		obj.zIndex = z1;
		obj.width = w1; 
		obj.height =h1 ;
		obj.left = l1; 
		obj.top = t1;		
	
        //alert("Help1 imgs(idx)=" + imgs[idx]) 
	    document.images.pic1.src =  imgs[idx];
		document.images.pic1.alt =  imgs[idx];
		  
	} else {
	   obj.visibility = "hidden";
	}
		
//apDiv2		
	obj = document.getElementById('apDiv2');
	obj = obj.style;
	if (v2=="True")
	{
   		obj.visibility = "visible";
		obj.zIndex = z2;	
		obj.width = w2; 
		obj.height = h2;
		obj.left = l2; 
		obj.top = t2;

		++idx;
		//alert("Help2 imgs(idx)=" + imgs[idx]);  
		document.images.pic2.src =  imgs[idx];
		document.images.pic2.alt =  imgs[idx];
		
	} else {
	   obj.visibility = "hidden";
	}
	
//apDiv3		
	obj = document.getElementById('apDiv3');
	obj = obj.style;
	if (v3=="True")
	{
	    obj.zIndex = z3;	
		obj.visibility = "visible";
		obj.width = w3; 
		obj.height =h3;
		obj.left = l3; 
		obj.top = t3;	
		
		++idx;
		document.images.pic3.src =  imgs[idx];		
		document.images.pic3.alt =  imgs[idx];
		
    } else {
	   obj.visibility = "hidden";
	}
	
//apDiv4		
	obj = document.getElementById('apDiv4');
	obj = obj.style;
     if (v4=="True")
	{
	    obj.zIndex = z4;	
		obj.visibility = "visible";
		obj.width = w4; 
		obj.height =h4;
		obj.left = l4; 
		obj.top = t4;	

		++idx;
		document.images.pic4.src =  imgs[idx];
		document.images.pic4.alt =  imgs[idx];
		
	} else {
	   obj.visibility = "hidden";
	}	
	
//apDiv5		
	obj = document.getElementById('apDiv5');
	obj = obj.style;
	if (v5=="True")
	{
	    obj.zIndex = z5;	
		obj.visibility = "visible";
		obj.width = w5; 
		obj.height =h5;
		obj.left = l5; 
		obj.top = t5;	

		++idx
		document.images.pic5.src =  imgs[idx];
		document.images.pic5.alt =  imgs[idx];
		
	} else {
	   obj.visibility = "hidden";
	}    
	
//apDiv6		
	obj = document.getElementById('apDiv6');
	obj = obj.style;
	if (v6=="True")
	{
	    obj.zIndex = z6;	
		obj.visibility = "visible";
		obj.width = w6; 
		obj.height =h6;
		obj.left = l6; 
		obj.top = t6;	

		++idx
		document.images.pic6.src =  imgs[idx];
		document.images.pic6.alt =  imgs[idx];
		
	} else {
	   obj.visibility = "hidden";
	}    

}

