
    ModalDialog = {};
var txt="";
var divdata="";
    /**
    * Shows a modal dialog
    * 
    * @param string contentID ID of content layer to use HTML of
    * @param int    width     Width of dialog
    */
    function ModalDialog_Show(contentID, width,cnt)
    {
        
        if(cnt=="1")
		{
		    txt="What is this about?";
		    document.getElementById('data').innerHTML=divdata;
		    divdata='<p>Whatpageamion.com is a tool for Search Engine Optimizers who are keen to know the Google rankings of their sites for a particular set of Keywords. The way this works is very simple, enter the name of your site, and upto four keywords you&#39;d like to check. After hitting the button the application will let you know on which position your site would show up for visitors using that keyword.</p>';
		   
		
		}
		if(cnt=="2")
		{
		    txt="FAQs";
		    document.getElementById('data').innerHTML=divdata;
		    divdata='<h2>Why don&#39;t you check for beyond the top 50 results?</h2><p>Well the top 50 results means about 5 pages. If you expect visitors to go beyond the first 5 pages of Google Results.. then all we can say is &#34;Best of Luck Dude!!&#34;</p><h2>What about Country specific Google Searches?</h2><p>Sorry no not yet&#46;&#46;&#46; for now all that we can tell is where you stand for google.com (USA)</p><h1>Are these results realtime?</h1><p>Yes What You See here is What you get on Google (WYSHIWYGG &#45; if we may), we don&#39;t cache results or lookup within dated databases, everything is realtime.</p><h2>Can I see which are the top 10 sites for my keyword?</h2><p>Yes just click on the big blue bar and it should open up to show you the top 10 sites that will show up for that particular keyword. I&#39;m sure you already figured this out before you came here</p>';
		
		}
		if(cnt=="3")
		{
		   txt="Privacy Policy";
		    document.getElementById('data').innerHTML=divdata;
		    divdata='<p>We collect all sorts of personal information while you are using our service. We collect things like your DNA samples, retinal scans and finger prints using our patent pending technology. All this information is stored securely in our databases and made available to investigative agencies as and when they ask us.</p><p>You think we are kidding ?   &#46;&#46;&#46;&#46;&#46;&#46; Ofcourse we are !!!!</p><p> To tell you the truth we don&#39;t store anything.. infact we don&#39;t even look at what you are typing in&#46;&#46;&#46; we simply pass on your data (keeping our eyes closed) to Google and show you the results. However we have absolutely no idea what Google does with all that information you are sending their way, so make sure you go ahead and check out their <a href="http://www.google.co.in/intl/en/privacy.html">Privacy Policy</a></p>';
		
		}
		document.getElementById('data').innerHTML=divdata;
        if (document.all) {
            var selectObjs = document.getElementsByTagName('select');
			
          
		   for (var i=0; i<selectObjs.length; ++i) {
                if (!selectObjs[i].md_nohide) {
                    selectObjs[i].md_vis = selectObjs[i].style.visibility;
                    selectObjs[i].style.visibility = 'hidden';
                }
            }
        }
        
        /**
        * Create the background layer if necessary
        */
        var dialogBg = document.getElementById('modalBg');
        
        if (!dialogBg) {
            var bgDiv = document.createElement('div');
            bgDiv.id = 'modalBg';
            bgDiv.className = 'modalBg';
            bgDiv.style.opacity = 0.7;
        
            document.body.appendChild(bgDiv);
            
            var dialogBg = document.getElementById('modalBg');
            ModalDialog.background = dialogBg;
        }
        
        var dialogShadow = document.getElementById('modalShadow');
        
        if (!dialogShadow) {
            var shadowDiv = document.createElement('div');
            shadowDiv.id = 'modalShadow';
            shadowDiv.className = 'modalShadow';
            
            document.body.appendChild(shadowDiv);
            
            var dialogShadow = document.getElementById('modalShadow');
        }
    
        // Show the dialog
        var dialog = document.getElementById(contentID);
        dialog.style.visibility = 'hidden';
        dialog.style.width = width + 'px';
        
        dialogShadow.style.visibility = 'visible';
        dialogShadow.style.width = dialog.offsetWidth + 'px';
        dialogShadow.style.height = dialog.offsetHeight + 'px';
    
        /**
        * Insert the header into the dialog
        */
        var dialogHeader = document.createElement('div');
        dialogHeader.id = 'dialogHeader';
        dialogHeader.className = 'modalDialogHeader';
        dialog.appendChild(dialogHeader);
        dialogHeader = document.getElementById('dialogHeader');
        
        var label = document.createElement('label');
        label.For = "fr";
        var text = document.createTextNode(txt);
        label.appendChild(text);
        dialogHeader.appendChild(label);
        
        
        Fade(dialogBg, true, null, null, 70);
        Fade(dialog, true, null, null, 100);
        Fade(dialogShadow, true, null, null, 50, 'ModalDialog_FinishFade');
        
        
        // Moz stuff
        if (!document.all) {
            dialogBg.style.width  = '100%';
            dialogBg.style.height = '100%';

            dialog.style.left = document.body.offsetWidth / 2 - width / 2 + 'px';
            dialog.style.top =  '120px';
            
            dialogHeader.style.width = (dialog.offsetWidth - 2) + 'px';
            dialogHeader.style.paddingTop = '5px';
            dialogHeader.style.paddingTop = '5px';
            dialogShadow.style.left = (document.body.offsetWidth / 2 - width / 2) + 4 + 'px';
        
        // IE stuff
        } else {
            dialogHeader.style.width = dialog.offsetWidth + 'px';
            dialogBg.style.width = document.body.scrollWidth + 5;
        }
        
        // this is run for all browsers
        dialog.style.top = document.body.scrollTop + (document.body.clientHeight / 2) - (dialog.offsetHeight / 2);
        dialogShadow.style.top  = parseInt(dialog.style.top) + 4;
        
        /**
        * When the window is resized, reposition the dialog
        */
        window.onresize = ModalDialog.Reposition;
        window.onscroll = ModalDialog.Reposition;
        
        // Set visible dialog var
        ModalDialog.dialog = dialog;
        ModalDialog.shadow = dialogShadow;
    }
    
    
    /**
    * Closes a modal dialog
    */
    function ModalDialog_Close()
    {
        var dialogBg     = ModalDialog.background;
        var dialog       = ModalDialog.dialog;
        var dialogShadow = ModalDialog.shadow;
    
        
        // Lose the dialog header
        dialog.removeChild(document.getElementById('dialogHeader'));
    
        // Hide stuff
        dialogBg.style.MozOpacity = 0;
        dialogBg.style.visibility = 'hidden';
        
        dialog.style.MozOpacity = 0;
        dialog.style.visibility = 'hidden';
        dialogShadow.style.visibility = 'hidden';
        
        
        __visibleDialog = null;
        
        /**
        * Unhide all selects
        */
        var selectObjs = document.getElementsByTagName('select');
        
        for (var i=0; i<selectObjs.length; ++i) {
            if (!selectObjs[i].md_nohide) {
                selectObjs[i].style.visibility = selectObjs[i].md_vis;
            }
        }
    }
    
    function ModalDialog_FinishFade()
    {
        var shadow  = ModalDialog.shadow;
        var visible = ModalDialog.dialog;
    
        shadow.style.width = visible.offsetWidth;
        shadow.style.height = visible.offsetHeight;
        shadow.style.filter = 'Alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius=2)';
    }

   
    ModalDialog.Reposition = function ()
    {
        var dialog = ModalDialog.dialog;
        var shadow = ModalDialog.shadow;

        // Reposition in the vertical center
        dialog.style.top  = document.body.scrollTop + (document.body.clientHeight / 2) - (dialog.offsetHeight / 2);
        shadow.style.top = parseInt(dialog.style.top) + 4;

        // Reposition in the horizontal centre
        dialog.style.left  = document.body.scrollLeft + (document.body.clientWidth / 2) - (dialog.offsetLeft / 2);
        shadow.style.left = parseInt(dialog.style.left) + 4;
    }
    
    
    ModalDialog.Show = ModalDialog_Show;
    ModalDialog.Close = ModalDialog_Close;
