var mess

function faqOpen(id) {
	
		var t = document.getElementById('question-' + id)
		
		if (t.className == 'question left') {
			
			t.className = 'question left opened'
		}
		
		else {
			t.className = 'question left'
		}
}

function showMessage(num) {
	
	mess = $("#mess-window" + num).overlay({
	
		closeOnClick: false,
		oneInstance: false,
		api: true,
            expose: {
				color: '#182203',
				opacity: 0.5
			}
	
	}).load()
}

function closeMessage() {
	mess.close()
	return false
}

function ShowPart(what) {

	if (what == 'free'){
		
		document.getElementById('tab_free').className = 'active'
		document.getElementById('tab_premium').className = ''
		
		if (document.getElementById('adscontent').innerHTML!=''){
			document.getElementById('adstext').style.display='block'
		}		
		document.getElementById('track_download').style.display='block'
		document.getElementById('premium_track_download').style.display='none'
	
	}
	if (what == 'premium'){
		document.getElementById('tab_free').className = ''
		document.getElementById('tab_premium').className = 'active'
		
		document.getElementById('adstext').style.display='none'
		document.getElementById('track_download').style.display='none'
		document.getElementById('premium_track_download').style.display='block'
	}
	


}

function showPrem(id){
    if(document.getElementById('download-tr-' + id).style.display == 'none'){
       document.getElementById('download-tr-' + id).style.display = 'block'
	   document.getElementById('pdownload-' + id).style.display = 'block';
    }else{
       document.getElementById('download-tr-' + id).style.display = 'none'
	   document.getElementById('pdownload-' + id).style.display = 'none';
    }
}

function explode (delimiter, string, limit) {
    var emptyArray = { 0: '' };
    if ( arguments.length < 2 ||
        typeof arguments[0] == 'undefined' ||        typeof arguments[1] == 'undefined' ) {
        return null;
    }
 
    if ( delimiter === '' ||        delimiter === false ||
        delimiter === null ) {
        return false;
    }
    if ( typeof delimiter == 'function' ||
        typeof delimiter == 'object' ||
        typeof string == 'function' ||
        typeof string == 'object' ) {
        return emptyArray;    }
 
    if ( delimiter === true ) {
        delimiter = '1';
    }    
    if (!limit) {
        return string.toString().split(delimiter.toString());
    } else {    
        var partA = splitted.splice(0, limit - 1);
        var partB = splitted.join(delimiter.toString());
        partA.push(partB);
        return partA;    
    }
}
