/*******************************************************************************
*	common.js
*
*	Copyright 2010 Guidance Software, LLC
*	All Rights Reserved Worldwide
*
*	Javascript functions used across all js files.
*
*   Dependecny:
*       
*       - Scriptaculous
*       - Prototype
*
*	History:
*
*	06-09-10  sa	First
******************************************************************************/
function in_array(e,d,c){var b="",a=!!c;if(a){for(b in d){if(d[b]===e){return true}}}else{for(b in d){if(d[b]==e){return true}}}return false}Array.prototype.shuffle=function(){var a=this.length;for(var c=0;c<a;c++){var d=Math.floor(Math.random()*a);var b=this[c];this[c]=this[d];this[d]=b}};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};function array_merge(b){var a=b;for(var c=1;c<arguments.length;c++){a=a.concat(arguments[c])}return a}function strstr(b,c,a){var d=0;b+="";d=b.indexOf(c);if(d==-1){return false}else{if(a){return b.substr(0,d)}else{return b.slice(d)}}}function htmlspecialchars_decode(b,f){var d=0,c=0,e=false;if(typeof f==="undefined"){f=2}b=b.toString().replace(/&lt;/g,"<").replace(/&gt;/g,">");var a={ENT_NOQUOTES:0,ENT_HTML_QUOTE_SINGLE:1,ENT_HTML_QUOTE_DOUBLE:2,ENT_COMPAT:2,ENT_QUOTES:3,ENT_IGNORE:4};if(f===0){e=true}if(typeof f!=="number"){f=[].concat(f);for(c=0;c<f.length;c++){if(a[f[c]]===0){e=true}else{if(a[f[c]]){d=d|a[f[c]]}}}f=d}if(f&a.ENT_HTML_QUOTE_SINGLE){b=b.replace(/&#0*39;/g,"'")}if(!e){b=b.replace(/&quot;/g,'"')}b=b.replace(/&amp;/g,"&");return b}function getPageScroll(){var a;if(self.pageYOffset){a=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}else{if(document.body){a=document.body.scrollTop}}}arrayPageScroll=new Array("",a);return arrayPageScroll}function getPageSize(){var c,a;if(window.innerHeight&&window.scrollMaxY){c=document.body.scrollWidth;a=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){c=document.body.scrollWidth;a=document.body.scrollHeight}else{c=document.body.offsetWidth;a=document.body.offsetHeight}}var b,d;if(self.innerHeight){b=self.innerWidth;d=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){b=document.documentElement.clientWidth;d=document.documentElement.clientHeight}else{if(document.body){b=document.body.clientWidth;d=document.body.clientHeight}}}if(a<d){pageHeight=d}else{pageHeight=a}if(c<b){pageWidth=b}else{pageWidth=c}return{pageWidth:pageWidth,pageHeight:pageHeight,windowWidth:b,windowHeight:d}}function xtractFile(b){var a=b.match(/(.*)\/([^\/\\]+)(\.\w+)$/);if(a!=null){return{path:a[1],file:a[2],extension:a[3]}}return false}function getImgDimensions(a){var b=new Image();b.src=a;return{height:b.height,width:b.width}}function getImgWidth(a){return getImgDimensions(a).width}function getImgHeight(a){return getImgDimensions(a).height}function get_param(e){var c=window.location.search.substring(1);if(c.indexOf("&")>-1){var d=c.split("&");for(var b=0;b<d.length;b++){var a=d[b].split("=");if(a[0]==e){return a[1]}}}else{var d=c.split("=");if(d[0]==e){return d[1]}}return null};
