var main = new Array("Выберите категорию...", "Arts and Entertainment", "- Celebrities", "- Humanities", "- Movies", "- Music", "- Photography", "- Poetry", "Computers", "- Computer Certification", "- Data Recovery", "- Games", "- Hardware", "- Networks", "- Software", "Finance", "- Credit", "- Currency Trading", "- Debt Consolidation", "- Fundraising", "- Insurance", "- Investing", "- Leasing", "- Loans", "- Mortgage", "- Mutual Funds", "- Personal Finance", "- Real Estate", "- Stock Market", "- Taxes", "- Wealth Building", "Home and Family", "- Babies", "- Crafts", "- Elderly Care", "- Gardening", "- Hobbies", "- Holidays", "- Home Improvement", "- Home Security", "- Interior Design", "- Landscaping", "- Parenting", "- Pets", "- Pregnancy", "Product Reviews", "- Book Reviews", "- Consumer Electronics", "- Digital Products", "- Movie Reviews", "- Music Reviews", "Self Improvement", "- Attraction", "- Coaching", "- Creativity", "- Goal Setting", "- Grief", "- Happiness", "- Innovation", "- Inspirational", "- Leadership", "- Motivation", "- Organizing", "- Spirituality", "- Stress Management", "- Success", "- Time Management", "Vehicles", "- Boats", "- Cars", "- Motorcycles", "- RVs", "- Trucks-SUVS", "Business", "- Advertising", "- Article Marketing", "- Careers", "- Customer Service", "- Entrepreneurs", "- Ethics", "- Home Based Business", "- Management", "- Marketing", "- Networking", "- Public Relations", "- Sales", "- Small Business", "Disease and Illness", "- Breast Cancer", "- Colon Cancer", "- Leukemia", "- Mesothelioma", "- Multiple Sclerosis", "- Ovarian Cancer", "- Prostate Cancer", "- Skin Cancer", "Food and Beverage", "- Coffee", "- Cooking", "- Gourmet", "- Recipes", "- Wine", "Internet Business", "- Affiliate Programs", "- Auctions", "- Audio-Video Streaming", "- Blogging", "- Domains", "- Ebooks", "- Ecommerce", "- Email Marketing", "- Ezine Marketing", "- Ezine Publishing", "- Forums", "- Internet Marketing", "- Podcasts", "- PPC Advertising", "- RSS", "- Security", "- SEO", "- Site Promotion", "- Spam", "- Traffic Generation", "- Web Design", "- Web Hosting", "Recreation and Sports", "- Biking", "- Extreme", "- Fishing", "- Gambling and Casinos", "- Golf", "- Hunting", "- Martial Arts", "- Running", "- Tennis", "Society", "- Dating", "- Divorce", "- Marriage", "- Relationships", "- Religion", "- Sexuality", "- Weddings", "Writing and Speaking", "- Article Writing", "- Book Marketing", "- Copywriting", "- Public Speaking", "- Writing", "Communications", "- Broadband Internet", "- GPS", "- Mobile Phones", "- Satellite Radio", "- Satellite TV", "- Video Conferencing", "- VOIP", "Fashion", "- Clothing", "- Jewelry", "- Shoes", "Health and Fitness", "- Acne", "- Alternative Medicine", "- Beauty", "- Cardio", "- Depression", "- Diabetes", "- Exercise", "- Fitness Equipment", "- Hair Loss", "- Medicine", "- Meditation", "- Mens Issues", "- Muscle Building", "- Nutrition", "- Supplements", "- Weight Loss", "- Womens Issues", "- Yoga", "Politics", "- Commentary", "- Current Events", "- History", "Reference and Education", "- Adult", "- College", "- Environmental", "- Homeschooling", "- K-12 Education", "- Language", "- Legal", "- Philosophy", "- Psychology", "- Science", "- Sociology", "- Weather", "Travel and Leisure", "- Aviation", "- Boating", "- Cruises", "- Destinations", "- Outdoors", "- Travel Tips", "- Vacations", "Others");
var vip = new Array("Выберите категорию...", "Arts and Entertainment", "- Celebrities", "- Humanities", "- Movies", "- Music", "- Photography", "- Poetry", "Computers", "- Computer Certification", "- Data Recovery", "- Games", "- Hardware", "- Networks", "- Software", "Finance", "- Credit", "- Currency Trading", "- Debt Consolidation", "- Fundraising", "- Insurance", "- Investing", "- Leasing", "- Loans", "- Mortgage", "- Mutual Funds", "- Personal Finance", "- Real Estate", "- Stock Market", "- Taxes", "- Wealth Building", "Home and Family", "- Babies", "- Crafts", "- Elderly Care", "- Gardening", "- Hobbies", "- Holidays", "- Home Improvement", "- Home Security", "- Interior Design", "- Landscaping", "- Parenting", "- Pets", "- Pregnancy", "Product Reviews", "- Book Reviews", "- Consumer Electronics", "- Digital Products", "- Movie Reviews", "- Music Reviews", "Self Improvement", "- Attraction", "- Coaching", "- Creativity", "- Goal Setting", "- Grief", "- Happiness", "- Innovation", "- Inspirational", "- Leadership", "- Motivation", "- Organizing", "- Spirituality", "- Stress Management", "- Success", "- Time Management", "Vehicles", "- Boats", "- Cars", "- Motorcycles", "- RVs", "- Trucks-SUVS", "Business", "- Advertising", "- Article Marketing", "- Careers", "- Customer Service", "- Entrepreneurs", "- Ethics", "- Home Based Business", "- Management", "- Marketing", "- Networking", "- Public Relations", "- Sales", "- Small Business", "Disease and Illness", "- Breast Cancer", "- Colon Cancer", "- Leukemia", "- Mesothelioma", "- Multiple Sclerosis", "- Ovarian Cancer", "- Prostate Cancer", "- Skin Cancer", "Food and Beverage", "- Coffee", "- Cooking", "- Gourmet", "- Recipes", "- Wine", "Internet Business", "- Affiliate Programs", "- Auctions", "- Audio-Video Streaming", "- Blogging", "- Domains", "- Ebooks", "- Ecommerce", "- Email Marketing", "- Ezine Marketing", "- Ezine Publishing", "- Forums", "- Internet Marketing", "- Podcasts", "- PPC Advertising", "- RSS", "- Security", "- SEO", "- Site Promotion", "- Spam", "- Traffic Generation", "- Web Design", "- Web Hosting", "Recreation and Sports", "- Biking", "- Extreme", "- Fishing", "- Golf", "- Hunting", "- Martial Arts", "- Running", "- Tennis", "Society", "- Dating", "- Divorce", "- Marriage", "- Relationships", "- Religion", "- Weddings", "Writing and Speaking", "- Article Writing", "- Book Marketing", "- Copywriting", "- Public Speaking", "- Writing", "Communications", "- Broadband Internet", "- GPS", "- Mobile Phones", "- Satellite Radio", "- Satellite TV", "- Video Conferencing", "- VOIP", "Fashion", "- Clothing", "- Jewelry", "- Shoes", "Politics", "- Commentary", "- Current Events", "- History", "Reference and Education", "- Adult", "- College", "- Environmental", "- Homeschooling", "- K-12 Education", "- Language", "- Legal", "- Philosophy", "- Psychology", "- Science", "- Sociology", "- Weather", "Travel and Leisure", "- Aviation", "- Boating", "- Cruises", "- Destinations", "- Outdoors", "- Travel Tips", "- Vacations", "Others");
var dating = new Array("Выберите категорию...", "Dating", "Marriage", "Relationships", "Weddings");
var medical = new Array("Выберите категорию...", "Disease and Illness", "- Breast Cancer", "- Colon Cancer", "- Leukemia", "- Mesothelioma", "- Multiple Sclerosis", "- Ovarian Cancer", "- Prostate Cancer", "- Skin Cancer", "Health and Fitness", "- Acne", "- Alternative Medicine", "- Beauty", "- Cardio", "- Depression", "- Diabetes", "- Exercise", "- Fitness Equipment", "- Hair Loss", "- Medicine", "- Meditation", "- Mens Issues", "- Muscle Building", "- Nutrition", "- Supplements", "- Weight Loss", "- Womens Issues", "- Yoga", "Others");
var edu = new Array("Выберите категорию...", "Reference and Education", "- Adult", "- College", "- Environmental", "- Homeschooling", "- K-12 Education", "- Language", "- Legal", "- Philosophy", "- Psychology", "- Science", "- Sociology", "- Weather", "Writing and Speaking", "- Article Writing", "- Book Marketing", "- Copywriting", "- Public Speaking", "- Writing");
var soft = new Array("Выберите категорию...", "Software", "Games", "Movies", "Music", "eBooks", "Magazines", "Graphics", "Tutorials", "PDA-Mobiles", "Wallpapers", "Others");

function feelSelect(s, n) {
	var flag = 0;
	if (document.f.pack) {
		var objPack = document.f.pack;
		var m = parseInt(objPack.options[s].value);
	} else {
			m = s;
			flag = 1;
		}
	if (m > 0) {
		var mas = new Array();
		switch (m) {
			case 4: mas = dating; break;
			case 5: mas = vip; break;
			case 6: mas = medical; break;
			case 7: mas = edu; break;
			case 8: mas = soft; break;
			default: mas = main;
		}
		var objSel = document.f.category;
		objSel.options.length = 0;
		var j = 0;
		for (var i = 0; i < mas.length; i++) {
			if (!(m == 5 && i >= 87 && i <= 95) && !(m == 5 && i == 164) && !((m == 1 || m == 2) && i >= 87 && i <= 95) && !((m == 1 || m == 2) && i >= 161 && i <= 179) && !((m == 1 || m == 2) && (i == 141 || i == 185))) {
				if (i == n) objSel.options[j] = new Option(mas[i], i, '', true);
				else objSel.options[j] = new Option(mas[i], i);
				j++;
			}
		}
		if (flag == 1) document.write(mas[n].replace("- ", ""));
	}
}

function getCategory(s, n) {
	var mas = new Array();
	switch (s) {
		case 4: mas = dating; break;
		case 5: mas = vip; break;
		case 6: mas = medical; break;
		case 7: mas = edu; break;
		case 8: mas = soft; break;
		default: mas = main;
	}
	mas[n] = mas[n].replace("- ", "");
	document.write(mas[n]);
}

function upperMe(form, n) {
	if (n == 1) {
		MaxLen = 5000;
		par = form.title;
		par2 = form.num1;
	} else {
			MaxLen = 50000;
			par = form.article;
			par2 = form.num2;
		}
	inputStr = par.value;
	strlength = inputStr.length;
	if (strlength > MaxLen) par.value = inputStr.substring(0, MaxLen);
	par2.value = (MaxLen - par.value.length);
	par.focus();
}

function conf(form) {
	if (confirm("Убедитесь, что введенные Вами данные соответствуют нашим требованиям, ознакомиться с которыми Вы можете на странице FAQ - http://seocity.net/index.php?act=faq#rules\n\nВ противном случает, Ваш заказ будет отклонен!\n\nА также убедитесь в правильности введенных Вами данных!\n\nОтправить на выполнение?")) {
		form.submit();
	}
}

function fnApplyTag(sTag) {
	if (!document.all && !document.all.item) return;
	var obj = document.f.article;
	var flag;
	obj.focus();
	if (document.selection) {
		var oSelTxt = document.selection.createRange(); 
		var sSelTxt = oSelTxt.text;
		flag = 1;
	} else if (typeof(obj.selectionStart)=="number") {
				if (obj.selectionStart!=obj.selectionEnd) {
					var start = obj.selectionStart;
					var end = obj.selectionEnd;
					var rs = obj.value.substr(start,end-start);
					var sSelTxt = rs;
					flag = 2;
				}
			}
	oTag="[";
	cTag="[";
	if(sTag=="bold") {
		oTag+="b]";
		cTag+="/b]";
	}
	if(sTag=="underline") {
		oTag+="u]";
		cTag+="/u]";
	}
	if(sTag=="italic") {
		oTag+="i]";
		cTag+="/i]";
	}
	if (sSelTxt) {
		if (flag == 1) oSelTxt.text = oTag+sSelTxt+cTag;
		else {
				obj.value = obj.value.substr(0,start)+oTag+sSelTxt+cTag+obj.value.substr(end);
				obj.setSelectionRange(end, end);
			}
	} else {
			document.f.article.focus();
			document.f.document.selection.createRange().text = oTag+cTag;
		}
}

function fnPrompt() {
	var url = prompt("Введите адрес ссылки", "http://");
	if ((url)&&(url != "")) {
		if (!document.all && !document.all.item) return;
		var obj = document.f.article;
		var flag;
		obj.focus();
		if (document.selection) {
			var oSelTxt = document.selection.createRange(); 
			var sSelTxt = oSelTxt.text;
			flag = 1;
		} else if (typeof(obj.selectionStart)=="number") {
				if (obj.selectionStart!=obj.selectionEnd) {
					var start = obj.selectionStart;
					var end = obj.selectionEnd;
					var rs = obj.value.substr(start,end-start);
					var sSelTxt = rs;
					flag = 2;
				}
			}
		if ((sSelTxt) && (sSelTxt != "")) var url_text = sSelTxt;
		else var url_text = prompt("Введите текст ссылки", "");
		if ((url_text)&&(url_text != "")) {
			if (flag == 1) oSelTxt.text = "[url="+url+"]"+url_text+"[/url]";
			else {
					obj.value = obj.value.substr(0,start)+"[url="+url+"]"+url_text+"[/url]"+obj.value.substr(end);
					obj.setSelectionRange(end, end);
				}
		}
	}
}
