﻿
function getWindowDims() {
    return {
        'width': window.innerWidth ?
                    window.innerWidth : //firefox
                    ((document.documentElement.clientWidth == 0) ? // are we in quirks mode?
                      document.body.clientWidth :  // yes we are, so this is width
                      document.documentElement.clientWidth), // no, so this is width

        'height': window.innerHeight ?
                    window.innerHeight : //firefox
                    ((document.documentElement.clientHeight == 0) ? // are we in quirks mode?
                      document.body.clientHeight :  // yes we are, so this is width
                      document.documentElement.clientHeight), // no, so this is width

        'scrollTop': window.pageYOffset ?
                        window.pageYOffset : // ff
                        (document.body.scrollTop != 0 ? //ie
                          document.body.scrollTop :  // quirks mode ie
                          (document.documentElement.scrollTop)), // strict mode ie

        'scrollLeft': window.pageXOffset ?
                        window.pageXOffset :
                        (document.body.scrollLeft != 0 ? //ie
                                  document.body.scrollLeft : // quirks mode ie
                                  document.documentElement.scrollLeft), // strict mode ie

        'scrollWidth': document.all ?
                         document.body.clientWidth : //ie
                         document.body.offsetWidth, //ff


        'scrollHeight': document.all ?
                          document.body.clientHeight : //ie
                          document.body.offsetHeight //ff

    };
}


function emailValidationcheck(str) 
		{
			var at="@"
			var dot="."
			var lat=str.indexOf(at)
			var lstr=str.length
			var ldot=str.indexOf(dot)
			if (str.indexOf(at)==-1)
			return false;
			if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
			return false;
			if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
				return false;
			if (str.indexOf(at,(lat+1))!=-1)
				return false;
			if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
				return false;
			if (str.indexOf(dot,(lat+2))==-1)
				return false;		
			if (str.indexOf(" ")!=-1)
				return false;
 			return true;
		}
		