
	var win=null;
	function GenerateNewWindowCode(form){
		pg=document.ScriptOptions.page.value;page='"'+pg+'"';nm=document.ScriptOptions.WinName.value;sb=document.ScriptOptions.scrollbars.options[document.ScriptOptions.scrollbars.selectedIndex].value;loc=document.ScriptOptions.loc.checked;dir=document.ScriptOptions.dir.checked;stat=document.ScriptOptions.stat.checked;mb=document.ScriptOptions.mb.checked;tb=document.ScriptOptions.tb.checked;res=document.ScriptOptions.res.checked;WhichPosition=document.ScriptOptions.WhichPos.options[document.ScriptOptions.WhichPos.selectedIndex].value;w=document.ScriptOptions.wdth.value;h=document.ScriptOptions.hght.value;
		if(pg==""){alert('You need to specify a page to be displayed in the window');document.ScriptOptions.page.focus();return false;}
		if(nm==""){alert('You need to specify a name for the window');document.ScriptOptions.WinName.focus();return false;}
		if(w==""){alert('You need to specify a width for the window');document.ScriptOptions.wdth.focus();return false;}
		if(h==""){alert('You need to specify a height for the window');document.ScriptOptions.hght.focus();return false;}
		NewWindowSettings = "settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',"+((loc)?"location=yes,":"location=no,")+((dir)?"directories=yes,":"directories=no,")+((stat)?"status=yes,":"status=no,")+((mb)?"menubar=yes,":"menubar=no,")+((tb)?"toolbar=yes,":"toolbar=no,")+((res)?"resizable=yes":"resizable=no")+"'";
		StartCode='<script language="javascript" type="text/javascript">\r\n<!--\r\n'
			+ '/****************************************************\r\n'
			+ '     By (Akrws.Blogfa.Com(          Mail (Kapyxnet@GMail.Com)'
			+ '****************************************************/\r\n'
		MainCode='var win=null;\r\n'
			+ 'function NewWindow(mypage,myname,w,h,scroll,pos){\r\n'
			+ 'if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}\r\n'
			+ 'if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}\r\n'
			+ 'else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}\r\n'
			+ NewWindowSettings+';\r\n'
			+ 'win=window.open(mypage,myname,settings);}\r\n'
		CloseCode='function CloseNewWin(){if(win!=null && win.open)win.close()}\r\n'+'window.onfocus=CloseNewWin;\r\n'
		EndCode='// -->\r\n</scr'+'ipt>'
                HeadCode=StartCode+MainCode+EndCode
		BodyCode="<a href="+page+" onclick=\"NewWindow(this.href,'"+nm+"','"+w+"','"+h+"','"+sb+"','"+WhichPosition+"');return false\" onfocus=\"this.blur()\">YourLinkText</a>";
		document.ScriptOptions.NewWindowV3_headsection.value=HeadCode;
		document.ScriptOptions.bodylink.value=BodyCode;
		document.ScriptOptions.NewWindowV3_headsection.focus()}
