function joom_getcoordinates(){document.nameshieldform.xvalue.value=document.getElementById("u1").offsetTop;document.nameshieldform.yvalue.value=document.getElementById("u1").offsetLeft;document.nameshieldform.submit()}function joom_validatecomment(){if(document.commentform.cmttext.value==''){alert(joomgallery_enter_comment)}else if(jg_use_code==1){if(document.commentform.jgcode!=null&&document.commentform.jg_code.value==''){alert(joomgallery_enter_code)}else{document.commentform.submit()}}else{document.commentform.submit()}}function joom_smilie(a){document.commentform.cmttext.value+=a+' ';document.commentform.cmttext.focus()}function joom_validatesend2friend(){if((document.send2friend.send2friendname.value=='')||(document.send2friend.send2friendemail.value=='')){alert(joomgallery_enter_name_email)}else{document.send2friend.submit()}}function joom_checkme(){var a=document.adminForm;a.imgtitle.style.backgroundColor='';a.catid.style.backgroundColor='';var b=false;if(a.imgtitle.value==''||a.imgtitle.value==null){alert(joomgallery_pic_must_have_title);a.imgtitle.style.backgroundColor=jg_ffwrong;a.imgtitle.focus();return false}else if(a.catid.value=="0"){alert(joomgallery_select_category);a.catid.style.backgroundColor=jg_ffwrong;a.catid.focus();return false}else{var c=0;var d=true;var e=new Array();var f=new Array();var g=new Array();for(i=0;i<jg_inputcounter;i++){f[i]='arrscreenshot['+i+']';g[i]=document.getElementsByName(f[i])[0].value;document.getElementsByName(f[i])[0].style.backgroundColor='';if(g[i]!=""){d=false;e[c]=i;c++}}}if(d){alert(joomgallery_select_file);document.getElementsByName(f[0])[0].focus();return false}else{var h=false;var k=new Array();var l=new Array();for(i=0;i<e.length;i++){l[i]=new RegExp('\.jpg$|\.jpe$|\.jpeg$|\.gif$|\.png$','ig')}for(i=0;i<e.length;i++){k=l[i].test(g[e[i]]);if(k!=true){h=true;document.getElementsByName(f[e[i]])[0].style.backgroundColor=jg_ffwrong}}}if(h){alert(joomgallery_wrong_extension);document.getElementsByName(f[0])[0].focus();return false}else{var m=false;if(jg_filenamewithjs!=0){var n=/[^ a-zA-Z0-9_-]/;var o=new Array();var p=new Array();var q=new Array();for(i=0;i<e.length;i++){o[i]=g[e[i]].lastIndexOf('\\');p[i]=g[e[i]].lastIndexOf('\.')-g[e[i]].length;if(o[i]<1){o[i]=g[e[i]].lastIndexOf('/')}q[i]=g[e[i]].slice(o[i]+1,p[i]);if(n.test(q[i])){m=true;document.getElementsByName(f[e[i]])[0].style.backgroundColor=jg_ffwrong}}}}if(m){alert(joomgallery_wrong_filename);document.getElementsByName(f[0])[0].focus();return false}else if(e.length>1){var r=new Number();var s=new Number();for(i=0;i<e.length;i++){for(j=e.length-1;j>i;j--){if(g[e[i]].indexOf(g[e[j]])==0){b=true;document.getElementsByName(f[e[i]])[0].style.backgroundColor=jg_ffwrong;document.getElementsByName(f[e[j]])[0].style.backgroundColor=jg_ffwrong;r=i+1;s=j+1;alert(joomgallery_filename_double1+' '+r+' '+joomgallery_filename_double2+' '+s+'.')}}}}if(b){document.getElementsByName(f[0])[0].focus();return false}else{a.submit();return true}}function joom_checkme2(){var a=document.adminForm;a.imgtitle.style.backgroundColor='';a.catid.style.backgroundColor='';if(a.imgtitle.value==''||a.imgtitle.value==null){alert(joomgallery_pic_must_have_title);a.imgtitle.style.backgroundColor=jg_ffwrong;a.imgtitle.focus();return false}else if(a.catid.value=='0'){alert(joomgallery_select_category);a.catid.style.backgroundColor=jg_ffwrong;a.catid.focus();return false}else{a.submit();return true}}function joom_openjswindow(a,b,c,d){var c=parseInt(c);var d=parseInt(d);var e=(resizeJsImage>0)?0:1;pgwindow=window.open('','JoomGallery','toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,scrollbars='+e+',width='+c+',height='+d+'');with(pgwindow.document){write("<html><head><title>"+b+"<\/title>\n");write("<meta http-equiv='imagetoolbar' content='no' />\n");write("<script language='javascript' type='text/javascript'>\n");write("<!--\n");write("var disableclick = "+jg_disableclick+";\n");write("if (disableclick>0) {document.oncontextmenu = function(){return false;} }\n");write("function resize() {\n");write(" if("+resizeJsImage+">0) {\n");write("  var windowWidth, windowHeight, padleft, padtop;\n");write("  if (self.innerHeight) {  // all except Explorer\n");write("   windowWidth = self.innerWidth;\n");write("   windowHeight = self.innerHeight;\n");write("   padleft = 6;\n");write("   padtop = 55;\n");write("  } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode\n");write("   windowWidth = document.documentElement.clientWidth;\n");write("   windowHeight = document.documentElement.clientHeight;\n");write("   padleft = 10;\n");write("   padtop = 35;\n");write("  } else if (document.body) { // other Explorers\n");write("   windowWidth = document.body.clientWidth;\n");write("   windowHeight = document.body.clientHeight;\n");write("   padleft = 10;\n");write("   padtop = 35;\n");write("  }\n");write("  var imgwidth = "+c+"+padleft;\n");write("  var imgheight = "+d+"+padtop;\n");write("  if(imgwidth>windowWidth) {\n");write("    imgheight = (imgheight * windowWidth)/imgwidth;\n");write("    imgwidth = windowWidth;\n");write("  }\n");write("  if(imgheight>windowHeight) {\n");write("    imgwidth = (imgwidth * windowHeight)/imgheight;\n");write("    imgheight = windowHeight;\n");write("  }\n");write("  self.resizeTo(imgwidth, imgheight);\n");write("  self.document.getElementById('js_window_image').width = imgwidth-padleft;\n");write("  self.document.getElementById('js_window_image').style.width = imgwidth-padleft;\n");write("  self.document.getElementById('js_window_image').height = imgheight-padtop;\n");write("  self.document.getElementById('js_window_image').style.height = imgheight-padtop;\n");write("  self.document.body.style.overflow='hidden'\n");write(" } else {\n");write("  self.document.body.style.overflow=''\n");write(" }\n");write(" self.focus();\n");write("}\n");write("function clicker() { \n");write("if (disableclick>0) {self.close(); } \n");write("}\n");write("\/\/-->\n");write("<\/script>\n");write("<\/head>\n");write("<body topmargin='0' marginheight='0' leftmargin='0' marginwidth='0' onload='resize()' onclick='clicker()' onblur='self.focus()'>\n");write("<img src='"+a+"' border='0' hspace='0' vspace='0' onclick='self.close()' alt='"+b+"'\ id=\"js_window_image\" class=\"pngfile\" />\n");write("<\/body><\/html>");close()}pgwindow.moveTo(0,0)}function joom_opendhtml(a,b,c,d,e){d=parseInt(d);e=parseInt(e);var f,windowHeight;if(self.innerHeight){f=self.innerWidth;windowHeight=self.innerHeight}else if(document.documentElement&&document.documentElement.clientHeight){f=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight}else if(document.body){f=document.body.clientWidth;windowHeight=document.body.clientHeight}var g,xScroll;if(self.pageYOffset){g=self.pageYOffset;xScroll=self.pageXOffset}else if(document.documentElement&&document.documentElement.scrollTop){g=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft}else if(document.body){g=document.body.scrollTop;xScroll=document.body.scrollLeft}if(resizeJsImage==1){if((d+3*jg_padding)>f){e=(e*(f-2*jg_padding))/d;d=f-2*jg_padding}if((e+2*jg_padding+80)>windowHeight){d=(d*(windowHeight-2*jg_padding-80))/e;e=windowHeight-2*jg_padding-80}}var h=(windowHeight/2)-(e/2)+g+document.body.style.padding-10;var i=(f/2)-(d/2)+xScroll+document.body.style.padding;if(h>=30){h=h-30}var j=document.getElementsByTagName('BODY')[0];if(!document.getElementById("jg_photocontainer")){divObjContainer=document.createElement("div");divObjContainer.setAttribute("id","jg_photocontainer");j.appendChild(divObjContainer)}else{divObjContainer=document.getElementById("jg_photocontainer")}var k=new Image();k.src="components/com_joomgallery/assets/images/close.png";var l,dhtmltext2="";divObjContainer.style.display="block";l="<div class=\"jg_photocontainer\" style=\"top:"+h+"px; left:"+i+"px; position: absolute; display:block;z-index:99999;\" onclick=\"joom_photocontainershut()\">";l+="<div class=\"photoborder\" style=\"background-color: "+jg_openjs_background+"; padding: "+jg_padding+"px; border: solid 1px "+jg_dhtml_border+";\">";l+="<img onclick=\"joom_photocontainershut()\" style=\"cursor:pointer;border: solid 1px #000;width:"+d+"px;height:"+e+"px;\" src=\""+a+"\" alt=\""+b+"\" width=\""+d+"px\" height=\""+e+"px\" class=\"pngfile\" \/>";l+="<img onclick=\"joom_photocontainershut()\" style=\"cursor:pointer;position:absolute;bottom:"+jg_padding+"px;right:"+jg_padding+"px;width:"+k.width+"px;height:"+k.height+"px;\" src=\""+k.src+"\" alt=\"close\" id=\"dhtml_close\" class=\"pngfile\" />";l+="<br /><div id=\"joom_dhtml_imgtext\" style=\"margin-top:"+jg_padding+"px;text-align: justify; width:"+d+"px;\">&nbsp;<br />&nbsp;</div>";l+="<\/div></div>";divObjContainer.innerHTML=l;document.getElementById("joom_dhtml_imgtext").style.width2=document.getElementById("joom_dhtml_imgtext").style.width-document.getElementById("dhtml_close").style.width;if(jg_show_title_in_dhtml==1){dhtmltext2+="<strong>"+b+"</strong><br />"}if(jg_show_description_in_dhtml==1){dhtmltext2+=c}if(dhtmltext2!=""){document.getElementById("joom_dhtml_imgtext").innerHTML=dhtmltext2}if(jg_disableclick==1){divObjContainer.oncontextmenu=function(){return false}}}function joom_photocontainershut(){document.getElementById("jg_photocontainer").style.display="none"}function joom_cursorchange(e){active_slimbox=document.getElementById("lbImage");if(active_slimbox!=undefined){return}if(jg_comment_active!=1){if(navigator.appName=="Microsoft Internet Explorer"){taste=window.event.keyCode}else{taste=e.which}switch(taste){case 37:if(document.form_jg_back_link){window.location=document.form_jg_back_link.action}break;case 39:if(document.form_jg_forward_link){window.location=document.form_jg_forward_link.action}break;default:break}}}
