﻿

    /////////////////////////////////////////////////////
   // character count function
    function getObjectCounter(obj) {
			var theObj;
			if(document.all) {
				if(typeof obj=="string") {
					return document.all(obj);
				} else {
					return obj.style;
				}
			}
			if(document.getElementById) {
				if(typeof obj=="string") {
					return document.getElementById(obj);
				} else {
					return obj.style;
				}
			}
			return null;
		}
		
		function charCounter(editorName, displayName, message, max) {

			var oEditor		= getObjectCounter(editorName);
			//var oDisplay  	= getObject(displayName);
			var current    	= parseInt(max) - parseInt(oEditor.value.length);
			if ( current <= 0 ) {
				current			= 0;		
				oEditor.value	= oEditor.value.substr(0, max);
			}
			
			//oDisplay.innerHTML = message.replace("{CHAR}", current);
		}
		
		//////////////////////////////////////////////////////
		
		//This script gets around IE6 security problem with Flash, enabling the ActiveX control to be used without first activating it by clicking.

        // make sure to include the usual <object> embedding within <noscript> tags

        function embedFlash(width, height, src) {
            document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" height="' + height + '" width="' + width + '" />\n');
            document.write('<param name="movie" value="'+ src + '" />\n');
            document.write('<param name="quality" value="best" />\n');
            document.write('<param name="wmode" value="transparent" />\n');
            document.write('<param name="play" value="true" />\n');
            document.write('<embed height="' + height + '" src="'+ src + '" type="application/x-shockwave-flash" width="' + width + '" quality="best" play="true" wmode="transparent" >\n');
            document.write('</object>\n');
        }
        
        function embedFlashTwo(src) {
            document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="100%" id="galleryarea" align="middle">\n');
            document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
            document.write('<param name="movie" value="galleryarea.swf" /><param name="quality" value="high" /><param name="scale" value="noborder" /><param name="salign" value="l" /><param name="bgcolor" value="#000000" /><embed src="galleryarea.swf" quality="high" scale="noborder" salign="l" bgcolor="#000000" width="100%" height="100%" name="galleryarea" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" />\n');
            document.write('</object>\n');
        }
        
         function embedFlashThree(src) {
            document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="100%" id="originarea" align="middle">\n');
            document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
            document.write('<param name="movie" value="originarea.swf" /><param name="quality" value="high" /><param name="scale" value="noborder" /><param name="salign" value="l" /><param name="bgcolor" value="#000000" /><embed src="originarea.swf" quality="high" scale="noborder" salign="l" bgcolor="#000000" width="100%" height="100%" name="originarea" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" />\n');
            document.write('</object>\n');
        }
        ///////////////
        function confirmSubmit()
        {
        var agree=confirm("Are you sure you wish to clear all data?");
        if (agree)
	        return true ;
        else
	        return false ;
        }
        
        /////// 
        // preload images
        var myimages=new Array()
        function preloadimages(){
            for (i=0;i<preloadimages.arguments.length;i++){
                myimages[i]=new Image()
                myimages[i].src=preloadimages.arguments[i]
            }
        }
        


