// JavaScript Document
	function $(id) {
		var getid = $(id);	
		return getid;
	}
	

			function doStuff() {
			var uicons = $('uiconselector').value;
			var icons = $('iconselector').value;
			if (icons == '/default') {
				icons = '';
			}
			var txt = "";
			$("gen").value = "";

			//Poster
			if ($("poster").value != ""){
			txt = "";
			txt += "[center][img]";
			txt += $("poster").value;
			txt += "[/img][/center]\n";
			$("gen").value += txt;
			}
			
			//Title
			if ($("title").value != ""){
			txt = "";
			txt += "[size=\"6\"][font=\"Georgia\"][center]";
			if($('ml2r').checked){
				txt += "&#8234;" + $("title").value + "&#8236;";
			}else{
				txt += $("title").value;
			}
			txt += "[/center][/font][/size]\n";
			$("gen").value += txt;
			}
			
			//Size
			if ($("qualityselect").value != ""){
			txt = "";
			txt += "[center][b]";
				if ($("msize").value != ""){
			txt += "[color=\"" + $("firstcolor").value + "\"]Size: [/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("msize").value;
			txt += " ";
			txt += $("sizeselect").value;
			txt += "[/color] | [color=\"" + $("firstcolor").value + "\"]Quality:[/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("qualityselect").value;
				}else{
			txt += "[color=\"" + $("firstcolor").value + "\"]Quality:[/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("qualityselect").value;
				}
				if($("year").value != ""){
			txt += "[/color] | [color=\"" + $("firstcolor").value + "\"]Year:[/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("year").value;
			txt += "[/color]\n";
				}else{
			txt += "[/color]\n";
				}
			txt += "[color=\"" + $("firstcolor").value + "\"]Genre:[/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("mgenre").value;
			txt += "[/color][/b][/center]\n";
			$("gen").value += txt;
			}
			
			//IMDB.com
			if ($("imdb").value != "" || $("imdbrate").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]IMDB[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_imdb.jpg[/img][/left]";
			}
			if ($("imdbrate").value != ""){
			txt += "[left][b]IMDB [color=\"#8B0000\"]User Rating[/color]: [color=\"#FF4400\"]" + $("imdbrate").value + "[/color]/10[/b][/left]";
			}
			if ($("imdb").value != ""){
			txt += "[code]";
			txt += $("imdb").value; 
			txt += "[/code]\n";
			}
			$("gen").value += txt;
			}
			
			//Plot Outline
			if ($("info").value != "" || $("farsiinfo").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Information[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_info.jpg[/img][/left]";
			}
			$("gen").value += txt;
			}
			if ($("farsiinfo").value != ""){
			txt = "";
			txt += "[right][b]توضیحات:[/b]\n";
			txt += $("farsiinfo").value;
			txt += "[/right][center]***[/center]";
			$("gen").value += txt;
			}
			if ($("info").value != ""){
			txt = "";
			txt += "[left][b]Plot Outline:[/b]\n";
			txt += $("info").value;
			txt += "[/left]\n";
			$("gen").value += txt;
			}
			
			//File details
			if ($("containerselect").value != "" || $("codecselect").value != "" || $("langselect").value != "" || $("moredetails").value != ""){
			txt = "";
			txt += "[left][b]File Details:[/b]\n";
			if($("containerselect").value != ""){
			txt += "Container Format: [b]" + $("containerselect").value + "[/b]\n";
			}
			if($("codecselect").value != ""){
			txt += "Video Codec: [b]" + $("codecselect").value + "[/b]\n";
			}
			if($("langselect").value != ""){
			txt += "Language: [b]" + $("langselect").value + "[/b]\n";
			}
			if($("moredetails").value != ""){
			txt += $("moredetails").value;
			}
			txt += "[/left]\n";
			$("gen").value += txt;
			}
			
			//ScreenShots
				if ($("sshot1").value != ""){
				if($("img").checked == true){
				txt = "";
				if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Screenshot[/size][/font][/left][center]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_shot.jpg[/img][/left][center]";
			}
				txt += "[img]";
				txt += $("sshot1").value;
				txt += "[/img]";
				$("gen").value += txt;
				if ($("sshot2").value != ""){
				txt = "";
				txt += "[img]";
				$("gen").value += "\n";
				txt += $("sshot2").value;
				txt += "[/img]";
				$("gen").value += txt;
				}
				if ($("sshot3").value != ""){
				txt = "";
				txt += "[img]";
				$("gen").value += "\n";
				txt += $("sshot3").value;
				txt += "[/img]";
				$("gen").value += txt;
				}
				if ($("sshot4").value != ""){
				txt = "";
				txt += "[img]";
				$("gen").value += "\n";
				txt += $("sshot4").value;
				txt += "[/img]";
				$("gen").value += txt;
				}
				if ($("sshot5").value != ""){
				txt = "";
				txt += "[img]";
				$("gen").value += "\n";
				txt += $("sshot5").value;
				txt += "[/img]";
				$("gen").value += txt;
				}
				txt = "";
				txt += "[/center]";
				$("gen").value += txt;
				$("gen").value += "\n";
			} else {
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Screenshot[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_shot.jpg[/img][/left]";
			}
			txt += "[code]";
			txt += $("sshot1").value;
			$("gen").value += txt;
			if ($("sshot2").value != ""){
			txt = "";
			$("gen").value += "\n";
			txt += $("sshot2").value;
			$("gen").value += txt;
			}
			if ($("sshot3").value != ""){
			txt = "";
			$("gen").value += "\n";
			txt += $("sshot3").value;
			$("gen").value += txt;
			}
			if ($("sshot4").value != ""){
			txt = "";
			$("gen").value += "\n";
			txt += $("sshot4").value;
			$("gen").value += txt;
			}
			if ($("sshot5").value != ""){
			txt = "";
			$("gen").value += "\n";
			txt += $("sshot5").value;
			$("gen").value += txt;
			}
			txt = "";
			txt += "[/code]";
			$("gen").value += txt;
			$("gen").value += "\n";
			}
			}
			
			//Download Links
			if ($("downlinks").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Download[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_download.jpg[/img][/left]";
			}
			$("gen").value += txt;
				if ($("direct").checked == true){
			txt = "";
			txt += "[left][b][color=\"#FF0000\"]DIRECT LINKS [/color][/b]:xok:[/left]";
			$("gen").value += txt;
			}
			if ($("movlinenum").value > 18) {
			txt = "";
			txt += "[codebox]";
			txt += $("downlinks").value;
			txt += "[/codebox]\n";
			$("gen").value += txt;
			}else {
			txt = "";
			txt += "[code]";
			txt += $("downlinks").value;
			txt += "[/code]\n";
			$("gen").value += txt;
			}
			}
			
			//MirrorLinks
			if ($("mirrorlinks").value != ""){
			txt = "";
			txt += "[left][b][color=\"#000000\"][size=\"4\"]Mirror:[/size][/color][/b][/left]";
			$("gen").value += txt;
				if ($("direct2").checked == true){
			txt = "";
			txt += "[left][b][color=\"#FF0000\"]DIRECT LINKS [/color][/b]:xok:[/left]";
			$("gen").value += txt;
			}
			if ($("mmovlinenum").value > 18) {
			txt = "";
			txt += "[codebox]";
			txt += $("mirrorlinks").value;
			txt += "[/codebox]\n";
			$("gen").value += txt;
			}else {
			txt = "";
			txt += "[code]";
			txt += $("mirrorlinks").value;
			txt += "[/code]\n";
			$("gen").value += txt;
			}
			}
			
			//dlcomment
			if ($("mdlcomment").value != ""){
			txt = "";
			txt += "[left][b]Comment:[/b]\n";
			txt += $("mdlcomment").value;
			txt += "[/left]\n";
			$("gen").value += txt;
			}
			
			//Sample
			if ($("sample").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Sample[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_sample.jpg[/img][/left]";
			}
			txt += "[code]";
			txt += $("sample").value;
			txt += "[/code]\n";
			$("gen").value += txt;
			}
			
			//Password
			if ($("pass").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Password[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_password.jpg[/img][/left]";
			}
			txt += "[code]";
			txt += $("pass").value;
			txt += "[/code]\n";
			$("gen").value += txt;
			}
			
			//Subtitle
			if ($("sub").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Subtitle[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_subtitle.jpg[/img][/left]";
			}
			$("gen").value += txt;
			if ($("persian").checked == true){
			txt = "";
			txt += "[left][b][color=\"#FF0000\"]PERSIAN SUBTITLE [/color][/b]:xok:[/left]";
			$("gen").value += txt;
			}
			txt = "";
			txt += "[code]";
			txt += $("sub").value;
			txt += "[/code]\n";
			$("gen").value += txt;
			}
			
			//uploader
			if ($("m_upload").checked == true){
			txt = "";
			txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images/uploader" + uicons + "/" + $("m_uploader").value + ".jpg[/img][/left]\n";
			$("gen").value += txt;
			}
			
			txt = "";
			txt += "[left][url=\"http://www.pcseven.com/ftp/eqbal/postgenerator.html\"][color=\"#D9D9D9\"]Made By [b]PC7 Post-Generator[/b] ver 1.0.1.1[/color][/url][/left]";
			$("gen").value += txt;
			
			$("topictitle").value = $("title").value + " -- " + $("year").value;
			$("topicdesc").value = $("qualityselect").value + " | " + $("mgenre").value + " | " + $("imdbrate").value;
			}
			
			function showshot () {
			$("moreshot").style.display = "block";
			$("addshot").style.display = "none";
			}
			function showmirror () {
			$("mirror").style.display = "block";
			$("addmirror").style.display = "none";
			}
			/*function edit () {
			$("gen").disabled = false;
			}*/
//////////////////////application////////////////////////////////
			function appdoStuff() {
			var uicons = $('uiconselector').value;
			var icons = $('iconselector').value;
			if (icons == '/default') {
				icons = '';
			}
			var txt = "";
			$("appgen").value = "";
			if($("appsize").value == ""){
			displayStaticMessage('<div style=\"text-align:right; font-weight:bold; font-size:14px; padding-right:5px\"><a href=\'#\' onclick=\"closeMessage(\'appsize\');return false\">X</a></div><b>خطا</b><br>لطفا حجم(Size) فایل مورد نظر را وارد نمایید!<br>',false);
			return false
			}
			//Title
			if ($("apptitle").value != ""){
			txt = "";
			txt += "[size=\"6\"][font=\"Georgia\"][center]";
			if($('sl2r').checked){
				txt += "&#8234;" + $("apptitle").value + "&#8236;";
			}else{
				txt += $("apptitle").value; 
			}
			txt += "[/center][/font][/size]\n";
			$("appgen").value += txt;
			}
			
			//Size
			if ($("appsize").value != ""){
			txt = "";
			txt += "[center][b][color=\"" + $("firstcolor").value + "\"]Size: [/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("appsize").value;
			txt += " ";
			txt += $("appsizeselect").value;
			txt += "[/color][/b][/center]\n";
			$("appgen").value += txt;
			}

			//ScreenShots
			if ($("appsshot1").value != ""){
				if($("appimg").checked == true){
				txt = "";
				if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Screenshot[/size][/font][/left][center]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_shot.jpg[/img][/left][center]";
			}
				txt += "[img]";
				txt += $("appsshot1").value;
				txt += "[/img]";
				$("appgen").value += txt;
				if ($("appsshot2").value != ""){
				txt = "";
				txt += "[img]";
				$("appgen").value += "\n";
				txt += $("appsshot2").value;
				txt += "[/img]";
				$("appgen").value += txt;
				}
				if ($("appsshot3").value != ""){
				txt = "";
				txt += "[img]";
				$("appgen").value += "\n";
				txt += $("appsshot3").value;
				txt += "[/img]";
				$("appgen").value += txt;
				}
				if ($("appsshot4").value != ""){
				txt = "";
				txt += "[img]";
				$("appgen").value += "\n";
				txt += $("appsshot4").value;
				txt += "[/img]";
				$("appgen").value += txt;
				}
				if ($("appsshot5").value != ""){
				txt = "";
				txt += "[img]";
				$("appgen").value += "\n";
				txt += $("appsshot5").value;
				txt += "[/img]";
				$("appgen").value += txt;
				}
				txt = "";
				txt += "[/center]";
				$("appgen").value += txt;
				$("appgen").value += "\n";
			} else {
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Screenshot[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_shot.jpg[/img][/left]";
			}
			txt += "[code]";
			txt += $("appsshot1").value;
			$("appgen").value += txt;
			if ($("appsshot2").value != ""){
			txt = "";
			$("appgen").value += "\n";
			txt += $("appsshot2").value;
			$("appgen").value += txt;
			}
			if ($("appsshot3").value != ""){
			txt = "";
			$("appgen").value += "\n";
			txt += $("appsshot3").value;
			$("appgen").value += txt;
			}
			if ($("appsshot4").value != ""){
			txt = "";
			$("appgen").value += "\n";
			txt += $("appsshot4").value;
			$("appgen").value += txt;
			}
			if ($("appsshot5").value != ""){
			txt = "";
			$("appgen").value += "\n";
			txt += $("appsshot5").value;
			$("appgen").value += txt;
			}
			txt = "";
			txt += "[/code]";
			$("appgen").value += txt;
			$("appgen").value += "\n";
			}
			}
			
			//info farsi
			if ($("appinfofarsi").value != "" || $("appinfoenglish").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Information[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_info.jpg[/img][/left]";
			}
			$("appgen").value += txt;
			}
			if ($("appinfofarsi").value != ""){
			txt = "";
			txt += "[right][b]توضیحات:[/b]\n";
			txt += $("appinfofarsi").value;
			txt += "[/right][center]***[/center]";
			$("appgen").value += txt;
			}
			if ($("appinfoenglish").value != ""){
			txt = "";
			txt += "[left][b]Description:[/b]\n";
			txt += $("appinfoenglish").value;
			txt += "[/left]\n";
			$("appgen").value += txt;
			}
			
			//homepage
			if ($("apphomepage").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Homepage[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_homepage.jpg[/img][/left]";
			}
			txt += "[code]";
			txt += $("apphomepage").value; 
			txt += "[/code]\n\n";
			$("appgen").value += txt;
			}
			
			//Download Links
			if ($("appdownlinks").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Download[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_download.jpg[/img][/left]";
			}
			$("appgen").value += txt;
				if ($("appdirect").checked == true){
			txt = "";
			txt += "[left][b][color=\"#FF0000\"]DIRECT LINKS [/color][/b]:xok:[/left]";
			$("appgen").value += txt;
			}
			if ($("applinenum").value > 18) {
			txt = "";
			txt += "[codebox]";
			txt += $("appdownlinks").value;
			txt += "[/codebox]\n";
			$("appgen").value += txt;
			}else {
			txt = "";
			txt += "[code]";
			txt += $("appdownlinks").value;
			txt += "[/code]\n";
			$("appgen").value += txt;
			}
			}
			
			//MirrorLinks
			if ($("appmirrorlinks").value != ""){
			txt = "";
			txt += "[left][b][color=\"#000000\"][size=\"4\"]Mirror:[/size][/color][/b][/left]";
			$("appgen").value += txt;
				if ($("appdirect2").checked == true){
			txt = "";
			txt += "[left][b][color=\"#FF0000\"]DIRECT LINKS [/color][/b]:xok:[/left]";
			$("appgen").value += txt;
			}
			if ($("mapplinenum").value > 18) {
			txt = "";
			txt += "[codebox]";
			txt += $("appmirrorlinks").value;
			txt += "[/codebox]\n";
			$("appgen").value += txt;
			}else {
			txt = "";
			txt += "[code]";
			txt += $("appmirrorlinks").value;
			txt += "[/code]\n";
			$("appgen").value += txt;
			}
			}

			//dlcomment
			if ($("appdlcomment").value != ""){
			txt = "";
			txt += "[left][b]Comment:[/b]\n";
			txt += $("appdlcomment").value;
			txt += "[/left]\n";
			$("appgen").value += txt;
			}
			
			//crack
			if ($("crack").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Crack[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_crack.jpg[/img][/left]";
			}
			txt += "[code]";
			txt += $("crack").value;
			txt += "[/code]\n";
			$("appgen").value += txt;
			}
			
			//Password
			if ($("apppass").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Password[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_password.jpg[/img][/left]";
			}
			txt += "[code]";
			txt += $("apppass").value;
			txt += "[/code]\n";
			$("appgen").value += txt;
			}
			
			//uploader
			if ($("app_upload").checked == true){
			txt = "";
			txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images/uploader" + uicons + "/" + $("app_uploader").value + ".jpg[/img][/left]\n";
			$("appgen").value += txt;
			}
			
			txt = "";
			txt += "[left][url=\"http://www.pcseven.com/ftp/eqbal/postgenerator.html\"][color=\"#D9D9D9\"]Made By [b]PC7 Post-Generator[/b] ver 1.0.1.1[/color][/url][/left]";
			$("appgen").value += txt;
			}
			function appshowshot () {
			$("appmoreshot").style.display = "block";
			$("appaddshot").style.display = "none";
			}
			function appshowmirror () {
			$("appmirror").style.display = "block";
			$("appaddmirror").style.display = "none";
			}

//////////////////Music//////////////////////////
			function musicdoStuff() {
			var uicons = $('uiconselector').value;
			var icons = $('iconselector').value;
			if (icons == '/default') {
				icons = '';
			}
			var txt = "";
			$("musicgen").value = "";
			if($("musicsize").value == ""){
			displayStaticMessage('<div style=\"text-align:right; font-weight:bold; font-size:14px; padding-right:5px\"><a href=\'#\' onclick=\"closeMessage(\'musicsize\');return false\">X</a></div><b>خطا</b><br>لطفا حجم(Size) فایل مورد نظر را وارد نمایید!<br>',false);
			return false
			}
			//cover
			if ($("musicposter").value != ""){
			txt = "";
			txt += "[center][img]";
			txt += $("musicposter").value;
			txt += "[/img][/center]\n";
			$("musicgen").value += txt;
			}
			
			//AlbumTitle
			if ($("musictitle").value != ""){
			txt = "";
			txt += "[size=\"6\"][font=\"Georgia\"][center]";
			if($('al2r').checked){
				txt += "&#8234;" + $("musictitle").value + "&#8236;";
			}else{
				txt += $("musictitle").value; 
			}
			txt += "[/center][/font][/size]\n";
			$("musicgen").value += txt;
			}
			
			//Size
			if ($("musicsize").value != ""){
			txt = "";
			txt += "[center][b]";
				if($("musicartist").value != ""){
			txt += "[color=\"" + $("firstcolor").value + "\"]Artist: [/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("musicartist").value + "[/color] | ";
				}
			txt += "[color=\"" + $("firstcolor").value + "\"]Size: [/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("musicsize").value;
			txt += " ";
			txt += $("musicsizeselect").value;
			txt += "[/color] | [color=\"" + $("firstcolor").value + "\"]Format:[/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("musicqualityselect").value;
			txt += "[/color] | [color=\"" + $("firstcolor").value + "\"]Bitrate:[/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("musicbitrate").value + " kbps[/color]";
				if($("musicyear").value != ""){
			txt += " | [color=\"" + $("firstcolor").value + "\"]Year:[/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("musicyear").value + "[/color]";
				}
				if($("musicgenre").value != ""){
			txt += " | [color=\"" + $("firstcolor").value + "\"]Genre:[/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("musicgenre").value + "[/color]";
				}				
			txt += "[/b][/center]\n";
			$("musicgen").value += txt;
			}
				
			//info farsi
			if ($("musicinfofarsi").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Information[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_info.jpg[/img][/left]";
			}
			txt += "[right][b]توضیحات:[/b]\n";
			txt += $("musicinfofarsi").value;
			txt += "[/right]";
			$("musicgen").value += txt;
			}
				
			//tracklist
			if ($("musictrack").value != ""){
				if ($("tracklinenum").value > 18) {
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Tracklist[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_tracklist.jpg[/img][/left][codebox]";
			}
			txt += $("musictrack").value;
			txt += "[/codebox]\n";
			$("musicgen").value += txt;
				}else {
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Tracklist[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_tracklist.jpg[/img][/left][code]";
			}
			txt += $("musictrack").value;
			txt += "[/code]\n";
			$("musicgen").value += txt;
				}
			}
			
			//Download Links
			if ($("musicdownlinks").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Download[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_download.jpg[/img][/left]";
			}
			$("musicgen").value += txt;
				if ($("musicdirect").checked == true){
			txt = "";
			txt += "[left][b][color=\"#FF0000\"]DIRECT LINKS [/color][/b]:xok:[/left]";
			$("musicgen").value += txt;
			}
			if ($("musiclinenum").value > 18) {
			txt = "";
			txt += "[codebox]";
			txt += $("musicdownlinks").value;
			txt += "[/codebox]\n";
			$("musicgen").value += txt;
			}else{
			txt = "";
			txt += "[code]";
			txt += $("musicdownlinks").value;
			txt += "[/code]\n";
			$("musicgen").value += txt;
			}
			}
			
			//MirrorLinks
			if ($("musicmirrorlinks").value != ""){
			txt = "";
			txt += "[left][b][color=\"#000000\"][size=\"4\"]Mirror:[/size][/color][/b][/left]";
			$("musicgen").value += txt;
				if ($("musicdirect2").checked == true){
			txt = "";
			txt += "[left][b][color=\"#FF0000\"]DIRECT LINKS [/color][/b]:xok:[/left]";
			$("musicgen").value += txt;
			}
			if ($("mmusiclinenum").value > 18) {
			txt = "";
			txt += "[codebox]";
			txt += $("musicmirrorlinks").value;
			txt += "[/codebox]\n";
			$("musicgen").value += txt;
			}else{
			txt = "";
			txt += "[code]";
			txt += $("musicmirrorlinks").value;
			txt += "[/code]\n";
			$("musicgen").value += txt;
			}
			}

			//dlcomment
			if ($("musicdlcomment").value != ""){
			txt = "";
			txt += "[left][b]Comment:[/b]\n";
			txt += $("musicdlcomment").value;
			txt += "[/left]\n";
			$("musicgen").value += txt;
			}

			//wikipedia
			if ($("wikipagemusic").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Wikipedia[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_wikipedia.jpg[/img][/left]";
			}
			txt += "[code]";
			txt += $("wikipagemusic").value; 
			txt += "[/code]\n\n";
			$("musicgen").value += txt;
			}
			
			//Password
			if ($("musicpass").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Password[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_password.jpg[/img][/left]";
			}
			txt += "[code]";
			txt += $("musicpass").value;
			txt += "[/code]\n";
			$("musicgen").value += txt;
			}
			
			//uploader
			if ($("music_upload").checked == true){
			txt = "";
			txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images/uploader" + uicons + "/" + $("music_uploader").value + ".jpg[/img][/left]\n";
			$("musicgen").value += txt;
			}
			
			txt = "";
			txt += "[left][url=\"http://www.pcseven.com/ftp/eqbal/postgenerator.html\"][color=\"#D9D9D9\"]Made By [b]PC7 Post-Generator[/b] ver 1.0.1.1[/color][/url][/left]";
			$("musicgen").value += txt;
			}
			function musicshowmirror () {
			$("musicmirror").style.display = "block";
			$("musicaddmirror").style.display = "none";
			}

///////////////////////eBook////////////////////////////////
			function bookdoStuff() {
			var uicons = $('uiconselector').value;
			var icons = $('iconselector').value;
			if (icons == '/default') {
				icons = '';
			}
			var txt = "";
			$("bookgen").value = "";
			if($("booksize").value == ""){
			displayStaticMessage('<div style=\"text-align:right; font-weight:bold; font-size:14px; padding-right:5px\"><a href=\'#\' onclick=\"closeMessage(\'booksize\');return false\">X</a></div><b>خطا</b><br>لطفا حجم(Size) فایل مورد نظر را وارد نمایید!<br>',false);
			return false
			}
			//cover
			if ($("bookposter").value != ""){
			txt = "";
			txt += "[center][img]";
			txt += $("bookposter").value;
			txt += "[/img][/center]\n";
			$("bookgen").value += txt;
			}

			//Title
			if ($("booktitle").value != ""){
			txt = "";
			txt += "[size=\"6\"][font=\"Georgia\"][center]";
			if($('bl2r').checked){
				txt += "&#8234;" + $("booktitle").value + "&#8236;";
			}else{
				txt += $("booktitle").value; 
			}
			txt += "[/center][/font][/size]\n";
			$("bookgen").value += txt;
			}
			
			//Size
			if ($("booksize").value != ""){
			txt = "";
			txt += "[center][b]"
			if ($("bookauthor").value != ""){
			txt += "[color=\"" + $("firstcolor").value + "\"]Author: [/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("bookauthor").value + "[/color] | ";	
			}
			txt += "[color=\"" + $("firstcolor").value + "\"]Size: [/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("booksize").value;
			txt += " ";
			txt += $("booksizeselect").value;
			txt += "[/color] | [color=\"" + $("firstcolor").value + "\"]Format:[/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("ebookformat").value;
			if($("bookpublisher").value != ""){
			txt += "[/color] | [color=\"" + $("firstcolor").value + "\"]Publish By: [/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("bookpublisher").value;		
			}
			if($("bookyear").value != ""){
			txt += "[/color] | [color=\"" + $("firstcolor").value + "\"]Published in: [/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("bookyear").value;		
			}
			if($("bookisbn").value != ""){
			txt += "[/color] | [color=\"" + $("firstcolor").value + "\"]ISBN: [/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("bookisbn").value;		
			}
			txt += "[/color][/b][/center]\n";
			$("bookgen").value += txt;
			}

			
			//info farsi
			if ($("bookinfofarsi").value != "" || $("bookinfoenglish").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Information[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_info.jpg[/img][/left]";
			}
			$("bookgen").value += txt;
			}
			if ($("bookinfofarsi").value != ""){
			txt = "";
			txt += "[right][b]توضیحات:[/b]\n";
			txt += $("bookinfofarsi").value;
			txt += "[/right][center]***[/center]";
			$("bookgen").value += txt;
			}
			if ($("bookinfoenglish").value != ""){
			txt = "";
			txt += "[left][b]Description:[/b]\n";
			txt += $("bookinfoenglish").value;
			txt += "[/left]\n";
			$("bookgen").value += txt;
			}
			
			//Download Links
			if ($("bookdownlinks").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Download[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_download.jpg[/img][/left]";
			}
			$("bookgen").value += txt;
				if ($("bookdirect").checked == true){
			txt = "";
			txt += "[left][b][color=\"#FF0000\"]DIRECT LINKS [/color][/b]:xok:[/left]";
			$("bookgen").value += txt;
			}
			if ($("booklinenum").value > 18) {
			txt = "";
			txt += "[codebox]";
			txt += $("bookdownlinks").value;
			txt += "[/codebox]\n";
			$("bookgen").value += txt;
			}else{
			txt = "";
			txt += "[code]";
			txt += $("bookdownlinks").value;
			txt += "[/code]\n";
			$("bookgen").value += txt;
			}
			}
			
			//MirrorLinks
			if ($("bookmirrorlinks").value != ""){
			txt = "";
			txt += "[left][b][color=\"#000000\"][size=\"4\"]Mirror:[/size][/color][/b][/left]";
			$("bookgen").value += txt;
				if ($("bookdirect2").checked == true){
			txt = "";
			txt += "[left][b][color=\"#FF0000\"]DIRECT LINKS [/color][/b]:xok:[/left]";
			$("bookgen").value += txt;
			}
			if ($("mbooklinenum").value > 18) {
			txt = "";
			txt += "[codebox]";
			txt += $("bookmirrorlinks").value;
			txt += "[/codebox]\n";
			$("bookgen").value += txt;
			}else{
			txt = "";
			txt += "[code]";
			txt += $("bookmirrorlinks").value;
			txt += "[/code]\n";
			$("bookgen").value += txt;
			}
			}
			
			//dlcomment
			if ($("bookdlcomment").value != ""){
			txt = "";
			txt += "[left][b]Comment:[/b]\n";
			txt += $("bookdlcomment").value;
			txt += "[/left]\n";
			$("bookgen").value += txt;
			}
						
			//Password
			if ($("bookpass").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Password[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_password.jpg[/img][/left]";
			}
			txt += "[code]";
			txt += $("bookpass").value;
			txt += "[/code]\n";
			$("bookgen").value += txt;
			}
			
			//uploader
			if ($("book_upload").checked == true){
			txt = "";
			txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images/uploader" + uicons + "/" + $("book_uploader").value + ".jpg[/img][/left]\n";
			$("bookgen").value += txt;
			}
			
			txt = "";
			txt += "[left][url=\"http://www.pcseven.com/ftp/eqbal/postgenerator.html\"][color=\"#D9D9D9\"]Made By [b]PC7 Post-Generator[/b] ver 1.0.1.1[/color][/url][/left]";
			$("bookgen").value += txt;
			}
			function bookshowmirror () {
			$("bookmirror").style.display = "block";
			$("bookaddmirror").style.display = "none";
			}

//////////////////////Game/////////////////////////////
			function gamedoStuff() {
			var uicons = $('uiconselector').value;
			var icons = $('iconselector').value;
			if (icons == '/default') {
				icons = '';
			}
			var txt = "";
			$("gamegen").value = "";
			if($("gamesize").value == ""){
			displayStaticMessage('<div style=\"text-align:right; font-weight:bold; font-size:14px; padding-right:5px\"><a href=\'#\' onclick=\"closeMessage(\'gamesize\');return false\">X</a></div><b>خطا</b><br>لطفا حجم(Size) فایل مورد نظر را وارد نمایید!<br>',false);
			return false
			}
			//Poster
			if ($("gameposter").value != ""){
			txt = "";
			txt += "[center][img]";
			txt += $("gameposter").value;
			txt += "[/img][/center]\n";
			$("gamegen").value += txt;
			}
			
			//Title
			if ($("gametitle").value != ""){
			txt = "";
			txt += "[size=\"6\"][font=\"Georgia\"][center]";
			if($('gl2r').checked){
				txt += "&#8234;" + $("gametitle").value + "&#8236;";
			}else{
				txt += $("gametitle").value; 
			}
			txt += "[/center][/font][/size]\n";
			$("gamegen").value += txt;
			}
			
			//Size
			if ($("gamesize").value != ""){
			txt = "";
			txt += "[center][b][color=\"" + $("firstcolor").value + "\"]Size: [/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("gamesize").value;
			txt += " ";
			txt += $("gamesizeselect").value + "[/color]";
				if ($("gamepublisher").value != ""){
			txt += " | [color=\"" + $("firstcolor").value + "\"]Publisher:[/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("gamepublisher").value + "[/color]";
				}
				if ($("gamedeveloper").value != ""){
			txt += " | [color=\"" + $("firstcolor").value + "\"]Developer:[/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("gamedeveloper").value + "[/color]";
				}
			txt += "\n[color=\"" + $("firstcolor").value + "\"]Platform:[/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("platformselect").value;
			txt += "[/color] | [color=\"" + $("firstcolor").value + "\"]Genre:[/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("gamegenre").value + "[/color]";
				if ($("gamerelease").value != "") {
			txt += " | [color=\"" + $("firstcolor").value + "\"]Release Date:[/color] [color=\"" + $("secondcolor").value + "\"]";
			txt += $("gamerelease").value + "[/color]";
				}
			txt += "[/b][/center]\n";
			$("gamegen").value += txt;
			}
				
			//info farsi
			if ($("gameinfofarsi").value != "" || $("gameinfoenglish").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Information[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_info.jpg[/img][/left]";
			}
			$("gamegen").value += txt;
			}
			if ($("gameinfofarsi").value != ""){
			txt = "";
			txt += "[right][b]توضیحات:[/b]\n";
			txt += $("gameinfofarsi").value;
			txt += "[/right][center]***[/center]";
			$("gamegen").value += txt;
			}
			if ($("gameinfoenglish").value != ""){
			txt = "";
			txt += "[left][b]Description:[/b]\n";
			txt += $("gameinfoenglish").value;
			txt += "[/left]\n";
			$("gamegen").value += txt;
			}
			
			//ScreenShots
				if ($("gamesshot1").value != ""){
				if($("gameimg").checked == true){
				txt = "";
				if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Screenshot[/size][/font][/left][center]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_shot.jpg[/img][/left][center]";
			}
				txt += "[img]";
				txt += $("gamesshot1").value;
				txt += "[/img]";
				$("gamegen").value += txt;
				if ($("gamesshot2").value != ""){
				txt = "";
				txt += "[img]";
				$("gamegen").value += "\n";
				txt += $("gamesshot2").value;
				txt += "[/img]";
				$("gamegen").value += txt;
				}
				if ($("gamesshot3").value != ""){
				txt = "";
				txt += "[img]";
				$("gamegen").value += "\n";
				txt += $("gamesshot3").value;
				txt += "[/img]";
				$("gamegen").value += txt;
				}
				if ($("gamesshot4").value != ""){
				txt = "";
				txt += "[img]";
				$("gamegen").value += "\n";
				txt += $("gamesshot4").value;
				txt += "[/img]";
				$("gamegen").value += txt;
				}
				if ($("gamesshot5").value != ""){
				txt = "";
				txt += "[img]";
				$("gamegen").value += "\n";
				txt += $("gamesshot5").value;
				txt += "[/img]";
				$("gamegen").value += txt;
				}
				txt = "";
				txt += "[/center]";
				$("gamegen").value += txt;
				$("gamegen").value += "\n";
			} else {
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Screenshot[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_shot.jpg[/img][/left]";
			}
			txt += "[code]";
			txt += $("gamesshot1").value;
			$("gamegen").value += txt;
			if ($("gamesshot2").value != ""){
			txt = "";
			$("gamegen").value += "\n";
			txt += $("gamesshot2").value;
			$("gamegen").value += txt;
			}
			if ($("gamesshot3").value != ""){
			txt = "";
			$("gamegen").value += "\n";
			txt += $("gamesshot3").value;
			$("gamegen").value += txt;
			}
			if ($("gamesshot4").value != ""){
			txt = "";
			$("gamegen").value += "\n";
			txt += $("gamesshot4").value;
			$("gamegen").value += txt;
			}
			if ($("gamesshot5").value != ""){
			txt = "";
			$("gamegen").value += "\n";
			txt += $("gamesshot5").value;
			$("gamegen").value += txt;
			}
			txt = "";
			txt += "[/code]";
			$("gamegen").value += txt;
			$("gamegen").value += "\n";
			}
			}
			
			//homepage
			if ($("gamehomepage").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Homepage[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_homepage.jpg[/img][/left]";
			}
			txt += "[code]";
			txt += $("gamehomepage").value; 
			txt += "[/code]\n\n";
			$("gamegen").value += txt;
			}

			
			//Download Links
			if ($("gamedownlinks").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Download[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_download.jpg[/img][/left]";
			}
			$("gamegen").value += txt;
				if ($("gamedirect").checked == true){
			txt = "";
			txt += "[left][b][color=\"#FF0000\"]DIRECT LINKS [/color][/b]:xok:[/left]";
			$("gamegen").value += txt;
			}
			if ($("gamelinenum").value > 18) {
			txt = "";
			txt += "[codebox]";
			txt += $("gamedownlinks").value;
			txt += "[/codebox]\n";
			$("gamegen").value += txt;
			}else{
			txt = "";
			txt += "[code]";
			txt += $("gamedownlinks").value;
			txt += "[/code]\n";
			$("gamegen").value += txt;
			}
			}
			
			//MirrorLinks
			if ($("gamemirrorlinks").value != ""){
			txt = "";
			txt += "[left][b][color=\"#000000\"][size=\"4\"]Mirror:[/size][/color][/b][/left]";
			$("gamegen").value += txt;
				if ($("gamedirect2").checked == true){
			txt = "";
			txt += "[left][b][color=\"#FF0000\"]DIRECT LINKS [/color][/b]:xok:[/left]";
			$("gamegen").value += txt;
			}
			if ($("mgamelinenum").value > 18) {
			txt = "";
			txt += "[codebox]";
			txt += $("gamemirrorlinks").value;
			txt += "[/codebox]\n";
			$("gamegen").value += txt;
			}else{
			txt = "";
			txt += "[code]";
			txt += $("gamemirrorlinks").value;
			txt += "[/code]\n";
			$("gamegen").value += txt;
			}
			}
			
			//dlcomment
			if ($("gamedlcomment").value != ""){
			txt = "";
			txt += "[left][b]Comment:[/b]\n";
			txt += $("gamedlcomment").value;
			txt += "[/left]\n";
			$("gamegen").value += txt;
			}
			
			//Password
			if ($("gamepass").value != ""){
			txt = "";
			if(icons == 'hide'){
				txt += "[left][font=\"Georgia\"][size=\"5\"]Password[/size][/font][/left]";
			}else{
				txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images" + icons + "/post_password.jpg[/img][/left]";
			}
			txt += "[code]";
			txt += $("gamepass").value;
			txt += "[/code]\n";
			$("gamegen").value += txt;
			}
			
			//uploader
			if ($("game_upload").checked == true){
			txt = "";
			txt += "[left][img]http://www.pcseven.com/ftp/eqbal/asset/images/uploader" + uicons + "/" + $("game_uploader").value + ".jpg[/img][/left]\n";
			$("gamegen").value += txt;
			}
			
			txt = "";
			txt += "[left][url=\"http://www.pcseven.com/ftp/eqbal/postgenerator.html\"][color=\"#D9D9D9\"]Made By [b]PC7 Post-Generator[/b] ver 1.0.1.1[/color][/url][/left]";
			$("gamegen").value += txt;
			}
			function gameshowshot () {
			$("gamemoreshot").style.display = "block";
			$("gameaddshot").style.display = "none";
			}
			function gameshowmirror () {
			$("gamemirror").style.display = "block";
			$("gameaddmirror").style.display = "none";
			}



	function copy(text2copy) {
  if (window.clipboardData) {
    window.clipboardData.setData("Text",text2copy);
  } else {
    var flashcopier = 'flashcopier';
    if(!$(flashcopier)) {
      var divholder = document.createElement('div');
      divholder.id = flashcopier;
      document.body.appendChild(divholder);
    }
    $(flashcopier).innerHTML = '';
    var divinfo = '<embed src="asset/_clipboard.swf" FlashVars="clipboard='+encodeURIComponent(text2copy)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
    $(flashcopier).innerHTML = divinfo;
  }
}
function countlines(areaid) 
{ 
  var area = $(areaid) 
        // trim trailing return char if exists 
  var text = area.value.replace(/\s+$/g,"") 
  var split = text.split("\n") 
  return split.length 
	} 
	function changebg(id) {
$(id).style.background = "url(asset/images/greentab_over.jpg)";
if (id == "movie") {
$("app").style.background = "url(asset/images/greentab.jpg)";
$("music").style.background = "url(asset/images/greentab.jpg)";
$("ebook").style.background = "url(asset/images/greentab.jpg)";
$("game").style.background = "url(asset/images/greentab.jpg)";
}
 else if (id == "app") {
$("movie").style.background = "url(asset/images/greentab.jpg)";
$("music").style.background = "url(asset/images/greentab.jpg)";
$("ebook").style.background = "url(asset/images/greentab.jpg)";
$("game").style.background = "url(asset/images/greentab.jpg)";
}
 else if (id == "music") {
$("movie").style.background = "url(asset/images/greentab.jpg)";
$("app").style.background = "url(asset/images/greentab.jpg)";
$("ebook").style.background = "url(asset/images/greentab.jpg)";
$("game").style.background = "url(asset/images/greentab.jpg)";
}
 else if (id == "ebook") {
$("movie").style.background = "url(asset/images/greentab.jpg)";
$("music").style.background = "url(asset/images/greentab.jpg)";
$("app").style.background = "url(asset/images/greentab.jpg)";
$("game").style.background = "url(asset/images/greentab.jpg)";
}
 else if (id == "game") {
$("movie").style.background = "url(asset/images/greentab.jpg)";
$("music").style.background = "url(asset/images/greentab.jpg)";
$("ebook").style.background = "url(asset/images/greentab.jpg)";
$("app").style.background = "url(asset/images/greentab.jpg)";
		}
	}
	
var currentlyActiveInputRef = false;
var currentlyActiveInputClassName = false;

function highlightActiveInput() {
  if(currentlyActiveInputRef) {
    currentlyActiveInputRef.className = currentlyActiveInputClassName;
  }
  currentlyActiveInputClassName = this.className;
  this.className = 'all-input-highlighted';
  currentlyActiveInputRef = this;
}

function blurActiveInput() {
  this.className = currentlyActiveInputClassName;
}

function initInputHighlightScript() {
  var tags = ['INPUT','TEXTAREA'];
  for(tagCounter=0;tagCounter<tags.length;tagCounter++){
    var inputs = document.getElementsByTagName(tags[tagCounter]);
    for(var no=0;no<inputs.length;no++){
      if(inputs[no].className && inputs[no].className=='generated-input')continue;
      if(inputs[no].tagName.toLowerCase()=='textarea' || (inputs[no].tagName.toLowerCase()=='input' && 

inputs[no].type.toLowerCase()=='text')){
        inputs[no].onfocus = highlightActiveInput;
        inputs[no].onblur = blurActiveInput;
      }
    }
  }
}
function showoption() {
	if($('show_more_option').value=='   Show   ') {
		$('more_option0').style.display='';
		$('more_option1').style.display='';
		$('more_option2').style.display='';
		$('more_option3').style.display='';
		$('show_more_option').value='   Hide   ';
	}else {
		$('more_option0').style.display='none';
		$('more_option1').style.display='none';
		$('more_option2').style.display='none';
		$('more_option3').style.display='none';
		$('show_more_option').value='   Show   ';
	}
}
//////////////////
   var http_request = false;
   function makePOSTRequest(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { 
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { 
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      document.split
      http_request.onreadystatechange = alertContents;
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
   }

   function alertContents() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            result = http_request.responseText;
            //$('allripinfo').innerHTML = result; 
			var imdb_array = result.split("$%");
			if($('title').value == ''){
			$('title').value = imdb_array[0];
			}
			if($('year').value == ''){
			$('year').value = imdb_array[1];
			}
			if($('imdbrate').value == ''){
			$('imdbrate').value = imdb_array[2];
			}
			if($('info').value == ''){
			$('info').value = imdb_array[3];
			}
			if($('mgenre').value == ''){
			$('mgenre').value = imdb_array[4];
			}
			$('posterimage').innerHTML = imdb_array[5];
		   $('rip').disabled = false;
		   $('preloading').style.display = 'none';
		   if($('poster_rip').checked){
		   $('posterselect').style.display = 'block';
		   }else{
		   $('allloading').style.display = 'none';
		   }
         } else {
            alert('There was a problem with the request!');
		   $('preloading').style.display = 'none';
		   $('allloading').style.display = 'none';
         }
      }
   }
   
   function get(obj) {
	if($("imdb").value == ""){
			displayStaticMessage('<div style=\"text-align:right; font-weight:bold; font-size:14px; padding-right:5px\"><a href=\'#\' onclick=\"closeMessage(\'imdb\');return false\">X</a></div><b>خطا</b><br>لينک IMDB فيلم مورد نظر را وارد نماييد!<br>',false);
		}else{
	var poststr = "imdblink=" + escape(encodeURI( $("imdb").value )) + "&poster_rip_status=" + $('poster_rip').checked;
	  
      makePOSTRequest('rip.php', poststr);
	  
  	   $('rip').disabled = true;
	   $('allloading').style.display = 'block';
	   $('preloading').style.display = 'block';
		$('title').value = '';
		$('year').value = '';
		$('imdbrate').value = '';
		$('info').value = '';
	  }
   }
   
   function poster(obj) {
      var poststr = "imdblink=" + escape(encodeURI( $("imdb").value )) + "&i=" + escape(encodeURI( $("i").value )) + "&imdbstatus=ok&poster_rip_status=" + $('poster_rip').checked;
	  
      makePOSTRequest('rip.php', poststr);
	  
   $('posterselect').style.display = 'none';
   $('preloading').style.display = 'block';
   }

	function selectposter() {
		   $('poster').value = $('posterlink').value;
		   $('posterselect').style.display = 'none';
		   $('allloading').style.display = 'none';
	}
	
	
	
	function showhidepref() {
		if ($('prefbut').value == 'Preferences: Show') {
			$('colors').style.display = 'block';
			$('settings').style.display = 'block';
			$('icons').style.display = 'block';
			$('prefbut').value = 'Preferences: Hide'
		}else { 
			$('colors').style.display = 'none';
			$('icons').style.display = 'none';
			$('settings').style.display = 'none';
			$('prefbut').value = 'Preferences: Show'
		}
	}
	
function set_cookie ( name, value, exp_y, exp_m, exp_d)
{
  var cookie_string = name + "=" + escape ( value );

  if ( exp_y )
  {
    var expires = new Date ( exp_y, exp_m, exp_d );
    cookie_string += "; expires=" + expires.toGMTString();
  }
  
  document.cookie = cookie_string;
}

function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );

  if ( results )
    return ( unescape ( results[2] ) );
  else
    return null;
}

function delete_cookie ( cookie_name )
{
  var cookie_date = new Date ( );
  cookie_date.setTime ( cookie_date.getTime() - 1 );
  document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}


function save() {
	set_cookie ('icon', $('iconselector').value, 2008, 12, 01);
	set_cookie ('uicon', $('uiconselector').value, 2008, 12, 01);
	set_cookie ('colorone', $('firstcolor').value, 2008, 12, 01);
	set_cookie ('colortwo', $('secondcolor').value, 2008, 12, 01);
 	alert('تنظیمات ذخیره شد');
}
function clear() {
	delete_cookie ('icon');
	delete_cookie ('uicon');
	delete_cookie ('colorone');
	delete_cookie ('colortwo');
	alert('تنظیمات ذخیره شده پاک شدند');
}

function getcookiedata() {
	if (get_cookie ('icon') !=null && get_cookie ('icon')!= '') {
	$('iconselector').value = get_cookie ('icon');
	}
	if (get_cookie ('uicon') !=null && get_cookie ('uicon')!= '') {
	$('uiconselector').value = get_cookie ('uicon');
	}
	if (get_cookie ('colorone')) {
	$('firstcolor').value = get_cookie ('colorone');
	$('f_sample').style.color = get_cookie ('colorone');
	}
	if (get_cookie ('colortwo')) {
	$('secondcolor').value = get_cookie ('colortwo');
	$('s_sample').style.color = get_cookie ('colortwo');
	}
}

function toggleuploader(upload, uploader, password) {
	if($(upload).checked == true){
		$(uploader).disabled = false;
		$(password).value = "www.pcseven.com";
	}else {
		$(uploader).disabled = true;
		$(password).value = "";
	}
}