(function () {
	for (var j=0; j<2; j++) {
		if (as_promo_form[j].id == 'yakuba') {
			form = '<div style="margin:0 0 20px 0;border:0 solid #ccccc5;width:240px;height:512px;text-align:left;background:url(../css/promo_form/bg_yakuba.jpg) no-repeat 0 0;overflow:hidden;position:relative;">' +
			'<div style="padding:230px 15px 0 15px;"><form style="clear:both;" action="http://www.astrostar.ru/service/astrologer_counselling_vip#sid=astrologer_counselling_vip&p_group=banners&p_code=39" onsubmit="' +
			'AstrostarPortal.promoCookies( 1, &#39;yakuba_vip&#39; );AstrostarPortal.promoSubmit( this.action, {&#39;sid&#39;: this.sid.value});' +
			'return false;"><input value="astrologer_counselling_vip" name="sid" type="hidden"><input name="_charset_test_" value="тест" type="hidden">' +
			'<p style="color:#fff;font:14px Tahoma,Arial,sans-serif;margin:0;padding:0;"><strong><</strong>Осень - время перемен и решительных действий.' + 
			'<strong>В сентябре</strong>  уделите особое внимание делам и финансам. <strong>Аспекты октября</strong>  сулят существенные изменения в жизни.' +
			'Ноябрь серьезно угрожает вашей личной жизни. <strong>Напишите мне, и я спрошу у звезд, как получить то, что вам нужно.</strong><strong>></strong></p>' +
			'<p style="color:#fff;font:14px Tahoma,Arial,sans-serif;text-align:right;margin:0;padding:0;"><strong>Анастасия Якуба</strong></p>' +
			'<input value="" style="position:absolute;left:15px;bottom:10px;width:207px;height:59px;border:0;background:url(../css/promo_form/get_quest_yakuba.png)' +
			'0 0 no-repeat;cursor:pointer;cursor:hand;" type="submit"></form></div></div>';
		} else if (as_promo_form[j].id == 'as_coun_love') {
			form = '<div style="border:1px solid #ccc;"><div style="margin:0 0;border:0 solid #ccccc5;width:240px;height:430px;text-align:left;background:url(../css/promo_form/astrologer_counselling_love.jpg)' + 
			'no-repeat 0 0;overflow:hidden;position:relative;"><div style="padding:220px 15px 0;"><form style="clear:both;" action="http://www.astrostar.ru/service/astrologer_counselling_love#sid=astrologer_counselling_love_super&p_group=banners&p_code=31" onsubmit="' +
			'AstrostarPortal.promoCookies( 1, &#39;astrologer_counselling_love&#39; );AstrostarPortal.promoSubmit( this.action, {&#39;sid&#39;: this.sid.value,&#39;p_group&#39;: &#39;banners&#39;,&#39;p_code&#39;: 2' +
			'});return false;"><input value="astrologer_counselling_love" name="sid" type="hidden"><input name="_charset_test_" value="тест" type="hidden"><input name="p_group" value="banners" type="hidden">' +
			'<input name="p_code" value="2" type="hidden"><p></p><p style="color:#fff;font:14px Tahoma,Arial,sans-serif;margin:0;padding:0 0 10px;"><label>&nbsp;<input name="one" value="1" style="width:auto;"' +
			'type="checkbox">&nbsp;&nbsp;Что меня ждет в любви?</label></p><p style="color:#fff;font:14px Tahoma,Arial,sans-serif;margin:0;padding:0 0 10px;"><label>&nbsp;<input name="one" value="1" ' +
			'style="width:auto;" type="checkbox">&nbsp;&nbsp;Когда я выйду замуж?</label></p><p style="color:#fff;font:14px Tahoma,Arial,sans-serif;margin:0;padding:0 0 10px;"><label>' +
			'&nbsp;<input name="one" value="1" style="width:auto;" type="checkbox">&nbsp;&nbsp;Как сложатся отношения?</label></p><p style="color:#fff;font:14px Tahoma,Arial,sans-serif;margin:0;padding:0 0 10px;">' +
			'<label>&nbsp;<input name="one" value="1" style="width:auto;" type="checkbox">&nbsp;&nbsp;Кого мне лучше выбрать?</label></p><input value="" style="position:absolute;left:15px;bottom:20px;width:207px;' +
			'height:59px;border:0;background:url(../css/promo_form/get_quest_yakuba.png) 0 0 no-repeat;cursor:pointer;cursor:hand;" type="submit"></form></div></div></div>';
		} else if (as_promo_form[j].id == 'astr_coun') {
			console.log(as_promo_form[j].id)
			form = '<div style="margin:0 0 20px 0"><object data="../css/promo_form/astrologer_counselling_240x400-'+parseInt(Math.ceil(Math.random()*4))+'.swf" name="astrostar_bnr" id="astrostar_bnr_banner_1317286874684" type="application/x-shockwave-flash" height="400" width="240">' +
				   '<param value="#000000" name="bgcolor"><param value="false" name="menu">' +
				   '<param value="link1=http://www.astrostar.ru/service/astrologer_counselling#sid=astrologer_counselling_super&p_group=banners&p_code=45&amp;target=_blank" name="flashvars"></object></div>';
		} else {
			var form = '<form id="'+as_promo_form[j].id+'" class="as_promo_form_right_block" action="'+as_promo_form[j].link+'">';;
			if (as_promo_form[j].id == 'astrostar_name_secret_ad') {
				form += '<div class="as_caligraph"></div>';
			} else {
				form += '<div class="as_ad_h">'+as_promo_form[j].name+'</div>';
			}
			form += '<div class="as_inside1"> '+as_promo_form[j].text+'</div><div class="as_inside2"> ' +
					   '<input id="name" class="as_text_input" type="text" name="name" value="Имя" maxlength="10" style="color: rgb(111, 111, 111);"> ';
			if (as_promo_form[j].id == 'astrostar_name_secret_ad') {
				form += '<input id="as_parent_name" class="as_text_input" type="text" name="parent_name" value="Отчество" style="color: rgb(111, 111, 111);">' +
					   '<input id="as_surname" class="as_text_input" type="text" name="surname" value="Фамилия">';
			}
			form +=	'<div class="as_about_birth"> Дата рождения: </div><select id="birth_day" class="as_date" name="birth_day">';
			for (var i=1; i<=31; i++) {
				form += '<option>'+i+'</option>';   
			}
			form += '</select><select id="birth_month" class="as_month" name="birth_month">';
			var month = ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'];
			for (var i=1; i<=12; i++) {
				form += '<option value="'+i+'">'+month[i-1]+'</option>';
			}
			form += '</select><select id="birth_year" class="as_year" name="birth_year">';
			for (var i=1932; i<2011; i++) {
				form += '<option>'+i+'</option>';
			}
			form += '</select><input id="as_submit" type="submit" value="'+as_promo_form[j].btn+'"></div></form>';
		}
	   document.write(form); 
	}
	
	$(document).ready(function () {
	    $('.as_promo_form_right_block').find('#name').focus(function () {    
		$(this).select()
	    })
	})
})();

