var suggestlines=new Array("Please make a suggestion for Filepak!","Seen something on Filepak that you'd like done better? Suggest it!","Want to send a message of love? (Awww shucks :D)","What's on your mind?","Filepak knows what you did last summer... (As long as you type it into this box)","I <3 Suggestion Box");var randomnumber=Math.floor(Math.random()*6)
function setMessage(){document.myform.message.value=suggestlines[randomnumber];}
function removeSuggestText(){if(document.myform.message.value==suggestlines[randomnumber]){document.myform.message.value="";}}
function getMessageResponse(str)
{var xmlHttp;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e)
{alert("Your browser does not support AJAX!");return false;}}}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4)
{document.myform.message.value='Thank you for your suggestion!';document.myform.message.disabled='disabled';document.myform.suggestbutton.disabled='disabled';document.myform.message.style.backgroundColor='WhiteSmoke';}}
if(document.myform.message.value==suggestlines[randomnumber]||document.myform.message.value==""){}else{var url="suggestion.php";url=url+"?message="+str;url=url+"&sid="+Math.random();xmlHttp.open("GET",url,true);xmlHttp.send(null);}}
function checkExtension(){var extstring=document.uploadform.uploaded.value;var ext=extstring.split(".");var ext=ext[1].toLowerCase();if(ext!="jpg"&&ext!="jpeg"&&ext!="gml"&&ext!="png"&&ext!="ico"&&ext!="gif"&&ext!="bmp"&&ext!="tga"&&ext!="psd"&&ext!="tif"&&ext!="jpe"&&ext!="tiff"&&ext!="ai"&&ext!="eps"&&ext!="zip"&&ext!="rar"&&ext!="jz"&&ext!="7z"&&ext!="gz"&&ext!="bz3"&&ext!="mp3"&&ext!="wav"&&ext!="aac"&&ext!="ogg"&&ext!="avi"&&ext!="mp4"&&ext!="mpg"&&ext!="mpeg"&&ext!="mpeg4"&&ext!="txt"&&ext!="doc"&&ext!="docx"&&ext!="xls"&&ext!="xlsx"&&ext!="ppt"&&ext!="pptx"&&ext!="bsp"&&ext!="fla"&&ext!="pdf"&&ext!="apk"&&ext!="torrent"){alert("Sorry, that extension is not allowed!")
document.uploadform.uploaded.focus();}}

var popupStatus=0;function loadPopup(){if(popupStatus==0){$("#backgroundPopup").css({"opacity":"0.7"});$("#backgroundPopup").fadeIn("slow");$("#popupContact").fadeIn("slow");popupStatus=1;}}
function disablePopup(){if(popupStatus==1){$("#backgroundPopup").fadeOut("slow");$("#popupContact").fadeOut("slow");popupStatus=0;}}
function centerPopup(){var windowWidth=document.documentElement.clientWidth;var windowHeight=document.documentElement.clientHeight;var popupHeight=$("#popupContact").height();var popupWidth=$("#popupContact").width();$("#popupContact").css({"position":"absolute","top":windowHeight/2-popupHeight/2,"left":windowWidth/2-popupWidth/2});$("#backgroundPopup").css({"height":windowHeight});}
$(document).ready(function(){$("#button").click(function(){centerPopup();loadPopup();});});
