document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='"+jvs_location+"standard\/timers.js'  TYPE='text\/javascript'><\/SCR" + "IPT>");
document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='"+jvs_location+"standard\/MenuEffects.js'  TYPE='text\/javascript'><\/SCR" + "IPT>");
document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='"+jvs_location+"standard\/shiftWidth.js'  TYPE='text\/javascript'><\/SCR" + "IPT>");
document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='"+jvs_location+"standard\/ChangeDivContent.js'  TYPE='text\/javascript'><\/SCR" + "IPT>");
	
	transition_effects=0; transition_effects2=0;
	mobile_detect=0; skip_ready=0; skip_timer=0; splashout=0; splish=0; picload=0; detectpic_timer=0; writedtimer=0;
	ldetect=0;piclimit=25; skip=0; splashcount=0; splashdot_time=0; movepass=0; movelimit=30; shiftpass=0; shiftlimit=4;
	pd_hold=0; pgcount=0; readyload=0; sub6step=0; unloadtime=0; unloader_step=0;
	tablecell_fix='';	if (document.all){tablecell_fix='inline';} if (this.opera) {tablecell_fix='table-cell';}
	
	function detect_mobile(){
		user_detect=navigator.userAgent.toLowerCase();
		if((user_detect.match(/iphone|ipod|opera|windows ce|iemobile|android|pda|nitro|ericsson|palm|blackberry/i))){
			mobile_detect=1;
		}
	}
	
	function polka_dot_write(){
		if(mobile_detect==0){
			var effect_location=jvs_location.replace('/jvs/','effects/');
			var theme_location=jvs_location.replace('/jvs/','');
			var pdstr='<td id="content_section1" valign="top">';		
			pdstr+='<div id="polka_div">';					
				pdstr+='<IFRAME SRC="'+effect_location+'main_polka_dots.html" id="polka_content" name="polka_content" frameborder="0" width="0px" height="0px" allowTransparency="true" style="width:100%; height:100%; background-color: transparent;" scrolling="no">';
				pdstr+='		<!-- Alternate content for non-supporting browsers -->';
				pdstr+='		<table background="'+effect_location+'images/main-polka_dots.jpg" width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" summary="">';
				pdstr+='	      <tr>';
				pdstr+='	        <td align="center" valign="middle">';
				pdstr+='	        </td>';
				pdstr+='	      </tr>';
				pdstr+='	    </table>';
				pdstr+='';
				pdstr+='</IFRAME>';
				pdstr+='<div id="polka_min"></div>';
			pdstr+='<div id="skip_splash"><table height="100%" width="100%" border="0"><tr><td align="right" valign="bottom"><a href="javascript:skip_flash();"><img id="skip" name="skip" src="'+theme_location+'images/theme/skip.png" border="0" style="display:none;" alt="skip" title="skip"></a></td></tr></table></div></div>';
			pdstr+='</td>';
			document.write(pdstr);
		}else{
			polka_dot_noiframe();
		}
	}
	
	function polka_dot_noiframe(){
		var effect_location=jvs_location.replace('/jvs/','effects/');
		var theme_location=jvs_location.replace('/jvs/','');
		var pdstr='<td id="content_section1" valign="top">';		
		pdstr+='<div id="polka_div">';
			pdstr+='		<table background="'+effect_location+'images/main-polka_dots.jpg" width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" summary="">';
			pdstr+='	      <tr>';
			pdstr+='	        <td align="center" valign="middle">';
			pdstr+='	        </td>';
			pdstr+='	      </tr>';
			pdstr+='	    </table>';
			pdstr+='<div id="polka_min"></div>';
		pdstr+='</td>';
		document.write(pdstr);	
	}
	
	function setup_splash(){
		var section1 = browserstyle('content_section1');			section1.borderRight='none'; section1.width = '100%';
		var min_wz1 =  browserstyle('polka_min');					min_wz1.display='block'; min_wz1.width = '820px';
		var section2 = browserstyle('content_section2');			section2.display='none'; section2.width = '0%'; section2.borderRight='none';
		var section3 = browserstyle('content_section3');			section3.display = 'none';		section3.width = '0%';
		var section3min = browserstyle('content_min'); 				section3min.display = 'none';
		
		skip_ready++;
		skip_timer=setTimeout("show_skip();",0);
		splashout=setTimeout("splash();",0);
	}
	
	function show_skip(){
		if(mobile_detect==0){
			if (skip_ready >= 3){
				var skipper = browserstyle('skip');		skipper.display='inline'; clearTimeout(skip_timer);
			}else{
				clearTimeout(skip_timer);skip_timer=setTimeout("show_skip();",50);
			}
		}
	}
	
	function skip_flash(){
		clearTimeout(splashout);
		if(mobile_detect==0){setOpacity("header",100);}
		if(mobile_detect==0){setOpacity("footer",100);}
		var section1 = browserstyle('content_section1');			section1.borderRight='solid #939598 medium';
		var fds_out = browserstyle('skip_splash');						fds_out.display='none';	fds_out.top='-200%'; fds_out.left='-200%';
		movepass=2;shiftpass=8;pgcount=1; 
		splash_step_5();clearTimeout(splashout);
		movepass=2;shiftpass=8;pgcount=1; splash_step_6();clearTimeout(splashout);
		splash(); splish=5; movepass=0;shiftpass=0;pgcount=0; window.polka_content.start_effects(); setTimeout('window.polka_content.stop_effects();',1000);
		setTimeout('window.polka_content.restart_effects();',1050);		
		setTimeout('splish=7;',1050); skip=1; readyload=0;
			
	}
	
	function detectpicload(){
		if (picload < 1){
			picload=4;
		}
	}
	
	function detectloadd(){
		if (ldetect < 3){
			splish=3; piclimit=25; ldetect=piclimit;
			clearTimeout(loaddtimer); clearTimeout(writedtimer);
			clearTimeout(splashout); splashout=setTimeout("splash();",50);
		}
	}
	
	function loaddetecter(){
		if (mobile_detect==0){
			if (document.images){
				if (ldetect==0){
					piclimit=window.polka_content.ImageNumber;  
					writedetect(); 
				}else if (ldetect < piclimit){
					writedetect();
				}else if (ldetect == piclimit){
					if (skip<1){
						splish=3; 
						clearTimeout(splashout);
						splashout=setTimeout("splash();",50);
					}
				}
			}else{
			   if (skip<1){
					splish=3; 
					clearTimeout(splashout);
					splashout=setTimeout("splash();",50);
				}
			}
	  	}
		ldetect++;
	}
	
	function setup_loads(){
		document.write('<div id="loads" name="loads" style="position: absolute; display:none; overflow: hidden; top:-100%; left:-100%; height:0; width:0;"></div>');	
	}

	function writedetect(){
		if (window.polka_content.ImageSet[ldetect]){
			var wdt='<img id="imenud" name="imenud" onload="loaddetecter();" border="0" src="'+ window.polka_content.ImageSet[ldetect].src+'" alt="'+window.polka_content.ImageSet[ldetect].alt+'" title="'+window.polka_content.ImageSet[ldetect].alt+'" />';
			ChangeDivContent('loads',wdt); 
		}
	}

	function splash(){		
		switch (splish){
			case 0:
				clearTimeout(splashout);
				if (detectpic_timer==0){detectpic_timer=setTimeout('detectpicload();',1050);}
				if (mobile_detect==1){ splish++;}
				splashout=setTimeout("splash();",50);
			break;
			case 1:
				if (mobile_detect==0){
					if (document.images){
						if (picload>=4){
							fadeIn('header',0,5);		splish++;
						}
					}else{
						fadeIn('header',0,5);			splish++;
					}
				}else{splish++;}
				clearTimeout(splashout); splashout=setTimeout("splash();",50); 
			break;
			case 2:
				if (mobile_detect==0){
					if (fadeInObject.header==0){					
						setTimeout('detectloadd();',1500); loaddtimer=setTimeout('loaddetecter();',50); fadeIn('footer',0,5);
					}else{
						clearTimeout(splashout); splashout=setTimeout("splash();",50);
					}	
				}else{splish++; clearTimeout(splashout); splashout=setTimeout("splash();",50); }
			break;
			case 3:
				if (mobile_detect==0){
					if (fadeInObject.footer==0){
						var section1 = browserstyle('content_section1');			section1.borderRight='solid #939598 medium';
						fadeOut('skip_splash',100,5); splish=4; 
					}
				}else{splish++; var section1 = browserstyle('content_section1');	section1.borderRight='solid #939598 medium';}
				clearTimeout(splashout); splashout=setTimeout("splash();",50);
			break;
			case 4:
				if (mobile_detect==0){
					if(fadeOutObject.skip_splash==0){
						var fds_out = browserstyle('skip_splash');						fds_out.display='none';	fds_out.top='-500%'; fds_out.left='-500%';
						seconds_timer('start'); splish=5; 
						clearTimeout(splashout); splashout=setTimeout("splash();", 1000); window.polka_content.start_effects(); 
					}else{
						clearTimeout(splashout); splashout=setTimeout("splash();",50);
					}
				}else{splish++; clearTimeout(splashout); splashout=setTimeout("splash();",200); }
			break;
			case 5:
				splash_step_5(); 
			break;
			case 6:
				splash_step_6();
			break;
			case 7:
				clearTimeout(splashout); transition_effects2=transition_effects;				
					switch (transition_effects){
						case 0:
							
						break;
						case 1:
							window.iframe_content.dot_pop();
						break;
						case 2:
							window.iframe_content.dot_fade();
						break;
						case 3:
							window.iframe_content.dot_giant();
						break;
						case 4:
							window.iframe_content.dot_form();
						break;
						case 5:
						
						break;
					}
			break;
		}
	}
	
	function splash_step_5(){ 
		if ((transition_effects==0)||(transition_effects==4)||(transition_effects==5)){ 
			if (mobile_detect==0){ 
				window.polka_content.stop_effects();							
				if (splashcount < 1){
					splashdot_time=seconds_timer('stop');
					movepass=movepass/splashdot_time;
				}
			}
			
			if(transition_effects==0){var sect1_end=65; var sect1_endpx='470px';var sect2_end=35; var sect2_endpx='350px'; var sect_speed=5;}else if((transition_effects==4)||(transition_effects==5)){var sect1_end=0; var sect1_endpx='0px'; var sect2_end=100; var sect2_endpx='820px'; var sect_speed=10; var section1min = browserstyle('polka_min'); section1min.display='none';}
			if (transition_effects==4){window.iframe_content.set_dot_form();}
			
			var section3 = browserstyle('content_section3'); section3.backgroundColor='#c2dfda'; section3.display = tablecell_fix;
			var min_wz1 =  browserstyle('polka_min');	min_wz1.display='none';
			var min_wz3 = browserstyle('content_min'); 	min_wz3.display='none';
			
			if (mobile_detect==0){
				if (shiftpass < shiftlimit){
					shift_width('content_section1','>',100,sect1_end,'%',sect_speed);
					shift_width('content_section3', '<',0,sect2_end,'%',sect_speed);
				}else{shift_widthObject.content_section3=0;}
			}else{
				section3.width=sect2_end+'%'; var section1 = browserstyle('content_section1'); section1.width=sect1_end+'%';
				var min_wz3 = browserstyle('content_min'); 					min_wz3.display='block'; min_wz3.width = sect2_endpx;
				var min_wz1 =  browserstyle('polka_min');					min_wz1.display='block'; min_wz1.width = sect1_endpx;
			}
			splish=6; 	clearTimeout(splashout); splashout=setTimeout("splash();",50);
		}else if((transition_effects==1)||(transition_effects==2)||(transition_effects==3)){
			var section2 = browserstyle('content_section2');	section2.borderRight='solid #939598 medium';	
			var min_wz1 =  browserstyle('polka_min');	min_wz1.display='none';
			var min_wz2 =  browserstyle('menu_header');	min_wz2.display='none';
			
			switch (transition_effects){
				case 1:
					window.iframe_content.set_dot_pop();
				break;
				case 2:
					window.iframe_content.set_dot_fade();
				break;
				case 3:
					window.iframe_content.set_dot_giant();
				break;
			}
			if (mobile_detect==0){
				window.polka_content.stop_effects();
				if (splashcount < 1){
					splashdot_time=seconds_timer('stop');
					movepass=movepass/splashdot_time;
				}
			}
			
			section2.display = tablecell_fix;
			
			if (mobile_detect==0){
				if (shiftpass < shiftlimit){
					shift_width('content_section1','>',100,65,'%',5);
					shift_width('content_section2', '<',0,35,'%',5);
				}else{shift_widthObject.content_section2=0;}
			}else{
				section2.width='35%'; var section1 = browserstyle('content_section1'); section1.width='65%';
				var min_wz2 =  browserstyle('menu_header');	min_wz2.display='block'; min_wz2.width = '290px';
				var min_wz1 =  browserstyle('polka_min');	min_wz1.display='block'; min_wz1.width = '530px';
			}
			
			splish=6; clearTimeout(splashout); splashout=setTimeout("splash();",50);
		}
		splashcount++;
	}
	
	function splash_step_6(){
		if ((transition_effects==0)||(transition_effects==4)||(transition_effects==5)){
			if ((shift_widthObject.content_section3==0)||(mobile_detect==1)){
				var min_wz3 = browserstyle('content_min'); min_wz3.display='block'; min_wz3.width='400px';
				if (mobile_detect==0){
					if ((pd_hold==0)&&(transition_effects==0)&&(movepass>movelimit)){	window.polka_content.restart_effects();	}
				}
				if(transition_effects==0){var sect1_end='65%'; var sect1_endpx='470px'; var sect2_end='35%'; var sect2_endpx='350px'; var secdis=tablecell_fix;}else if((transition_effects==4)||(transition_effects==5)){var sect1_end='0'; var sect1_endpx='0px'; var sect2_end='100%'; var sect2_endpx='820px'; var secdis='none';}
				var section1 = browserstyle('content_section1');		section1.width = sect1_end; section1.display = secdis;
				var section3 = browserstyle('content_section3');		section3.width = sect2_end; 
				var min_wz3 = browserstyle('content_min'); 					min_wz3.display='block'; min_wz3.width = sect2_endpx;
				var min_wz1 =  browserstyle('polka_min');					min_wz1.display='block'; min_wz1.width = sect1_endpx;
				
				splish=7;			readyload=0;	pgcount++;
			}else if (pgcount==0){shiftpass++;}
			clearTimeout(splashout); splashout=setTimeout("splash();",50);
		}else if((transition_effects==1)||(transition_effects==2)||(transition_effects==3)){
			if (((shift_widthObject.content_section2==0)&&(sub6step==0))||((mobile_detect==1)&&(sub6step==0))){
				var min_wz3 = browserstyle('content_min'); 					min_wz3.display='none';
				var section3 = browserstyle('content_section3');		section3.backgroundColor='#d9e9e6'; section3.display = tablecell_fix;
				var section1 = browserstyle('content_section1');		section1.width = '65%'; 
				var section1min = browserstyle('polka_min'); section1min.display='none';
				var section2 = browserstyle('content_section2');		section2.width = '35%'; 				
				var min_wz2 =  browserstyle('menu_header');				min_wz2.display='block'; min_wz2.width = '290px'; 
				if (mobile_detect==0){
					if (shiftpass < shiftlimit){
						shift_width('content_section1','>',65,0,'%',5);
						shift_width('content_section3', '<',0,65,'%',5);
					}else{shift_widthObject.content_section1=0;}
				}
				sub6step=1;
			}else if(((sub6step==1)&&(shift_widthObject.content_section1==0))||((mobile_detect==1)&&(sub6step==1))){
				var section1 = browserstyle('content_section1');		section1.width = '0%'; section1.display = 'none';
				var section3 = browserstyle('content_section3');		section3.width = '65%';
				var min_wz3 = browserstyle('content_min'); 						min_wz3.display='block'; min_wz3.width = '530px';
				splish=7;	readyload=0;	sub6step=0; pgcount++;
			}else if((shift_widthObject.content_section2!=0)&&(pgcount==0)){shiftpass++;}
			clearTimeout(splashout); splashout=setTimeout("splash();",50);					
		}
	}
	
	function loader(){
		if (mobile_detect==1){pd_hold=1;}
		if ((splish>6)&&(pd_hold==0)&&(skip!=1)){
			pd_hold=window.polka_content.pd_switch;
			
			if (readyload==1){
				splish=5;	window.polka_content.stop_effects(); clearTimeout(splashout);		splashout=setTimeout("splash();",50);
			}else{
				loadtime=setTimeout("loader();",50);
			}
	
		}else if(pd_hold==1){
			if (transition_effects==0){
				var section2 = browserstyle('content_section2');			section2.width = '0%'; section2.display = 'none';
				var section1 = browserstyle('content_section1');			section1.width = '65%'; section1.display = tablecell_fix;
				var section3 = browserstyle('content_section3');			section3.width = '35%'; section3.backgroundColor='#c2dfda'; section3.display = tablecell_fix;	
				var min_wz1 =  browserstyle('polka_min');					min_wz1.display='block'; min_wz1.width = '470px';
				var min_wz3 = browserstyle('content_min'); 					min_wz3.display='block'; min_wz3.width = '350px';
				
			}else if ((transition_effects==1)||(transition_effects==2)||(transition_effects==3)){				
				var section1 = browserstyle('content_section1');				section1.width = '0%'; section1.display = 'none';
				var section3 = browserstyle('content_section3');				section3.width = '65%'; section3.backgroundColor='#d9e9e6'; section3.display = tablecell_fix;
				var min_wz3 = browserstyle('content_min'); 						min_wz3.display='block'; min_wz3.width = '530px';
				var section2 = browserstyle('content_section2');				section2.width = '35%'; section2.display = tablecell_fix; section2.borderRight='solid #939598 medium';
				var min_wz2 =  browserstyle('menu_header');						min_wz2.display='block'; min_wz2.width = '290px';
				
				if (transition_effects==2) {window.iframe_content.notransition_dot_fade();}else if (transition_effects==3) {window.iframe_content.notransition_dot_giant();}
				
			}else if ((transition_effects==4)||(transition_effects2==5)){
				var section1 = browserstyle('content_section1');				section1.width = '0%'; section1.display = 'none';
				var section3 = browserstyle('content_section3');				section3.width = '100%'; section3.backgroundColor='#c2dfda'; section3.display = tablecell_fix;
				var min_wz3 = browserstyle('content_min'); 						min_wz3.display='block'; min_wz3.width = '820px';
				var section2 = browserstyle('content_section2');				section2.width = '0%'; section2.display = 'none';
				if (transition_effects==4){window.iframe_content.notransition_dot_form();}
			}
			skip=0;
	
		}else{
			skip=0;
		}
		
	}

	function unloader(){
		if ((transition_effects2==0)||(transition_effects2==4)||(transition_effects2==5)){
			if (mobile_detect==0){pd_hold=window.polka_content.pd_switch;}else{pd_hold=1;} skip=0;
			if ((splish>6)&&(pd_hold==0)){
				if (readyload==0){
					var min_wz3 = browserstyle('content_min'); min_wz3.display='none';
					window.polka_content.stop_effects();
					
					if(transition_effects2==0){var sect1_start=65; var sect2_start=35; var sect_speed=7;}else if((transition_effects2==4)||(transition_effects2==5)){var sect1_start=0; var sect2_start=100; var sect_speed=10;}
					
					var section1 = browserstyle('content_section1'); section1.display = tablecell_fix; 
					if (shiftpass < shiftlimit){
						shift_width('content_section1','<',sect1_start,100,'%',sect_speed);
						shift_width('content_section3', '>',sect2_start,0,'%',sect_speed);
					}else{shift_widthObject.content_section3=0;}
					readyload=1;
				}
				
				if (shift_widthObject.content_section3==0){
					var section1 = browserstyle('content_section1');			section1.width = '100%';	
					var min_wz1 =  browserstyle('polka_min');					min_wz1.display='block'; min_wz1.width = '820px';
					var section3 = browserstyle('content_section3');			section3.display = 'none';		section3.width = '0%';
					 
					if(movepass > movelimit){window.polka_content.restart_effects();}			readyload=1;
				}else{
					unloadtime=setTimeout("unloader();",50);
				}
		
			}else if ((splish>6)&&(pd_hold==1)){
				var section1 = browserstyle('content_section1');			section1.width = '100%'; section1.display = tablecell_fix;	
				var min_wz1 =  browserstyle('polka_min');					min_wz1.display='block'; min_wz1.width = '820px';
				var section3 = browserstyle('content_section3');			section3.display = 'none';		section3.width = '0%'; 
			}
		}else if((transition_effects2==1)||(transition_effects2==2)||(transition_effects2==3)){
			if (mobile_detect==0){pd_hold=window.polka_content.pd_switch;}else{pd_hold=1;} skip=0;
			
			if ((splish>6)&&(pd_hold==0)){
				if (unloader_step==0){ 
					var min_wz3 = browserstyle('content_min'); min_wz3.display='none';
					var min_wz2 =  browserstyle('menu_header');						min_wz2.display='none';
					window.polka_content.stop_effects(); 
					
					var section1 = browserstyle('content_section1');  		section1.display = tablecell_fix;
					if (shiftpass < shiftlimit){
						shift_width('content_section1','<',0,70,'%',10);
						shift_width('content_section3', '>',70,0,'%',10);
					}else{shift_widthObject.content_section3=0;}
					unloader_step=1;
				}
				
				if (shift_widthObject.content_section3==0){
					if (unloader_step==1){						
						if (shiftpass < shiftlimit){
							shift_width('content_section1','<',70,100,'%',10);
							shift_width('content_section2', '>',70,0,'%',10);
						}else{shift_widthObject.content_section2=0;}
						unloader_step=2;
					}					
				
					if (shift_widthObject.content_section2==0){
						var section1 = browserstyle('content_section1');		section1.width = '100%';
						var min_wz1 =  browserstyle('polka_min');				min_wz1.display='block'; min_wz1.width = '820px';
						var section3 = browserstyle('content_section3');		section3.width = '0%'; section3.display = 'none';
					
						var section2 = browserstyle('content_section2');		section2.width = '0%'; section2.display = 'none';
						
						if(movepass > movelimit){window.polka_content.restart_effects();}		readyload=1; unloader_step=0;
					}else{
						unloadtime=setTimeout("unloader();",50);
					}
					
				}else{
					unloadtime=setTimeout("unloader();",50);
				}
		
			}else if ((splish>6)&&(pd_hold==1)){
				var section1 = browserstyle('content_section1');		section1.width = '100%'; section1.display = tablecell_fix;	
				var min_wz1 =  browserstyle('polka_min');				min_wz1.display='block'; min_wz1.width = '820px';
				var section3 = browserstyle('content_section3');		section3.width = '0%'; section3.display = 'none';
				var section2 = browserstyle('content_section2');		section2.width = '0%'; section2.display = 'none';
			}
		}
	}
