	////////////////////////////////////////////////////////////
	function writeActionForm() {
		
		var res = getData();
		var formStr = '<form action="'+res['url']+'" name="jsDownload" id="jsDownload" method="post">';
		formStr += '<input type="hidden" name="pData" value="'+res['pData']+'" />';				
		formStr += '<input type="hidden" name="lang" value="'+res['lang']+'" />';
		formStr += '<input type="hidden" name="skin_id" value="'+res['skin_id']+'" />';
		formStr += '</form>';	
		
		$("body").append(formStr);
	}
	
	////////////////////////////////////////////////////////////
	function initIframeSrc(iframeEL) {
		
		var res = getData();
		iframeEL.src=res['url']+"?pData="+res['pData']+"&lang="+res['lang']+"&skin_id="+res['skin_id'];
	}
	
	
	
	////////////////////////////////////////////////////////////
	//gets all the cookies from the current page an sets them in a new window specified sent as a parameter
	var setchild = function(_win){
		//get all the cookies and split them into a array
		var cookies = document.cookie.split(";");
	
		for (k in cookies){
			//split the current string into a new array
			try{
				var rr_keyval = cookies[k].split("=");
				for (m in rr_keyval)
					//cut the spaces from the beginning of the string
					while (rr_keyval[m].charAt(0)==' ') rr_keyval[m] = rr_keyval[m].substring(1,rr_keyval[m].length);
				//set a new cookie in the new window
				_win.document.cookie = rr_keyval[0] + "=" + rr_keyval[1] + "; path=/";
			}catch (err){

			}
		}
	}


	function getData(){
		
		var res = Array();
		res['url'] = 'http://online.rummyroyal.com/bo/noDown.php';
		res['skin_id'] = 7;		
		//var rAFID = (getCookie("rAFID"))?(getCookie("rAFID")):'';
		//var cRefID = (getCookie("cRefID"))?(getCookie("cRefID")):'';
		//var cusReferrer = (getCookie("cusReferrer"))?(getCookie("cusReferrer")):'';
		//var qs = (getCookie("qs"))?(getCookie("qs")):'';
		var aid = (getCookie("aid"))?(getCookie("aid")):'1';
		var bid = (getCookie("bid"))?(getCookie("bid")):'0';
		var cid = (getCookie("cid"))?(getCookie("cid")):'1';
		var lid = (getCookie("lid"))?(getCookie("lid")):'1';
		var brs = browserDetection();
		var pixLeadFlag = 0;
		if(aid == 2946 || (aid == 1866 && cid == 4456) || aid == 1650 || aid == 3239 || aid == 531){
			pixLeadFlag = 1;
		}
		res['pD'] = aid+'Z'+cid+'B'+lid+'X'+bid+'Q1W0G'+brs+'G'+pixLeadFlag;
		res['lang'] = 'hr';
		return res;
	}
	//////////////////////////////////////////////////////////
	function browserDetection(){
		var browser = jQuery.browser;
		var curBrowser = '';
		for (br in browser){
			if (browser[br] == true) {
				curBrowser = br;
			}
		}
		switch (curBrowser) {
			case 'safari':
				return 's';
				break;
			case 'opera':
				return 'o';
				break;
			case 'msie':
				return 'i';
				break;
			case 'mozilla':
				return 'f';
				break;
			case 'chrome':
				return 'c';
				break;
			default:
				return 'u';
				break;																				
		}
	}
	$(document).ready(function() {
		$("a[id='noDownloadLink12']").click(function(event){			
			var winProps  = 'height=' + screen.availHeight + ',width=' + screen.availWidth +'toolbar=0,scrollbars=0,status=0,resizable=1,location=0,menuBar=0,top=0,left=0,fullscreen';
                        var res = getData();
                        res['url'] = res['url']+'?skin_id='+res['skin_id']+'&lang='+res['lang']+'&pD='+res['pD'];
                        var win = window.open(res['url'],'win',winProps);	
		});
		//writeActionForm();
	});
	
	function getUnixTime()
	{
		var foo = new Date; // Generic JS date object
		var unixtime_ms = foo.getTime(); // Returns milliseconds since the epoch
		var unixtime = parseInt(unixtime_ms / 1000);	
		return unixtime;
	}

