Tuesday, September 18, 2012

javascript to hide one div tag and show another in same place

hide one div tag and show other div tag in same place using simple JavaScript 
sample code
 
 
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; 
charset=iso-8859-1">
<script>
function showDiv(n)
{
document.getElementById("div"+n).style.display = 'block'
return false;
}

function hideDiv(n)
{
for (x=1; x<=10; x++)
{
document.getElementById("div"+x).style.display = 'none'
}
document.getElementById(n).style.display = 'block'
return false;

}

function toggleDiv(id)
{
 for (x=1; x<=3; x++)
 {
  document.getElementById("div"+x).
                 style.display = 'none';
 }
 
 document.getElementById(id).style.display = 'block';
}


</script>

</head>

<body>

<table width="50%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>
<a href="#" onClick="toggleDiv('div1');return false;">
show div 1</a> &nbsp;
<a href="#" onClick="toggleDiv('div2');return false;">
show div 2</a> &nbsp;
<a href="#" onClick="toggleDiv('div3');return false;">
show div 3</a>
</td>
</tr>

<tr>
<td>

<div id="div1" style="display: none">
<table border=0 width=25% cellspacing="0" cellpadding="0">
<tr><td><a href="http://mukhesh-blog.blogspot.in/">
my blog</a></td></tr>
</table>
</div>

<div id="div2" style="display: none">
<table border=0 width=25% cellspacing="0" cellpadding="0">
<tr><td><a href="http://mukhesh.mywapblog.com/">
links</a></td></tr>
</table>
</div>


<div id="div3" style="display: none">

Wednesday, September 12, 2012

5 O'Clock T-PAIN feat. Wiz Khalifa & Lily Allen LYRICS

[Lily Allen:]
It's 5 o'clock in the morning
Conversation got boring
You said you're going to bed soon
So I snuck off to your bedroom
And I thought I'd just wait there (uh)
Until I heard you come up the stairs (uhh)
And I pretended I was sleeping (uhh)
And I was hoping...

[T-Pain:]
It's 5 o'clock in the morning, and I want ya
And you want me, don't ya?
I can see it
Cause you've been waiting on me since
I said that I was hittin' the club
Something coming up on me
And I know you be getting so horny
Cause you be sending me texts saying
Like boy just get your ass up in that car
And come get all of this love

(It's 5 o'clock in the morning)
You ain't got to remind me
She already said if I don't come home on time
She might go crazy
And she'll be waiting on me naked
With one of my chains on
She might come and find me (oh oh oh)
And then ask me kindly
Do I want her to go crazy?
We do this every night
And then we always wake up singing the same song

[Hook: Lily Allen]
It's 5 o'clock in the morning (yeah)
Conversation got boring (talk to me girl)
You said you're going to bed soon (let’s go)
So I snuck off to your bedroom (come on)
And I thought I'd just wait there (wait on me)
Until I heard you come up the stairs (I won’t let you stay lonely)
And I pretended I was sleeping (alright)
And I was hoping you would creep in (goodnight)

[Hook 2: T-Pain]
It's 5 o'clock in the morning
Conversation got boring
You said you're going to bed soon
So I snuck off to your bedroom
And I thought I'd just wait there
Until I heard you come up the stairs
And I pretended I was sleeping
And I was hoping you would creep in

[T-Pain:]
It's 5 o'clock in the morning
And you calling
And these females got me stalling
I can hear your voice in my head like
"What is he doing? Oh, what is he doing?"
Cause I keep checking my cell phone
And these missed calls
You texting me like I'm a kill y'all
If you don't get your ass up out of that club
And do you know what time it is?

(It's 5 o'clock in the morning)
Oh, oh my bad, girl
And this Nuvo got me trippin'
And I know that you mad, girl
But you ain't got to worry about nothing
Girl I got you, girl I got you
She might come and find me, and then ask me kindly
Do I want her to go crazy?
We do this every night and then
We always wake up singing the same song

[Hook: Lily Allen]
It's 5 o'clock in the morning (yeah)
Conversation got boring (talk to me girl)
You said you're going to bed soon (let’s go)
So I snuck off to your bedroom (come on)
And I thought I'd just wait there (wait on me)
Until I heard you come up the stairs (I won’t let you stay lonely)
And I pretended I was sleeping (alright)
And I was hoping you would creep in (baby girl goodnight)

[Hook 2: T-Pain]
It's 5 o'clock in the morning
Conversation got boring
You said you're going to bed soon
So I snuck off to your bedroom
And I thought I'd just wait there
Until I heard you come up the stairs
And I pretended I was sleeping
And I was hoping you would creep in

(It's 5 o'clock in the morning)

[Wiz Khalifa:]
You ain't got nothing on
But the t-shirt that I left over your house
The last time I came and put it on ya
Too many thirsty girls up in this club for me to
Leave here with one of them
That's why I call her
And you'll be right at home waiting for me
Iphone plugged in the wall, just waiting for me
Club closed at 6, left around 4:30
Yeah so by the time I'm at your crib...
(It's 5 o'clock in the morning)
And you yawning, but I've been drinking all night and I feel like performing
With you in the bedroom
Floor to the dresser
Don't want nothing less cause I'm sure you're the best
You're the one, so I let you
That's how you show me love
And when we finish you like "Damn, babe you woke me up"
I love the way you put it down like it's for both of us
The sun ain't the only thing that's coming up

[Hook:]
It's 5 o'clock in the morning
Conversation got boring
You said you're going to bed soon
So I snuck off to your bedroom
And I thought I'd just wait there
Until I heard you come up the stairs
And I pretended I was sleeping
And I was hoping you would creep in
It's 5 o'clock in the morning

Monday, September 10, 2012

How to hide, show, or toggle your div

sample js
/*
<script language="javascript"> 
function toggle() {
        var ele = document.getElementById("toggleText");
        var text = document.getElementById("displayText");
        if(ele.style.display == "block") {
                ele.style.display = "none";
                text.innerHTML = "show";
        }
        else {
                ele.style.display = "block";
                text.innerHTML = "hide";
        }
} 
</script>
 
<a id="displayText" href="javascript:toggle();">show</a> <== click Here
<div id="toggleText" style="display: none"><h1>peek-a-boo</h1></div>

*/

By default, the peek-a-boo text is loaded when the page loads but the display attribute for the div that the content resides in is set to none so it is not visible to the visitor. When the link is clicked, the toggle() JavaScript functions executes and checks the value of the display style for the div that contains the content that we want to toggle.
If the display style is none, the function will:
  • Set the display style to block - This is executed in the else block of the function. The inner HTML content of a DOM element with a block display setting will be visible unless it is furthered controlled by CSS styling.
  • Change the link text to hide - The inner HTML of the link text, which in this case is just show, is replaced with the hide text.
If the display style is block, the function will:
  • Set the display style to none - This is executed in the if block of the function. The inner HTML content of a DOM element with the none display setting will not be visible for the viewer.
  • Change the link text to show - The inner HTML of the link text, which in this case is just hide, is replaced with the show text.

Here is a more reusable and flexible toggle function that takes 2 parameters: one for the div to hide/show and a second parameter for the div that contains the link text to be switched.
<script language="javascript"> 
function toggle(showHideDiv, switchTextDiv) {
        var ele = document.getElementById(showHideDiv);
        var text = document.getElementById(switchTextDiv);
        if(ele.style.display == "block") {
                ele.style.display = "none";
                text.innerHTML = "show";
        }
        else {
                ele.style.display = "block";
                text.innerHTML = "hide";
        }
} 
</script>
If you spice up this demo with some extra CSS styling, this can look like a nice little dialog box.

#headerDiv, #contentDiv {
float: left;
width: 510px;
}
#titleText {
float: left;
font-size: 1.1em;
font-weight: bold;
margin: 5px;
}
#myHeader {
font-size: 1.1em;
font-weight: bold;
margin: 5px;
}
#headerDiv {
background-color: #0037DB;
color: #9EB6FF;
}
#contentDiv {
background-color: #FFE694;
}
#myContent {
margin: 5px 10px;
}
#headerDiv a {
float: right;
margin: 10px 10px 5px 5px;
}
#headerDiv a:hover {
color: #FFFFFF;
}
Here is the HTML code:
<div id="headerDiv">
     <div id="titleText">Hide/Show Div Demo - Click here ==></div>
<a id="myHeader" href="javascript:toggle2('myContent','myHeader');
" >collapse</a>
</div>
<div style="clear:both;"></div>
<div id="contentDiv">
     <div id="myContent" style="display: block;">This is the 
content that is dynamically being collapsed.</div>
</div>
Here is the toogle2 JavaScript function:
function toggle2(showHideDiv, switchTextDiv) {
        var ele = document.getElementById(showHideDiv);
        var text = document.getElementById(switchTextDiv);
        if(ele.style.display == "block") {
                ele.style.display = "none";
                text.innerHTML = "restore";
        }
        else {
                ele.style.display = "block";
                text.innerHTML = "collapse";
        }
}



This demo uses the toggle2 function as previously demonstrated and a new function called toggle3. I apologize for not being very creative on the function names. Anyway, here is the JavaScript code for toggle3:
1
2
3
4
5
6
7
8
9
10
function toggle3(contentDiv, controlDiv) {
        if (contentDiv.constructor == Array) {
                for(i=0; i < contentDiv.length; i++) {
                     toggle2(contentDiv[i], controlDiv[i]);
                }
        }
        else {
               toggle2(contentDiv, controlDiv);
        }
}
Line 2 of the function checks to see if the first argument is an array or not. If it is an array, it will also assume that the second argument is an array as well. If it is an array, the script will loop through each element and execute toggle2 with each pair of elements in the arrays. Please note that this function also assumes that both arrays are in the same order such that contentDiv[3] and controlDiv[3] are a pair that refer to the same toggle element.
If the first argument is not an array, we will just pass the arguments as is to toggle2.
Here is the HTML code for the demo:
<table>
   <tr>
      <td>
         <div style="border: 1px solid blue; background-color: #99CCFF;
 padding: 5px; width: 150px;">
            <a id="myHeader1" href="javascript:toggle2('myContent1',
'myHeader1');" >collapse</a>
         </div>
         <div id="myContent1" style="border: 1px solid black; 
background-color: #CCCCCC; display: 
block;padding: 5px; width: 150px;">Div #1</div>
      </td>
      <td>
         <div style="border: 1px solid blue; background-color: #99CCFF;
 padding: 5px; width: 150px;">
            <a id="myHeader2" href="javascript:toggle2('myContent2',
'myHeader2');" >collapse</a>
         </div>
         <div id="myContent2" style="border: 1px solid black;
 background-color: #CCCCCC; display: block;padding: 
5px; width: 150px;">Div #2</div
      </td>
      <td>
         <div style="border: 1px solid blue; background-color: #99CCFF;
 padding: 5px; width: 150px;">
            <a id="myHeader3" href="javascript:toggle2('myContent3', 
'myHeader3');" >collapse</a>
         </div>
         <div id="myContent3" style="border: 1px solid black; 
background-color: #CCCCCC; display: block;padding: 
5px; width: 150px;">Div #3</div
      </td>
   </tr>
</table>
<input type="button" value="Press me to toggle all 3 DIVs" 
onClick="toggle3(['myContent1', 'myContent2', 'myContent3'], 
['myHeader1', 'myHeader2', 'myHeader3']);">
All the excitement is jammed into line 23 where we call the toggle3 function and pass over 2 arrays: one array containing all the content div ids and another array containing the header div ids. The rest is history =)

This demo was written in response to a request. We start off with some hidden divs and each click of the button will reveal one div at a time. When we have revealed all the divs, the button will disappear.
Demo




Here is the HTML code:
<table>
   <tr>
      <td style="width: 150px;">
         <div id="box1" style="border: 1px solid black; 
background-color: #CCCCCC; display: none;padding: 5px;">First</div>
      </td>
      <td style="width: 150px;">
         <div id="box2" style="border: 1px solid black; 
background-color: #CCCCCC; display: none;padding: 5px;">Second</div
      </td>
      <td style="width: 150px;">
         <div id="box3" style="border: 1px solid black;
 background-color: #CCCCCC; display: none;padding: 5px;">Third</div
      </td>
   </tr>
</table>
<input id="toggleButton" type="button" value="Show me the money!"
 onclick="counter++; toggle4('box');">
The HTML code contains 3 hidden divs to start off with. The button will launch the toggle4JavaScript function and pass over the prefix of the div IDs. Each div id is named with the prefix box and a number following the name. For example, box1box2, and box3. This is important for our JavaScript function. In addition, it increments the counter by 1 each time. This variable is initialized in our function.
Here is the JavaScript code:
var counter = 0;
var numBoxes = 3;
function toggle4(showHideDiv) {
     

JavaScript Continuous Reel Slideshow

Directions

Step 1:

< /*
script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

<style type="text/css">

#myreel{ /*sample CSS for demo*/
border:15px solid black;
}

.paginate{
width: 330px;
margin-top:5px;
font:bold 14px Arial;
text-align:center;
}

</style>

<script src="reelslideshow.js" type="text/javascript">



</script>

<script type="text/javascript">

var firstreel=new reelslideshow({
wrapperid: "myreel", //ID of blank DIV on page to house Slideshow
dimensions: [300, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["http://i26.tinypic.com/11l7ls0.jpg"], //["image_path", "optional_link", "optional_target"]
["http://i29.tinypic.com/xp3hns.jpg", "http://en.wikipedia.org/wiki/Cave", "_new"],
["http://i30.tinypic.com/531q3n.jpg"],
["http://i31.tinypic.com/119w28m.jpg"] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2000, cycles:2, pauseonmouseover:true},
orientation: "h", //Valid values: "h" or "v"
persist: true, //remember last viewed slide and recall within same session?
slideduration: 300 //transition duration (milliseconds)
})

</script

*/

Step 2:

<---div id="myreel"></div>

<div class="paginate">
≤ <a href="javascript:firstreel.navigate('back')" style="margin-right:200px;">back</a>  <a href="javascript:firstreel.navigate('forth')">forth</a> ≥
</div----->


Step 3:

/*

jQuery.noConflict()

function reelslideshow(options){
        var $=jQuery
        this.setting={displaymode:{type:'auto', pause:2000, cycles:2, pauseonmouseover:true}, orientation:'h', persist:true, slideduration:500} //default settings
        jQuery.extend(this.setting, options) //merge default settings with options
        var curslide=(this.setting.persist)? reelslideshow.routines.getCookie("slider-"+this.setting.wrapperid) : 0
        this.curslide=(curslide==null || curslide>this.setting.imagearray.length-1)? 0 : parseInt(curslide) //make sure curslide index is within bounds
        this.curstep=0
        this.zIndex=1
        this.animation_isrunning=false //variable to indicate whether an image is currently being slided in
        this.posprop=(this.setting.orientation=="h")? "left" : "top"
        options=null
        var slideshow=this, setting=this.setting, preloadimages=[], slidesHTML=''
        for (var i=0; i<setting.imagearray.length; i++){ //preload images
                preloadimages=new Image()
                preloadimages.src=setting.imagearray[0]
                slidesHTML+=reelslideshow.routines.getSlideHTML(setting.imagearray, setting.dimensions[0]+'px', setting.dimensions[1]+'px', this.posprop)+'\n'
        }
        jQuery(function($){ //on document.ready
                slideshow.init($, slidesHTML)
        })
        $(window).bind('unload', function(){ //on window onload
                if (slideshow.setting.persist) //remember last shown slide's index?
                        reelslideshow.routines.setCookie("slider-"+setting.wrapperid, slideshow.curslide)
        })
}

reelslideshow.prototype={

        slide:function(nextslide, dir){ //possible values for dir: "left", "right", "top", or "down"
                if (this.curslide==nextslide)
                        return
                var slider=this
                var nextslide_initialpos=this.setting.dimensions[(dir=="right"||dir=="left")? 0 : 1] * ((dir=="right"||dir=="down")? -1 : 1)
                var curslide_finalpos=-nextslide_initialpos
                var posprop=this.posprop
                if (this.animation_isrunning!=null)
                        this.animation_isrunning=true //indicate animation is running
                this.$imageslides.eq(dir=="left"||dir=="top"? nextslide : this.curslide).css("zIndex", ++this.zIndex) //increase zIndex of upcoming slide so it overlaps outgoing
                this.$imageslides.eq(nextslide).css(reelslideshow.routines.createobj(['visibility', 'visible'], [posprop, nextslide_initialpos])) //show upcoming slide
                        .animate(reelslideshow.routines.createobj([posprop, 0]), this.setting.slideduration, function(){slider.animation_isrunning=false})
                this.$imageslides.eq(this.curslide).animate(reelslideshow.routines.createobj([posprop, curslide_finalpos]), this.setting.slideduration, function(){jQuery(this).css("visibility", "hidden")}) //hide outgoing slide
                this.curslide=nextslide
        },

        navigate:function(keyword){ //keyword: "back" or "forth"
                clearTimeout(this.rotatetimer)
                var dir=(keyword=="back")? (this.setting.orientation=="h"? "right" : "down") : (this.setting.orientation=="h"? "left" : "up")
                var targetslide=(keyword=="back")? this.curslide-1 : this.curslide+1
                targetslide=(targetslide<0)? this.$imageslides.length-1 : (targetslide>this.$imageslides.length-1)? 0 : targetslide //wrap around
                if (this.animation_isrunning==false)
                        this.slide(targetslide, dir)
        },

        rotate:function(){
                var slideshow=this
                if (this.ismouseover){ //pause slideshow onmouseover
                        this.rotatetimer=setTimeout(function(){slideshow.rotate()}, this.setting.displaymode.pause)
                        return
                }
                var nextslide=(this.curslide<this.$imageslides.length-1)? this.curslide+1 : 0
                this.slide(nextslide, this.posprop) //go to next slide, either to the left or upwards depending on setting.orientation setting
                if (this.setting.displaymode.cycles==0 || this.curstep<this.maxsteps-1){
                        this.rotatetimer=setTimeout(function(){slideshow.rotate()}, this.setting.displaymode.pause)
                        this.curstep++
                }
        },

        init:function($, slidesHTML){
                var slideshow=this, setting=this.setting
                this.$wrapperdiv=$('#'+setting.wrapperid).css({position:'relative', visibility:'visible', overflow:'hidden', width:setting.dimensions[0], height:setting.dimensions[1]}) //main DIV
                if (this.$wrapperdiv.length==0){ //if no wrapper DIV found
                        alert("Error: DIV with ID \""+setting.wrapperid+"\" not found on page.")
                        return
                }
                this.$wrapperdiv.html(slidesHTML)
                this.$imageslides=this.$wrapperdiv.find('div.slide')
                this.$imageslides.eq(this.curslide).css(reelslideshow.routines.createobj([this.posprop, 0])) //set current slide's CSS position (either "left" or "top") to 0
                if (this.setting.displaymode.type=="auto"){ //auto slide mode?
                        this.setting.displaymode.pause+=this.setting.slideduration
                        this.maxsteps=this.setting.displaymode.cycles * this.$imageslides.length
                        if (this.setting.displaymode.pauseonmouseover){
                                this.$wrapperdiv.mouseenter(function(){slideshow.ismouseover=true})
                                this.$wrapperdiv.mouseleave(function(){slideshow.ismouseover=false})
                        }
                        this.rotatetimer=setTimeout(function(){slideshow.rotate()}, this.setting.displaymode.pause)
                }
        }

}

reelslideshow.routines={

        getSlideHTML:function(imgref, w, h, posprop){
                var posstr=posprop+":"+((posprop=="left")? w : h)
                var layerHTML=(imgref[1])? '<a href="'+imgref[1]+'" target="'+imgref[2]+'">' : '' //hyperlink slide?
                layerHTML+='<img src="'+imgref[0]+'" style="border-width:0;" />'
                layerHTML+=(imgref[1])? '</a>' : ''
                return '<div class="slide" style="position:absolute;'+posstr+';width:'+w+';height:'+h+';text-align:center;">'
                        +'<div style="width:'+w+';height:'+h+';display:table-cell;vertical-align:middle;">'
                        +layerHTML
                        +'</div></div>' //return HTML for this layer
        },


        getCookie:function(Name){ 
                var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
                if (document.cookie.match(re)) //if cookie found
                        return document.cookie.match(re)[0].split("=")[1] //return its value
                return null
        },

        setCookie:function(name, value){
                document.cookie = name+"=" + value + ";path=/"
        },

        createobj:function(){
                var obj={}
                for (var i=0; i<arguments.length; i++){
                        obj[arguments[0]]=arguments[1]
                }
                return obj
        }
}

*/

Hide Check Boxes on Drop Down Selecton with javascript

copy paste the code in any editor and replace all <| and |> with < and >

<|html|>
    <|head|><|title|>Disable with Dropdown Test<|/title|>
        <|script type="text/javascript"|>
            function num_check(val) {
                var status = (val == 0)? true : false;
                for(i=0; i <| chkBoxes.length; i++) {
                    chkBoxes.checked = false;
                    chkBoxes.disabled = status;
                }
            }
            window.onload=function(){
                chkBoxes = document.getElementById('top_space').getElementsByTagName('input');
                num_check(0);
            }
        <|/script|>
    <|/head|>
    <|body|>
        <|form name="form1"|>
            <|div|>
                <|p|>type:<|/p|>
                <|div class="top_space" id="top_space"|>
                    <|p|> <|select name="num" id="num" class="drop_down" onChange="num_check(this.value);"|>
                            <|option value="0" selected="selected"|>office<|/option|>
                            <|option value="1"|>function hall<|/option|>
                            <|option value="2"|>shop<|/option|>
                            <|option value="3"|>go down<|/option|>
                            <|option value="4"|>school<|/option|>
                        <|/select|> <|/p|>
                    <|input type="checkbox" id="cat1" name="list" value="1" /|><|label for="cat1"|>Summative<|/label|><|br /|>
                    <|input type="checkbox" id="cat2" name="list" value="2" /|><|label for="cat2"|>Formative<|/label|><|br /|>
                    <|input type="checkbox" id="cat3" name="list" value="3" /|><|label for="cat3"|>Homework<|/label|><|br /|>
                    <|input type="checkbox" id="cat4" name="list" value="4" /|><|label for="cat4"|>Classwork<|/label|><|br /|>
                <|/div|>
            <|/div|>
        <|/form|>
    <|/body|>
<|/html|>

Movable Div Tag in Html with Javascript

copy paste the code in any editor and replace all <| and |> with < and >
<|!doctype html public "-//W3C//DTD HTML 3.2 Final//EN">
    <|html>
       <|head>
          <|style>
          .Text{
            font-family: Verdana,Arial,Sans-serif,'Times New Roman';
            font-size: 9pt;
            font-weight: normal;
            font-style: normal;
            color: #666;
            text-decoration: none;
          }

          .alertsBoxTitle{
            font-family: Verdana,Arial,Sans-serif,'Times New Roman';
            font-size: 9pt;
            font-weight: bold;
            font-style: normal;
            color: #ffffff;
            text-decoration: none;
          }
          .alertsBox{
            background: #ECF1F9;
            border: 1px #a1bcdf solid;
          }
          body{
           overflow:hidden;
          }
          <|/style>

          <|script language="javascript">
          // browser detection
          var agt=navigator.userAgent.toLowerCase();
          var is_major = parseInt(navigator.appVersion);
          var is_minor = parseFloat(navigator.appVersion);

          var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                      && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                      && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
          var is_nav4 = (is_nav && (is_major == 4));
          var is_nav6 = (is_nav && (is_major == 5));
          var is_nav6up = (is_nav && (is_major >= 5));
          var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

          var dragapproved=false
          var z,x,y
          var maxleft,maxtop,maxright,maxbottom;

          function setdragBounds()
          {
              // you can set the bounds of the draggable area here
              maxleft = 10;
              maxtop = 10;
              maxright = document.body.clientWidth - 10;
              maxbottom = document.body.clientHeight - 100;
          }

          function move(e)
          {
               var tmpXpos = (!is_ie)? temp1+e.clientX-x: temp1+event.clientX-x;
               var tmpYpos = (!is_ie)? temp2+e.clientY-y : temp2+event.clientY-y;
               if (dragapproved)
               {
                  z.style.left = tmpXpos;
                  z.style.top = tmpYpos;

                  if (tmpXpos <| maxleft)
                      z.style.left = maxleft;

                  if (tmpXpos > maxright)
                      z.style.left = maxright;

                  if (tmpYpos <| maxtop)
                      z.style.top = maxtop;
                  if (tmpYpos > maxbottom)
                      z.style.top = maxbottom;

                  return false
               }
          }

          function drags(e)
          {
                 if (!(is_ie)&&!(!is_ie)) return

                 var firedobj=(!is_ie)? e.target : event.srcElement
                 var topelement=(!is_ie)? "HTML" : "BODY"

                 while (firedobj.tagName!=topelement && firedobj.className!="drag" && firedobj.tagName!='SELECT' && firedobj.tagName!='TEXTAREA' && firedobj.tagName!='INPUT' && firedobj.tagName!='IMG')
                 {
                     // here you can add the elements that cannot be used for drag . using their class name or id or tag names
                     firedobj=(!is_ie)? firedobj.parentNode : firedobj.parentElement
                 }

                 if (firedobj.className=="drag")
                 {
                     dragapproved = true
                     z = firedobj
                     var tmpheight = z.style.height.split("px")
                     maxbottom = (tmpheight[0])?document.body.clientHeight - tmpheight[0]:document.body.clientHeight - 20;

                     temp1 = parseInt(z.style.left+0)
                     temp2 = parseInt(z.style.top+0)
                     x = (!is_ie)? e.clientX: event.clientX
                     y = (!is_ie)? e.clientY: event.clientY
                     document.onmousemove = move

                     return false
                 }
          }

          document.onmousedown=drags
          document.onmouseup=new Function("dragapproved=false")
       <|/script>
    <|/head>

    <|body>
      <|div id="Dialog" style="width:316px;height:119px;max-width:316px;position:relative;top:50px;left:140px; z-index:1000;" class="drag">
        <|table width="100%" style="width:315px;height:119px" cellspacing="0" cellpadding="0" class="alertsBox" id="dialog_table">
          <|tr style="cursor:move">
            <|td class="alertsBoxTitle notselectable" colspan="2" align="left" height="21" style="cursor:move;background-color:#32426F">Drag Me<|/td>
          <|/tr>
          <|tr>
            <|td align="center" colspan="2" height="5"> <|/td>
          <|/tr>
          <|tr>
            <|td align="center" colspan="2">
              <|table width="97%"  border="0" cellspacing="0" cellpadding="0" align="center">
                <|tr>
                  <|td valign='top' align="center">
                    <|/td>
                <|/tr>
                <|tr>
                  <|td valign='top' colspan="2" class="Text">this div can be placed any where<|/td>
                <|/tr>
                <|tr>
                  <|td valign='top' colspan="2" align="center"><|br/><|input type="button" value="Ok"/><|/td>
                <|/tr>
              <|/table><|/td>
          <|/tr>
        <|/table>
      <|/div>
    <|/body>
<|/html>

Bartender T-PAIN feat. Akon LYRICS

[Intro - T-Pain]
Yeah...
Uh-Huh...
Yeah...
Yeah...

[Verse 1 - T-Pain]
Broke up with my girl last night so I went to the club (so I went to the club)
Put on a fresh white suit and a MiniCoop sitting on dubs (sitting on dubs)
I'm just looking for somebody to talk to and show me some love (show me some love)
If you know what I mean... Uh-Huh...
Everybody's jockin' me as soon as I stepped in the spot (I stepped in the spot)
200 bitches and man ain't none of them hot (ain't none of them hot)
'Cept for this pretty young thing that was workin' all the way at the top (all the way at the top)
Shawty what is your name?

[Hook (T-Pain):]
Oh she made us drinks, to drink
We drunk 'em, got drunk
And then I think she thinks I'm cool
She gave me a wink, I winked back
And then I think that, we hit it off something proper like...

[Chorus (T-Pain):]
I like the bartender
(Oh if you're lookin' for me)
I'm at the bar with her
(Uh-huh, OK)
I like the bartender
(Yeah if you're lookin' for me)
I'm at the bar with her
(Oh uh-huh, OK)

[Verse 2 - T-Pain]
Got a brand new girl so I'm feeling all good inside (all good inside)
Feel like I put some brand new 24's on a brand new ride (on a brand new ride)
Triple shot of patron on the rocks with little bit a lime (with a little bit a lime)
I'm just keeping it real (Uh-huh)
Baby still working at the club so I'm getting in free (so I'm getting in free)
Wednesday night I'm on the list T-Pain plus 3 (T-Pain plus 3)
Every time I hit the spot baby girl taking care of me (taking care of me)
How do you think I feel?

[Hook (T-Pain)]

[Chorus (T-Pain)]

[Verse 3 - Akon]
Shorty I'm sure you heard that I rarely ever come out (never come out)
Unless I'm in the M6 doing tricks freeway burnt out (freeway burnt out)
Got a passenger side that's empty wanting it to be your spot (be your spot)
But you on my billboard we can act like the charts gonna end up on top (end up on top)
Don't smoke don't drink that's why I don't be by the bar baby (baby)
Just lookin' at you from a distance looking like a god damn star baby (baby)
So my girl don't see me T-Pain can I get those keys to the car? (those keys to the car?)
'Bout to go and Bang Bang Boogie with my cutie and I'll see you tomar' (see you tomar')

[Hook (T-Pain, Akon):]
Oh she made us drinks, to drink
We drunk 'em, got drunk
And now I know she thinks I'm cool
She gave me a wink, I winked back (Uh-huh)
And then I think that, (Uh-huh) we 'gonna have fun at my spot tonight... (Oh yes)

[Chorus (T-Pain)]