


// window pop up 
var newwindow;
function poptastic(url)
{
	newwindow=window.open(url,'name','height=500,width=400,resizable=yes,scrollbars=1');
	if (window.focus) {newwindow.focus()}
}


// used for the image upload crop page
function writefile(x)
{
var y=document.getElementById(x).value

myFileEx = y.split(".");
myFileExValue = myFileEx.pop();
myFileExValue = myFileExValue.toLowerCase();

mySplitArray = y.split("\\");
mySplitValue = mySplitArray.pop();
//document.getElementById("readytoupload").innerHTML=y.toUpperCase()  //sets a field 

//document.getElementById("readytoupload").innerHTML='<span style="display:none;"><input type="file" name="file_upload_btn" value="" id="file_upload_btn"  onchange="checkFileExtension(\'image\', this.value);"/></span>';  // sets an upload field   
if(myFileExValue!="jpg" && myFileExValue!="png") { 
document.getElementById("readytoupload").innerHTML="<div id=\"filewrite\"><i>It looks like there is a problem with this file extension. At the moment only these file extensions are allowed: .jpg .png</i></div>";
} else {
document.getElementById("readytoupload").innerHTML="<div id=\"filewrite\"><i>Your file " + mySplitValue + " is ready for upload</i></div>";
}

}
