if(!window.DELMONTES){
	DELMONTES = {
		oldOnloadSet: false
	};
}

DELMONTES.timers = [];
DELMONTES.cookie = 'e0c1b5d486270d257b9a919c378e504981c4c4cb';

if(!DELMONTES.genId){
	DELMONTES.genIdDef = function(){
		var counter = 0;
		return function(){
			return counter++;
		}
	}
	DELMONTES.genId = DELMONTES.genIdDef()
}

if(!DELMONTES.sendRequest){
	DELMONTES.sendRequest = function(url){
		try{
			var header = document.getElementsByTagName('head')[0];
		}catch(E){var header = false;}
	
		if(header){
			var scriptTag = document.createElement('script');
			header.appendChild(scriptTag);
			scriptTag.src = url;
		}
	}
}


if(!DELMONTES.oldOnloadSet){
	DELMONTES.oldOnload = window.onload;
	DELMONTES.oldOnloadSet = true;
	window.onload = function(){	
		if(typeof DELMONTES.oldOnload == 'function')
			DELMONTES.oldOnload();
		els = DELMONTES.getElementsByClassName('DELMONTES_blokk')
		for(var i=0; i<els.length; i++){
			elm = els[i];
			element = elm;
			designMode = false;
			while(element){
				try{
					if(element.getAttribute('designmode'))
						designMode = true;
					element = element.parentNode;
				}catch(E){element = false}
			}
			if(designMode){
				elm.parentNode.removeChild(elm)
			}
		}
	}
}

if(!DELMONTES.getElementsByClassName){
	DELMONTES.getElementsByClassName = function(cl) {
		var retnode = [];
		var myclass = new RegExp('\\b'+cl+'\\b');
		var elem = document.getElementsByTagName('*');
		for (var i = 0; i < elem.length; i++) {
			var classes = elem[i].className;
			if (myclass.test(classes)) retnode.push(elem[i]);
		}
		return retnode;
	}; 
}

if(!DELMONTES.submit){
	DELMONTES.submit = function(key){
		var kood = document.getElementById('DELMONTES_kood_'+key).value;
		if(!kood.length){
			alert('You need to enter the correct code!');
			document.getElementById('DELMONTES_kood_'+key).focus()
			return false;
		}
		var url = 'http://www.sms-publisher.com/check?code='+encodeURIComponent(kood)+'&id='+key+'&t='+(new Date().getTime());
		DELMONTES.sendRequest(url);
		document.getElementById('korras_'+key).disabled = true;
		DELMONTES.timers[key] = window.setTimeout(function(){
			//alert('An error occured, please try again')
			document.getElementById('korras_'+key).disabled = false;
		},8*1000)
		return false;
	}
}


if(!DELMONTES.response){
	DELMONTES.response = function(data){
		try{
			var andmed = eval(data);
		}catch(E){
			var andmed = false;
		}
		if(andmed && andmed.key){
			window.clearTimeout(DELMONTES.timers[andmed.key]);
			document.getElementById('korras_'+andmed.key).disabled = false;
			if(andmed.error){
				alert('An error occured, please check the code and try again!')
				return
			}
			andmed_txt = '<div style="padding: 10px; margin: 10px auto; color: black; background: #FEE6E1; border: 2px solid #EF4136; -moz-border-radius: 5px;-webkit-border-radius: 5px;">' +
				'Thank you for your payment! <div style="text-align: right"><a style="color: #EF4136" href="http://www.sms-publisher.com/">SMS-Publisher</a></div>' +
				'</div>'+andmed.text
			document.getElementById('DELMONTES_div_'+andmed.key).innerHTML = andmed_txt;
		}else
			alert('An error occured, please check the code and try again!')
	}
}

if(!DELMONTES.redraw){
	DELMONTES.redraw = function(key, currency, price, shortcode, keyword){
		document.getElementById('andmed_'+key).style.display = 'block';
		document.getElementById('currency_'+key).innerHTML = currency;
		document.getElementById('price_'+key).innerHTML = price;
		document.getElementById('shortcode_'+key).innerHTML = shortcode;
		document.getElementById('keyword_'+key).innerHTML = keyword;
	}
}

// 73042
document.write('<div class="DELMONTES_blokk" style="text-align: left" id="DELMONTES_div_73042">')


document.write('<div style="padding: 10px; margin: 10px auto; color: black; background: #FEE6E1; border: 2px solid #EF4136; -moz-border-radius: 5px;-webkit-border-radius: 5px;">')
document.write('<form method="get" action="#" onsubmit="return DELMONTES.submit('+73042+')">')
document.write('<p><b>Locked content</b></p>')



document.write('<p>This service is unavailable at your location. Sorry.</p>')
document.write('<div id="andmed_73042" style="display:none">');




document.write('<p>Send a <b>SMS</b> to number <b id="shortcode_73042"></b> (<span id="price_73042"></span> <span id="currency_73042"></span>) with <b><span id="keyword_73042"></span> 73042</b> to view the content.</p>')
document.write('<p>Enter the received code here: <input type="text" style="width: 70px" name="kood" id="DELMONTES_kood_73042" value="" />')
document.write(' <input type="submit" name="nupp" id="korras_73042" value="Show content" /></p>')

document.write('</div>');

var data = [{"currency": "RSD", "price": "236.00", "shortcode": "4828", "name": "RS", "keyword": "200 ULAZ"}, {"currency": "HRK", "price": "6.10", "shortcode": "67454", "name": "HR", "keyword": "TXT ULAZ"}];

document.write('<div style="float: left">Not in <img src="http://www.sms-publisher.com/ico/flags/us.png" alt="us"/>? <a href="javascript:void(0)" style="color: #EF4136;" onclick="document.getElementById(\'riigid_73042\').style.display=\'block\'">Show all possible locations</a></div>')

document.write('<div style="text-align: right"><a style="color: #EF4136;" href="http://www.sms-publisher.com/">SMS-Publisher</a></div>');
document.write('<div style="clear:both"></div>');


document.write('<div id="riigid_73042" style="display:none"><div style="padding: 6px 10px; margin:3px; border: 1px solid #EF4136; -moz-border-radius: 5px;-webkit-border-radius: 5px;">')
for(var i=0;i<data.length;i++){
	var lipp = data[i];
	document.write('<div style="float: left; width: 16px; height: 11px; background:url(http://www.sms-publisher.com/ico/flags/'+lipp.name.toLowerCase()+'.png) no-repeat center center; margin: 1px;cursor:pointer;" title="'+lipp.name.toLowerCase()+'" onclick="DELMONTES.redraw(73042,\''+lipp.currency+'\',\''+lipp.price+'\',\''+lipp.shortcode+'\',\''+lipp.keyword+'\')"></div>')
}
document.write('<div style="clear:both"></div>');

document.write('</div></div>')


document.write('</form>')
document.write('</div>')

document.write('</div>')