function conf()
{
  if( confirm( 'Are you sure?' ) ) return true
  else return false;
}

function conf_studio()
{
  if( confirm( 'You are attempting to leave the tab without saving your work. If you would like to save your changes please click \'Save and Continue\' or click \'OK\' to proceed without saving your changes.' ) ) return true
  else return false;
}

function conf_delall()
{
  if( confirm( 'Are You sure you want to delete this item(s)?' ) ) return true
  else return false;
}

function conf2()
{
  if( confirm( 'Are you sure you want to delete this product registration?' ) ) return true
  else return false;
}


function openAWindow2( pageToLoad, winName, width, height, center){

xposition=0; yposition=0;
if ((parseInt(navigator.appVersion) >= 4 ) &&(center)){
 xposition = (screen.width - width) / 8;
 yposition = (screen.height - height) / 3;
}

args = "width=" + width + ","
+ "height=" + height + ","
+ "location=0,"
+ "menubar=0,"
+ "resizable=0,"
+ "scrollbars=1,"
+ "status=0,"
+ "titlebar=0,"
+ "toolbar=0,"
+ "hotkeys=0,"
+ "screenx=" + xposition + "," //NN Only
+ "screeny=" + yposition + "," //NN Only
+ "left=" + xposition + "," //IE Only
+ "top=" + yposition; //IE Only

window.open( pageToLoad, winName, args );

}

function openAWindow( pageToLoad, winName, width, height, center){

xposition=0; yposition=0;
if ((parseInt(navigator.appVersion) >= 4 ) &&(center)){
 xposition = (screen.width - width) / 8;
 yposition = (screen.height - height) / 3;
}

args = "width=" + width + ","
+ "height=" + height + ","
+ "location=0,"
+ "menubar=0,"
+ "resizable=0,"
+ "scrollbars=0,"
+ "status=0,"
+ "titlebar=0,"
+ "toolbar=0,"
+ "hotkeys=0,"
+ "screenx=" + xposition + "," //NN Only
+ "screeny=" + yposition + "," //NN Only
+ "left=" + xposition + "," //IE Only
+ "top=" + yposition; //IE Only

window.open( pageToLoad, winName, args );

}

function void_() {
}

function xget(id) {
	if(document.getElementById) return document.getElementById(id);
	if(document.all) return document.all[id];
	return null;
}

if (navigator.userAgent.toLowerCase().indexOf('gecko') != -1) {
     window.attachEvent = function(eventName, delegate) {
         this.addEventListener(eventName.substring(2), delegate, false);
     }
 /*
     window.detachEvent = function(eventName, delegate) {
         this.removeEventListener(eventName.substring(2), delegate, false);
     }
 
     window.document.attachEvent = function(eventName, delegate) {
         this.addEventListener(eventName.substring(2), delegate, false);
     }
     
     window.document.detachEvent = function(eventName, delegate) {
         this.removeEventListener(eventName.substring(2), delegate, false);
     }
 
     HTMLElement.prototype.attachEvent = function(eventName, delegate) {
         this.addEventListener(eventName.substring(2), delegate, false);
     }
 
     HTMLElement.prototype.detachEvent = function(eventName, delegate) {
         this.removeEventListener(eventName.substring(2), delegate, false);
     }
 
     HTMLElement.prototype.fireEvent = function(eventName, eventInstance) {
         var events = this.ownerDocument.createEvent("events");
         events.initEvent(eventName.substring(2), false, true);
         this.dispatchEvent(ev);
     }
     
     Event.prototype.__defineGetter__("srcElement", function () {
        var node = this.target;
        while (node.nodeType != 1) node = node.parentNode;
        return node;
     })
*/
 }

function makeHttpRequest(url, callback_function, return_xml) {
  var http_request = false;

  if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType && return_xml == 'xml') {
			 http_request.overrideMimeType('text/xml');
		}
  } else if (window.ActiveXObject) { // IE
		try {
			 http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			 try {
				  http_request = new ActiveXObject("Microsoft.XMLHTTP");
			 } catch (e) {}
		}
  }

  if (!http_request) {
		alert('Unfortunately your browser doesn\'t support this feature.');
		return false;
  }

  http_request.onreadystatechange = function() {
		if (http_request.readyState == 4) {
			 if (http_request.status == 200) {
				  if (return_xml == 'xml') {
						eval(callback_function + '(http_request.responseXML)');
				  } else {
						eval(callback_function + '(http_request.responseText)');
				  }
			 } else {
//				  alert('There was a problem with the request. (Code: ' + http_request.status + ')');
			 }
		}
  }
  http_request.open('GET', url, true);
  http_request.send(null);
}

function detect_user_agent(){
	navigator.DOM=!!(document.getElementById?1:0);
	navigator.OPERA=!!(window.opera);
	navigator.OPERA5=!!(navigator.OPERA&&navigator.userAgent.indexOf("pera 5")>0);
	navigator.OPERA6=	!!(navigator.OPERA&&navigator.userAgent.indexOf("pera 6")>0);
	navigator.IE8=		!!(navigator.appVersion.indexOf("IE 8")>0&&navigator.DOM&&!navigator.OPERA?1:0);
	navigator.IE7=		!!(navigator.appVersion.indexOf("IE 7")>0&&navigator.DOM&&!navigator.OPERA?1:0);
	navigator.IE6=		!!(navigator.appVersion.indexOf("IE 6")>0&&!navigator.IE7&&!navigator.IE8&&navigator.DOM&&!navigator.OPERA?1:0);
	navigator.IE5=		!!(navigator.appVersion.indexOf("IE 5")>0&&navigator.DOM&&!navigator.OPERA?1:0);
	navigator.IE4=		!!(document.all&&!navigator.DOM?1:0);
	navigator.IE=		!!(navigator.IE4||navigator.IE5||navigator.IE6);
	navigator.MAC=		!!(navigator.userAgent.indexOf("Mac")>0);
	navigator.NS6=		!!(navigator.DOM && parseInt(navigator.appVersion)>4?1:0);
	navigator.NS4=		!!(document.layers && !navigator.DOM?1:0);
	navigator.DOMCORE1=	!!(typeof(document.getElementsByTagName)!='undefined' && typeof(document.createElement)!='undefined');
	navigator.DOMCORE2=	!!(navigator.DOMCORE1 && typeof(document.getElementById) != 'undefined' && typeof(document.createElementNS) != 'undefined');
	navigator.DOMHTML=	!!(navigator.DOMCORE1 && typeof(document.getElementById) != 'undefined');
	navigator.DOMCSS1=	!!(navigator.NS6||navigator.IE)	;
	if(navigator.DOMCORE1&&!navigator.OPERA)
	{	var check_element=document.createElement('p');
		navigator.DOMCSS2=!!(typeof(check_element)=='object');
	} else	navigator.DOMCSS2=!!(false)	
	navigator.DETECTED=	(	navigator.OPERA||navigator.OPERA6||navigator.OPERA5||navigator.IE||navigator.IE6||navigator.IE5||navigator.IE4||navigator.MAC||navigator.NS6||navigator.NS4||navigator.DOM||navigator.DOMHTML||navigator.DOMCORE1||navigator.DOMCORE2||navigator.DOMCSS1||navigator.DOMCSS2	);
	}
	
var current=1;
function nextT(max)
{
	if (current+2<=max)
	{
		n=current+2;
		xget('img_'+current).style.display='none';
		xget('img_'+n).style.display='block';
		current=current+1;
	}
}
function prevT()
{
	if (current>1)
	{
		p=current+1;
		n=current-1;
		xget('img_'+p).style.display='none';
		xget('img_'+n).style.display='block';
		current=current-1;
	}
}	

var currentArticle=1;
function nextarticle()
{
	if (currentArticle+1<=parseInt(xget('articleall').innerHTML))
	{
		n=currentArticle+1;
		if (xget('ArticleHome'+n)){
			xget('ArticleHome'+currentArticle).style.display='none';
			xget('ArticleHome'+n).style.display='block';

			if (xget("scroller_bar_v_8_"+currentArticle))
			{
				vertical_8 = new VerticalScroll('scroller_v_8_'+currentArticle, 'scroller_bar_v_8_'+currentArticle, 'movemenu_v_8_'+currentArticle, 98);
				vertical_8.prepare();
				document.onmousemove = handleOnMouseMove;
				window.onmouseup = handleOnMouseUp;			 
				 
				xget('scroller_bar_v_8_'+currentArticle).onclick = handleOnClickBarVertical_8;    
				xget('scroller_v_8_'+currentArticle).onmousedown = handleOnMouseDownVertical_8;
				xget('scroller_v_8_'+currentArticle).onmouseup = handleOnMouseUp;
				xget('scroller_v_8_'+currentArticle).onclick = handleOnClickVertical_8; 
				
				if (xget('withscript_v_8_'+currentArticle).addEventListener)
					xget('withscript_v_8_'+currentArticle).addEventListener('DOMMouseScroll', handleOnMouseWheelVertical_8, false);
				xget('withscript_v_8_'+currentArticle).onmousewheel = handleOnMouseWheelVertical_8;
			}
			
			currentArticle=currentArticle+1;
			xget("articlecur").innerHTML=currentArticle;
		}
	}
	return false;	
}
function prevarticle()
{
	if (currentArticle>1)
	{
		p=currentArticle-1;
		if (xget('ArticleHome'+p)){		
			xget('ArticleHome'+currentArticle).style.display='none';
			xget('ArticleHome'+p).style.display='block';

			currentArticle=currentArticle-1;

			if (xget("scroller_bar_v_8_"+(currentArticle-1)))
			{
				vertical_8 = new VerticalScroll('scroller_v_8_'+(currentArticle-1), 'scroller_bar_v_8_'+(currentArticle-1), 'movemenu_v_8_'+(currentArticle-1), 98);
				vertical_8.prepare();
				document.onmousemove = handleOnMouseMove;
				window.onmouseup = handleOnMouseUp;			 
				 
				xget('scroller_bar_v_8_'+(currentArticle-1)).onclick = handleOnClickBarVertical_8;    
				xget('scroller_v_8_'+(currentArticle-1)).onmousedown = handleOnMouseDownVertical_8;
				xget('scroller_v_8_'+(currentArticle-1)).onmouseup = handleOnMouseUp;
				xget('scroller_v_8_'+(currentArticle-1)).onclick = handleOnClickVertical_8; 
				
				if (xget('withscript_v_8_'+(currentArticle-1)).addEventListener)
					xget('withscript_v_8_'+(currentArticle-1)).addEventListener('DOMMouseScroll', handleOnMouseWheelVertical_8, false);
				xget('withscript_v_8_'+(currentArticle-1)).onmousewheel = handleOnMouseWheelVertical_8;
			}

			xget("articlecur").innerHTML=currentArticle;			
		}
	}
	return false;
}	

var currentBanner=1;
function showbanner(id)
{
	if (xget('topbanner'+id) && xget('linkbanner'+id) && id!=currentBanner)
	{
		xget('topbanner'+id).style.display='block';
		xget('linkbanner'+id).src='/images/sekonic/b_banner_a.gif';
		if (xget('topbanner'+currentBanner)) xget('topbanner'+currentBanner).style.display='none';
		if (xget('linkbanner'+currentBanner)) xget('linkbanner'+currentBanner).src='/images/sekonic/b_banner.gif';		
		currentBanner=id;
	}
	return false;	
}


var currentImage=0;
function showimgproduct(src,i)
{
		src2=src.replace("/ThumbnailImage.aspx?path=","")
		src2=src2.replace("&width=262","")
		xget('img_big').innerHTML="<img src=\""+src+"\" alt=\"\" onclick=\"new_show_img_full(" + i + ");return new_start_full();\" class=\"cursor_zoom\" fsrc=\"" + src2 + "\" /><img src=\"/images/plus2.gif\" onclick=\"new_show_img_full(" + i + ");return new_start_full();\" class=\"cursor_zoom\" fsrc=\"" + src2 + "\" alt=\"\" />";
		
		xget('small_link_'+currentImage).className="";
		xget('small_link_'+i).className="active";
		currentImage=i;		
	return false;
}

function showtab(id)
{
	for (i=1; i<=2; i++)
	{
		if (xget('link_for_tab_'+i)) xget('link_for_tab_'+i).className='tabs_1';
		if (xget('tabs_'+i)) xget('tabs_'+i).style.display='none';
	}
	if (xget('link_for_tab_'+id)) xget('link_for_tab_'+id).className='tabs_1 active';
	if (xget('tabs_'+id)) xget('tabs_'+id).style.display='block';

	return false;
}

var IsShowBanner=1;
function showbanner_()
{
	if (IsShowBanner==1)
	{
		showbanner(currentBanner+1);
		setTimeout("showbanner_();",4000);
	}
}

function loadmy(id)
{
	setTimeout("showbanner_();",4000);	

	if (xget('popuptableBG')) {
		xget('popuptableBG').style.height=getDocumentHeight()+'px';
		xget('CountryMap').style.top=(getBodyScrollTop()+0)+"px";
		xget('CountryMap').style.left=(getViewportWidth()/2-506)+"px";
		xget('CountryMap').style.display='block';
		var coll = document.getElementsByTagName('IFRAME');	
		if (coll!=null) {
			for (i=0; i<coll.length; i++)
			{
				coll[i].style.display='none';
			}
		 } 		
	}

    if (!are_cookies_enabled()) {
        alert('This site requires cookies for best functionality. Without enabling cookies you can browse only the USA version of our site: you will not be able to view the international sections of the site.');
    }
}

function showCountry(id)
{
	closeCountry();
	if (xget('CountryMap2')) {							 
		xget('CountryMap2').style.backgroundImage='url(/images/sekonic/map/'+id+'.gif)';
		if (xget('head_'+id)) { xget('head_'+id).style.display='none'; }
		if (xget('block_'+id)) { xget('block_'+id).style.display='block'; }
			}
}

function closeCountry()
{
	xget('CountryMap2').style.backgroundImage='none';
	if (xget('block_america')) { xget('block_america').style.display='none'; }	
	if (xget('head_america')) { xget('head_america').style.display='block'; }
	if (xget('block_asia')) { xget('block_asia').style.display='none'; }	
	if (xget('head_asia')) { xget('head_asia').style.display='block'; }
	if (xget('block_africa')) { xget('block_africa').style.display='none'; }	
	if (xget('head_africa')) { xget('head_africa').style.display='block'; }
	if (xget('block_europe')) { xget('block_europe').style.display='none'; }	
	if (xget('head_europe')) { xget('head_europe').style.display='block'; }
}


var ua = navigator.userAgent.toLowerCase(); 
var isOpera = (ua.indexOf('opera')  > -1); 
var isIE = (!isOpera && ua.indexOf('msie') > -1); 
  
function getDocumentHeight() { 
return Math.max(document.compatMode != 'CSS1Compat' ? document.body.scrollHeight : document.documentElement.scrollHeight, getViewportHeight()); 
} 
function getDocumentWidth() { 
return Math.max(document.compatMode != 'CSS1Compat' ? document.body.scrollWidth : document.documentElement.scrollWidth, getViewportWidth()); 
} 
function getViewportHeight() { 
	return ((document.compatMode || isIE) && !isOpera) ? (document.compatMode == 'CSS1Compat') ? document.documentElement.clientHeight : document.body.clientHeight : (document.parentWindow || document.defaultView).innerHeight; 
}
function getViewportWidth() { 
	return ((document.compatMode || isIE) && !isOpera) ? (document.compatMode == 'CSS1Compat') ? document.documentElement.clientWidth : document.body.clientWidth : (document.parentWindow || document.defaultView).innerWidth; 
}
function getBodyScrollTop() {
  return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}

function set_meta (id,value){
	if (xget(id))
	{
		xget(id).value=trim12(value);
	}	
}

function trim12 (str) {
	var	str = str.replace(/^\s\s*/, ''),
		ws = /\s/,
		i = str.length;
	while (ws.test(str.charAt(--i)));
	return str.slice(0, i + 1);
}

if (window.attachEvent) {window.attachEvent("onload", loadmy);}


var new_i_curent=0;
var new_slideshow=0;
var full_new_slideshow=0;
var current_width1=495;
var current_width2=604;

function new_show_img(id) {
	if (xget('i'+id)) {
		
		for (i=0;i<50;i++)
		{
			if (xget('i'+i)) xget('i'+i).className="";
			if (xget('feat_tp'+i)) xget('feat_tp'+i).style.display='none';			
		}
		xget('i'+id).className="a";
		var leftPx=0;
		for (i=0;i<id;i++)
		{
			leftPx=leftPx+parseInt(xget('i'+i).offsetWidth)+2;
		}

		var leftPxAll=0;
		var ii=0;
		for (i=(parseInt(xget('allNum').innerHTML)-1);i>=0;i--)
		{		
			leftPxAll=leftPxAll+parseInt(xget('i'+i).offsetWidth)+2;			
			ii=ii+1;			
			if (leftPxAll>current_width1) {ii=ii-1;break;}
		}
		if (current_width2==604)
		{
			if (second8) second8.setPositionMy(leftPx,id,(parseInt(xget('allNum').innerHTML)-1)-ii);
		}
		else if (current_width2==630)
		{
			if (second10) second10.setPositionMy(leftPx,id,(parseInt(xget('allNum').innerHTML)-1)-ii);	
		}
		else if (current_width2==250)
		{
			if (second11) second11.setPositionMy(leftPx,id,(parseInt(xget('allNum').innerHTML)-1)-ii);	
		}
		if (xget('info_'+id)) xget('info').innerHTML=xget('info_'+id).value;
		xget('info').style.left=parseInt(((current_width2-parseInt(xget('info').offsetWidth))/2))+"px";
		xget("imgBig").style.border="0px #E3E3E3 solid";
		xget("imgBig").src="/lightbox/images/ajax-loader2.gif";
		xget("imgBig").style.marginTop="140px";
//		xget("imgBig").src=xget('i'+id).src.replace("height=69","height=289&maxwidth="+current_width2);
		gettrum(xget('i'+id).src.replace("height=69","height=410&maxwidth="+current_width2),"imgBig");
//		if (parseInt(xget("imgBig").offsetWidth)>current_width2) {xget("imgBig").style.width=current_width2+"px";xget("imgBig").style.height="";}		
		xget("imgBig").style.marginTop="0px";		
		new_i_curent=id;
		if ((new_i_curent+1)<10) xget("curNum").innerHTML="0"+(new_i_curent+1); else xget("curNum").innerHTML=(new_i_curent+1);		

		if (xget('feat_tp'+id)) xget('feat_tp'+id).style.display='block';
		
	}
    return false;
}

function new_show_next(){
	if (xget('i'+(new_i_curent+1))) new_show_img(new_i_curent+1);
	return false;
}
function new_show_prev(){
	if (xget('i'+(new_i_curent-1))) new_show_img(new_i_curent-1);
	return false;
}

function new_start_slideshow()
{
	if (new_slideshow==0)
	{
		xget('play').src='/images/sekonic/v_stop.gif';
		new_slideshow=1;
		new_start_slideshow_();
	}
	else
	{
		xget('play').src='/images/sekonic/v_play.gif';		
		new_slideshow=0;
	}
	return false;
}

function new_start_slideshow_()
{
	if (new_slideshow==1)
	{	
		if (!xget('i'+(new_i_curent+1))) {new_i_curent=-1}
		new_show_next();
		if (new_i_curent>=0) {
			setTimeout("new_start_slideshow_();",5000);	
		}
	}
	return false;
}

function new_show_info(){
	if (xget('info'))
	{
		if (xget('info').style.display!="block") 
		{
			xget('info').style.display="block";
			xget('info').style.left=parseInt(((current_width2-parseInt(xget('info').offsetWidth))/2))+"px";							
		}
		else
		{
			xget('info').style.display="none";
		}		
	}
	return false;
}

function new_show_img_full(id) {
	new_show_img(id);
	if (xget('full_i'+id)) {		
		for (i=0;i<50;i++)
			if (xget('full_i'+i)) xget('full_i'+i).className="";
		xget('full_i'+id).className="a";
		var leftPx=0;
		for (i=0;i<id;i++)
		{
			leftPx=leftPx+parseInt(xget('full_i'+i).offsetWidth)+2;
		}

		var leftPxAll=0;
		var ii=0;
		for (i=(parseInt(xget('full_allNum').innerHTML)-1);i>=0;i--)
		{		
			leftPxAll=leftPxAll+parseInt(xget('full_i'+i).offsetWidth)+2;
			ii=ii+1;
			if (leftPxAll>848) {ii=ii-1;break;}
		}		

		if (second9) second9.setPositionMy(leftPx,id,(parseInt(xget('full_allNum').innerHTML)-1)-ii);
		
		if (xget('full_info_'+id)) xget('full_info').innerHTML=xget('full_info_'+id).value;
//		xget('full_info').style.left=parseInt(((969-parseInt(xget('full_info').offsetWidth))/2))+"px";	

		xget("full_imgBig").style.border="0px #E3E3E3 solid";
		xget("full_imgBig").src="/lightbox/images/ajax-loader.gif";
		xget("full_imgBig").style.marginTop="260px";

		if (current_width2==250)
		{
			k=(getViewportHeight()-16-16-128);
			if (k>700) k=700;
			k2=(getViewportWidth()-16-16);
			if (k2>700) k2=700;		
			//xget("full_imgBig").src=xget('full_i'+id).src.replace("height=69","height="+k+"&maxwidth="+(k2)+"");
			gettrum(xget('full_i'+id).src.replace("height=69","height="+k+"&maxwidth="+(k2)+""),'full_imgBig');
		}
		else
		{
			gettrum(xget('full_i'+id).src.replace("height=69","height="+(getViewportHeight()-16-16-128)+"&maxwidth="+(getViewportWidth()-16-16)+""),'full_imgBig');
			//xget("full_imgBig").src=xget('full_i'+id).src.replace("height=69","height="+(getViewportHeight()-16-16-128)+"&maxwidth="+(getViewportWidth()-16-16)+"");
		}
		xget("full_imgBig").style.marginTop="0px";
		
		
		new_i_curent=id;
		if ((new_i_curent+1)<10) xget("full_curNum").innerHTML="0"+(new_i_curent+1); else xget("full_curNum").innerHTML=(new_i_curent+1);
	}
    return false;
}

function new_show_next_full(){
	if (xget('full_i'+(new_i_curent+1))) {new_show_img_full(new_i_curent+1);}
	return false;
}
function new_show_prev_full(){
	if (xget('full_i'+(new_i_curent-1))) {new_show_img_full(new_i_curent-1);}
	return false;
}

function new_start_slideshow_full()
{
	if (full_new_slideshow==0)
	{
		xget('full_play').src='/images/sekonic/v_stop.gif';
		full_new_slideshow=1;
		new_start_slideshow_full_();
	}
	else
	{
		xget('full_play').src='/images/sekonic/v_play.gif';		
		full_new_slideshow=0;
	}
	return false;
}

function new_start_slideshow_full_()
{
	if (full_new_slideshow==1)
	{	
		if (!xget('full_i'+(new_i_curent+1))) {new_i_curent=-1}
		new_show_next_full();
		if (new_i_curent>=0) {
			setTimeout("new_start_slideshow_full_();",5000);	
		}
	}
	return false;
}

function isnew_start_full() {
	if (xget('t2')) {
	if (xget('t2').style.display=='block') {
		xget('popuptableBG2').style.height=getDocumentHeight()+'px';
		xget('t2').style.top=(getBodyScrollTop()+8)+"px";
		xget('t2').style.width=(getViewportWidth()-16-16)+"px";
		xget('t2').style.height=(getViewportHeight()-16-16)+"px";
		xget('blk1').style.height=(getViewportHeight()-77-16-16-5)+"px";	
		new_show_img_full(new_i_curent);
	}
	}
}

function new_start_full() {
	
	new_show_img_full(new_i_curent);
	xget('popuptableBG2').style.height=getDocumentHeight()+'px';
	xget('popuptableBG2').style.display='block';
	xget('t2').style.display='block';
	xget('t2').style.top=(getBodyScrollTop()+8)+"px";
	xget('t2').style.left="8px";
	xget('t2').style.width=(getViewportWidth()-16-16)+"px";
	xget('t2').style.height=(getViewportHeight()-16-16)+"px";

	xget('blk1').style.height=(getViewportHeight()-77-16-16-5)+"px";
//	xget('imageslist').style.width=(getViewportWidth()-21-16-16)+"px";
//	xget('t2').style.left=parseInt(((getDocumentWidth()-parseInt(xget('t2').offsetWidth))/2))+"px";
	
	if (xget("scroller_bar9") && !second9)
	{
			second9 = new Scroll('scroller9', 'scroller_bar9', 'movemenu9', 848);
			second9.prepare();
			document.onmousemove = handleOnMouseMove;
			window.onmouseup = handleOnMouseUp;			 
			 
			xget('scroller_bar9').onclick = handleOnClickBarsecond9;    
			xget('scroller9').onmousedown = handleOnMouseDownsecond9;
			xget('scroller9').onmouseup = handleOnMouseUp;
			xget('scroller9').onclick = handleOnClicksecond9; 
			
//			if (xget('withscript9').addEventListener)
//				xget('withscript9').addEventListener('DOMMouseScroll', handleOnMouseWheelsecond9, false);
//			xget('withscript9').onmousewheel = handleOnMouseWheelsecond9;
			
	}			
	
	xget('popuptableBG2').onclick=function(){new_close_full();};
	if (new_slideshow==0) {xget('full_play').src='/images/sekonic/v_play.gif';} else {new_slideshow=0;full_new_slideshow=1;xget('full_play').src='/images/sekonic/v_stop.gif';new_start_slideshow_full_();}	
	
	var coll = document.getElementsByTagName('OBJECT');	
	if (coll!=null) {
		for (i=0; i<coll.length; i++)
		{
			coll[i].style.display='none';
		}
	} 
	
	new_i_curent=new_i_curent-1;
	new_show_next_full();
	
	return false;	
}

function new_close_full() {	
	if (xget('play'))
	{
		if (full_new_slideshow==0) {xget('play').src='/images/sekonic/v_play.gif';} else {full_new_slideshow=0;new_slideshow=1;xget('play').src='/images/sekonic/v_stop.gif';new_start_slideshow_();}
	}	
	xget('t2').style.display='none';	
	xget('popuptableBG2').style.display='none';
	
	var coll = document.getElementsByTagName('OBJECT');	
	if (coll!=null) {
		for (i=0; i<coll.length; i++)
		{
			coll[i].style.display='block';
		}
	} 	
	
	return false;	
}

function setattrebut(url) {	
	if (xget("blk1_link"))
	{
		if (url=="")
		{
			xget("blk1_link").style.cursor='default';
			xget("blk1_link").click="location.href='#';";			
		}
		else
		{
			xget("blk1_link").style.cursor='pointer';
			xget("blk1_link").click="location.href='"+url+"';";
		}
	}
}

function getBodyScrollTop()
{
  return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}

if (window.attachEvent) {window.attachEvent("onresize", isnew_start_full);}



function openfullViewer(obj)
{
	if (obj)
	{
		var fwidth = obj.getAttribute('fwidth');
		var fheight = obj.getAttribute('fheight');
		var fsrc = obj.getAttribute('fsrc');
		
		if (xget('popuptableIn'))
		{			
			k=(getViewportHeight()-16-16);
			k2=(getViewportWidth()-16-16);

			xget('popuptableIn').innerHTML = "<img src=\"/ThumbnailImage.aspx?path=" + fsrc + "&height=" + k + "&maxwidth=" + k2 + "\" alt=\"\" /><img src=\"/images/cancel.gif\" class=\"popuptableInclose\" alt=\"\" />";
			xget('popuptableIn').onclick=function(){new_close_full3();};
			xget('popuptableBG2').onclick=function(){new_close_full3();};
			var coll = document.getElementsByTagName('OBJECT');	
			if (coll!=null) {
				for (i=0; i<coll.length; i++)
				{
					coll[i].style.display='none';
				}
			} 	
			if (xget('VideoPlayerE')) xget('VideoPlayerE').style.display='none';
			xget('popuptableIn').style.top=(getBodyScrollTop()+8)+"px";
			xget('popuptableBG2').style.height=getDocumentHeight()+'px';
			xget('popuptableBG2').style.display='block';			
			xget('popuptableIn').style.display='block';				
		}		
	}	
}

function new_close_full3() {	
	xget('popuptableIn').style.display='none';	
	xget('popuptableBG2').style.display='none';	
	xget('popuptableIn').innerHTML="";
	var coll = document.getElementsByTagName('OBJECT');	
	if (coll!=null) {
		for (i=0; i<coll.length; i++)
		{
			coll[i].style.display='block';
		}
	} 		
	if (xget('VideoPlayerE')) xget('VideoPlayerE').style.display='block';
	return false;	
}

var cursel=0;
function selAll() {	
	var coll = document.getElementsByTagName('input');	
	if (coll!=null) {		
		for (i=0; i<coll.length; i++)
		{
			if (coll[i].id.indexOf('item')>=0)
			{
				if (cursel==0) coll[i].checked=true;				
				if (cursel==1) coll[i].checked=false;				
			}
		}
		if (cursel==0) {
			cursel=1;
			if (xget('selAllLink')) xget('selAllLink').innerHTML='Unselect All';
			if (xget('selAllImg')) xget('selAllImg').src='/images/unchecked.gif';	
		} else {
			cursel=0;
			if (xget('selAllLink')) xget('selAllLink').innerHTML='Select All';			
			if (xget('selAllImg')) xget('selAllImg').src='/images/checked.gif';			
		}
	} 		
	return false;	
}

function showPreviewI(k,obj) {	
	if (obj) {	
		var tdParent=obj.id.replace('PreviewLink','')
		var idI=obj.id.replace('PreviewLink','PreviewI')

		var coll = document.getElementsByTagName('select');	
		var objFolders;
		var objFiles;
		if (coll!=null) {		
			for (i=0; i<coll.length; i++)
			{
				if (coll[i].id.indexOf(tdParent+'cboFolders')>=0) objFolders=coll[i];
				if (coll[i].id.indexOf(tdParent+'cboFiles')>=0) objFiles=coll[i];
			}
		}
		if (xget(idI).style.display=='block' && k==1)
		{
			obj.innerHTML='Show Preview';
			xget(idI).style.display='none';
			if (objFiles && !objFiles.onchange) objFiles.onchange=function(){};
		}
		else
		{		
			if (objFolders && objFiles) {
				xget(idI).src="/ThumbnailImage.aspx?Path=/Portals/0/"+objFolders['options'][objFolders.selectedIndex].text.replace('Root','')+objFiles['options'][objFiles.selectedIndex].text+"&width=150&IsSave=0";			
				xget(idI).style.border='1px #666666 solid';
				xget(idI).style.display='block';
				obj.innerHTML='Hidden Preview';
				if(!objFiles.onchange)objFiles.onchange=function(){showPreviewI(0,obj)};
			}
		}
	}	
	return false;	
}

function SetCookie (name, value) {
        var argv = SetCookie.arguments;
        var argc = SetCookie.arguments.length;



        var expires = (argc > 2) ? argv[2] : null;
        var path = (argc > 3) ? argv[3] : null;
        var domain = (argc > 4) ? argv[4] : null;
        var secure = (argc > 5) ? argv[5] : false;

        document.cookie = name + "=" + escape (value) +
                ((expires == null) ? "" : ("; expires=" +
expires.toGMTString())) +
                ((path == null) ? "" : ("; path=" + path)) +
                ((domain == null) ? "" : ("; domain=" + domain)) +
                ((secure == true) ? "; secure" : "");

}

function getCookieVal (offset) {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1)
      endstr = document.cookie.length;

   return unescape(document.cookie.substring(offset, endstr));
}


function GetCookie (name) {	

        var arg = name + "=";
        var alen = arg.length;
        var clen = document.cookie.length;
        var i = 0;
					
        while (i < clen) {
                var j = i + alen;
				
                if (document.cookie.substring(i, j) == arg)
                        return getCookieVal (j);
                i = document.cookie.indexOf(" ", i) + 1;
                        if (i == 0)
                                break;
                }
   return null;
}

function showVideo(id) {	
	if (id==0)
	{
		if (xget('vid_0')) xget('vid_0').style.display='block';	
		if (xget('vid_1')) xget('vid_1').style.display='none';	
		SetCookie('vidShow',0,null,'/');
	}
	if (id==1)
	{
		if (xget('vid_0')) xget('vid_0').style.display='none';	
		if (xget('vid_1')) xget('vid_1').style.display='block';	
		SetCookie('vidShow',1,null,'/');
	}
	return false;	
}

function showVideo2(id,id2) {	
	if (id2==0)
	{
		if (xget('vid_'+id+'_0')) xget('vid_'+id+'_0').style.display='block';	
		if (xget('vid_'+id+'_1')) xget('vid_'+id+'_1').style.display='none';	
		SetCookie('vidShow',0,null,'/');
	}
	if (id2==1)
	{
		if (xget('vid_'+id+'_0')) xget('vid_'+id+'_0').style.display='none';	
		if (xget('vid_'+id+'_1')) xget('vid_'+id+'_1').style.display='block';	
		SetCookie('vidShow',1,null,'/');
	}
	return false;	
}


function are_cookies_enabled()
{
	var cookieEnabled = (navigator.cookieEnabled) ? true : false;

	if (typeof navigator.cookieEnabled == "undefined" && !cookieEnabled)
	{ 
		document.cookie="testcookie";
		cookieEnabled = (document.cookie.indexOf("testcookie") != -1) ? true : false;
	}
	return (cookieEnabled);
}

function touchHandler(event) {
    var touches = event.changedTouches,
        first = touches[0],
        type = "",
        callee = arguments.callee;
    if (touches.length === 1) {
        switch (event.type) {
        case "touchstart":
            type = "mousedown";
            break;
            callee._previousTarget = null;
        case "touchmove":
            type = "mousemove";
            break;
        case "touchend":
            type = "mouseup";
            break;
        default:
            return;
        }
        var simulatedEvent = document.createEvent("MouseEvent");
        simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0, null);
        first.target.dispatchEvent(simulatedEvent);
        if (simulatedEvent.defaultPrevented) {
            event.preventDefault();
        }
        if (callee._previousEvent && callee._previousEvent.touches) {}
        if (event.type === "touchend" && !simulatedEvent.defaultPrevented && callee._previousEvent && callee._previousEvent.touches && callee._previousEvent.touches[0].target === first.target && callee._previousEvent.type !== "touchmove") {
            event.preventDefault();
            simulatedEvent = document.createEvent("MouseEvent");
            simulatedEvent.initMouseEvent("click", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0, null);
            first.target.dispatchEvent(simulatedEvent);
            if (simulatedEvent.defaultPrevented) {
                event.preventDefault();
            }
        }
        callee._previousEvent = first;
    }
}
if (typeof Touch !== "undefined") {
    document.addEventListener('touchstart', touchHandler, true);
    document.addEventListener('touchmove', touchHandler, true);
    document.addEventListener('touchend', touchHandler, true);
    document.addEventListener('touchcancel', touchHandler, true);
}
