var uploadX = (screen.width/2)-200;
var uploadY = (screen.height/2)-100;
var pos = "left="+uploadX+",top="+uploadY;

function loadcontactuspage(lang){
uploadWindow = window.open("http://" + window.location.hostname + "/contact_us.asp?lang="+lang,"Upload","width=450,height=400,"+pos+", scrollbars=yes");}

function LoadSiteStatisticWindow(type,section,lang,pid,tid){
window.open("sitestatistic.asp?type="+type+"&section="+section+"&lang="+lang+"&pid="+pid+"&tid="+tid,"SiteStatistic","scrollbars=yes,width=540,height=350,"+pos);}

//Load help section
function LoadHelpFiles(section){
window.open("help/Default.asp?section="+section,"Help","scrollbars=yes,width=470,height=450,"+pos);}
//Load help section

//Submit member form
function SubmitMembersForm(message){
if (window.document.frm_newsletter.title.value == "" || window.document.frm_newsletter.email.value == ""){;
alert(message);
if (window.document.frm_newsletter.title.value == ""){
window.document.frm_newsletter.title.focus ()}
else{
if (window.document.frm_newsletter.email.value == ""){
window.document.frm_newsletter.email.focus ()}}}
else{

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
var returnval=emailfilter.test(window.document.frm_newsletter.email.value)
if (returnval==false){
alert(message)
window.document.frm_newsletter.email.select ()}

else{
window.document.frm_newsletter.submit ()
window.document.frm_newsletter.title.value = ""
window.document.frm_newsletter.email.value = ""
window.document.frm_newsletter.realaction[0].checked = true}}}
//Submit member form


//Submit vote form
function GetValueFromVoteForm(VoteIndex){window.document.frm_vote.fp.value = VoteIndex}

function SubmitVoteForm(message){
if (window.document.frm_vote.fp.value == ""){
alert (message)}
else{
window.document.frm_vote.submit()}}
//Submit vote form


//Load vote result window
function LoadVoteResult(RecordID,CLang,NewHeight){
window.open("voteresult.asp?id="+RecordID+"&lang="+CLang,"voteresult","width=420,height="+NewHeight+","+pos);}
//Load vote result window


//Load comment window
function LoadCommentResult(RecordID,PageID,CLang){
window.open("comments.asp?id="+RecordID+"&pid="+PageID+"&lang="+CLang,"comments","scrollbars=1,width=430,height=500,"+pos);}
//Load comment window


//set bookmark
var bookmarkurl= window.location.href 
var bookmarktitle= window.document.title 
function addbookmark(){
if (document.all){
window.external.AddFavorite(bookmarkurl,bookmarktitle)}}
//end set bookmark


//send mail to a friend
function sendmail(){
var initialsubj = window.document.title
var initialmsg = window.location
window.location = "mailto:?subject="+initialsubj+"&body="+initialmsg;}
//send mail to a friend


//prinable version
function pversionload(){
var pageurl= window.location.href + "?pt=5"
window.open (pageurl)}
//prinable version


//Blank Click
function BlankFunction(){var b}
//Blank Click


//SubmitFavoriesForm
function SubmitFavoriesForm(message){
if (window.document.frm_add_to_favorites.page_title.value == ""){
alert(message)
window.document.frm_add_to_favorites.page_title.focus ()}
else{
window.document.frm_add_to_favorites.submit ()}}
//SubmitFavoriesForm


//reloading images
var slidespeed=2000

//specify images
var slideimages=new Array("images/new_banner_02.gif","images/new_banner_05.gif","images/new_banner_06.gif")

//specify corresponding links
var slidelinks=new Array("dpage.asp?pid=43&lang=fa","dpage.asp?pid=7&lang=fa","linkestan.asp?lang=fa&pid=13&type=linkestan")

var newwindow=0 //open links in new window? 1=yes, 0=no

var imageholder=new Array()
var ee=document.all
for (i=0;i<slideimages.length;i++){
imageholder[i]=new Image()
imageholder[i].src=slideimages[i]
}

function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
window.location=slidelinks[whichlink]
}
//reloading images
