function conf()
{
  if( confirm( 'Are you sure?' ) ) return true
  else return false;
}

function conf_del()
{
  if( confirm( 'Are you sure you want to remove this item?' ) ) 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 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;
}
function xgetO(id) {
	if(window.opener.document.getElementById) return window.opener.document.getElementById(id);
	if(window.opener.document.all) return window.opener.document.all[id];
	return null;
}


var slideshow=1;
var i_curent=0;
function set_feat (obj){
	slideshow=0;
	if (xget('feat_'+obj.id))
	{
		for (var i=0;i<=50; i++)
		{
			if (xget('feat_p'+i))
			{
				xget('feat_p'+i).style.display='none';
				if (xget('zoom_p'+i)) xget('zoom_p'+i).style.display='none';				
				if (xget('feat_tp'+i)) xget('feat_tp'+i).style.display='none';
				if (xget('p'+i)) xget('p'+i).className='p';
				if (('p'+i)==obj.id) i_curent=i;
			}
		}

		if (xget('feat_'+obj.id)) xget('feat_'+obj.id).style.display='block';
		if (xget('zoom_'+obj.id)) xget('zoom_'+obj.id).style.display='inline-table';		
		if (xget('feat_t'+obj.id)) xget('feat_t'+obj.id).style.display='block';
		obj.className='p_a';
	}
	return false;
}
function set_feat_ (obj){
	if (xget('feat_'+obj.id))
	{
		for (var i=0;i<=50; i++)
		{
			if (xget('feat_p'+i))
			{
				xget('feat_p'+i).style.display='none';
				if (xget('zoom_p'+i)) xget('zoom_p'+i).style.display='none';				
				if (xget('feat_tp'+i)) xget('feat_tp'+i).style.display='none';
				if (xget('p'+i)) xget('p'+i).className='p';
				if (('p'+i)==obj.id) i_curent=i;
			}
		}

		if (xget('feat_'+obj.id)) xget('feat_'+obj.id).style.display='block';
		if (xget('zoom_'+obj.id)) xget('zoom_'+obj.id).style.display='inline-table';		
		if (xget('feat_t'+obj.id)) xget('feat_t'+obj.id).style.display='block';
		obj.className='p_a';
	}
}

function set_feat_next(){
	if (xget('p'+(i_curent+1))) set_feat (xget('p'+(i_curent+1)));
	return false;
}
function set_feat_prev(){
	if (xget('p'+(i_curent-1))) set_feat (xget('p'+(i_curent-1)));
	return false;
}
function set_feat_next_(){
	if (xget('p'+(i_curent+1))) set_feat_ (xget('p'+(i_curent+1)));
}
function set_feat_prev_(){
	if (xget('p'+(i_curent-1))) set_feat_ (xget('p'+(i_curent-1)));
}


function set_feat_slideshow()
{
	if (slideshow==1)
	{		
		if (!xget('p'+(i_curent+1))) {i_curent=-1}
		set_feat_next_();
		if (i_curent>=0) {
			setTimeout("set_feat_slideshow();",15000);	
		}
	}
}
function set_feat_slideshow_()
{
	getschools();
	if (xget('zoom_p0')) {xget('zoom_p0').style.display='inline-table';}
	type_onchange();
	setTimeout("set_feat_slideshow();",15000);	
}

function type_onchange()
{
	if (xget('dnn_ctr692_EditGalleryTableMy_Type'))
	{
		if (xget('dnn_ctr692_EditGalleryTableMy_Type').value=='Group Show')
		{
			xget('dnn_ctr692_EditGalleryTableMy_Sequence_x0020__x0023__label_lblLabel').parentNode.parentNode.parentNode.style.display='none';
		}
	}
}

function show_feat (){
	if (xget('feat_p'+(i_curent)))
	{
		openAWindow2( xget('feat_p'+(i_curent)).style.backgroundImage.replace("url(","").replace(")",""), '', 800+17, 600+17, 1)
	}	
}

function showtab (id){
		for (var i=1;i<=10; i++)
		{
			if (xget('content_tab'+i) && xget('tab'+i))
			{
				xget('content_tab'+i).style.display='none';
				xget('tab'+i).className='tab';
			}
		}
		xget('content_tab'+id).style.display='block';
		xget('tab'+id).className='tab_a';	
}


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 (navigator.userAgent.toLowerCase().indexOf('gecko') != -1) {
     window.attachEvent = function(eventName, delegate) {
         this.addEventListener(eventName.substring(2), delegate, false);
     } 
 }
 
function show_noshow(id) {
	for(i=61;i<=69;i++)
	{
		xget('id'+i).style.display='none';
	}
	if (id!="id0")
	{
		if (xget(id).style.display=='')
			xget(id).style.display='none';
		else
		{
			xget(id).style.display='';
			xget('map').src="/images/moc/map/n"+id+".jpg";
		}
	}
}

function show_div(id) {
	if (xget(id))
	{	
		if (xget(id).style.display=='block' || xget(id).style.display=='')
		{
			xget(id).style.display='none';
			pathname = location.pathname;
			myDomain = pathname.substring(0,pathname.lastIndexOf('/')) +'/';
			var largeExpDate = new Date ();
			largeExpDate.setTime(largeExpDate.getTime());
			if (id=='Moreportfolios') SetCookie('isportfolio',0,null,'/');
			if (id=='Morediagrams') SetCookie('isdiagram',0,null,'/');
			if (id=='GroupShows') SetCookie('isgroupshows',0,null,'/');
			if (id=='Diagrams') SetCookie('isDiagrams',0,null,'/');
			if (id=='Assignments') SetCookie('isAssignments',0,null,'/');
			
			if (id=='AddEditPortfolios') SetCookie('isAddEditPortfolios',0,null,'/');			
			if (id=='Portfolios1') SetCookie('isportfolio1',0,null,'/');
			if (id=='MyVideos') SetCookie('isMyVideos',0,null,'/');
			if (id=='MyPortfolio') SetCookie('isMyPortfolio',0,null,'/');
			if (id=='MyDiagram') SetCookie('isMyDiagram',0,null,'/');
			if (id=='MyAssignment') SetCookie('isMyAssignment',0,null,'/');
			if (id=='MyProfile') SetCookie('isMyProfile',0,null,'/');
		}
		else
		{
			xget(id).style.display='block';
			pathname = location.pathname;
			myDomain = pathname.substring(0,pathname.lastIndexOf('/')) +'/';
			var largeExpDate = new Date ();
			largeExpDate.setTime(largeExpDate.getTime());
			if (id=='Moreportfolios') SetCookie('isportfolio',1,null,'/');
			if (id=='Morediagrams') SetCookie('isdiagram',1,null,'/');
			if (id=='GroupShows') SetCookie('isgroupshows',1,null,'/');			
			if (id=='Diagrams') SetCookie('isDiagrams',1,null,'/');
			if (id=='Assignments') SetCookie('isAssignments',1,null,'/');			
			if (id=='AddEditPortfolios') SetCookie('isAddEditPortfolios',1,null,'/');			
			if (id=='Portfolios1') SetCookie('isportfolio1',1,null,'/');	
			if (id=='MyVideos') SetCookie('isMyVideos',1,null,'/');	
			if (id=='MyPortfolio') SetCookie('isMyPortfolio',1,null,'/');	
			if (id=='MyDiagram') SetCookie('isMyDiagram',1,null,'/');
			if (id=='MyAssignment') SetCookie('isMyAssignment',1,null,'/');
			if (id=='MyProfile') SetCookie('isMyProfile',1,null,'/');	
		}
	}
	return false;
}


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 getTestimonial(stat,select) {
	var obj=document.getElementById('Dealer');
	while (obj.options.length>=1)
		obj.remove(0);

	obj.options[0]=new Option("Please Wait!!!","");

	obj.selectedIndex=obj.options.length-1;
	obj.disabled=true;  
   	makeHttpRequest('/checkState.aspx?stat='+stat+'&select='+select, 'displayTestimonial', 'text');
}
function displayTestimonial(text) { 
	obj=document.getElementById('Dealer');
	obj.disabled=false;
	obj.options[0]=new Option("None","None");
	obj.selectedIndex=obj.options.length-1;
	while (obj.options.length>1)
		obj.remove(1);   	
	eval(text);		
}

function getTestimonial3(stat,s) {
   	makeHttpRequest('/checkPortfolio.aspx?stat='+stat+'&select='+s, 'displayTestimonial3', 'text');
}
function displayTestimonial3(text) { 
	obj=document.getElementById('dnn_ctr701_EditGalleryTable_Description');
	obj2=document.getElementById('dnn_ctr701_EditGalleryTable_Photo_url_cboFolders');
	obj3=document.getElementById('dnn_ctr701_EditGalleryTable_Photo_url_cboFiles');
//	alert(text);
	eval(text);		
}

function gettrum(url,id) {
	url=url.replace("ThumbnailImage.aspx?","ThumbnailImageGetStr.aspx?idimg="+id+"&");
   	makeHttpRequest(url, 'displaytrum', 'text');
}
function displaytrum(text) { 
	eval(text);		
}

function getschools() {
   	makeHttpRequest('/schools.aspx', 'displayschools', 'text');
}
function displayschools(text) { 
	eval(text);		
}


function delayedAlert(){
         setTimeout("getTestimonial2();",5000);
}
function getTestimonial2() {
	if (xget("DealerSelect") && xget("Dealer") && xget("Statedealer"))
		getTestimonial(xget("Statedealer").value,xget("DealerSelect").innerHTML)
}


function ShowSelectUsers(obj) {
   	makeHttpRequest('/getusersmy.aspx?value='+obj.value, 'displaySelectUsers', 'text');
}
function ShowSelectUsers2(obj) {
   	makeHttpRequest('/getusersmy.aspx?value='+obj.value+'&t=1', 'displaySelectUsers', 'text');
}
function displaySelectUsers(text) { 
	eval(text);		
}
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;
	}
}


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;
}

var i_curent_port=0;

var ccc = 0;
function show_desc (id){
	if (xget('port_'+id) && xget('port_temp'))
	{
		detect_user_agent();
		str='<table width="100%" border="0" cellspacing="0" cellpadding="0">';
		if (navigator.IE6) 
        	str+='<tr><td><img src="/images/moc/e.gif" alt="" width="217" height="21" class="png" /></td></tr>';		
		else		
        	str+='<tr><td><img src="/images/moc/gallery/table5_1.png" alt="" width="217" height="21" class="png" /></td></tr>';
		if (navigator.IE6) 
			 str+='<tr><td class="center_bg_">';
		else		
			 str+='<tr><td class="center_bg">';
		str+=xget('port_'+id).innerHTML.replace('class="text display_none"','class="text"')
		str+='</td></tr>';
		if (navigator.IE6) 
        	str+='<tr><td><img src="/images/moc/e.gif" alt="" width="217" height="21" class="png" /></td></tr>';		
		else
        	str+='<tr><td><img src="/images/moc/gallery/table5_3.png" alt="" width="217" height="21" class="png" /></td></tr>';
		str+='</table>';
		xget('port_temp').innerHTML=str;
		
		var p = "";
		if (xget('dnn_ctr1105_search_list_gallery_search')) p="/Prospectus/Search/Profile/";
		if (xget('dnn_ctr1007_search_list_Studio_search')) p="/Studio/Diagram/";
		if (xget('dnn_ctr1058_search_list_gallery_search')) p="/FacultyLounge/Portfolio/";
		if (xget('dnn_ctr716_search_list_gallery_search')) p="/Gallery/Portfolio/";		
		if (p!='' && xget('image_'+id))
		{
			xget('image_'+id).onclick=function(){location.href=''+p+''+id+'.aspx';return false;};
			if (ccc>0 && xget('image_'+ccc)) xget('image_'+ccc).onclick=function(){return true;};
			ccc=id;
		}
		
		if (navigator.IE6) 
		{
			xget('port_temp').style.top=(xget('port_'+id).offsetTop+178)+'px';
			xget('port_temp').style.left=(xget('port_'+id).offsetLeft+32)+'px';					
		}
		else
		{
			xget('port_temp').style.top=xget('port_'+id).offsetTop+'px';
			xget('port_temp').style.left=xget('port_'+id).offsetLeft+'px';					
		}
				
		xget('port_temp').style.display='block';		
	}
}

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.IE9=		!!(navigator.appVersion.indexOf("IE 9")>0&&navigator.DOM&&!navigator.OPERA?1: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.IE7||navigator.IE8||navigator.IE9);
	navigator.MAC=		!!(navigator.userAgent.indexOf("Mac")>0);
	navigator.Mozilla=		!!(navigator.userAgent.indexOf("Mozilla")>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	);
	}


function send_to_group(id)
{
	if (xget('imgnum') && xget('groupshow'))
	{
	if (xget('imgnum').value!='' && xget('groupshow').value!='')
	{
		location.href='/Gallery/Portfolio/'+id+'.aspx?imgnum='+xget('imgnum').value.replace('FileID=','')+'&groupshow='+xget('groupshow').value+'';
	}
	}
}

var showtabstudio_cur=1;
function showtabstudio(id)
{
	showtabstudio_cur=id;
	if (xget('withscript2_tab11') && xget('withscript2_tab12') || true)
	{
		xget('tabstudio11').className='studio_tab_small_';
		xget('tabstudio21').className='studio_tab_small_';
		xget('tabstudio31').className='studio_tab_small_';
		xget('tabstudio41').className='studio_tab_small_';
		xget('tabstudio51').className='studio_tab_small_';
		if (id==11 || id==12 || id==13)
			xget('tabstudio11').className='studio_tab_small_a';
		if (id==21 || id==22)
			xget('tabstudio21').className='studio_tab_small_a';
		if (id==31 || id==32)
			xget('tabstudio31').className='studio_tab_small_a';
		if (id==41 || id==42 || id==43)
			xget('tabstudio41').className='studio_tab_small_a';
		if (id==51)
			xget('tabstudio51').className='studio_tab_small_a';

		if (xget('withscript2_tab11')) xget('withscript2_tab11').style.display='none';
		if (xget('withscript2_tab12')) xget('withscript2_tab12').style.display='none';
		if (xget('withscript2_tab13')) xget('withscript2_tab13').style.display='none';
		if (xget('withscript2_tab21')) xget('withscript2_tab21').style.display='none';
		if (xget('withscript2_tab31')) xget('withscript2_tab31').style.display='none';
		if (xget('withscript2_tab32')) xget('withscript2_tab32').style.display='none';
		if (xget('withscript2_tab41')) xget('withscript2_tab41').style.display='none';		
		if (xget('withscript2_tab42')) xget('withscript2_tab42').style.display='none';		
		if (xget('withscript2_tab43')) xget('withscript2_tab43').style.display='none';		
		if (xget('withscript2_tab51')) xget('withscript2_tab51').style.display='none';				
		if (xget('withscript2_tab11')) xget('withscript2_tab'+id).style.display='block';	
		for (i=1;i<=62;i++)
		{
			if (xget('i'+i+'_dIi15v'))
			{
//			if (parseInt(xget('i'+i+'_dIi15v').style.left)<tableX1 || parseInt(xget('i'+i+'_dIi15v').style.left)>tableX2-parseInt(xget('i'+i+'_dIi15v').style.width) || parseInt(xget('i'+i+'_dIi15v').style.top)<tableY1 || parseInt(xget('i'+i+'_dIi15v').style.top)>tableY2-parseInt(xget('i'+i+'_dIi15v').style.height))
			if (parseInt(xget('i'+i+'_dIi15v').style.left)>=elementsX1)
			{					
				xget('i'+i+'_dIi15v').style.display='none';		
			}		
			}			
			for (j=1;j<=5;j++)
			{						
				if (xget('i'+i+'_'+j+'dIi15v'))
				{
//				if (parseInt(xget('i'+i+'_'+j+'dIi15v').style.left)<tableX1 || parseInt(xget('i'+i+'_'+j+'dIi15v').style.left)>tableX2-parseInt(xget('i'+i+'_'+j+'dIi15v').style.width) || parseInt(xget('i'+i+'_'+j+'dIi15v').style.top)<tableY1 || parseInt(xget('i'+i+'_'+j+'dIi15v').style.top)>tableY2-parseInt(xget('i'+i+'_'+j+'dIi15v').style.height))
				if (parseInt(xget('i'+i+'_'+j+'dIi15v').style.left)>=elementsX1)
				{							
					xget('i'+i+'_'+j+'dIi15v').style.display='none';		
				}		
				}
			}
		}					
		if (id==11)
		{
			for (i=1;i<=11;i++)
			{
				if (xget('i'+i+'_dIi15v'))
				{
					xget('i'+i+'_dIi15v').style.display='block';
				}				
				for (j=1;j<=5;j++)
				{				
				if (xget('i'+i+'_'+j+'dIi15v'))
				{
					xget('i'+i+'_'+j+'dIi15v').style.display='block';
				}
				}
			}
		}
		else if (id==12)
		{	
			for (i=12;i<=21;i++)
			{
				if (xget('i'+i+'_dIi15v'))
				{
					xget('i'+i+'_dIi15v').style.display='block';
				}
				for (j=1;j<=5;j++)
				{				
				if (xget('i'+i+'_'+j+'dIi15v'))
				{
					xget('i'+i+'_'+j+'dIi15v').style.display='block';
				}
				}
			}
		}
		else if (id==21)
		{	
			for (i=22;i<=24;i++)
			{
				if (xget('i'+i+'_dIi15v'))
				{
					xget('i'+i+'_dIi15v').style.display='block';
				}
				for (j=1;j<=5;j++)
				{				
				if (xget('i'+i+'_'+j+'dIi15v'))
				{
					xget('i'+i+'_'+j+'dIi15v').style.display='block';
				}
				}
			}
		}
		else if (id==31)
		{	
			for (i=25;i<=34;i++)
			{
				if (xget('i'+i+'_dIi15v'))
				{
					xget('i'+i+'_dIi15v').style.display='block';
				}
				for (j=1;j<=5;j++)
				{
				if (xget('i'+i+'_'+j+'dIi15v'))
				{
					xget('i'+i+'_'+j+'dIi15v').style.display='block';
				}
				}				
			}
			for (i=62;i<=62;i++)
			{
				if (xget('i'+i+'_dIi15v'))
				{
					xget('i'+i+'_dIi15v').style.display='block';
				}
				for (j=1;j<=5;j++)
				{
				if (xget('i'+i+'_'+j+'dIi15v'))
				{
					xget('i'+i+'_'+j+'dIi15v').style.display='block';
				}
				}				
			}
		}		
		else if (id==41)
		{	
			for (i=35;i<=38;i++)
			{
				if (xget('i'+i+'_dIi15v'))
				{
					xget('i'+i+'_dIi15v').style.display='block';
				}
				for (j=1;j<=5;j++)
				{								
				if (xget('i'+i+'_'+j+'dIi15v'))
				{
					xget('i'+i+'_'+j+'dIi15v').style.display='block';
				}
				}
			}
		}
		else if (id==42)
		{	
			for (i=39;i<=41;i++)
			{
				if (xget('i'+i+'_dIi15v'))
				{
					xget('i'+i+'_dIi15v').style.display='block';
				}
				for (j=1;j<=5;j++)
				{								
				if (xget('i'+i+'_'+j+'dIi15v'))
				{
					xget('i'+i+'_'+j+'dIi15v').style.display='block';
				}
				}
			}
		}
		else if (id==43)
		{	
			for (i=42;i<=49;i++)
			{
				if (xget('i'+i+'_dIi15v'))
				{
					xget('i'+i+'_dIi15v').style.display='block';
				}
				for (j=1;j<=5;j++)
				{								
				if (xget('i'+i+'_'+j+'dIi15v'))
				{
					xget('i'+i+'_'+j+'dIi15v').style.display='block';
				}
				}
			}
		}
		else if (id==51)
		{	
			for (i=50;i<=60;i++)
			{
				if (xget('i'+i+'_dIi15v'))
				{
					xget('i'+i+'_dIi15v').style.display='block';
				}
				for (j=1;j<=5;j++)
				{								
				if (xget('i'+i+'_'+j+'dIi15v'))
				{
					xget('i'+i+'_'+j+'dIi15v').style.display='block';
				}
				}
			}
		}
		
	}
	return false;
}

function getOffsetx (element) {
   var x=0, y=0;
   if (element.getBoundingClientRect) {
     var offset = element.getBoundingClientRect();
     x = offset.left;
     y = offset.top;
   } else {
     while (element !== null && element !== parent)  {
       x += element.offsetLeft || 0;
       y += element.offsetTop || 0;
       element = element.offsetParent;
     }
   }
   return x
 }
 function getOffsety (element) {
   var x=0, y=0;
   if (element.getBoundingClientRect) {
     var offset = element.getBoundingClientRect();
     x = offset.left;
     y = offset.top;
   } else {
     while (element !== null && element !== parent)  {
       x += element.offsetLeft || 0;
       y += element.offsetTop || 0;
       element = element.offsetParent;
     }
   }
   return y
 }
 
function isNumber(x) {
   return ! isNaN(x * 1);
}

if (window.attachEvent) {window.attachEvent("onload", set_feat_slideshow_);}

function addproduct(id,str) {
	if (xgetO(id))
	{
		xgetO(id).value=xgetO(id).value+str+"\n";
	}
	else
	{
		if (xgetO('dnn_ctr553_EditUserDefinedTable_Products'))
		{
			xgetO('dnn_ctr553_EditUserDefinedTable_Products').value=xgetO('dnn_ctr553_EditUserDefinedTable_Products').value+str+"\n";
		}	
	}
	window.close();
	return false;
}


function listproducts(id) {
	window.open('/Admin/Articles/Articles/Products.aspx');
    return false;
}

function listproducts2(id,i) {
	window.open('/Admin/Articles/Articles/Products.aspx?MOID='+i);
    return false;
}

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)+7;
		}

		var leftPxAll=0;
		var ii=0;
		for (i=(parseInt(xget('allNum').innerHTML)-1);i>=0;i--)
		{		
			leftPxAll=leftPxAll+parseInt(xget('i'+i).offsetWidth)+7;			
			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==438)
		{
			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 (second111) second111.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").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=289&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";	
		
		xget("imgBig").ontouchstart = small_imgBigOntouchstart;		
		xget("imgBig").ontouchmove = small_imgBigOntouchmove;
		
		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_img_new(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)+7;
		}

		var leftPxAll=0;
		var ii=0;
		for (i=(parseInt(xget('allNum').innerHTML)-1);i>=0;i--)
		{		
			leftPxAll=leftPxAll+parseInt(xget('i'+i).offsetWidth)+7;			
			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==438)
		{
			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 (second111) second111.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").src="/lightbox/images/loading.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=289&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";	
		
		xget("imgBig").ontouchstart = small_imgBigOntouchstart;		
		xget("imgBig").ontouchmove = small_imgBigOntouchmove;
		
		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_show_next_new(){
	if (xget('i'+(new_i_curent+1))) new_show_img_new(new_i_curent+1);
	return false;
}
function new_show_prev_new(){
	if (xget('i'+(new_i_curent-1))) new_show_img_new(new_i_curent-1);
	return false;
}

function new_start_slideshow()
{
	if (new_slideshow==0)
	{
		xget('play').src='/images/moc/v_stop.gif';
		new_slideshow=1;
		new_start_slideshow_();
	}
	else
	{
		xget('play').src='/images/moc/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)+7;
		}

		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)+7;
			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").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";		
		
		xget("full_imgBig").ontouchstart = full_imgBigOntouchstart;		
		xget("full_imgBig").ontouchmove = full_imgBigOntouchmove;
		
		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;
}

var viewer_touchpageXstart=0;
var viewer_touchpageXmove=0;

function full_imgBigOntouchstart(e) {
	if(e.touches.length == 1){ // Only deal with one finger
			var touch = e.touches[0]; // Get the information for finger #1
			var node = touch.target; // Find the node the drag started from
			viewer_touchpageXstart=touch.pageX;
		}
    }

function full_imgBigOntouchmove(e) {
		if(e.touches.length == 1){ // Only deal with one finger
			var touch = e.touches[0]; // Get the information for finger #1
			var node = touch.target; // Find the node the drag started from
			viewer_touchpageXmove=touch.pageX;
						
			var ddd=0;
			ddd=viewer_touchpageXmove-viewer_touchpageXstart;
//			alert('Xstart='+viewer_touchpageXstart+'; Xmove='+viewer_touchpageXmove+';');
			if (ddd<0){
				new_show_next_full();
			}
			else{
				new_show_prev_full();
			}

			viewer_touchpageXstart=0;
			viewer_touchpageXmove=0;

            return false;		
		}
}	

var viewer_s_touchpageXstart=0;
var viewer_s_touchpageXmove=0;

function small_imgBigOntouchstart(e) {
	if(e.touches.length == 1){ // Only deal with one finger
			var touch = e.touches[0]; // Get the information for finger #1
			var node = touch.target; // Find the node the drag started from
			viewer_s_touchpageXstart=touch.pageX;			
		}
    }

function small_imgBigOntouchmove(e) {
		if(e.touches.length == 1){ // Only deal with one finger
			var touch = e.touches[0]; // Get the information for finger #1
			var node = touch.target; // Find the node the drag started from
			viewer_s_touchpageXmove=touch.pageX;
						
			var ddd=0;
//			alert('Xstart='+viewer_s_touchpageXstart+'; Xmove='+viewer_s_touchpageXmove+';');
			ddd=viewer_s_touchpageXmove-viewer_s_touchpageXstart;
			if (ddd<0){
				new_show_next();
			}
			else{
				new_show_prev();
			}

			viewer_s_touchpageXstart=0;
			viewer_s_touchpageXmove=0;

            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/moc/v_stop.gif';
		full_new_slideshow=1;
		new_start_slideshow_full_();
	}
	else
	{
		xget('full_play').src='/images/moc/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('popuptableBG').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('popuptableBG').style.height=getDocumentHeight()+'px';
	xget('popuptableBG').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; 
			
			get('withscript9').ontouchmove = handleOnMousetouchmovesecond9;
			get('withscript9').ontouchstart = handleOnMousetouchstartsecond9;
			
//			if (xget('withscript9').addEventListener)
//				xget('withscript9').addEventListener('DOMMouseScroll', handleOnMouseWheelsecond9, false);
//			xget('withscript9').onmousewheel = handleOnMouseWheelsecond9;
			
	}			
	
	xget('popuptableBG').onclick=function(){new_close_full();};
	if (new_slideshow==0) {xget('full_play').src='/images/moc/v_play.gif';} else {new_slideshow=0;full_new_slideshow=1;xget('full_play').src='/images/moc/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 (full_new_slideshow==0) {xget('play').src='/images/moc/v_play.gif';} else {full_new_slideshow=0;new_slideshow=1;xget('play').src='/images/moc/v_stop.gif';new_start_slideshow_();}
	xget('t2').style.display='none';	
	xget('popuptableBG').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+"';";
		}
	}
}


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 getBodyScrollLeft()
{
  return self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);
}

if (window.attachEvent) {window.attachEvent("onresize", isnew_start_full);}

function setselectCategory(i)
{
  if (xget('dnn_ctr783_Events_EventMonth_SelectCategory_ddlCategories')) 
  {
	  xget('dnn_ctr783_Events_EventMonth_SelectCategory_ddlCategories').selectedIndex=i;
	  setTimeout('__doPostBack(\'dnn$ctr783$Events$EventMonth$SelectCategory$ddlCategories\',\'\')', 0);
  }
  
  if (xget('dnn_ctr783_Events_EventList_SelectCategory_ddlCategories')) 
  {
	  xget('dnn_ctr783_Events_EventList_SelectCategory_ddlCategories').selectedIndex=i;
	  setTimeout('__doPostBack(\'dnn$ctr783$Events$EventList$SelectCategory$ddlCategories\',\'\')', 0);
  }
}

function setatfixed0()
{
	if (xget('Form'))
	{	
		xget('Form').setAttribute( "autocomplete", "on" );
	}

	if (xget('atfixed'))
	{	
		setatfixed();
		xget('atfixed').style.display='block';
	}
	if (xget('atfixed2'))
	{	
		setatfixed();
		xget('atfixed2').style.display='block';
	}
	
	if (xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl00_Username')) xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl00_Username').tabIndex=1;
	if (xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl03_DisplayName')) xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl03_DisplayName').tabIndex=2;
	if (xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl04_Email')) xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl04_Email').tabIndex=5;
	if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl00_Contact_I')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl00_Contact_I').tabIndex=4;
	if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl01_Telephone_I')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl01_Telephone_I').tabIndex=6;
	if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl02_Website2')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl02_Website2').tabIndex=3;
	
	if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl05_Street_I')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl05_Street_I').tabIndex=7;
	if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl06_Street2_I')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl06_Street2_I').tabIndex=8;
	if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl07_City_I')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl07_City_I').tabIndex=9;
	if (xget('Country_I')) xget('Country_I').tabIndex=10;
	if (xget('State_I')) xget('State_I').tabIndex=11;
	if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl10_Zip_I')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl10_Zip_I').tabIndex=12;
	if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl11_HowDidyoufind_I')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl11_HowDidyoufind_I').tabIndex=13;
	if (xget('P_degrees_offered')) xget('P_degrees_offered').tabIndex=14;
	if (xget('Orientation_I')) xget('Orientation_I').tabIndex=15;
	if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl14_Keywords_I')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl14_Keywords_I').tabIndex=16;
	if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl15_IsShowProspectus')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl15_IsShowProspectus').tabIndex=17;
	if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl16_IsSend')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl16_IsSend').tabIndex=18;		
	if (xget('dnn_ctr709_ManageUsers_User_txtPassword')) xget('dnn_ctr709_ManageUsers_User_txtPassword').tabIndex=19;
	if (xget('dnn_ctr709_ManageUsers_User_txtConfirm')) xget('dnn_ctr709_ManageUsers_User_txtConfirm').tabIndex=20;
	if (xget('dnn_ctr709_ManageUsers_User_ctlCaptcha')) xget('dnn_ctr709_ManageUsers_User_ctlCaptcha').tabIndex=21;
	if (xget('dnn_ctr709_ManageUsers_cmdRegister_cmdRegister_icon')) xget('dnn_ctr709_ManageUsers_cmdRegister_cmdRegister_icon').tabIndex=22;
	if (xget('dnn_ctr709_ManageUsers_cmdRegister_cmdRegister_link')) xget('dnn_ctr709_ManageUsers_cmdRegister_cmdRegister_link').tabIndex=23;
	
	if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl02_SchoolName_E'))
	{
		if (xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl00_Username')) xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl00_Username').tabIndex=1;
		if (xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl01_FirstName')) xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl01_FirstName').tabIndex=2;
		if (xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl02_LastName')) xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl02_LastName').tabIndex=3;
		if (xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl03_DisplayName')) xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl03_DisplayName').tabIndex=4;
		if (xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl04_Email')) xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl04_Email').tabIndex=5;
		if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl02_SchoolName_E')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl02_SchoolName_E').tabIndex=6;
		if (xget('SchoolType_E')) xget('SchoolType_E').tabIndex=7;
		if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl05_Streetaddress')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl05_Streetaddress').tabIndex=8;
		if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl06_Streetaddress2')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl06_Streetaddress2').tabIndex=9;
		if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl07_City_E')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl07_City_E').tabIndex=10;
		if (xget('State_E')) xget('State_E').tabIndex=11;
		if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl09_Zipcode_E')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl09_Zipcode_E').tabIndex=12;
		if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl10_Telephone_E')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl10_Telephone_E').tabIndex=13;
		if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl11_Fax_E')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl11_Fax_E').tabIndex=14;
		if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl12_Department')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl12_Department').tabIndex=15;
		if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl13_ClassesYouteach_E')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl13_ClassesYouteach_E').tabIndex=16;
		if (xget('Orientation_E')) xget('Orientation_E').tabIndex=17;
		if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl15_HowDidyoufind_E')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl15_HowDidyoufind_E').tabIndex=18;
		if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl16_IsSend')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl16_IsSend').tabIndex=19;			
		if (xget('dnn_ctr709_ManageUsers_User_txtPassword')) xget('dnn_ctr709_ManageUsers_User_txtPassword').tabIndex=20;
		if (xget('dnn_ctr709_ManageUsers_User_txtConfirm')) xget('dnn_ctr709_ManageUsers_User_txtConfirm').tabIndex=21;
		if (xget('dnn_ctr709_ManageUsers_User_ctlCaptcha')) xget('dnn_ctr709_ManageUsers_User_ctlCaptcha').tabIndex=22;
		if (xget('dnn_ctr709_ManageUsers_cmdRegister_cmdRegister_icon')) xget('dnn_ctr709_ManageUsers_cmdRegister_cmdRegister_icon').tabIndex=23;
		if (xget('dnn_ctr709_ManageUsers_cmdRegister_cmdRegister_link')) xget('dnn_ctr709_ManageUsers_cmdRegister_cmdRegister_link').tabIndex=24;
	}

	if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl03_SchoolName_S'))
	{
		if (xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl00_Username')) xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl00_Username').tabIndex=1;
		if (xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl01_FirstName')) xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl01_FirstName').tabIndex=2;
		if (xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl02_LastName')) xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl02_LastName').tabIndex=3;
		if (xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl03_DisplayName')) xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl03_DisplayName').tabIndex=4;
		if (xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl04_Email')) xget('dnn_ctr709_ManageUsers_User_UserEditor_ctl04_Email').tabIndex=5;
		if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl03_SchoolName_S')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl03_SchoolName_S').tabIndex=6;
		if (xget('SchoolType_S')) xget('SchoolType_S').tabIndex=7;
		if (xget('State_S')) xget('State_S').tabIndex=8;
		if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl06_Degree_S')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl06_Degree_S').tabIndex=9;
		if (xget('DateofGraduation')) xget('DateofGraduation').tabIndex=10;
		if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl08_FacultyPersonsname')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl08_FacultyPersonsname').tabIndex=11;
		if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl09_HowDidyoufind')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl09_HowDidyoufind').tabIndex=12;
		if (xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl10_IsSend2')) xget('dnn_ctr709_ManageUsers_User_ProfileProperties_ctl10_IsSend2').tabIndex=13;	
		if (xget('dnn_ctr709_ManageUsers_User_txtPassword')) xget('dnn_ctr709_ManageUsers_User_txtPassword').tabIndex=14;
		if (xget('dnn_ctr709_ManageUsers_User_txtConfirm')) xget('dnn_ctr709_ManageUsers_User_txtConfirm').tabIndex=15;
		if (xget('dnn_ctr709_ManageUsers_User_ctlCaptcha')) xget('dnn_ctr709_ManageUsers_User_ctlCaptcha').tabIndex=16;
		if (xget('dnn_ctr709_ManageUsers_cmdRegister_cmdRegister_icon')) xget('dnn_ctr709_ManageUsers_cmdRegister_cmdRegister_icon').tabIndex=17;
		if (xget('dnn_ctr709_ManageUsers_cmdRegister_cmdRegister_link')) xget('dnn_ctr709_ManageUsers_cmdRegister_cmdRegister_link').tabIndex=18;
	}


	if (xget('dnn_ctr1210_EditGalleryTableMy_Title') && xget('dnn_ctr1210_EditGalleryTableMy_Video'))
	{
		xget('dnn_ctr1210_EditGalleryTableMy_Title').onclick=function(){if (xget('dnn_ctr1210_EditGalleryTableMy_Title').value=="Enter your video's title.") xget('dnn_ctr1210_EditGalleryTableMy_Title').value='';};
		xget('dnn_ctr1210_EditGalleryTableMy_Video').onclick=function(){if (xget('dnn_ctr1210_EditGalleryTableMy_Video').value=="Paste your video embed code here.") xget('dnn_ctr1210_EditGalleryTableMy_Video').value='';};
		
		xget('dnn_ctr1210_EditGalleryTableMy_cmdUpdate').onclick=function(){
			if (xget('dnn_ctr1210_EditGalleryTableMy_Title').value=="Enter your video's title.") xget('dnn_ctr1210_EditGalleryTableMy_Title').value='';
			if (xget('dnn_ctr1210_EditGalleryTableMy_Video').value=="Paste your video embed code here.") xget('dnn_ctr1210_EditGalleryTableMy_Video').value='';
		};

	}


	if (GetCookie('ShowRelatedPDFCOO')=='1')
	{
		ShowRelatedPDFCOOC();
	}
	if (GetCookie('ShowRelatedImageCOO')=='1')
	{
		ShowRelatedImageCOOC();
	}

}

function setatfixed()
{
	if (xget('atfixed'))
	{		
		var offset = parseInt(xget('atfixedtop').offsetTop);
		var topPadding = 15;
//		alert(offset +'---'+getBodyScrollTop());
		if (getBodyScrollTop() > offset) {
			xget('atfixed').style.top=(parseInt(getBodyScrollTop())+topPadding)+'px';
		}
		else {
			xget('atfixed').style.top=(offset)+'px';
		}
	}
	if (xget('atfixed2'))
	{		
		var offset = parseInt(xget('atfixedtop2').offsetTop);
		var topPadding = 15;
		if (getBodyScrollTop() > offset) {
			xget('atfixed2').style.top=(parseInt(getBodyScrollTop())+topPadding)+'px';
		}
		else {
			xget('atfixed2').style.top=(offset)+'px';
		}
		
		if (xget('atfixedtop3')) 
		{
			var offset = parseInt(xget('atfixedtop3').offsetTop);
			var topPadding = 15;
			if ((getBodyScrollTop()+430) > offset && getBodyScrollTop() > parseInt(xget('atfixedtop2').offsetTop)) {
				xget('atfixed2').style.top=(offset-(430))+'px';		
			}
		}
	}
}

function show_feed(id)
{
	if (xget('Feeds1') && xget('Feeds2'))
	{	
		xget('Feeds1').style.display='none';
		xget('Feeds2').style.display='none';		
		xget('aFeeds1').className='sell';
		xget('aFeeds2').className='sell';
		
		xget('Feeds'+id).style.display='block';		
		xget('aFeeds'+id).className='sell2_a';		
	}
	return false;
}

if (window.attachEvent) {window.attachEvent("onload", setatfixed0);}
if (window.attachEvent) {window.attachEvent("onscroll", setatfixed);}
if (window.attachEvent) {window.attachEvent("ontouchmove", setatfixed);}

function ShowRelatedPDF()
{
	if (xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_2_tr')){
		if (xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_2_tr').style.display=='table-row')
		{
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_2_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_2_tr').style.display='none';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_3_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_3_tr').style.display='none';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_4_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_4_tr').style.display='none';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_5_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_5_tr').style.display='none';
			if (xget('ShowRelatedPDF')) xget('ShowRelatedPDF').innerHTML='Click here to upload additional PDF files >>';
			SetCookie('ShowRelatedPDFCOO',0,null,'/');
		}
		else
		{
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_2_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_2_tr').style.display='table-row';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_3_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_3_tr').style.display='table-row';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_4_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_4_tr').style.display='table-row';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_5_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_5_tr').style.display='table-row';
			if (xget('ShowRelatedPDF')) xget('ShowRelatedPDF').innerHTML='<< Hide additional PDF';
			SetCookie('ShowRelatedPDFCOO',1,null,'/');
		}
	}
	if (xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_2_tr')){
		if (xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_2_tr').style.display=='table-row')
		{
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_2_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_2_tr').style.display='none';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_3_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_3_tr').style.display='none';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_4_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_4_tr').style.display='none';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_5_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_5_tr').style.display='none';
			if (xget('ShowRelatedPDF')) xget('ShowRelatedPDF').innerHTML='Click here to upload additional PDF files >>';	
			SetCookie('ShowRelatedPDFCOO',0,null,'/');
		}
		else
		{
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_2_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_2_tr').style.display='table-row';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_3_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_3_tr').style.display='table-row';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_4_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_4_tr').style.display='table-row';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_5_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_5_tr').style.display='table-row';
			if (xget('ShowRelatedPDF')) xget('ShowRelatedPDF').innerHTML='<< Hide additional PDF';	
			SetCookie('ShowRelatedPDFCOO',1,null,'/');
		}
	}

	return false;
}

function ShowRelatedPDFCOOC()
{
	if (xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_2_tr')){
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_2_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_2_tr').style.display='table-row';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_3_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_3_tr').style.display='table-row';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_4_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_4_tr').style.display='table-row';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_5_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_PDF_5_tr').style.display='table-row';
			if (xget('ShowRelatedPDF')) xget('ShowRelatedPDF').innerHTML='<< Hide additional PDF';
			SetCookie('ShowRelatedPDFCOO',1,null,'/');
	}
	if (xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_2_tr')){
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_2_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_2_tr').style.display='table-row';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_3_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_3_tr').style.display='table-row';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_4_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_4_tr').style.display='table-row';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_5_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_PDF_5_tr').style.display='table-row';
			if (xget('ShowRelatedPDF')) xget('ShowRelatedPDF').innerHTML='<< Hide additional PDF';	
			SetCookie('ShowRelatedPDFCOO',1,null,'/');
	}

	return false;
}

function ShowRelatedImage()
{
	if (xget('dnn_ctr1179_EditStudioTableMy_Related_Image_2_tr')){
		if (xget('dnn_ctr1179_EditStudioTableMy_Related_Image_2_tr').style.display=='table-row')
		{
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_Image_2_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_Image_2_tr').style.display='none';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_Image_3_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_Image_3_tr').style.display='none';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_Image_4_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_Image_4_tr').style.display='none';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_Image_5_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_Image_5_tr').style.display='none';
			if (xget('ShowRelatedImage')) xget('ShowRelatedImage').innerHTML='Click here to upload additional images >>';
			SetCookie('ShowRelatedImageCOO',0,null,'/');
		}
		else
		{
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_Image_2_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_Image_2_tr').style.display='table-row';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_Image_3_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_Image_3_tr').style.display='table-row';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_Image_4_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_Image_4_tr').style.display='table-row';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_Image_5_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_Image_5_tr').style.display='table-row';
			if (xget('ShowRelatedImage')) xget('ShowRelatedImage').innerHTML='<< Hide additional images';
			SetCookie('ShowRelatedImageCOO',1,null,'/');
		}
	}
	if (xget('dnn_ctr1180_EditStudioTableMy_Related_Image_2_tr')){
		if (xget('dnn_ctr1180_EditStudioTableMy_Related_Image_2_tr').style.display=='table-row')
		{
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_Image_2_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_Image_2_tr').style.display='none';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_Image_3_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_Image_3_tr').style.display='none';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_Image_4_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_Image_4_tr').style.display='none';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_Image_5_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_Image_5_tr').style.display='none';
			if (xget('ShowRelatedImage')) xget('ShowRelatedImage').innerHTML='Click here to upload additional images >>';	
			SetCookie('ShowRelatedImageCOO',0,null,'/');
		}
		else
		{
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_Image_2_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_Image_2_tr').style.display='table-row';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_Image_3_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_Image_3_tr').style.display='table-row';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_Image_4_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_Image_4_tr').style.display='table-row';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_Image_5_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_Image_5_tr').style.display='table-row';
			if (xget('ShowRelatedImage')) xget('ShowRelatedImage').innerHTML='<< Hide additional images';	
			SetCookie('ShowRelatedImageCOO',1,null,'/');
		}
	}

	return false;
}

function ShowRelatedImageCOOC()
{
	if (xget('dnn_ctr1179_EditStudioTableMy_Related_Image_2_tr')){
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_Image_2_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_Image_2_tr').style.display='table-row';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_Image_3_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_Image_3_tr').style.display='table-row';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_Image_4_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_Image_4_tr').style.display='table-row';
			if (xget('dnn_ctr1179_EditStudioTableMy_Related_Image_5_tr')) xget('dnn_ctr1179_EditStudioTableMy_Related_Image_5_tr').style.display='table-row';
			if (xget('ShowRelatedImage')) xget('ShowRelatedImage').innerHTML='<< Hide additional images';
			SetCookie('ShowRelatedImageCOO',1,null,'/');
	}
	if (xget('dnn_ctr1180_EditStudioTableMy_Related_Image_2_tr')){
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_Image_2_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_Image_2_tr').style.display='table-row';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_Image_3_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_Image_3_tr').style.display='table-row';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_Image_4_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_Image_4_tr').style.display='table-row';
			if (xget('dnn_ctr1180_EditStudioTableMy_Related_Image_5_tr')) xget('dnn_ctr1180_EditStudioTableMy_Related_Image_5_tr').style.display='table-row';
			if (xget('ShowRelatedImage')) xget('ShowRelatedImage').innerHTML='<< Hide additional images';	
			SetCookie('ShowRelatedImageCOO',1,null,'/');
	}

	return false;
}

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);
}

function showVideoForm()
{
	if (xget('VideoForm0') && xget('VideoForm'))
	{
		xget('VideoForm').style.display='block';
		xget('VideoForm0').style.display='none';
	}
	return false;
}

function clearForm()
{
	if (xget('dnn_ctr1210_EditGalleryTableMy_Title') && xget('dnn_ctr1210_EditGalleryTableMy_Video'))
	{
		xget('dnn_ctr1210_EditGalleryTableMy_Title').value='';
		xget('dnn_ctr1210_EditGalleryTableMy_Video').value='';
	}
	return false;
}

function showVideoBlock(id)
{
	if (xget('VideoBlock_'+id) && xget('VideoBlock'))
	{
		//isbl=true;
		//if (xget('VideoBlock_'+id).style.display=='block') isbl=false;
		//for(i=0;i<50;i++)
		//{
		//	if (xget('VideoBlock_'+i)) xget('VideoBlock_'+i).style.display='none';
		//}
		//if (isbl)
		//{
		//	xget('VideoBlock_'+id).style.display='block';
		//}
		xget('VideoBlock').innerHTML=xget('VideoBlock_'+id).innerHTML;
	}
	return false;
}

function makepage(src,id) {
  // We break the closing script tag in half to prevent
  // the HTML parser from seeing it as a part of
  // the *main* page.
  return "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html>\n" +
    "<head>\n" +
    "<title>Ilford Bucks Certificate</title>\n" +
    "<script>\n" +
    "function step1() {\n" +
    "  setTimeout('step2()', 10);\n" +
    "}\n" +
    "function step2() {\n" +
    "  window.print();\n" +
	
    "if(navigator.userAgent.toLowerCase().indexOf('chrome')<0){\n" +	
	"  if(confirm('The certificate has been sent to your printer. Please check your certificate before closing this window.\\n\\nClick OK if the certificate printer successfully.\\nIf it did not, click Cancel and then Print to try again.')) { window.opener.location.href='/Store/BucksBalance.aspx?ID="+id+"&IsPrint=Yes';window.close();}else{step2();}\n" +
	"}\n" +
    "}\n" +
    "</scr" + "ipt>\n"+
    "<link id='basedstyles' rel='stylesheet' type='text/css' href='/Portals/_default/Skins/moc/css/based.css' /></head>\n" +
    "<body onload=\"step1()\" style='background-color:white; background-image:url(/images/certificate.jpg); padding:0px;'>\n" +	
    "" + src + "\n" +
    "</body>\n" +
    "</html>\n";
}

function loadHash(varHash)
{
  if(varHash != undefined) {
    var strBrowser = navigator.userAgent.toLowerCase();

    if (strBrowser.indexOf('chrome') > 0 || strBrowser.indexOf('safari') > 0) {
        this.location.href = "#" + varHash;
    }
    else {
        this.window.location.hash = "#" + varHash;
    }
  }
}


function openAWindowDiv( pageToLoad, winName, width, height, center) {
		xget('popuptableBG').style.height=getDocumentHeight()+'px';
		xget('popuptableBG').style.display='block';		
		xget('popuptableBG').onclick=function(){closeAWindowDiv();};
		xget('popupdiv').onclick=function(){closeAWindowDiv();};
		var style="position:absolute; top:0px; margin:0;padding:0;left:0px;width:"+width+"px;height:"+height+"px;";
		style+=" margin-left: "+((getViewportWidth()-width)/2)+"px;";
		style+=" margin-top: "+((getViewportHeight()-height)/2)+"px;";	
		xget('popupdiv').innerHTML='<div class="noalpha" style="'+style+'"><a href="#" onclick="closeAWindowDiv()"><img src="/lightbox/images/close_button1.png" style="float:right;"></a><br /><iframe src="'+pageToLoad+'" scrolling="yes" onclick="closeAWindowDiv()" width="'+width+'" height="'+height+'" frameborder="0"></iframe></div>';
		xget('popupdiv').style.display='block';
		xget('popuptableBG').style.display='block';				
}
function closeAWindowDiv() {
		xget('popupdiv').style.display='none';
		xget('popuptableBG').style.display='none';
}

function GenerateCode() {
   	makeHttpRequest('/getGiftCode.aspx', 'displayCode', 'text');
	return false;
}
function displayCode(text) {
	eval(text);		
}
